/* ==========================================================================
   MARQUITOUH · PLANO TECNICO
   base.css — sistema de diseño: tokens, retícula, reglas, primitivas
   Tema por defecto: CLARO

   Las fuentes NO se cargan con @import (sería una petición encadenada que
   bloquea el pintado). Van como <link> en el <head> de cada página.
   ========================================================================== */

/* ---------- 1. TOKENS ---------------------------------------------------- */
:root {
  color-scheme: light;

  /* Superficies */
  --paper:        #F7F6F3;
  --paper-2:      #FFFFFF;
  --paper-3:      #EFEDE8;
  --paper-sunk:   #E9E7E1;

  /* Tinta */
  --ink:          #141416;
  --ink-2:        #3C3C41;
  --ink-3:        #66666F;   /* era #71717A: daba 4.47:1 sobre papel, 0.03 abajo del 4.5 */
  --ink-4:        #9A9AA2;   /* solo decoracion (reglas, ticks). NO usar para texto */

  /* Acento — rojo de la referencia */
  --red:          #B21F24;
  --red-ink:      #8E191D;   /* rojo legible sobre rojo, para hover de texto */
  --red-soft:     rgba(178, 31, 36, .07);
  --red-line:     rgba(178, 31, 36, .30);
  --red-glow:     rgba(178, 31, 36, .16);

  /* Filetes y retícula */
  --hair:         rgba(20, 20, 22, .14);
  --hair-2:       rgba(20, 20, 22, .07);
  --hair-3:       rgba(20, 20, 22, .28);
  --grid-minor:   rgba(20, 20, 22, .055);
  --grid-major:   rgba(20, 20, 22, .11);
  --cross-op:     .13;

  /* Ambiente */
  --scan-op:      .045;
  --grain-op:     .38;
  --shadow:       0 1px 0 rgba(20,20,22,.05), 0 14px 30px -20px rgba(20,20,22,.45);
  --shadow-lift:  0 1px 0 rgba(20,20,22,.05), 0 26px 50px -26px rgba(20,20,22,.55);

  /* Métrica */
  --ruler-w:      30px;
  --shell-max:    1240px;
  --gut:          clamp(18px, 4vw, 40px);
  --sec-pad:      clamp(64px, 9vw, 128px);

  /* Familias */
  --mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Space Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --body:    'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Movimiento */
  --ease:      cubic-bezier(.22, .61, .36, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-hard: cubic-bezier(.7, 0, .2, 1);
  --t-fast:    .18s;
  --t:         .34s;
  --t-slow:    .72s;
}

[data-theme="dark"] {
  color-scheme: dark;

  --paper:        #0A0A0B;
  --paper-2:      #121214;
  --paper-3:      #17171A;
  --paper-sunk:   #060607;

  --ink:          #EDEAE4;
  --ink-2:        #B9B6B0;
  --ink-3:        #85827D;
  --ink-4:        #5E5C58;

  --red:          #CE3339;   /*.version levantada para contraste sobre negro */
  --red-ink:      #E46065;
  --red-soft:     rgba(206, 51, 57, .10);
  --red-line:     rgba(206, 51, 57, .34);
  --red-glow:     rgba(206, 51, 57, .20);

  --hair:         rgba(237, 234, 228, .15);
  --hair-2:       rgba(237, 234, 228, .075);
  --hair-3:       rgba(237, 234, 228, .30);
  --grid-minor:   rgba(237, 234, 228, .045);
  --grid-major:   rgba(237, 234, 228, .10);
  --cross-op:     .13;

  --scan-op:      .06;
  --grain-op:     .22;
  --shadow:       0 1px 0 rgba(0,0,0,.4), 0 14px 30px -20px rgba(0,0,0,.9);
  --shadow-lift:  0 1px 0 rgba(0,0,0,.4), 0 26px 50px -26px rgba(0,0,0,1);
}

/* ---------- 3. RESET ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100vh;
  padding-inline: var(--ruler-w);
  /* hueco para que el reproductor fijo no tape el final del documento */
  padding-bottom: 56px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

.is-booting, body.is-booting { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--red); color: var(--paper-2); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* Scrollbar — filete técnico */
::-webkit-scrollbar        { width: 9px; height: 9px; }
::-webkit-scrollbar-track  { background: var(--paper-3); }
::-webkit-scrollbar-thumb  { background: var(--ink-4); border: 2px solid var(--paper-3); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }
* { scrollbar-width: thin; scrollbar-color: var(--ink-4) var(--paper-3); }

/* ---------- 4. TIPOGRAFÍA ----------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -.02em;
}

/* Etiqueta técnica — el `■ EVANGELION` de la referencia */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}
.tag::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--red);
  flex: none;
}
.tag--plain::before { display: none; }
.tag--muted { color: var(--ink-3); }
.tag--muted::before { background: var(--ink-4); }

