:root{
  --bg:#0A0A0B; --alt:#111114; --ink:#F4F1EA; --muted:#8A8A93;
  --accent:#C9A961; --federal:#7f92a6; --line:rgba(244,241,234,0.12);
  --serif:"Fraunces",Georgia,serif; --sans:"Inter",system-ui,sans-serif; --mono:"IBM Plex Mono",monospace;
  --maxw:1200px;
}
:root[data-theme="light"]{
  --bg:#f7f5ef; --alt:#fff; --ink:#1a1c20; --muted:#5c5f66;
  --accent:#8a6d1f; --federal:#3a536b; --line:rgba(0,0,0,.12);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
body{margin:0;background:var(--bg);color:var(--ink);font:400 17px/1.65 var(--serif);
  -webkit-font-smoothing:antialiased;overflow-x:hidden}
.mono{font-family:var(--mono);font-weight:400;letter-spacing:.08em;text-transform:uppercase;font-size:12px}
.sec-num{color:var(--accent);display:block;margin-bottom:1.4rem}
h1,h2{font-family:var(--serif);font-weight:900;line-height:1.02;letter-spacing:-.015em;margin:0}
em{color:var(--accent);font-style:italic}
.theme{position:fixed;bottom:20px;right:20px;z-index:50;width:42px;height:42px;border-radius:50%;
  background:var(--alt);border:1px solid var(--line);color:var(--ink);cursor:pointer;font-size:17px}

/* ---------- HERO ---------- */
.hero{height:300vh;position:relative}
.hero__sticky{position:sticky;top:0;height:100svh;overflow:hidden;display:flex;
  flex-direction:column;justify-content:flex-start;padding:13vh 8vw 9vh;gap:1.5rem}
.hero__canvas,.hero__video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0}
.hero__scrim{position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(100deg,rgba(10,10,11,.95) 0%,rgba(10,10,11,.74) 30%,rgba(10,10,11,.34) 58%,rgba(10,10,11,.52) 100%)}
.hero__copy{position:relative;z-index:2;max-width:min(92vw,1000px)}
.kicker{color:var(--accent);display:block;margin-bottom:1.6rem}
.hero__title{font-size:clamp(3rem,9.2vw,8.5rem);letter-spacing:-.025em;max-width:15ch}
.hero__lede{font-family:var(--sans);font-size:clamp(1rem,1.6vw,1.25rem);color:var(--muted);
  max-width:42ch;margin:1.8rem 0 0}
.hero__scrollcue{position:absolute;bottom:26px;left:8vw;color:var(--muted);z-index:2;
  animation:bob 2.4s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.hero__scrollcue{animation:none}}
@keyframes bob{50%{transform:translateY(6px)}}
.hero__timeline{position:relative;margin-top:auto;z-index:2}
.tl__line{position:relative;height:2px;background:var(--line);width:100%}
.tl__fill{position:absolute;left:0;top:0;height:100%;width:0;background:var(--accent)}
.tl__nodes{display:flex;justify-content:space-between;list-style:none;margin:0;padding:0;position:relative;top:-6px}
.tl__nodes li{flex:1;text-align:left;opacity:.32;transition:opacity .5s}
.tl__nodes li.on{opacity:1}
.tl__dot{width:11px;height:11px;border-radius:50%;background:var(--bg);border:2px solid var(--muted);display:block;margin-bottom:12px}
.tl__nodes li.on .tl__dot{border-color:var(--accent);background:var(--accent);box-shadow:0 0 0 5px color-mix(in srgb,var(--accent) 22%,transparent)}
.tl__yr{font-family:var(--mono);font-size:13px;color:var(--ink);display:block}
.tl__lb{font-family:var(--sans);font-size:12.5px;color:var(--muted);display:block;max-width:16ch;line-height:1.35;margin-top:3px}
@media (max-width:760px){
  .hero{height:100svh}
  .hero__sticky{position:relative;height:100svh;justify-content:center}
  .hero__timeline{position:static;margin-top:2.2rem;left:auto;right:auto;bottom:auto}
  .tl__line{display:none}
  .tl__nodes{flex-direction:column;gap:12px;top:0}
  .tl__nodes li{opacity:1}
  .tl__lb{max-width:none}
  .hero__scrollcue{display:none}
}
@media (prefers-reduced-motion:reduce){
  .hero{height:100svh}
  .hero__sticky{position:relative;height:100svh}
  .hero__scrollcue{display:none}
}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}

