/* =====================================================================
   ANUARIO ANDINO DE DERECHOS INTELECTUALES — hoja de estilos
   Diseño editorial: azul tinta + oro + papel. Sin dependencias.
   ===================================================================== */

:root {
  --ink:      #0F1B2D;
  --ink-2:    #16263D;
  --ink-3:    #1F3352;
  --paper:    #F6F1E7;
  --paper-2:  #EDE5D5;
  --white:    #FFFFFF;
  --gold:     #C9A227;
  --gold-2:   #E3C463;
  --gold-3:   #8F6E12;
  --terra:    #B0553A;
  --text:     #232A36;
  --muted:    #5F6775;
  --line:     rgba(15, 27, 45, .12);
  --line-d:   rgba(255, 255, 255, .12);

  --ff-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --ff-body:    "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1180px;
  --radius: 14px;
  --shadow: 0 20px 50px -20px rgba(15, 27, 45, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ff-body); font-size: 17px; line-height: 1.65;
  color: var(--text); background: var(--white); overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--ff-display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.1rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 2.5rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--ink); padding: .5rem 1rem; z-index: 1000; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: 1rem;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  font-family: var(--ff-body); letter-spacing: .01em;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--ink); box-shadow: 0 10px 25px -10px rgba(201, 162, 39, .7); }