/* Texto técnico secondary */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lead {
  font-size: clamp(1rem, .4vw + .95rem, 1.125rem);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 62ch;
}

/* Texto vertical a la derecha de los títulos */
.vtext {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .5em;
  color: var(--red);
  user-select: none;
}

/* ---------- 5. CAPA DE PLANO (fondo) ------------------------------------ */
/* Todo se inyecta desde core.js para no repetir markup en las 3 páginas */

.plano      { position: fixed; inset: 0; z-index: -3; pointer-events: none; }

/* El bajo de la musica late en la grilla. --bass (0..1) lo escribe el
   AnalyserNode del reproductor; sin musica se queda en 0 y esto no se ve. */
.plano__bass {
  position: absolute; inset: 0;
  background: radial-gradient(115% 75% at 50% 8%, var(--red-glow), transparent 68%);
  opacity: calc(var(--bass, 0) * .9);
}

.plano__grid {
  position: absolute; inset: -2px;
  background-image:
    repeating-linear-gradient(90deg, var(--grid-major) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(0deg,  var(--grid-major) 0 1px, transparent 1px 120px),
    repeating-linear-gradient(90deg, var(--grid-minor) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg,  var(--grid-minor) 0 1px, transparent 1px 24px);
  animation: deriva 90s linear infinite;
}

@keyframes deriva {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-120px, -120px, 0); }
}

