/* OKTAN — taller. CSS a mano, sin Tailwind. Concepto: "el banco de pruebas" — todo movimiento mide, cuenta o conmuta. */

/* Tipografía auto-hospedada (DEPLOY-PREP §6-bis) — Archivo e IBM Plex Mono son
   Google Fonts / OFL, vendorizado directo. Licencias en assets/fonts/OFL-*.txt.
   Archivo variable con eje width 62–100% en un solo archivo: font-stretch:62%
   (headings/labels) y el 100% por defecto (cuerpo) vienen del MISMO woff2 por
   interpolación real — antes se cargaba solo la instancia estática 100% desde
   Google Fonts sin eje wdth, así que font-stretch:62% en el CSS nunca hacía
   nada (bug preexistente, no introducido por este vendorizado — se corrige aquí
   de paso porque tocaba este mismo archivo). */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 100%;
  font-display: swap;
  src: url('../fonts/archivo-latin.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: 'Archivo';
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 62% 100%;
  font-display: swap;
  src: url('../fonts/archivo-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plexmono-400-latin.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/plexmono-400-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/plexmono-600-latin.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/plexmono-600-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --negro: #0B0B0C;
  --panel: #161719;
  --blanco: #EDEBE6;
  --ambar: #F5A300;
  --linea: #2C2D30;
  --apagado: #8A8B85;

  --margen: 4vw;
  --gutter: clamp(12px, 1.4vw, 24px);

  --f-display: 'Archivo', sans-serif;
  --f-mono: 'IBM Plex Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; }

body {
  background: var(--negro);
  color: var(--blanco);
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  font-variant-numeric: tabular-nums;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--ambar); color: var(--negro); }

:focus-visible { outline: 2px solid var(--ambar); outline-offset: 0; }

.mono { font-family: var(--f-mono); }
/* §8: cursor crosshair en zonas de datos — CSS nativo, sin retículo JS (evita lag) */
.mono, .cifra__num, .display--h1, .display--h2, .cifra-instrumental { cursor: crosshair; }

/* ── Grid visible (decorativo, aria-hidden, inyectado por JS) ─────────── */
.grid-lines { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.grid-lines__line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--linea); opacity: 0.6; }
.grid-lines__cross { position: absolute; top: -6px; font-family: var(--f-mono); font-size: 11px; color: var(--linea); transform: translateX(-50%); }

/* ── Tipografía ─────────────────────────────────────────────────────── */
.display {
  font-family: var(--f-display);
  font-stretch: 62%;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--blanco);
}
.display--h1 { font-size: clamp(64px, 11vw, 168px); line-height: 0.88; }
.display--h2 { font-size: clamp(40px, 6vw, 88px); line-height: 0.92; }

.cifra-instrumental { font-family: var(--f-display); font-stretch: 62%; font-weight: 900; font-size: clamp(56px, 8vw, 128px); color: var(--ambar); line-height: 1; }

.label {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--apagado);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.label::before { content: '▸'; color: var(--ambar); }

.sub { font-size: 20px; font-weight: 400; margin-top: 20px; max-width: 32em; }
.cuerpo { font-size: 16px; line-height: 1.55; color: color-mix(in srgb, var(--blanco) 80%, transparent); }
.linea-actitud { color: var(--ambar); font-size: 13px; margin-top: 20px; }

/* ── Grid de contenido ──────────────────────────────────────────────── */
.grid__content {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding-inline: var(--margen);
  position: relative;
  z-index: 2;
}

/* ── Nav ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--negro);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms linear;
}
.nav.is-scrolled { border-bottom-color: var(--linea); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--margen); }
.nav__brand { font-family: var(--f-display); font-stretch: 62%; font-weight: 900; font-size: 20px; letter-spacing: -0.01em; }
.nav__links { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 32px); font-size: 14px; }
.nav__links a { position: relative; padding-bottom: 4px; border-bottom: 2px solid transparent; transition: border-color 150ms linear; }
.nav__links a:hover, .nav__links a:focus-visible { border-bottom-color: var(--ambar); }
.nav__cta { background: var(--ambar); color: var(--negro); padding: 8px 16px; font-family: var(--f-mono); font-weight: 600; font-size: 13px; border-bottom: none !important; }
.nav__horario { display: none; font-size: 12px; color: var(--apagado); }
@media (min-width: 900px) { .nav__horario { display: inline; } }

@media (max-width: 720px) {
  .nav__inner { flex-wrap: wrap; row-gap: 12px; padding-block: 14px; }
  .nav__links {
    order: 3; width: 100%; justify-content: flex-start; gap: 20px; font-size: 13px;
    padding-top: 12px; border-top: 1px solid var(--linea);
  }
  .nav__cta { padding: 8px 14px; font-size: 12px; white-space: nowrap; }
}

/* ── Secciones ──────────────────────────────────────────────────────── */
.sec { position: relative; background: var(--negro); }
.sec__bleed { position: absolute; inset: 0; z-index: 0; }

.fotografia { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.68) contrast(1.18) brightness(0.96); }