.btn-gold:hover { box-shadow: 0 16px 30px -10px rgba(201, 162, 39, .8); }
.btn-ghost { color: var(--white); border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-outline { color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-sm { padding: .55rem 1.1rem; font-size: .9rem; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 27, 45, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-d); color: var(--white);
  transition: background .3s;
}
.site-header.scrolled { background: rgba(15, 27, 45, .96); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--ff-display); font-weight: 700; font-size: 1.35rem; letter-spacing: .01em; }
.brand-sub { font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; color: var(--gold-2); }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a:not(.btn) { text-decoration: none; font-size: .95rem; font-weight: 500; color: rgba(255, 255, 255, .85); position: relative; padding: .3rem 0; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px; background: var(--gold-2); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav a:not(.btn):hover::after, .nav a.active::after { transform: scaleX(1); }
.nav-cta { margin-left: .4rem; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.nav-toggle span { width: 24px; height: 2px; background: var(--white); transition: transform .3s, opacity .3s; border-radius: 2px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--ink); color: var(--white); overflow: hidden; padding: clamp(4rem, 8vw, 7rem) 0 0; }
.hero-bg { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% 10%, rgba(201, 162, 39, .22), transparent 60%),
    radial-gradient(40% 40% at 10% 90%, rgba(176, 85, 58, .18), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}
.hero-bg::before { /* trama andina escalonada */
  content: ""; position: absolute; inset: 0; opacity: .07;
  background-image:
    linear-gradient(0deg, transparent 24%, rgba(255,255,255,.9) 25%, rgba(255,255,255,.9) 26%, transparent 27%, transparent 74%, rgba(255,255,255,.9) 75%, rgba(255,255,255,.9) 76%, transparent 77%),
    linear-gradient(90deg, transparent 24%, rgba(255,255,255,.9) 25%, rgba(255,255,255,.9) 26%, transparent 27%, transparent 74%, rgba(255,255,255,.9) 75%, rgba(255,255,255,.9) 76%, transparent 77%);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(70% 70% at 70% 40%, #000 30%, transparent 100%);
          mask-image: radial-gradient(70% 70% at 70% 40%, #000 30%, transparent 100%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.eyebrow { display: flex; align-items: center; gap: .75rem; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 1.5rem; }
.eyebrow .line { width: 40px; height: 1px; background: var(--gold-2); }
.hero h1 { font-size: clamp(2.8rem, 2rem + 4vw, 5.4rem); font-weight: 600; margin-bottom: 1.2rem; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--gold-2); }
.lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: rgba(255, 255, 255, .8); max-width: 42rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* pila de portadas */
.hero-visual { display: flex; justify-content: center; perspective: 1400px; }
.stack { position: relative; width: 270px; height: 378px; margin-right: 60px; }
.stack .stack-item { position: absolute; inset: 0; z-index: calc(10 - var(--i)); transform: translate(calc(var(--i) * 30px), calc(var(--i) * -6px)) rotate(calc(-6deg + var(--i) * -5deg)); transform-origin: 50% 90%; box-shadow: -20px 30px 60px -20px rgba(0, 0, 0, .75); transition: transform .8s var(--ease); animation: float 7s ease-in-out infinite; animation-delay: calc(var(--i) * -1.2s); }
.stack:hover .stack-item { transform: translate(calc(var(--i) * 34px), calc(var(--i) * -10px)) rotate(calc(-8deg + var(--i) * -6deg)); }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

/* portadas generadas (sin imágenes) */
.cover {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  aspect-ratio: 5 / 7; width: 100%; padding: 1.1rem; border-radius: 6px 12px 12px 6px; color: var(--white);
  background: linear-gradient(160deg, var(--c1), var(--c2)); overflow: hidden; text-align: left;
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, .25), inset 8px 0 0 rgba(255, 255, 255, .06);
}
.cover::before { /* trama de chakanas */
  content: ""; position: absolute; inset: 0; opacity: .13;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.7) 0 2px, transparent 2px 14px), repeating-linear-gradient(-45deg, rgba(255,255,255,.7) 0 2px, transparent 2px 14px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.cover::after { content: ""; position: absolute; left: 1.1rem; right: 1.1rem; bottom: 4.4rem; height: 1px; background: rgba(255, 255, 255, .45); }
.cover-num { position: absolute; top: .8rem; right: 1rem; font-family: var(--ff-display); font-size: clamp(3rem, 12cqw, 5.5rem); font-weight: 700; line-height: 1; color: var(--gold-2); opacity: .95; }
.cover-title { font-family: var(--ff-display); font-weight: 700; font-size: 1.35rem; line-height: 1.05; }
.cover-sub { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; opacity: .85; margin-top: .2rem; }
.cover-year { position: absolute; left: 1.1rem; top: 1rem; font-size: .8rem; letter-spacing: .2em; color: var(--gold-2); }
.cover-xs { width: 80px; padding: .6rem; border-radius: 4px 8px 8px 4px; }
.cover-xs .cover-title { font-size: .7rem; } .cover-xs .cover-sub { display: none; }
.cover-xs .cover-num { font-size: 1.8rem; top: .4rem; right: .5rem; } .cover-xs .cover-year { font-size: .55rem; left: .6rem; top: .5rem; }
.cover-xs::after { bottom: 2.2rem; left: .6rem; right: .6rem; }
.cover-1  { --c1: #1F3352; --c2: #0F1B2D; }
.cover-2  { --c1: #7A2E2E; --c2: #3A1414; }
.cover-3  { --c1: #2E5E4E; --c2: #12302A; }
.cover-4  { --c1: #8A5A1E; --c2: #3E2809; }
.cover-5  { --c1: #3B3F73; --c2: #191B3A; }
.cover-6  { --c1: #6B3D5E; --c2: #2E1A2A; }
.cover-7  { --c1: #2F5F7A; --c2: #10283A; }
.cover-8  { --c1: #6E5A2A; --c2: #2D2410; }
.cover-9  { --c1: #4E4F52; --c2: #1E1F22; }
.cover-10 { --c1: #B0553A; --c2: #4B2116; }

/* cifras */
.stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(3rem, 6vw, 5rem); border-top: 1px solid var(--line-d); }
.stat { padding: 1.8rem 1rem 2rem; text-align: center; border-right: 1px solid var(--line-d); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-family: var(--ff-display); font-size: clamp(2.2rem, 1.6rem + 2vw, 3.4rem); font-weight: 600; color: var(--gold-2); line-height: 1; }
.stat span { font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }

/* ---------- Secciones ---------- */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-dark { background: var(--ink); color: var(--white); position: relative; }
.section-dark .kicker { color: var(--gold-2); }
.section-paper { background: var(--paper); }
.kicker { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-3); font-weight: 600; margin-bottom: .8rem; }
.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .sub { font-size: 1.12rem; color: var(--muted); }
.section-dark .section-head .sub { color: rgba(255, 255, 255, .7); }

/* Presentación */
.two-col { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.col-aside { position: sticky; top: 100px; }
.pull { font-family: var(--ff-display); font-size: 1.6rem; font-style: italic; line-height: 1.3; color: var(--ink); border-left: 3px solid var(--gold); padding-left: 1.2rem; margin: 1.5rem 0 2rem; }
.prose p { font-size: 1.08rem; color: #333a47; }
.prose em { font-style: italic; }
.dropcap::first-letter { font-family: var(--ff-display); font-size: 4.2rem; float: left; line-height: .85; padding: .1em .12em 0 0; color: var(--gold-3); font-weight: 700; }

/* Temas */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card-dark { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-d); border-radius: var(--radius); padding: 1.8rem; transition: transform .3s var(--ease), background .3s, border-color .3s; }
.card-dark:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .07); border-color: rgba(227, 196, 99, .45); }
.card-dark .icon { width: 40px; height: 40px; color: var(--gold-2); margin-bottom: 1rem; }
.card-dark h3 { font-size: 1.45rem; margin-bottom: .4rem; }
.card-dark p { margin: 0; color: rgba(255, 255, 255, .72); font-size: .98rem; }
.formats { margin-top: 3rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; border-top: 1px solid var(--line-d); padding-top: 2rem; }
.formats-label { margin: 0; font-family: var(--ff-display); font-style: italic; font-size: 1.3rem; color: var(--gold-2); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .35rem 1rem; font-size: .9rem; }

/* Consejo */
.direccion { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.2rem; margin-bottom: 3rem; }
.persona { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start; padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); transition: box-shadow .3s, transform .3s var(--ease); }
.persona:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.persona-lead { background: linear-gradient(135deg, #fff, var(--paper)); }
.persona h3 { font-size: 1.45rem; margin-bottom: .35rem; }
.persona p { margin: 0; color: var(--muted); font-size: .97rem; }
.persona-cargo { font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-3) !important; font-weight: 700; margin-bottom: .3rem !important; }
.avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--gold-2); font-family: var(--ff-display); font-weight: 700; font-size: 1.7rem; box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px var(--ink); }
.avatar-sm { width: 52px; height: 52px; font-size: 1.15rem; }
.pais { display: inline-block; font-family: var(--ff-body); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--terra); vertical-align: middle; margin-left: .4rem; }
.subhead { font-size: 1.1rem; font-family: var(--ff-body); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 1.2rem; }
.grid-consejo { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }

/* Números */
.search { position: relative; display: flex; align-items: center; max-width: 720px; margin: 0 0 2rem; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .5rem .3rem 1.1rem; box-shadow: 0 10px 30px -18px rgba(15, 27, 45, .4); }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 162, 39, .18); }
.search svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search input { flex: 1; border: 0; background: none; font: inherit; padding: .7rem .8rem; outline: none; min-width: 0; }
.search-clear { border: 0; background: var(--paper-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--ink); }
.search-results { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.4rem; margin-bottom: 2.5rem; max-height: 480px; overflow: auto; }
.search-results h4 { margin: .4rem 0 .6rem; font-family: var(--ff-body); font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.search-results .toc { margin-bottom: .6rem; }
.search-empty { color: var(--muted); margin: .5rem 0; }

.grid-numeros { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.4rem; }
.numero { display: flex; flex-direction: column; gap: .9rem; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.numero .cover { transition: transform .4s var(--ease), box-shadow .4s var(--ease); box-shadow: 0 14px 30px -14px rgba(15, 27, 45, .55), inset 6px 0 0 rgba(0, 0, 0, .25); }
.numero:hover .cover, .numero:focus-visible .cover { transform: translateY(-6px) rotate(-1.5deg); box-shadow: 0 26px 40px -16px rgba(15, 27, 45, .6), inset 6px 0 0 rgba(0, 0, 0, .25); }
.numero:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 8px; }
.numero-meta { display: flex; flex-direction: column; gap: .15rem; }
.numero-meta strong { font-family: var(--ff-display); font-size: 1.3rem; color: var(--ink); }
.numero-meta > span:not(.numero-link) { font-size: .92rem; color: var(--muted); line-height: 1.35; }
.numero-meta small { font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.numero-link { margin-top: .35rem; font-size: .85rem; font-weight: 700; color: var(--gold-3); letter-spacing: .08em; text-transform: uppercase; }
.numero-link::after { content: " →"; }
.note { margin-top: 2.5rem; font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1.2rem; }

/* Índice (dentro de diálogos y resultados) */
.toc-sec { font-family: var(--ff-body); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-3); margin: 1.6rem 0 .6rem; }
.toc { list-style: none; margin: 0; padding: 0; counter-reset: art; }
.toc-item { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); counter-increment: art; }
.toc-text { display: flex; flex-direction: column; gap: .1rem; }
.toc-text::before { content: counter(art, decimal-leading-zero); font-size: .72rem; color: var(--muted); letter-spacing: .1em; }
.toc-autor { font-weight: 700; color: var(--ink); font-size: .95rem; }
.toc-titulo { font-family: var(--ff-display); font-size: 1.15rem; line-height: 1.25; color: var(--text); }
.toc-pdf { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-decoration: none; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 999px; padding: .4rem .9rem; transition: background .25s, color .25s; white-space: nowrap; }
.toc-pdf svg { width: 16px; height: 16px; }
.toc-pdf:hover { background: var(--ink); color: var(--gold-2); }
.toc-na { font-size: .75rem; color: var(--muted); font-style: italic; white-space: nowrap; }
.toc-item mark { background: rgba(201, 162, 39, .35); color: inherit; padding: 0 .1em; border-radius: 2px; }

/* Diálogo */
.modal { width: min(880px, calc(100% - 2rem)); max-height: min(88vh, 900px); border: 0; border-radius: var(--radius); padding: 0; background: var(--white); color: var(--text); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); overflow: hidden; }
.modal::backdrop { background: rgba(15, 27, 45, .72); backdrop-filter: blur(4px); }
.modal[open] { display: flex; flex-direction: column; animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.2rem; align-items: center; padding: 1.4rem 1.6rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.modal-head .kicker { margin-bottom: .2rem; }
.modal-head h2 { font-size: 1.6rem; margin: 0; }
.modal-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink); align-self: start; }
.modal-close:hover { background: var(--ink); color: var(--white); }
.modal-body { padding: .4rem 1.6rem 1.6rem; overflow: auto; }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.contact-info .sub { color: rgba(255, 255, 255, .75); font-size: 1.08rem; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-direction: column; gap: 1rem; }
.contact-list li { display: flex; align-items: center; gap: .9rem; font-size: 1.02rem; }
.contact-list svg { width: 22px; height: 22px; color: var(--gold-2); flex: none; }
.contact-list a { color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(227, 196, 99, .5); }
.contact-list a:hover { border-bottom-color: var(--gold-2); }
.form { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-d); border-radius: var(--radius); padding: clamp(1.4rem, 3vw, 2.4rem); display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field label { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .75); font-weight: 600; }
.req { color: var(--gold-2); }
.field input, .field textarea { font: inherit; color: var(--white); background: rgba(15, 27, 45, .6); border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; padding: .8rem 1rem; outline: none; transition: border-color .25s, box-shadow .25s; width: 100%; }
.field input:focus, .field textarea:focus { border-color: var(--gold-2); box-shadow: 0 0 0 4px rgba(227, 196, 99, .18); }
.field textarea { resize: vertical; min-height: 130px; }
.field input.invalid, .field textarea.invalid { border-color: #E0705A; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-top: .4rem; }
.form-legal { margin: 0; font-size: .82rem; color: rgba(255, 255, 255, .55); max-width: 30rem; }
.form-msg { margin: 0; min-height: 1.5em; font-weight: 600; }
.form-msg.ok { color: #9FE0B0; } .form-msg.error { color: #F3A28F; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* Pie */
.site-footer { background: #0A1220; color: rgba(255, 255, 255, .75); padding: 3rem 0 1.5rem; border-top: 1px solid var(--line-d); }
.footer-grid { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--line-d); }
.footer-brand { display: flex; align-items: center; gap: 1rem; }
.footer-brand strong { display: block; color: var(--white); font-family: var(--ff-display); font-size: 1.25rem; }
.footer-brand span { font-size: .85rem; }
.footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-nav a { text-decoration: none; font-size: .92rem; }
.footer-nav a:hover { color: var(--gold-2); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1.4rem; font-size: .85rem; }
.footer-bottom p { margin: 0; }
.credit a { color: var(--gold-2); text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.credit a:hover { text-decoration: underline; }

.to-top { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--ink); display: grid; place-items: center; box-shadow: 0 10px 25px -8px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(10px); transition: opacity .3s, transform .3s; z-index: 90; }
.to-top.show { opacity: 1; transform: none; }
.to-top svg { width: 22px; height: 22px; }

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .stack-item { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-numeros { grid-template-columns: repeat(4, 1fr); }
  .stack { width: 230px; height: 322px; }
}
@media (max-width: 920px) {
  .nav { position: fixed; inset: 76px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--ink); border-bottom: 1px solid var(--line-d); padding: .5rem 1.25rem 1.25rem; transform: translateY(-110%); opacity: 0; transition: transform .35s var(--ease), opacity .3s; box-shadow: 0 30px 40px -20px rgba(0, 0, 0, .6); }
  .nav.open { transform: none; opacity: 1; }
  .nav a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--line-d); font-size: 1.05rem; }
  .nav-cta { margin: 1rem 0 0; }
  .nav-toggle { display: flex; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .eyebrow, .hero-actions { justify-content: center; }
  .lead { margin-inline: auto; }
  .hero-visual { margin-top: 1rem; }
  .stack { width: 220px; height: 308px; margin-left: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line-d); }
  .two-col, .direccion, .grid-consejo, .contact-grid { grid-template-columns: 1fr; }
  .col-aside { position: static; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-numeros { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-numeros { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .field-row { grid-template-columns: 1fr; }
  .persona { grid-template-columns: 1fr; }
  .modal-head { grid-template-columns: 1fr auto; }
  .modal-head .cover-xs { display: none; }
  .toc-item { grid-template-columns: 1fr; gap: .5rem; }
  .brand-sub { display: none; }
  .form-foot .btn { width: 100%; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