/* Cruzes de registro en cada intersección fuerte */
.plano__cross {
  position: absolute; inset: 0;
  opacity: var(--cross-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M60 51v18M51 60h18' stroke='%23000' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  animation: deriva 90s linear infinite;
}
[data-theme="dark"] .plano__cross {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cpath d='M60 51v18M51 60h18' stroke='%23fff' stroke-width='1'/%3E%3C/svg%3E");
}

/* Línea de escaneo descendente */
.plano__scan {
  position: absolute; inset-inline: 0; height: 34vh;
  background: linear-gradient(180deg, transparent, var(--red) 92%, transparent);
  opacity: 0;
  animation: escaneo 11s var(--ease-hard) infinite;
  will-change: transform;
}
@keyframes escaneo {
  0%          { transform: translateY(-40vh); opacity: 0; }
  6%          { opacity: var(--scan-op); }
  88%         { opacity: var(--scan-op); }
  100%        { transform: translateY(120vh); opacity: 0; }
}

/* Grano de papel */
.plano__grain {
  position: absolute; inset: 0;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ---------- 6. REGLAS DE BORDE (rulers) --------------------------------- */
.ruler {
  position: fixed; top: 0; bottom: 0; width: var(--ruler-w);
  z-index: 60;
  pointer-events: none;
  background: var(--paper);
  border-inline: 1px solid var(--hair-2);
  transition: background-color .5s var(--ease), border-color .5s var(--ease);
}
.ruler--l { left: 0;  border-left: 0; }
.ruler--r { right: 0; border-right: 0; }

/* Ticks: corto cada 6px, largo cada 30px */
.ruler__ticks {
  position: absolute; top: 0; bottom: 0; width: 7px;
  background-image:
    repeating-linear-gradient(180deg, var(--hair-3) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(180deg, var(--hair)   0 1px, transparent 1px 6px);
}
.ruler--l .ruler__ticks { right: 0; }
.ruler--r .ruler__ticks { left: 0; }

.ruler__nums {
  position: absolute; top: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-4);
  overflow: hidden;
  opacity: .5;
}
.ruler--l .ruler__nums { right: 11px; }
.ruler--r .ruler__nums { left: 11px; }
/* Los 200+ numerales de la regla son ESCALA GRAFICA, no informacion: viven en
   una capa aria-hidden y existen para que el borde parezca un instrumento.
   A .35 de opacidad daban 1.34:1, ilegible como texto. Se suben a .5 (algo mas
   presentes de verdad) y el numero pasa a contenido generado: asi ningun
   auditor los toma por texto que deberia poder leerse. El que marca la seccion
   actual, ese si, es texto de verdad. */
.ruler__nums span { display: block; height: 30px; line-height: 30px; }
.ruler__nums span::after { content: attr(data-n); }
.ruler__nums span.on { color: var(--red); font-weight: 700; }

/* Indicador de progreso: se llena en rojo */
.ruler__prog {
  position: absolute; top: 0; left: 0; right: 0;
  height: 0%;
  background: var(--red-soft);
  border-bottom: 1px solid var(--red);
  transition: height .1s linear;
}

/* Barra de progreso horizontal superior */
.progbar {
  position: fixed; top: 0; left: var(--ruler-w); right: 0;
  height: 2px; z-index: 70;
  background: var(--hair-2);
  pointer-events: none;
}
.progbar__fill {
  height: 100%; width: 0%;
  background: var(--red);
  transform-origin: left;
}

/* ---------- 7. SHELL ----------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.sec { padding-block: var(--sec-pad); position: relative; }
.sec--tight { padding-block: clamp(40px, 5vw, 68px); }
.sec--sunk  { background: var(--paper-3); }

/* Rejilla de dos columnas (texto + pieza) */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr minmax(230px, 360px);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
/* dos columnas iguales */
.grid-2--eq { grid-template-columns: 1fr 1fr; }
.grid-2 > figure { margin: 0; }

@media (max-width: 860px) {
  .grid-2,
  .grid-2--eq { grid-template-columns: 1fr; }
}

/* Filete superior de sección con Etiqueta */
.sec__head {
  display: flex; align-items: flex-start; gap: clamp(16px, 3vw, 34px);
  margin-bottom: clamp(30px, 4.5vw, 58px);
}
.sec__num {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(3.2rem, 8vw, 6rem);
  line-height: .78;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px var(--red-line);
  flex: none;
  user-select: none;
}
.sec__title { flex: 1; min-width: 0; }
/* h1 y h2 comparten estilo: en la pagina donde el primer bloque es el titulo
   principal, ese encabezado es un h1 y tiene que verse igual que los demas. */
.sec__title h1,
.sec__title h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  margin-top: 10px;
  text-wrap: balance;
}
.sec__title p { margin-top: 12px; }
.sec__vtext { flex: none; align-self: stretch; padding-block: 4px; }

/* Barra rayada roja */
.hatch {
  height: 5px; width: 100%;
  background-image: repeating-linear-gradient(-45deg, var(--red) 0 2px, transparent 2px 7px);
  opacity: .85;
}
.hatch--short { width: 72px; }

/* ---------- 8. PANEL ----------------------------------------------------- */
.panel {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  box-shadow: var(--shadow);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease),
              transform var(--t) var(--ease), background-color .5s var(--ease);
}

/* Marcas de recorte en las 4 esquinas (rojo) */
.panel--marks { background-repeat: no-repeat; }
.panel--marks::after {
  content: "";
  position: absolute; inset: 7px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t) var(--ease);
  background-image:
    linear-gradient(var(--red), var(--red)), linear-gradient(var(--red), var(--red)),
    linear-gradient(var(--red), var(--red)), linear-gradient(var(--red), var(--red)),
    linear-gradient(var(--red), var(--red)), linear-gradient(var(--red), var(--red)),
    linear-gradient(var(--red), var(--red)), linear-gradient(var(--red), var(--red));
  background-size: 9px 1px, 9px 1px, 1px 9px, 1px 9px, 9px 1px, 9px 1px, 1px 9px, 1px 9px;
  background-position:
    0 0,      100% 0,   0 7px,   100% 7px,
    0 100%,   100% 100%, 7px 0,   7px 100%;
  background-repeat: no-repeat;
}
.panel--marks:hover::after { opacity: 1; }
.panel:hover { border-color: var(--red-line); }