/* wipe horizontal duro, sin fade */
.lamina--wipe .fotografia { clip-path: inset(0 100% 0 0); transition: none; }
.lamina--wipe.is-revealed .fotografia { clip-path: inset(0); transition: clip-path 220ms linear; }

/* ══ 01 BANCO ═════════════════════════════════════════════════════════ */
.sec--banco { min-height: 100svh; display: flex; flex-direction: column; padding-top: 90px; }
.sec--banco .sec__bleed { opacity: 0.85; }
.sec--banco .lamina--wipe { width: 100%; height: 100%; }
.sec__content--banco { padding-top: clamp(24px, 5vh, 64px); grid-column: 1 / 13; }
.sec__content--banco > * { grid-column: 1 / 10; }
.sec__content--banco .display--h1 { margin-top: 14px; }

.dyno {
  position: relative; z-index: 2;
  margin-top: auto;
  width: calc(100% + var(--margen));
  padding-left: var(--margen);
  height: clamp(160px, 28vh, 320px);
}
.dyno__svg { width: 100%; height: 100%; overflow: visible; }
.dyno__path { stroke-width: 2.5; }
.dyno__path--kw { stroke: var(--ambar); }
.dyno__path--par { stroke: var(--blanco); opacity: 0.6; }
.dyno__marker circle { fill: var(--ambar); opacity: 0; }
.dyno__marker--par circle { fill: var(--blanco); }
.dyno__marker text { font-family: var(--f-mono); font-size: 15px; fill: var(--ambar); opacity: 0; font-weight: 600; }
.dyno__marker--par text { fill: var(--blanco); }
.dyno__marker.is-hit circle, .dyno__marker.is-hit text { opacity: 1; }

.readouts {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: clamp(16px, 2vw, 32px);
  padding: 18px var(--margen);
  border-top: 1px solid var(--linea);
  font-size: 11px; letter-spacing: 0.06em; color: var(--apagado);
}

@media (max-width: 900px) {
  .sec__content--banco > * { grid-column: 1 / 13; }
  .dyno { width: 100%; padding-left: 0; }
}

/* ── Marquesina ─────────────────────────────────────────────────────── */
.marquesina { position: relative; overflow: hidden; border-top: 1px solid var(--linea); border-bottom: 1px solid var(--linea); background: var(--panel); padding: 10px 0; white-space: nowrap; font-size: 12px; color: var(--apagado); }
.marquesina__track { display: inline-block; animation: marquesina 40s linear infinite; }
@keyframes marquesina { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquesina__track { animation-play-state: paused; } }

/* ══ 02 PROTOCOLOS ════════════════════════════════════════════════════ */
.sec--protocolos { padding-block: 96px; }
.sec--protocolos .grid__content > .label { grid-column: 1 / 13; }
.sec--protocolos .display--h2 { grid-column: 1 / 11; margin-top: 12px; }
.sec--protocolos .intro { grid-column: 1 / 8; margin-top: 20px; color: color-mix(in srgb, var(--blanco) 80%, transparent); }

.protocolos { list-style: none; margin-top: 56px; border-top: 1px solid var(--linea); }
.protocolo { border-bottom: 1px solid var(--linea); }
.protocolo__toggle {
  width: 100%; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter);
  padding: 22px var(--margen); text-align: left; position: relative;
  border-left: 3px solid transparent; transition: border-color 150ms linear;
}
.protocolo__toggle:hover, .protocolo__toggle[aria-expanded="true"] { border-left-color: var(--ambar); }
.protocolo__num { grid-column: 1 / 3; color: var(--ambar); font-size: 18px; font-weight: 600; }
.protocolo__nombre { grid-column: 3 / 11; font-family: var(--f-display); font-stretch: 62%; font-weight: 800; font-size: clamp(18px, 2vw, 24px); text-transform: uppercase; }
.protocolo__precio { grid-column: 11 / 13; text-align: right; color: var(--blanco); }
.protocolo__detalle { grid-column: 3 / 11; max-height: 0; overflow: hidden; transition: max-height 200ms linear; padding-left: var(--margen); }
.protocolo__detalle p { padding-bottom: 20px; max-width: 42em; color: color-mix(in srgb, var(--blanco) 80%, transparent); }
.protocolo[data-open="true"] .protocolo__detalle { max-height: 480px; }
.protocolo__img { width: 220px; aspect-ratio: 4/5; margin-bottom: 20px; }

@media (max-width: 900px) {
  .protocolo__toggle { grid-template-columns: 2.5em 1fr; row-gap: 4px; }
  .protocolo__nombre { grid-column: 2; }
  .protocolo__precio { grid-column: 1 / 3; text-align: left; margin-top: 4px; }
  .protocolo__detalle { grid-column: 1 / 13; padding-left: var(--margen); }
  .sec--protocolos .display--h2, .sec--protocolos .intro { grid-column: 1 / 13; }
}

