/* API Ahead — hoja de estilos del sitio. Sin framework, sin JavaScript. */

:root {
  --navy: #0B1B33;
  --blue: #0A5FF2;
  --blue-dark: #0849B8;
  --green: #1FB77A;
  --ink: #1F2937;
  --muted: #5B6B82;
  --surface: #F5F7FB;
  --border: #E3E8F0;
  --white: #FFFFFF;
  --sev-breaking: #E5484D;
  --sev-silent: #F5A524;
  --sev-deprecation: #E7C000;
  --sev-additive: #1FB77A;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 8px;
  --container: 1080px;
  --narrow: 720px;
  --gutter: 24px;
  --section: 96px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 16px;
}
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 18ch; }
.nb { white-space: nowrap; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); max-width: 26ch; }
h3 { font-size: 1.2rem; margin-bottom: 8px; }
p { margin: 0 0 16px; }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--navy);
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--narrow); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -48px; background: var(--navy); color: #fff;
  padding: 8px 12px; border-radius: var(--radius); z-index: 10;
}
.skip:focus { top: 8px; }

/* --- Navegación --- */
.nav { border-bottom: 1px solid var(--border); background: var(--white); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand img { border-radius: 6px; }
.nav__links { display: flex; align-items: center; gap: 22px; }
.nav__links a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav__links a:hover { color: var(--blue); }

/* --- Botones y formulario --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius);
  background: var(--blue); color: #fff !important; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s ease;
}
.btn:hover { background: var(--blue-dark); }
.btn:focus-visible { outline: 3px solid rgba(10, 95, 242, .35); outline-offset: 2px; }
.btn--small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }
.btn--ghost { background: var(--white); color: var(--navy) !important; border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--surface); }

.subscribe { display: flex; gap: 10px; max-width: 520px; margin-top: 28px; }
.subscribe input[type="email"] {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; color: var(--ink); background: var(--white);
}
.subscribe input[type="email"]:focus { outline: 3px solid rgba(10, 95, 242, .25); border-color: var(--blue); }
.trust { font-size: 0.85rem; color: var(--muted); margin-top: 12px; }

/* --- Tipografía auxiliar --- */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--blue); margin: 0 0 14px;
}
.eyebrow a { text-decoration: none; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.section__lead { color: var(--muted); max-width: 64ch; margin-bottom: 32px; }
.section__note { color: var(--muted); font-size: 0.98rem; max-width: 64ch; }

/* --- Secciones --- */
.hero { padding: clamp(48px, 7vw, 96px) 0 clamp(48px, 7vw, 88px); }
.hero .lead { margin-top: 20px; }
/* Dos columnas en escritorio: promesa y formulario a la izquierda, la edición
   real a la derecha. En pantallas estrechas la hoja va debajo del formulario. */
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center; }
.hero__proof .eyebrow--muted { color: var(--muted); margin-bottom: 12px; }
@media (min-width: 1024px) {
  .hero__inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; }
  .hero__proof .sheet { box-shadow: 0 24px 60px -24px rgba(11, 27, 51, 0.35), 0 1px 0 var(--border); }
}
.section { padding: var(--section) 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section--page { padding-top: 56px; }
.section--cta { text-align: center; }
.section--cta h2, .section--cta .lead { margin-inline: auto; }
.section--cta .subscribe { margin-inline: auto; }

/* --- La edición de muestra ("hoja") --- */
.sheet {
  border: 1px solid var(--border); border-radius: 12px; background: var(--white);
  box-shadow: 0 1px 2px rgba(11, 27, 51, .04), 0 12px 32px rgba(11, 27, 51, .08);
  overflow: hidden; max-width: 860px;
}
.sheet__bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--navy); color: #fff; font-family: var(--font-mono); font-size: 0.82rem;
}
.sheet__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.sheet__body { padding: 18px 22px 6px; }
.sheet__summary { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.sheet__summary strong { color: var(--navy); }
.findings { list-style: none; margin: 0; padding: 0; }
.finding { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 0.95rem; }
.finding p { margin: 1px 0 0; }
.finding__sev { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 8px; }
.finding--breaking .finding__sev { background: var(--sev-breaking); }
.finding--silent .finding__sev { background: var(--sev-silent); }
.finding__api { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.sheet__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface);
  font-size: 0.92rem; color: var(--muted);
}
.sheet__foot strong { color: var(--green); }