/* Panel con muesca superior roja */
.panel--notch { border-top: 2px solid var(--red); }

/* Panel hundido: sin sombra, fondo más bajo (zonas de lectura larga) */
.panel--sunk {
  background: var(--paper-3);
  box-shadow: none;
}

/* ---------- 9. BOTONES --------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border: 1px solid var(--ink);
  background: transparent;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
  transition: color var(--t) var(--ease), border-color var(--t) var(--ease);
}
/* Barrido de rayas al hover */
.btn::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image: repeating-linear-gradient(-45deg, var(--red) 0 3px, transparent 3px 8px);
  transform: translateY(101%);
  transition: transform var(--t) var(--ease-out);
}
.btn:hover { color: var(--paper-2); border-color: var(--red); }
.btn:hover::before { transform: translateY(0); }

.btn--red { background: var(--red); border-color: var(--red); color: var(--paper-2); }
.btn--red::before { background-image: repeating-linear-gradient(-45deg, var(--ink) 0 3px, transparent 3px 8px); }
.btn--red:hover { border-color: var(--ink); }
/* el número no puede ser rojo sobre fondo rojo */
.btn--red .btn__n { color: inherit; opacity: .55; }
.btn--red:hover .btn__n { opacity: 1; }

.btn--ghost { border-color: var(--hair); color: var(--ink-2); }
.btn__n { color: var(--red); transition: color var(--t) var(--ease); }
.btn:hover .btn__n { color: inherit; }

/* Enlace con subrayado que se dibuja */
.ulink {
  position: relative;
  display: inline-block;
  color: var(--ink);
  font-weight: 600;
  padding-bottom: 2px;
}
.ulink::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t) var(--ease-out);
}
.ulink:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- 10. RETÍCULA DE CURSOR (desktop) ---------------------------- */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.cursor__ring {
  position: absolute; inset: 0;
  border: 1px solid var(--red);
  border-radius: 50%;
  transform: scale(.4);
  transition: transform .34s var(--ease-out), border-color var(--t) var(--ease);
}
.cursor__cross { position: absolute; inset: 0; }
.cursor__cross::before, .cursor__cross::after {
  content: "";
  position: absolute;
  background: var(--red);
}
.cursor__cross::before { left: 50%; top: -7px; bottom: -7px; width: 1px; margin-left: -.5px; }
.cursor__cross::after  { top: 50%; left: -7px; right: -7px; height: 1px; margin-top: -.5px; }
.cursor__label {
  position: absolute; top: 40px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  color: var(--red);
  white-space: nowrap;
}
body.has-cursor .cursor.is-ready { opacity: 1; }
body.is-booting .cursor { opacity: 0; }
body.has-cursor .cursor.is-down .cursor__ring { transform: scale(.62); }
body.has-cursor a:hover ~ .cursor .cursor__ring,
body.has-cursor .cursor.is-hot .cursor__ring { transform: scale(1); }

@media (hover: hover) and (pointer: fine) {
  body.has-cursor,
  body.has-cursor a,
  body.has-cursor button { cursor: none; }
}

/* ---------- 11. LOADER (arranque de sistema) ---------------------------- */
.loader {
  position: fixed; inset: 0; z-index: 900;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity .5s var(--ease), visibility .5s;
}
.loader__box { width: min(420px, 78vw); }
.loader__top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--ink-3);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
}
.loader__pct { font-family: var(--display); font-weight: 900; font-size: 13px; color: var(--red); letter-spacing: 0; }
.loader__bar { position: relative; height: 3px; background: var(--hair-2); margin-top: 12px; overflow: hidden; }
.loader__bar i {
  position: absolute; inset: 0 100% 0 0;
  background-image: repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 10px);
  transition: right .2s linear;
}
.loader__log {
  margin-top: 16px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  color: var(--ink-4);
  min-height: 4.6em;
}
.loader__log div { opacity: 0; animation: logIn .3s var(--ease) forwards; }
@keyframes logIn { to { opacity: 1; } }
.loader__logo {
  margin-top: 22px;
  height: 26px;
  width: 100%;
  background: var(--ink);
  -webkit-mask: url('../logo-marquitouh-strip.png') center / contain no-repeat;
  mask: url('../logo-marquitouh-strip.png') center / contain no-repeat;
  opacity: 0;
  transform: scaleX(.2);
  transform-origin: left;
  transition: opacity .5s var(--ease), transform .8s var(--ease-out);
}
.loader.is-ready .loader__logo { opacity: 1; transform: scaleX(1); }
.loader.is-done { opacity: 0; visibility: hidden; }