/* ---------- GÉNESIS (recorrido horizontal con pin) ---------- */
.genesis{position:relative;height:520vh;background:#0A0A0B}
.genesis__sticky{position:sticky;top:0;height:100svh;overflow:hidden;display:flex;align-items:center}
.genesis__bg{position:absolute;inset:0;z-index:0;background:url("frames/hero/frame_0060.webp") center/cover no-repeat;opacity:.22;filter:grayscale(1)}
.genesis__scrim{position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(90deg,rgba(10,10,11,.9),rgba(10,10,11,.5) 60%,rgba(10,10,11,.85))}
.genesis__track{position:relative;z-index:2;display:flex;height:100%;will-change:transform}
.gpanel{flex:0 0 100vw;height:100%;display:flex;flex-direction:column;justify-content:center;padding:0 10vw}
.gpanel__yr{font-family:var(--mono);color:var(--accent);font-size:clamp(3rem,11vw,9.5rem);line-height:.95;letter-spacing:-.02em;font-weight:500}
.gpanel__t{font-family:var(--serif);font-weight:900;font-size:clamp(1.8rem,4.2vw,3.6rem);margin:.25em 0 .45em;max-width:16ch;line-height:1.05}
.gpanel__d{font-family:var(--sans);color:var(--muted);font-size:clamp(1rem,1.5vw,1.2rem);max-width:44ch;line-height:1.6}
.tachar{position:relative;color:var(--ink);white-space:nowrap}
.tachar::after{content:"";position:absolute;left:-2px;right:-2px;top:52%;height:3px;background:var(--accent);transform:scaleX(0);transform-origin:left;transition:transform .7s ease}
.gpanel.is-struck .tachar::after{transform:scaleX(1)}
.genesis__progress{position:absolute;z-index:3;left:10vw;right:10vw;bottom:11vh;height:2px;background:var(--line)}
.genesis__progress span{display:block;height:100%;width:0;background:var(--accent)}
.genesis__label{position:absolute;z-index:3;top:8vh;left:10vw;color:var(--muted)}
@media (max-width:820px){
  .genesis{height:auto}
  .genesis__sticky{position:relative;height:auto;display:block;overflow:visible}
  .genesis__bg{filter:grayscale(.3)}
  .genesis__track{flex-direction:column;height:auto;transform:none!important}
  .gpanel{flex:none;width:100%;min-height:76svh;padding:13vh 8vw;border-top:1px solid var(--line)}
  .genesis__progress{display:none}
  .gpanel.last .tachar::after{transform:scaleX(1)}
}

/* ---------- PREÁMBULO ---------- */
.preambulo{position:relative;min-height:100svh;display:flex;flex-direction:column;justify-content:center;
  padding:22vh 8vw;background:#0A0A0B;overflow:hidden}
.preambulo::before{content:"";position:absolute;inset:0;z-index:0;
  background:url("frames/hero/frame_0118.webp") center/cover no-repeat;opacity:.30}
.preambulo::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(180deg,#0A0A0B 0%,rgba(10,10,11,.42) 24%,rgba(10,10,11,.6) 60%,rgba(10,10,11,.92) 100%)}
.preambulo>*{position:relative;z-index:2}
.preambulo .sec-num{color:var(--accent)}
.preambulo__text{font-size:clamp(1.3rem,2.9vw,2.4rem);line-height:1.42;font-weight:400;color:#F4F1EA;
  max-width:24ch;margin:0;border:0;font-style:normal;quotes:none}
.preambulo__text::first-letter{font-weight:900;color:var(--accent);font-size:1.15em}
@media (min-width:900px){.preambulo__text{max-width:34ch}}

/* ---------- TESIS PUENTE ---------- */
.tesis{padding:16vh 8vw;max-width:var(--maxw);margin:0 auto}
.tesis__card{border-left:3px solid var(--accent);padding:1.4rem 0 1.4rem 2rem;max-width:60ch}
.tesis__card h2{font-size:clamp(1.5rem,3.2vw,2.5rem);line-height:1.12}
.tesis__card p{color:var(--muted);font-family:var(--sans);font-size:1.05rem;margin:1.2rem 0 0}
.tesis__card .mono{color:var(--accent);display:block;margin-bottom:1rem}

/* ---------- AUDIO (narración Preámbulo) ---------- */
.preambulo__audio{margin:0 0 2.6rem}
.audio-btn{display:inline-flex;align-items:center;gap:12px;background:transparent;color:var(--ink);
  border:1px solid color-mix(in srgb,var(--accent) 55%,transparent);border-radius:999px;padding:14px 24px;
  font-family:var(--mono);font-size:12px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;
  transition:background .25s,color .25s;min-height:48px}
.audio-btn:hover,.audio-btn.playing{background:var(--accent);color:var(--bg)}
.audio-btn__ic{font-size:13px;line-height:1}

/* ---------- EXPLORADOR ---------- */
.explorer{padding:16vh 8vw;max-width:var(--maxw);margin:0 auto}
.explorer__head{margin-bottom:8vh}
.explorer__head h2{font-size:clamp(1.8rem,4vw,3.2rem);max-width:16ch}
.stats{display:flex;gap:2.4rem;flex-wrap:wrap;margin-top:2.4rem;font-family:var(--sans)}
.stats b{display:block;font-family:var(--serif);font-size:2rem;font-weight:900}
.stats span{color:var(--muted);font-size:13px}
.explorer__layout{display:grid;grid-template-columns:300px 1fr;gap:3rem;align-items:start}
.index{position:sticky;top:4vh;max-height:92vh;overflow:auto;padding-right:8px;font-family:var(--sans)}
.grp{margin-bottom:1.2rem}
.grp>h3{font-family:var(--mono);font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--accent);margin:1.4rem 0 .7rem}
.index a{display:block;padding:10px 12px;border-radius:8px;color:var(--muted);text-decoration:none;
  border-left:2px solid transparent;cursor:pointer;font-size:14.5px;transition:color .2s,background .2s}
.index a small{font-family:var(--mono);font-size:11px;color:var(--accent);margin-right:6px}
.index a:hover{color:var(--ink);background:var(--alt)}
.index a.active{color:var(--ink);background:var(--alt);border-left-color:var(--accent);font-weight:600}
.detail{min-height:70vh;scroll-margin-top:2vh}
.card{background:var(--alt);border:1px solid var(--line);border-radius:16px;padding:clamp(24px,4vw,44px)}
.eyebrow{font-family:var(--mono);font-size:12px;letter-spacing:.1em;text-transform:uppercase;color:var(--accent)}
.detail h3.title{font-size:clamp(1.6rem,3.4vw,2.6rem);font-weight:900;margin:.5rem 0 0;line-height:1.08}
.badges{display:flex;gap:8px;flex-wrap:wrap;margin:1.4rem 0 0}
.badge{font-family:var(--mono);font-size:11px;padding:6px 11px;border-radius:999px;border:1px solid var(--line);color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.badge.no_ratificada{color:var(--bg);background:var(--accent);border-color:var(--accent)}
.badge.fed{color:var(--federal);border-color:color-mix(in srgb,var(--federal) 45%,transparent)}
.block{margin-top:2.2rem;padding-top:1.7rem;border-top:1px solid var(--line)}
.block h4{font-family:var(--mono);font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);margin:0 0 1rem}
.verbatim{font-size:1.15rem;line-height:1.7;margin:0}
.verbatim.pending{color:var(--muted);font-style:italic;font-size:1rem}
.debate ul,.juris ul{margin:0;padding:0;list-style:none}
.debate li{margin-bottom:1.2rem}
.debate .voz{font-family:var(--mono);font-size:12px;color:var(--accent);letter-spacing:.05em}
.debate .src{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:8px}
.debate p{margin:.35rem 0 0;font-style:italic}
.juris li{display:flex;justify-content:space-between;gap:1.2rem;padding:.7rem 0;border-bottom:1px dotted var(--line);font-size:1rem}
.juris .cita{font-family:var(--mono);font-size:12.5px;color:var(--federal);white-space:nowrap}
.fedgrid{display:grid;gap:1rem}
.fedgrid .row{display:grid;grid-template-columns:120px 1fr;gap:1rem;align-items:baseline}
.fedgrid .k{font-family:var(--mono);font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.empty{color:var(--muted);font-style:italic;font-size:.95rem}

/* ---------- TENSIÓN (bloque en detalle de provisión) ---------- */
.tns ul{margin:0;padding:0;list-style:none}
.tns li{padding:14px 0;border-bottom:1px dotted var(--line)}
.tns__top{display:flex;justify-content:space-between;gap:1rem;align-items:baseline}
.tns__caso{font-family:var(--serif);font-weight:600;font-size:1.05rem}
.tns__yr{font-family:var(--mono);font-size:12px;color:var(--federal);white-space:nowrap}
.tns__tipo{font-family:var(--mono);font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--accent);display:block;margin:.25rem 0}
.tns li p{margin:.4rem 0 0;font-size:.98rem;color:var(--muted);line-height:1.55}

/* ---------- PROMESA (línea de tensión federal) ---------- */
.promesa{padding:18vh 8vw;max-width:var(--maxw);margin:0 auto;background:var(--bg)}
.promesa__head{margin-bottom:8vh;max-width:60ch}
.promesa__head h2{font-size:clamp(1.9rem,4.4vw,3.4rem);margin:.2em 0 .4em}
.promesa__lede{font-family:var(--sans);color:var(--muted);font-size:1.08rem;line-height:1.6}
.promesa__list{list-style:none;margin:0;padding:0;position:relative}
.promesa__list::before{content:"";position:absolute;left:calc(clamp(3rem,7vw,6rem) + 1.1rem);top:1rem;bottom:1rem;width:2px;background:var(--line)}
.pcard{display:grid;grid-template-columns:clamp(3.5rem,8vw,7rem) 1fr;gap:clamp(1.6rem,3.5vw,3.2rem);padding:2.2rem 0;position:relative}
.pcard__yr{font-family:var(--mono);font-weight:500;font-size:clamp(1.1rem,1.7vw,1.45rem);color:var(--accent);position:relative}
.pcard__yr::after{content:"";position:absolute;right:-1.1rem;top:.35em;width:11px;height:11px;border-radius:50%;background:var(--accent);transform:translateX(50%);box-shadow:0 0 0 5px var(--bg)}
.pcard__tipo{color:var(--federal);font-size:11px;margin-bottom:.5rem}
.pcard__caso{font-family:var(--serif);font-weight:900;font-size:clamp(1.2rem,2.2vw,1.7rem);line-height:1.15;margin:0}
.pcard__cita{font-family:var(--mono);font-size:12px;color:var(--muted);font-weight:400;white-space:nowrap}
.pcard__hold{font-family:var(--sans);color:var(--muted);font-size:1rem;line-height:1.6;margin:.7rem 0 0;max-width:62ch}
.promesa__disc{color:var(--muted);text-transform:none;letter-spacing:0;margin-top:3rem;font-size:11.5px}
@media(max-width:640px){.pcard{grid-template-columns:1fr;gap:.6rem}.promesa__list::before{display:none}.pcard__yr::after{display:none}}

/* ---------- WIDGET EN VIVO ---------- */
.live{padding:18vh 8vw;background:var(--alt);border-top:1px solid var(--line)}
.live__inner{max-width:820px;margin:0 auto}
.tag{color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 40%,transparent);
  padding:5px 12px;border-radius:999px;display:inline-block}
.live h2{font-size:clamp(2rem,5vw,3.4rem);margin:1.4rem 0 0}
.live__lede{font-family:var(--sans);color:var(--muted);max-width:56ch;margin:1.2rem 0 2rem;font-size:1.05rem}
.live__form{display:flex;gap:10px;flex-wrap:wrap}
.live__form input{flex:1;min-width:240px;background:var(--bg);border:1px solid var(--line);
  border-radius:12px;padding:16px 18px;color:var(--ink);font-family:var(--serif);font-size:1.1rem}
.live__form input:focus{outline:none;border-color:var(--accent)}
.live__form button{background:var(--accent);color:var(--bg);border:0;border-radius:12px;
  padding:0 26px;min-height:54px;font-family:var(--sans);font-weight:600;font-size:1rem;cursor:pointer}
.live__form button:disabled{opacity:.5;cursor:default}
.live__chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.chip{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--line);
  border-radius:999px;padding:6px 12px;cursor:pointer;background:none}