/* --- Cómo funciona --- */
.steps { list-style: none; margin: 40px 0 0; padding: 0; max-width: 760px; }
.step { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 24px 0; border-top: 1px solid var(--border); }
.step > * { min-width: 0; }
.step:last-child { border-bottom: 1px solid var(--border); }
.step__num { font-family: var(--font-mono); color: var(--blue); font-size: 1rem; padding-top: 4px; }
.facts {
  margin: 16px 0 0; padding: 16px 18px; border-radius: var(--radius);
  background: var(--navy); color: #DCE4F2; font-family: var(--font-mono); font-size: 0.82rem;
  line-height: 1.7; overflow-x: auto; }
.facts__k { color: #7FB0FF; }
.facts__arrow { color: var(--green); }
.callout {
  margin-top: 40px; max-width: 760px; padding: 22px 24px;
  border-left: 4px solid var(--sev-silent); background: var(--white); border-radius: 0 var(--radius) var(--radius) 0;
}
.callout__title { font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.callout p:last-child { margin: 0; }

/* --- Categorías --- */
.categories { width: 100%; max-width: 860px; border-collapse: collapse; margin: 32px 0 20px; }
.categories th, .categories td { padding: 16px 12px 16px 0; border-top: 1px solid var(--border); vertical-align: top; text-align: left; }
.categories tr:last-child th, .categories tr:last-child td { border-bottom: 1px solid var(--border); }
.categories th { width: 220px; color: var(--navy); font-weight: 600; white-space: nowrap; }
.categories td { color: var(--ink); }
.sev { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; }
.sev--breaking { background: var(--sev-breaking); }
.sev--silent { background: var(--sev-silent); }
.sev--deprecation { background: var(--sev-deprecation); }
.sev--additive { background: var(--sev-additive); }

/* --- Archivo --- */
.archive { list-style: none; margin: 32px 0 0; padding: 0; }
.archive__item a { display: block; padding: 18px 0; border-top: 1px solid var(--border); text-decoration: none; color: inherit; }
.archive__item:last-child a { border-bottom: 1px solid var(--border); }
.archive__item a:hover .archive__range { color: var(--blue-dark); }
.archive__range { display: block; color: var(--blue); font-weight: 600; }
.archive__headline { display: block; color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* --- Página de edición (Markdown renderizado) --- */
.edition h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 24ch; }
.prose { max-width: var(--narrow); }
.prose h2 { font-size: 1.5rem; margin-top: 40px; }
.prose h3 { font-size: 1.1rem; margin-top: 28px; font-family: var(--font-mono); font-weight: 500; color: var(--muted); }
.prose blockquote { margin: 0 0 16px; padding: 12px 18px; background: var(--surface); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; color: var(--navy); }
.prose blockquote p { margin: 0; }
.prose table { border-collapse: collapse; margin: 16px 0 24px; }
.prose th, .prose td { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--border); text-align: left; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li li { margin-top: 4px; color: var(--muted); }
.prose em { color: var(--muted); }

/* --- Pie --- */
.footer { border-top: 1px solid var(--border); padding: 40px 0 48px; background: var(--surface); font-size: 0.9rem; color: var(--muted); }
.footer__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; margin-bottom: 24px; }
.brand--footer { font-size: 0.95rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer__links a { color: var(--ink); text-decoration: none; }
.footer__links a:hover { color: var(--blue); }
.footer__legal { font-size: 0.82rem; max-width: 80ch; }
.footer__copy { margin: 0; font-size: 0.82rem; }

/* --- Responsive --- */
@media (max-width: 720px) {
  :root { --section: 64px; }
  .nav__links { gap: 14px; }
  .nav__links a:not(.btn) { display: none; }
  .subscribe { flex-direction: column; }
  .step { grid-template-columns: 40px 1fr; }
  .categories th { width: auto; white-space: normal; }
  .sheet__bar { font-size: 0.74rem; }
}