/* ---------- 12. MODO RETÍCULA (easter egg) ------------------------------ */
.reticle-mode .plano__grid { animation-duration: 26s; }
.reticle-mode .plano__cross { opacity: calc(var(--cross-op) * 3); }
body.reticle-on .plano__scan { animation-duration: 3.2s; --scan-op: .16; }

.reticle-toast {
  position: fixed; z-index: 800;
  left: 50%; bottom: 40px;
  transform: translate(-50%, 140%);
  padding: 14px 26px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 10px; letter-spacing: .26em;
  text-transform: uppercase;
  transition: transform .6s var(--ease-out);
  display: flex; align-items: center; gap: 12px;
}
.reticle-toast.is-on { transform: translate(-50%, 0); }
.reticle-toast::before {
  content: ""; width: 7px; height: 7px; background: var(--red);
  animation: latido 1.1s var(--ease) infinite;
}
@keyframes latido { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* ---------- 13. UTILIDADES ---------------------------------------------- */
.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;
}
.hairline { height: 1px; background: var(--hair); border: 0; }

/* ---------- 14. REVEAL — entrada por scroll ---------------------------- */
/* data-reveal="up" | "fade" | "line" | "reticle" | "mask" */
[data-reveal] { --rv-d: 0ms; }
[data-reveal="up"]     { opacity: 0; transform: translateY(26px); }
[data-reveal="fade"]   { opacity: 0; }
[data-reveal="line"]   { clip-path: inset(0 100% 0 0); }
[data-reveal="mask"]   { clip-path: inset(0 0 100% 0); transform: translateY(12px); }
[data-reveal="reticle"] { opacity: 0; transform: scale(.9); }

[data-reveal] {
  transition:
    opacity var(--t-slow) var(--ease-out) var(--rv-d),
    transform var(--t-slow) var(--ease-out) var(--rv-d),
    clip-path var(--t-slow) var(--ease-out) var(--rv-d);
}
[data-reveal].in { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }

/* La cota/retícula de los títulos se dibuja antes que el texto */
.sec__head [data-reveal="line"] { transition-duration: .9s; }
.sec__head [data-reveal="fade"] { transition-delay: calc(var(--rv-d) + 180ms); }

/* ---------- 15. HEADER --------------------------------------------------- */
.hdr {
  position: fixed; top: 0; left: var(--ruler-w); right: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--hair-2);
  transition: transform .45s var(--ease), border-color .4s, background-color .5s var(--ease);
}
.hdr__in {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding: 0 var(--gut);
  height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hdr.is-hidden { transform: translateY(-101%); }
.hdr.is-solid  { border-bottom-color: var(--hair); }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__dot {
  width: 7px; height: 7px; background: var(--red); flex: none;
  animation: latido 2.6s var(--ease) infinite;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--t) var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 1px; background: var(--red);
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--t) var(--ease-out);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--ink); }

/* Controles de la derecha */
.hdr__ctl { display: flex; align-items: center; gap: 8px; }
.ctl {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--hair);
  color: var(--ink-2);
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease), background-color var(--t) var(--ease);
}
.ctl:hover { border-color: var(--red); color: var(--red); }
.ctl svg { width: 15px; height: 15px; }