.chip:hover{color:var(--ink);border-color:var(--accent)}
.live__out{margin-top:2rem}
.res{background:var(--bg);border:1px solid var(--line);border-radius:14px;padding:22px 24px;margin-bottom:14px}
.res__top{display:flex;justify-content:space-between;gap:1rem;align-items:baseline;flex-wrap:wrap}
.res__rub{font-family:var(--serif);font-weight:900;font-size:1.35rem;line-height:1.1}
.res__loc{font-family:var(--mono);font-size:11px;color:var(--accent);white-space:nowrap}
.res__txt{font-size:1.02rem;line-height:1.6;margin:.9rem 0 0;color:var(--ink)}
.res__meta{display:grid;gap:.5rem;margin-top:1rem;font-family:var(--sans);font-size:.92rem;color:var(--muted)}
.res__meta b{color:var(--ink);font-weight:600}
.skl{height:14px;background:linear-gradient(90deg,var(--line),transparent,var(--line));
  background-size:200% 100%;border-radius:6px;margin:10px 0;animation:sh 1.3s linear infinite}
@media (prefers-reduced-motion:reduce){.skl{animation:none}}
@keyframes sh{to{background-position:-200% 0}}
.pausa{border:1px dashed var(--line);border-radius:14px;padding:22px 24px;color:var(--muted);font-family:var(--sans)}
.live__disc{color:var(--muted);text-transform:none;letter-spacing:0;margin-top:1.6rem;line-height:1.6;font-size:11.5px}

/* ---------- FOOTER ---------- */
.foot{padding:8vh 8vw;border-top:1px solid var(--line);max-width:var(--maxw);margin:0 auto}
.foot__brand{font-family:var(--serif);font-weight:900;font-size:1.2rem;margin-bottom:1rem}
.foot p{color:var(--muted);text-transform:none;letter-spacing:0;font-size:12px;line-height:1.7;max-width:70ch}

[data-reveal]{will-change:opacity,transform}

@media (max-width:820px){
  .explorer__layout{grid-template-columns:1fr}
  .index{position:static;max-height:none;border-bottom:1px solid var(--line);padding-bottom:1rem;margin-bottom:2rem}
}
