/* =========================================================================
   Scala Vita · FASE 3 (noviembre 2026)
   Cabecera flotante con cinta, paneles desplegables, cajón lateral en móvil,
   pie con inscripción e insignia giratoria. Se carga después de styles.css.
   ========================================================================= */
:root{
  --sobre:#F3ECDB; --sobre-60:rgba(243,236,219,.78);
  --gut:clamp(16px,2.4vw,40px); --inset:clamp(8px,1.1vw,16px); --maxw3:1600px;
  --hdr:110px; --navh:110px;
}
html{ scroll-padding-top:calc(var(--hdr) + 16px); }
body{ touch-action:manipulation; -webkit-tap-highlight-color:rgba(85,107,47,.15); }
:focus-visible{ outline:2px solid var(--terra-big); outline-offset:3px; border-radius:4px; }
.wrap3{ width:100%; max-width:var(--maxw3); margin-inline:auto; padding-inline:var(--gut); }
.skip{ position:absolute; left:16px; top:-60px; z-index:100; background:var(--tinta); color:var(--sobre); padding:10px 14px; border-radius:8px; text-decoration:none; }
.skip:focus{ top:16px; }
.sr{ position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.b3{ display:inline-flex; align-items:center; gap:.5em; min-height:44px; padding:.7em 1.3em; border-radius:999px; font:600 .95rem/1 var(--sans); text-decoration:none; border:1.5px solid transparent; cursor:pointer; transition:background-color .2s, color .2s, border-color .2s; }
.b3-p{ background:var(--terra-big); color:#FFF8EE; }
.b3-p:hover{ background:var(--terracota-d); }
.b3-g{ border-color:var(--tinta); color:var(--tinta); background:transparent; }
.b3-g:hover{ background:var(--tinta); color:var(--sobre); }

/* ---------- cabecera flotante ---------- */
.hdr{ position:fixed; z-index:60; top:var(--inset); left:var(--inset); right:var(--inset); border-radius:14px; background:var(--paper); box-shadow:0 1px 0 var(--linea), 0 18px 40px -28px rgba(42,39,36,.45); overflow:hidden; }
.tick{ display:flex; align-items:center; background:var(--arena-osc); color:var(--tinta); height:30px; font:500 .7rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; }
.tick-vp{ flex:1; align-self:stretch; display:flex; align-items:center; overflow:hidden; mask-image:linear-gradient(90deg,transparent,#000 4%,#000 96%,transparent); }
.tick-tr{ display:flex; width:max-content; animation:tick 42s linear infinite; }
.tick-tr span{ padding-inline:2.2em; white-space:nowrap; line-height:30px; }
.tick-tr span::after{ content:"·"; margin-left:4.4em; color:var(--terra-big); }
.tick.paused .tick-tr{ animation-play-state:paused; }
@keyframes tick{ to{ transform:translateX(-50%); } }
.tick-btn{ flex:none; width:44px; height:30px; display:grid; place-items:center; border:0; background:transparent; color:var(--tinta); cursor:pointer; }
.tick-btn svg{ width:12px; height:12px; }
.bar{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; height:64px; padding-inline:clamp(12px,1.6vw,24px); }
.hnav{ display:flex; gap:clamp(4px,1vw,14px); align-items:center; }
.nl{ display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 10px; border:0; background:none; font:500 .95rem/1 var(--sans); color:var(--tinta); text-decoration:none; cursor:pointer; border-radius:8px; }
.nl:hover,.nl[aria-expanded="true"],.nl[aria-current="page"]{ color:var(--olivo); }
.nl .cv{ width:10px; height:10px; transition:transform .2s; }
.nl[aria-expanded="true"] .cv{ transform:rotate(180deg); }
.logo{ justify-self:center; display:block; }
.logo img{ height:40px; width:auto; }
.util{ justify-self:end; display:flex; align-items:center; gap:10px; }
.lang3{ display:flex; font:500 .78rem/1 var(--mono); }
.lang3 a{ display:grid; place-items:center; min-width:34px; min-height:44px; text-decoration:none; color:var(--tinta-45); }
.lang3 a[aria-current]{ color:var(--tinta); }
.util .b3{ min-height:40px; padding:.6em 1.1em; font-size:.88rem; }
.burger{ display:none; width:44px; height:44px; border:0; background:none; place-items:center; color:var(--tinta); cursor:pointer; }
.burger svg{ width:24px; height:24px; }

.mega{ display:none; border-top:1px solid var(--linea); padding:22px clamp(12px,1.6vw,24px) 26px; }
.mega.open{ display:block; animation:megaIn .32s cubic-bezier(.2,.7,.2,1); }
@keyframes megaIn{ from{ clip-path:inset(0 0 100% 0); opacity:.4; } to{ clip-path:inset(0 0 0 0); opacity:1; } }
.mega-b{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.mb{ display:grid; grid-template-columns:140px 1fr; gap:16px; align-items:center; padding:14px; border-radius:12px; text-decoration:none; color:var(--sobre); background:var(--card); }
.mb:hover{ filter:brightness(1.06); }
.mb .dgm{ color:var(--sobre); }
.mb b{ display:block; font:600 1.35rem/1.1 var(--serif); }
.mb small{ display:block; margin-top:4px; font:500 .7rem/1.2 var(--mono); letter-spacing:.14em; text-transform:uppercase; opacity:.85; }
.mb p{ margin:8px 0 0; font-size:.85rem; line-height:1.4; color:var(--sobre-60); }
.mega-l{ display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:6px; overscroll-behavior-x:contain; }
.mc{ flex:0 0 clamp(170px,14vw,230px); scroll-snap-align:start; text-decoration:none; color:var(--tinta); }
.mc .ph{ aspect-ratio:3/4; border-radius:8px; overflow:hidden; background:var(--arena-osc); }
.mc .ph img{ width:100%; height:100%; object-fit:cover; transition:transform .5s cubic-bezier(.2,.7,.2,1); }
.mc:hover .ph img{ transform:scale(1.04); }
.mc .ph.line{ display:grid; place-items:center; color:var(--olivo); background:var(--arena); border:1px dashed var(--linea); }
.mc b{ display:block; margin-top:10px; font:600 1.1rem/1.15 var(--serif); }
.mc small{ display:block; font:500 .72rem/1.3 var(--mono); color:var(--bronce-txt); letter-spacing:.06em; }
.mega-foot{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:16px; font:500 .74rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; }
.mega-foot a{ color:var(--tinta); text-decoration:underline; text-underline-offset:4px; }

/* diagramas a trazo (compartidos) */
.dgm text{ font:500 10.5px var(--mono); fill:currentColor; letter-spacing:.02em; }
.dgm .dg-c{ font:600 15px var(--serif); }
.dgm .dg-dot{ fill:#F2B48F; }
.ph.line .dgm .dg-dot{ fill:var(--terra-big); }
.mb .dgm text,.ph.line .dgm text{ display:none; }
.draw [pathLength]{ stroke-dasharray:1; stroke-dashoffset:1; }
@keyframes drawIn{ from{ stroke-dashoffset:1; } to{ stroke-dashoffset:0; } }
.draw.in [pathLength]{ stroke-dashoffset:0; animation:drawIn 1.6s cubic-bezier(.4,.1,.2,1) both; }
.draw .dg-t,.draw .dg-n,.draw .dg-c,.draw .dg-dot{ opacity:0; transition:opacity .6s .9s; }
.draw.in .dg-t,.draw.in .dg-n,.draw.in .dg-c,.draw.in .dg-dot{ opacity:1; }
.draw.in g:nth-of-type(2) [pathLength]{ animation-delay:.35s; }
.draw marker path{ opacity:0; transition:opacity .4s 1.3s; }
.draw.in marker path{ opacity:1; }

/* ---------- cajón lateral (móvil) ---------- */
.drawer{ position:fixed; inset:0 0 0 auto; margin:0; width:min(420px,92vw); max-width:none; height:100dvh; max-height:none; padding:0; border:0; background:var(--paper); color:var(--tinta); overscroll-behavior:contain; display:flex; flex-direction:column; }
.drawer:not([open]){ display:none; }
.drawer[open]{ animation:drIn .34s cubic-bezier(.2,.7,.2,1); }
.drawer::backdrop{ background:rgba(42,39,36,.45); backdrop-filter:blur(2px); }
@keyframes drIn{ from{ transform:translateX(100%); } to{ transform:none; } }
.dr-h{ display:flex; justify-content:space-between; align-items:center; padding:14px 16px; border-bottom:1px solid var(--linea); }
.dr-h img{ height:34px; width:auto; }
.dr-x{ width:44px; height:44px; border:0; background:none; display:grid; place-items:center; cursor:pointer; color:var(--tinta); }
.dr-b{ flex:1; overflow-y:auto; padding:8px 16px 24px; overscroll-behavior:contain; }
.dr-g{ border-bottom:1px solid var(--linea); padding:16px 0; }
.dr-g > a{ display:flex; justify-content:space-between; align-items:baseline; text-decoration:none; font:600 1.7rem/1.1 var(--serif); color:var(--tinta); }
.dr-g small{ font:500 .7rem/1 var(--mono); letter-spacing:.14em; text-transform:uppercase; color:var(--bronce-txt); }
.dr-g ul{ list-style:none; margin:10px 0 0; padding:0; }
.dr-g li a{ display:block; padding:8px 0; font-size:.95rem; color:var(--tinta-60); text-decoration:none; }
.dr-row{ display:flex; gap:10px; overflow-x:auto; margin-top:12px; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; }
.dr-row a{ flex:0 0 120px; scroll-snap-align:start; text-decoration:none; font:600 .9rem/1.2 var(--serif); color:var(--tinta); }
.dr-row img{ width:120px; height:150px; object-fit:cover; border-radius:6px; margin-bottom:6px; }
.dr-f{ padding:14px 16px calc(14px + env(safe-area-inset-bottom)); border-top:1px solid var(--linea); display:flex; justify-content:space-between; align-items:center; }

/* ---------- pie con inscripción ---------- */
.foot{ position:relative; z-index:2; background:var(--arena); overflow:hidden; padding-top:clamp(56px,7vw,96px); color:var(--tinta); }
.f-top{ display:grid; grid-template-columns:minmax(0,1.3fr) repeat(3,minmax(0,.5fr)); gap:32px; }
.f-news h2{ margin:0 0 6px; font:500 .95rem/1.3 var(--sans); letter-spacing:.06em; text-transform:uppercase; color:var(--tinta); }
.f-news p{ margin:0 0 14px; font-size:.9rem; color:var(--tinta-60); max-width:46ch; }
.f-news a{ display:inline-flex; justify-content:space-between; align-items:center; width:min(100%,340px); padding:10px 0; min-height:44px; border-bottom:1px solid var(--tinta); text-decoration:none; font:500 .78rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; }
.f-col h3{ margin:0 0 14px; font:600 .74rem/1 var(--mono); letter-spacing:.16em; text-transform:uppercase; color:var(--tinta); }
.f-col ul{ list-style:none; margin:0; padding:0; display:grid; gap:2px; }
.f-col a{ display:inline-block; padding:5px 0; font:500 .78rem/1.3 var(--sans); letter-spacing:.06em; text-transform:uppercase; text-decoration:none; }
.f-col a:hover{ text-decoration:underline; text-underline-offset:4px; }
.f-mid{ display:flex; flex-direction:column; align-items:center; gap:8px; margin-top:clamp(56px,7vw,96px); font:500 .74rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; }
.f-mid .lang3 a{ min-height:32px; padding-inline:6px; }
.inscr{ margin:clamp(16px,2vw,28px) 0 0; font:700 clamp(3.4rem,15.6vw,19rem)/.78 var(--serif); letter-spacing:-.035em; color:var(--arena-osc); white-space:nowrap; text-align:center; transform:translateY(.12em); user-select:none; }

/* ---------- insignia giratoria ---------- */
.badge{ opacity:0; pointer-events:none; translate:0 16px; transition:opacity .35s, translate .35s, transform .25s; position:fixed; z-index:45; right:clamp(14px,2vw,28px); bottom:clamp(14px,2vw,28px); width:128px; height:128px; border-radius:50%; background:var(--olivo-mm); color:var(--sobre); display:grid; place-items:center; text-decoration:none; box-shadow:0 18px 40px -20px rgba(42,39,36,.7); }
.badge:hover{ transform:scale(1.05); }
.badge .ring{ position:absolute; inset:0; animation:spin 22s linear infinite; }
.badge .ring text{ font:500 10.4px var(--mono); letter-spacing:.2em; text-transform:uppercase; fill:var(--sobre); }
.badge .sym{ width:52px; height:52px; color:#D9C38E; }
@keyframes spin{ to{ transform:rotate(360deg); } }
body.past .badge{ opacity:1; pointer-events:auto; translate:0 0; }
body.dr .badge{ opacity:0; pointer-events:none; }

/* ---------- páginas interiores ---------- */
body.inner > section:first-of-type{ padding-top:calc(var(--hdr) + clamp(36px,5vw,64px)); }

@media (max-width:1100px){
  .mega-b{ grid-template-columns:1fr; }
}
@media (max-width:860px){
  :root{ --hdr:96px; --navh:96px; }
  .hnav,.util .b3,.util .lang3{ display:none; }
  .burger{ display:grid; }
  .bar{ grid-template-columns:auto 1fr auto; height:56px; }
  .logo{ justify-self:start; } .logo img{ height:32px; }
  .f-top{ grid-template-columns:1fr 1fr; }
  .f-news{ grid-column:1/-1; }
  .badge{ width:92px; height:92px; }
  .badge .sym{ width:38px; height:38px; }
}
@media (max-width:420px){ .tick{ height:26px; font-size:.64rem; } }
@media (prefers-reduced-motion:reduce){
  .tick-tr,.badge .ring{ animation:none; }
  .mega.open,.drawer[open]{ animation:none; }
  .draw [pathLength],.draw.in [pathLength]{ animation:none; stroke-dashoffset:0; }
  .draw .dg-t,.draw .dg-n,.draw .dg-c,.draw .dg-dot{ opacity:1; transition:none; }
  .draw marker path{ opacity:1; transition:none; }
  .badge{ transition:opacity .2s; }
  .mc .ph img{ transition:none; }
}