/* Toggle tema: sol/luna */
.ctl--theme { position: relative; overflow: hidden; }
.ctl--theme svg { position: absolute; transition: transform .5s var(--ease-out), opacity .35s var(--ease); }
.ctl--theme .i-sun  { transform: translateY(0) rotate(0); opacity: 1; }
.ctl--theme .i-moon { transform: translateY(150%); opacity: 0; }
[data-theme="dark"] .ctl--theme .i-sun  { transform: translateY(-150%); opacity: 0; }
[data-theme="dark"] .ctl--theme .i-moon { transform: translateY(0) rotate(0); opacity: 1; }

/* Menú móvil */
.burger { display: none; }
@media (max-width: 820px) {
  .burger { display: grid; }
  .nav {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hair);
    padding: 8px var(--gut) 18px;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .45s var(--ease-out);
  }
  .nav.is-open { clip-path: inset(0 0 0 0); }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--hair-2); font-size: 11px; }
  .nav a::after { left: 0; right: auto; width: 18px; bottom: 6px; }
}

/* ---------- 16. REPRODUCTOR DE AUDIO ----------------------------------- */
.pl {
  position: fixed;
  left: calc(var(--ruler-w) + 14px);
  bottom: 14px;
  z-index: 85;
  display: flex; align-items: center; gap: 0;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  box-shadow: var(--shadow);
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease),
              background-color .5s var(--ease), transform .5s var(--ease-out);
}
.pl:hover { border-color: var(--red-line); box-shadow: var(--shadow-lift); }
.pl.is-idle { transform: translateY(calc(100% - 34px)); }

.pl__btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  color: var(--ink-2);
  border-right: 1px solid var(--hair-2);
  transition: color var(--t) var(--ease), background-color var(--t) var(--ease);
  flex: none;
}
.pl__btn:hover { color: var(--red); background: var(--red-soft); }
.pl__ico { width: 13px; height: 13px; }
.pl__ico--play { display: none; }
.pl.is-playing .pl__ico--play  { display: block; }
.pl.is-playing .pl__ico--pause { display: none; }

/* Ecualizador.
   Respaldo: si no hay Web Audio (o el visitante pidio menos movimiento) las
   barras usan la animacion CSS de siempre. Si hay AnalyserNode, core.js
   agrega .has-eq, desactiva la animacion y escribe la altura real de cada
   banda. Asi el VU nunca miente y nunca se queda freezes. */
.pl__eq { display: flex; align-items: flex-end; gap: 2px; height: 13px; padding-inline: 10px; flex: none; }
.pl__eq i {
  width: 2px; height: 3px;
  background: var(--red);
  transform-origin: bottom;
  animation: eq 1.05s var(--ease) infinite;
}
.pl__eq i:nth-child(1) { animation-delay: 0s; }
.pl__eq i:nth-child(2) { animation-delay: .18s; }
.pl__eq i:nth-child(3) { animation-delay: .36s; }
.pl__eq i:nth-child(4) { animation-delay: .1s; }
.pl.is-playing .pl__eq i { animation-play-state: running; animation-name: eq; }
.pl:not(.is-playing) .pl__eq i { animation-play-state: paused; height: 3px; }

@keyframes eq { 0%,100% { height: 3px; } 50% { height: 13px; } }

/* VU real: la altura la escribe core.js, la animacion se apaga */
.pl.has-eq .pl__eq i { animation: none; }
.pl.has-eq:not(.is-playing) .pl__eq i { height: 3px; }

/* Slider de volumen custom */
.pl__vol { display: flex; align-items: center; padding-inline: 8px 12px; }
.pl__vol svg { width: 11px; height: 11px; color: var(--ink-4); flex: none; }
.vol {
  position: relative;
  width: 74px; height: 18px;
  margin-left: 9px;
  display: flex; align-items: center;
  touch-action: none;
  cursor: ew-resize;
}
.vol__track { position: absolute; inset-inline: 0; height: 1px; background: var(--hair); }
.vol__fill  { position: absolute; left: 0; height: 1px; background: var(--red); width: 40%; }
.vol__knob {
  position: absolute; left: 40%;
  width: 3px; height: 11px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: height .2s var(--ease), background-color .2s var(--ease);
}
.vol:hover .vol__knob, .vol.is-drag .vol__knob { height: 15px; background: var(--red); }
.pl__num {
  /* --ink-3, no --ink-4: este numero es el valor real del volumen, no
     decoracion, y con ink-4 daba 2.79:1 sobre el blanco del reproductor. */
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .08em; color: var(--ink-3);
  min-width: 26px; text-align: right; flex: none;
}

