/* Fuentes autoalojadas (fontsource 5.3.0, subconjunto latin, licencia OFL en
   assets/fonts/). Sin peticiones a terceros: permite font-src 'self' en la CSP. */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin-300-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin-300-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/cormorant-garamond-latin-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/courier-prime-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Courier Prime';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/courier-prime-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/dm-sans-latin-opsz-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Mismo lenguaje editorial que index.html: campo morado, texto legal sobre papel. */
:root {
  --campo:        #2E1065;
  --papel:        #FBF7F1;
  --tinta:        #2E1065;
  --tinta-suave:  #4C1D95;
  --texto:        #F6F2FB;
  --texto-suave:  rgba(246, 242, 251, 0.78);
  --linea:        rgba(246, 242, 251, 0.22);
  --linea-papel:  rgba(46, 16, 101, 0.14);
  --acento:       #F97316;
  --acento-texto: #FDBA74;
  --acento-papel: #C2410C;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  'Courier Prime', 'Courier New', monospace;
  --gutter: clamp(16px, 6vw, 96px);
}

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

html { scroll-behavior: smooth; background: var(--campo); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--campo);
  color: var(--texto);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--acento); color: var(--tinta); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--papel); color: var(--tinta); padding: 10px 16px;
  font-family: var(--mono);
}
.skip-link:focus { left: 8px; top: 8px; }

a { color: #6D28D9; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }

.noise {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  opacity: 0.16; mix-blend-mode: color-burn;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 205px;
}

header.topbar {
  max-width: 1360px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 32px var(--gutter) 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--texto); }
.brand img { width: 72px; height: 37px; object-fit: contain; margin: -4px -10px -4px -14px; }
.brand span { font-family: var(--mono); font-weight: 700; font-size: 17px; letter-spacing: 0.12em; text-transform: uppercase; }
.topbar-back {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border: 1px solid rgba(246, 242, 251, 0.6); color: var(--texto); text-decoration: none;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
}
.topbar-back:hover { background: rgba(246, 242, 251, 0.12); }

.portada { max-width: 1360px; margin: 0 auto; padding: clamp(56px, 8vw, 112px) var(--gutter) 40px; }
.eyebrow { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--texto-suave); }
h1 {
  margin: 18px 0 0; max-width: 1100px;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 5.5rem); line-height: 1; text-transform: uppercase;
}
.updated { margin: 28px 0 0; font-family: var(--mono); font-size: 14px; letter-spacing: 0.06em; color: var(--texto-suave); }

main {
  max-width: 880px; margin: 0 auto 0;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px) clamp(40px, 6vw, 72px);
  background: var(--papel); color: var(--tinta);
}
.main-wrap { padding-inline: var(--gutter); }

.toc { margin: 0 0 48px; padding: 0 0 28px; border-bottom: 1px solid var(--linea-papel); }
.toc p { margin: 0 0 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--tinta-suave); }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.toc a { font-size: 1rem; text-decoration: none; color: var(--tinta); }
.toc a:hover { color: #6D28D9; text-decoration: underline; }

section { margin-bottom: 56px; scroll-margin-top: 24px; }

h2 {
  margin: 0 0 8px; padding-bottom: 12px; border-bottom: 1px solid var(--linea-papel);
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.05; text-transform: uppercase;
}
h3 {
  margin: 28px 0 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--acento-papel);
}
p { margin: 0 0 14px; font-size: 1rem; }
ul.plain { margin: 0 0 16px 20px; padding: 0; font-size: 1rem; }
ul.plain li { margin-bottom: 8px; }

.callout { margin: 22px 0; padding: 22px 24px; background: var(--tinta); color: var(--papel); font-size: 1rem; }
.callout strong { color: var(--acento-texto); }

.muted { color: var(--tinta-suave); font-size: 0.9rem; }

.tabla { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 0.92rem; }
caption {
  caption-side: top; text-align: left; padding-bottom: 8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tinta-suave);
}
th, td { text-align: left; padding: 10px 12px; border: 1px solid var(--linea-papel); vertical-align: top; }
th { font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; background: rgba(46, 16, 101, 0.05); }

footer {
  max-width: 1360px; margin: 0 auto;
  padding: 40px var(--gutter) 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.08em; color: var(--texto-suave);
}
footer a { color: var(--texto); text-decoration: none; opacity: 0.85; }
footer a:hover { opacity: 1; text-decoration: underline; }
footer nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

/* Móvil: marca y «Volver al inicio» en una sola fila, como la nav de las demás páginas */
@media (max-width: 479px) {
  header.topbar { padding-top: 20px; gap: 12px; }
  .brand { gap: 10px; }
  .brand img { width: 60px; height: 31px; margin: -4px -9px -4px -12px; }
  .brand span { font-size: 14px; letter-spacing: 0.08em; }
  .topbar-back { padding: 8px 10px; font-size: 12px; letter-spacing: 0.06em; }
}

/* Misma transición entre páginas que el resto del sitio (ver landing.css). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 160ms ease-in both pagina-sale; }
::view-transition-new(root) { animation: 280ms ease-out 60ms both pagina-entra; }
@keyframes pagina-sale { to { opacity: 0; } }
@keyframes pagina-entra { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}