/* ══ 03 LA NAVE ═══════════════════════════════════════════════════════ */
.sec--nave { padding-block: 96px; }
.sec--nave .label { grid-column: 1 / 13; }
.sec--nave .display--h2 { grid-column: 1 / 9; margin-top: 12px; margin-bottom: 40px; }
.nave__img { grid-column: 1 / 9; margin-left: calc(-1 * var(--margen)); width: calc(100% + var(--margen)); aspect-ratio: 16/9; }
.nave__specs { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 24px; }
.nave__specs-list { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 11px; letter-spacing: 0.06em; color: var(--apagado); }

.nave__cifras { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--linea); }
.cifra { display: flex; flex-direction: column; gap: 8px; }
.cifra__num { font-family: var(--f-display); font-stretch: 62%; font-weight: 900; font-size: clamp(40px, 6vw, 72px); color: var(--ambar); line-height: 1; }
.cifra__label { font-size: 11px; letter-spacing: 0.1em; color: var(--apagado); }

@media (max-width: 900px) {
  .sec--nave .display--h2, .nave__img, .nave__specs, .nave__cifras { grid-column: 1 / 13; }
  .nave__img { margin-left: 0; width: 100%; margin-bottom: 32px; }
  .nave__cifras { grid-template-columns: repeat(2, 1fr); }
}

/* ══ 04 REGISTRO ══════════════════════════════════════════════════════ */
.sec--registro { padding-block: 96px; }
.sec--registro .label { grid-column: 1 / 13; }
.sec--registro .display--h2 { grid-column: 1 / 11; margin-top: 12px; margin-bottom: 56px; }

.registro-cards { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); padding-inline: var(--margen); }
.registro-card { background: var(--panel); border: 1px solid var(--linea); }
.registro-card--mid { margin-top: 48px; }
.registro-card__img { aspect-ratio: 4/5; }
.registro-card__img--bn .fotografia { filter: saturate(0.15) contrast(1.18) brightness(0.96); }
.registro-card__log { padding: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; }
.registro-card__log--noimg { padding-top: 40px; min-height: 220px; }
.registro-card__ref { color: var(--ambar); letter-spacing: 0.02em; }
.registro-card__nota { color: var(--apagado); line-height: 1.5; }

@media (max-width: 900px) {
  .sec--registro .display--h2 { grid-column: 1 / 13; }
  .registro-cards { grid-template-columns: 1fr; }
  .registro-card--mid { margin-top: 0; }
}

/* ══ 05 ENTRADA ═══════════════════════════════════════════════════════ */
.sec--entrada { padding-block: 140px 0; }
.sec--entrada .label { grid-column: 1 / 13; }
.entrada__titulo { grid-column: 1 / 13; margin: 12px 0 56px; }
.entrada__form { grid-column: 1 / 7; display: flex; flex-direction: column; gap: 24px; }
.entrada__contacto { grid-column: 8 / 13; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--apagado); align-self: start; }
.entrada__contacto a { color: var(--blanco); }

.campo { display: flex; flex-direction: column; gap: 8px; }
.campo label { font-size: 11px; letter-spacing: 0.14em; color: var(--apagado); }
.campo input, .campo textarea {
  background: var(--panel); border: 1px solid var(--linea); color: var(--blanco);
  font-family: var(--f-display); font-size: 16px; padding: 12px; resize: vertical;
}
.campo input:focus, .campo textarea:focus { border-color: var(--ambar); }

.boton-entrada {
  margin-top: 8px; background: var(--ambar); color: var(--negro); font-weight: 600; font-size: 13px;
  padding: 16px 24px; display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform 150ms linear;
}
.boton-entrada:hover { transform: translateX(3px); }
.boton-entrada__estado { font-size: 12px; }

@media (max-width: 900px) {
  .entrada__form, .entrada__contacto { grid-column: 1 / 13; }
  .entrada__contacto { margin-top: 40px; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer { background: var(--panel); border-top: 1px solid var(--linea); padding: 24px var(--margen); font-size: 10px; color: var(--apagado); margin-top: 96px; }
.footer__credito { display: block; margin-top: 6px; }

/* ── Reveal helpers ─────────────────────────────────────────────────── */
[data-flicker] { opacity: 1; }
[data-flicker].is-flickering { animation: flicker 90ms steps(2); }
@keyframes flicker { 0% { opacity: 0; } 50% { opacity: 1; } 75% { opacity: 0; } 100% { opacity: 1; } }

/* ── prefers-reduced-motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lamina--wipe .fotografia { clip-path: inset(0) !important; transition: none !important; }
  [data-flicker].is-flickering { animation: none; }
  .dyno__path { stroke-dashoffset: 0 !important; }
  .dyno__marker { opacity: 1 !important; }
  .dyno__marker circle, .dyno__marker text { opacity: 1 !important; }
  .boton-entrada:hover { transform: none; }
}

/* ══ Chip de muestra (DEPLOY-PREP §1) — fijo, siempre visible, no se quita ═══ */
.chip-demo {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  background: var(--panel);
  color: var(--blanco);
  border: none;
  border-left: 3px solid var(--ambar);
  border-radius: 0;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 14px;
  line-height: 1.3;
  text-decoration: none;
}
.chip-demo__compact { display: none; }
@media (max-width: 720px) {
  .chip-demo__full { display: none; }
  .chip-demo__compact { display: inline; }
}