.pl__label {
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-3);
  padding-right: 12px;
  white-space: nowrap;
  border-right: 1px solid var(--hair-2);
  align-self: stretch;
  display: flex; align-items: center;
  padding-inline: 12px;
  transition: clip-path .4s var(--ease-out), opacity .3s var(--ease);
  clip-path: inset(0 0 0 0);
}
.pl.is-idle .pl__label { clip-path: inset(0 100% 0 0); }

@media (max-width: 900px) {
  .pl { left: 12px; right: 12px; bottom: 12px; }
  .pl__label { display: none; }
  .vol { flex: 1; width: auto; }
}
@media (max-width: 420px) {
  /* El ecualizador SE QUEDA: es la senal de que la musica esta sonando y es lo
     unico que se ve sin tocar nada. Lo que se sacrifica es el numero de
     volumen, que ya esta en el control deslizante. */
  .pl__eq { padding-inline: 6px; }
  .pl__num { display: none; }
}

/* Aviso de que el navegador bloqueó el autoplay */
.pl__gate {
  position: absolute; inset: -1px;
  border: 1px solid var(--red);
  pointer-events: none;
  opacity: 0;
}
.pl.needs-gesture .pl__gate { animation: gate 1.6s var(--ease) infinite; }
@keyframes gate { 0%,100% { opacity: 0; } 50% { opacity: 1; } }

/* Primera visita: el reproductor se DESPLIEGA e invita a tocar.
   Sin esto la etiqueta queda colapsada y nadie descubre el boton. */
.pl.needs-gesture .pl__label { clip-path: inset(0 0 0 0); }
.pl.needs-gesture .pl__btn   { color: var(--red); }
.pl.needs-gesture .pl__label::after {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--red);
  margin-right: 9px;
  animation: latido 1.1s var(--ease) infinite;
}

/* ---------- 17. FOOTER -------------------------------------------------- */
.ftr {
  border-top: 1px solid var(--hair);
  background: var(--paper-3);
  padding-block: 44px;
  transition: background-color .5s var(--ease);
}
.ftr__in {
  max-width: var(--shell-max); margin-inline: auto;
  padding-inline: var(--gut);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
}
.ftr p { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--ink-3); }

.to-top {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-3);
  transition: color var(--t) var(--ease);
}
.to-top:hover { color: var(--red); }
.to-top svg { width: 11px; height: 11px; }
.to-top.is-on { opacity: 1; visibility: visible; }
.to-top { opacity: 0; visibility: hidden; transition: color var(--t) var(--ease), opacity .3s, visibility .3s; }

/* ---------- 17. SALTAR AL CONTENIDO (teclado / lectores de pantalla) ----- */
.skip {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 1000;
  padding: 13px 20px;
  background: var(--red);
  color: var(--paper-2);
  font-family: var(--mono);
  font-size: 10px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  transform: translateY(-180%);
  transition: transform .22s var(--ease-out);
}
.skip:focus { transform: translateY(0); }
/* si el navegador scrollea solo, que no quede pegado arriba del todo */
html { scroll-padding-top: 88px; }

/* ---------- 18. RESPONSIVE ---------------------------------------------- */@media (max-width: 900px) {
  :root { --ruler-w: 0px; }
  .ruler { display: none; }
  .sec__vtext { display: none; }
  .sec__head { gap: 14px; }
  .loader { padding-inline: var(--gut); }
}

@media (max-width: 560px) {
  .sec__num { font-size: 2.6rem; }
  .btn { padding: 13px 18px; font-size: 9.5px; letter-spacing: .16em; }
}

/* ---------- 15. ACCESIBILIDAD · MOVIMIENTO REDUCIDO --------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .plano__scan, .plano__grain { display: none; }
  .plano__grid, .plano__cross { animation: none; }
  .cursor { display: none; }
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: auto; }
}
