/* CODE · hoja de estilo. Las reglas están en Web/DESIGN.md */
@font-face { font-family: "Futura XBC"; src: url("../fuentes/futura-xbc.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Futura Book"; src: url("../fuentes/futura-book.otf") format("opentype"); font-display: swap; }

:root {
  --mate: #0B0B0C;
  --mate-2: #17181A;
  --papel: #F6F3ED;
  --niebla: #DBDBDB;
  --linea: #C2CBD3;
  --tinta: #0B0B0C;
  --blanco: #FFFFFF;
  --gris: #8A8F96;
  --senal: #C8F04B;
  --titulo: "Futura XBC", "Futura", "Jost", "Arial Narrow", sans-serif;
  --texto: "Futura Book", "Futura", "Jost", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  --sello: "Share Tech Mono", "OCR A Extended", var(--mono);
  --suave: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--mate); color: var(--tinta); font-family: var(--texto); font-size: 17px; line-height: 1.5; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.mono { font-family: var(--mono); letter-spacing: .04em; }
.rotulo { font-size: 11px; font-weight: 700; color: var(--gris); letter-spacing: .14em; }
.senal { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--senal); flex: none; }
h1, h2 { font-family: var(--titulo); font-weight: 400; text-transform: uppercase; line-height: .95; letter-spacing: -.005em; }

/* Cabecera */
.cabecera { position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 14px 16px; mix-blend-mode: difference; color: #fff; pointer-events: none; }
.cabecera a { pointer-events: auto; }
.cabecera__logo img { width: 104px; }
.cabecera__lote { font-size: 11px; opacity: .8; margin-left: auto; }
.cabecera__pedir { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-decoration: none; border: 1px solid #fff; padding: 8px 12px; }
@media (max-width: 560px) { .cabecera__lote { display: none; } .cabecera__pedir { margin-left: auto; } }

/* A. Ruido */
.ruido { position: relative; height: 170vh; background: radial-gradient(120% 90% at 50% 40%, #E6E6E6 0%, var(--niebla) 55%, #BDBDBD 100%); }
.ruido__escena { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; place-items: center; }
.ruido__palabras { position: absolute; inset: 0; z-index: 2; }
.p { position: absolute; left: var(--x); top: var(--y); transform: rotate(var(--r)); font-family: var(--titulo); text-transform: uppercase; line-height: .9; white-space: nowrap; color: var(--tinta);
     font-size: calc(clamp(26px, 7.4vw, 120px) * var(--t)); max-width: calc(100vw - var(--x) - 8px); will-change: transform, opacity; }
.p::after { content: ""; position: absolute; left: -4%; right: -4%; top: 50%; height: .09em; background: var(--senal); transform: scaleX(var(--tache, 0)); transform-origin: left center; }
.ruido__bolsa { position: relative; z-index: 1; height: min(78svh, 128vw); aspect-ratio: 1392 / 1728;
  -webkit-mask-image: radial-gradient(farthest-side, #000 82%, transparent 100%); mask-image: radial-gradient(farthest-side, #000 82%, transparent 100%); }
.ruido__bolsa img { width: 100%; height: 100%; object-fit: cover; }
.ruido__frase { position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 9svh; text-align: center; opacity: 0; }
.ruido__frase h1 { font-size: clamp(40px, 7vw, 104px); max-width: 15ch; margin: 0 auto; }
.datos { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
.datos li { font-size: 11px; font-weight: 800; padding: 7px 10px; border: 1px solid var(--tinta); background: rgba(255,255,255,.35); }
.datos b { font-size: 13px; }
.ruido__pista { position: absolute; z-index: 3; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #555; }

/* B. Adentro */
.adentro { position: relative; height: 340vh; background: var(--mate); }
.adentro__escena { position: sticky; top: 0; height: 100svh; overflow: hidden; background: var(--mate); }
.adentro__bolsa { position: absolute; inset: 0; display: grid; place-items: center; background: var(--niebla); }
.adentro__bolsa { background: radial-gradient(120% 90% at 50% 40%, #E6E6E6 0%, var(--niebla) 55%, #BDBDBD 100%); }
.adentro__bolsa img { height: min(78svh, 128vw); width: auto; aspect-ratio: 1392 / 1728; will-change: transform;
  -webkit-mask-image: radial-gradient(farthest-side, #000 82%, transparent 100%); mask-image: radial-gradient(farthest-side, #000 82%, transparent 100%); }
.adentro__molecula img, .tira__molecula { mix-blend-mode: multiply; }
.adentro__lienzo { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.adentro__molecula { position: absolute; inset: 0; background: var(--papel); display: grid; grid-template-columns: 1fr; place-content: center; justify-items: center; gap: 28px; padding: 80px 16px 120px; clip-path: inset(100% 0 0 0); }
.adentro__molecula img { width: min(46vw, 260px); }
.adentro__texto { text-align: center; }
.adentro__texto h2 { font-size: clamp(48px, 9vw, 128px); }
.adentro__texto p { margin-top: 10px; }
.adentro__texto .mono { font-size: 13px; font-weight: 700; color: var(--gris); }
.adentro__escalas { position: absolute; left: 16px; bottom: 22px; z-index: 4; list-style: none; font-size: 12px; color: #fff; }
.adentro__escalas li { background: rgba(11,11,12,.78); padding: 10px 12px; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--suave), transform .4s var(--suave); position: absolute; bottom: 0; left: 0; width: max-content; max-width: calc(100vw - 32px); }
.adentro__escalas li.activo { opacity: 1; transform: none; }
.adentro__escalas b { font-size: 22px; display: block; letter-spacing: 0; }
@media (min-width: 900px) {
  .adentro__molecula { grid-template-columns: auto auto; align-items: center; gap: 72px; }
  .adentro__texto { text-align: left; }
  .adentro__escalas { left: 40px; bottom: 40px; }
}

.ruido__directo { margin: 8px auto 0; max-width: 34ch; font-size: 15px; color: #2a2a2a; }

/* Ruta del lote */
.ruta { background: var(--papel); padding: 80px 16px 72px; border-top: 1px solid var(--linea); }
.ruta h2 { font-size: clamp(40px, 6vw, 88px); margin-bottom: 28px; }
.ruta__pasos { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 980px; border-top: 2px solid var(--tinta); }
.ruta__pasos li { padding: 16px 12px 16px 0; border-bottom: 1px solid var(--linea); font-size: 12px;
  opacity: 0; transform: translateY(8px); transition: opacity .4s var(--suave), transform .4s var(--suave); }
.ruta__pasos li.visto { opacity: 1; transform: none; }
.ruta__pasos span { display: block; font-size: 20px; font-weight: 800; color: var(--gris); }
.ruta__pasos b { display: block; margin-top: 6px; font-size: 13px; }
.ruta__pasos p { color: #555; margin-top: 2px; }
.ruta__bajada { max-width: 34ch; margin: -14px 0 28px; font-size: 17px; }
.cadena { display: grid; gap: 14px; margin-bottom: 36px; max-width: 980px; }
.cadena__fila { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 16px; padding: 16px 0; border-top: 2px solid var(--tinta); }
.cadena__rotulo { grid-column: 1 / -1; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--gris); text-transform: uppercase; }
.cadena__fila--code .cadena__rotulo { color: var(--tinta); }
.cadena__pasos { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; min-width: 0; }
.cadena__pasos li { position: relative; padding: 6px 9px; border: 1px solid var(--linea); border-radius: 99px; background: rgba(255,255,255,.35); }
.cadena__pasos li:not(:last-child)::before { content: "→"; position: absolute; right: -9px; top: 50%; transform: translate(50%, -50%); font-size: 10px; color: var(--gris); }
.cadena__pasos li:not(:last-child) { margin-right: 12px; }
.cadena__pasos li.code { background: var(--tinta); color: #fff; border-color: var(--tinta); }
.cadena__pasos li.fuera { color: var(--gris); }
.cadena__pasos li.fuera::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 3px; background: var(--senal);
  transform: scaleX(var(--tache, 1)); transform-origin: left center; transition: transform .6s var(--suave); }
.cadena:not(.vista) .fuera { --tache: 0; }
.cadena__precio { text-align: right; line-height: 1; }
.cadena__precio b { display: block; font-family: var(--titulo); font-size: clamp(30px, 6vw, 56px); font-weight: 400; }
.cadena__fila:not(.cadena__fila--code) .cadena__precio b { color: var(--gris); text-decoration: line-through; text-decoration-color: var(--senal); text-decoration-thickness: 3px; }
.cadena__precio span { font-size: 10px; color: var(--gris); }
.ruta__nota { margin-top: 18px; font-size: 10px; color: var(--gris); max-width: 70ch; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .cadena:not(.vista) .fuera { --tache: 1; } }
.ruta__papeles { display: inline-block; margin-top: 24px; font-size: 12px; font-weight: 800; }
@media (min-width: 900px) {
  .ruta { padding: 120px 40px 100px; }
  .ruta__pasos { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .ruta__pasos li { opacity: 1; transform: none; } }

/* C. Ficha */
.ficha { position: relative; background: var(--papel); padding: 72px 16px 96px; display: grid; gap: 48px; }
.ficha__controles h2 { font-size: clamp(44px, 6.4vw, 92px); margin: 0 0 8px; }
.ficha__datos { list-style: none; margin-top: 22px; display: grid; gap: 10px; font-size: 13px; }
.ficha__datos li { display: block; }
.ficha__datos .senal { margin-right: 10px; vertical-align: 1px; }
.ficha__datos a { font-weight: 800; }
.ficha__nota { max-width: 36ch; }
fieldset { border: 0; margin-top: 28px; }
legend { margin-bottom: 10px; }
.gramos__opciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--tinta); border-left: 1px solid var(--tinta); max-width: 440px; }
.gramos__opciones button { font-family: var(--mono); font-weight: 800; font-size: 16px; padding: 16px 0; background: transparent; border: 0; border-right: 1px solid var(--tinta); border-bottom: 1px solid var(--tinta); cursor: pointer; color: var(--tinta); }
.gramos__opciones button[aria-checked="true"] { background: var(--tinta); color: var(--papel); }
.gramos__opciones button:focus-visible, .destino input:focus-visible, .tira__pagar:focus-visible, .terminal__comandos button:focus-visible { outline: 2px solid var(--senal); outline-offset: 2px; }
.ficha__envio { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; font-size: 12px; font-weight: 800; border: 1px solid var(--tinta); padding: 10px 14px; }
.destino label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.destino input { accent-color: var(--tinta); width: 18px; height: 18px; }

.impresora { justify-self: center; width: min(100%, 380px); }
.impresora__ranura { position: relative; z-index: 2; height: 46px; background: var(--mate); color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 10px; box-shadow: 0 6px 0 -2px #000; }
.impresora__salida { overflow: hidden; margin: 0 12px; }
.tira { background: #FBFBF9; box-shadow: 0 18px 30px -18px rgba(0,0,0,.35); transform-origin: top; }
.tira__cabeza, .tira__pie { width: 100%; }
.tira__cuerpo { padding: 18px 22px 8px; }
.tira__molecula { width: 46%; margin: 4px auto 14px; }
.tira h3 { font-size: 22px; line-height: 1.15; font-weight: 800; }
.tira__formula { font-size: 10px; color: var(--gris); margin-top: 6px; }
.tira__neto { position: relative; border: 2px solid var(--tinta); height: 120px; margin-top: 16px; }
.tira__neto span { position: absolute; left: 10px; top: 8px; font-size: 11px; font-weight: 800; }
.tira__neto .sello { position: absolute; right: 34px; bottom: 16px; font-family: var(--sello); font-weight: 400; font-size: 64px; line-height: 1; color: #22222A; opacity: .9; transform: rotate(-1.5deg); }
.tira__neto i { position: absolute; right: 10px; bottom: 6px; font-style: normal; font-weight: 800; font-size: 22px; }
.tira__regla { font-size: 11px; color: #555; margin-top: 12px; font-weight: 700; }
.tira__regla b { color: var(--tinta); }
.tira__filas { margin-top: 16px; font-size: 11px; }
.tira__filas div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--linea); }
.tira__filas dt { color: var(--gris); }
.tira__filas dd { font-weight: 800; text-align: right; }
.tira__filas .total dd { font-size: 16px; }
.tira__acepto { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: 12px; line-height: 1.4; cursor: pointer; }
.tira__acepto input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--tinta); flex: none; }
.tira__acepto.falta { color: #B3261E; }
.tira__pagar[aria-disabled="true"] { opacity: .45; }
.ruta__papeles { display: inline-block; margin-top: 22px; font-size: 12px; font-weight: 800; }
.tira__pagar { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; margin-top: 18px; background: var(--mate); color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; }
.tira__pagar:hover { background: #000; }
.tira__frase { font-size: 13px; font-weight: 800; margin: 18px 0 4px; line-height: 1.4; }
@media (min-width: 900px) {
  .ficha { grid-template-columns: 1fr 1fr; align-items: start; padding: 140px 40px; column-gap: 40px; }
  .impresora { position: sticky; top: 90px; }
}

/* D. Terminal */
.terminal { background: var(--mate); padding: 96px 16px; }
.terminal__marco { max-width: 860px; margin: 0 auto; border: 1px solid #2a2b2e; background: #0E0F10; }
.terminal__barra { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 11px; color: var(--gris); border-bottom: 1px solid #2a2b2e; }
.terminal__salida { min-height: 300px; max-height: 60svh; overflow-y: auto; padding: 18px 14px; font-size: 13px; line-height: 1.7; color: #E9E9E6; white-space: pre-wrap; }
.terminal__salida .cmd { color: var(--senal); }
.terminal__salida .dato { color: #fff; font-weight: 800; }
.terminal__salida .cursor { display: inline-block; width: .6em; height: 1.1em; background: var(--senal); vertical-align: text-bottom; animation: parpadeo 1s steps(1) infinite; }
@keyframes parpadeo { 50% { opacity: 0; } }
.terminal__comandos { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; border-top: 1px solid #2a2b2e; }
.terminal__comandos button { font: inherit; font-size: 12px; color: #E9E9E6; background: transparent; border: 1px solid #3a3b3f; padding: 10px 12px; cursor: pointer; text-align: left; }
.terminal__comandos button:hover { border-color: var(--senal); color: #fff; }

/* Pie */
.pie { background: var(--mate); color: #E9E9E6; padding: 72px 16px 120px; text-align: center; display: grid; gap: 18px; justify-items: center; border-top: 1px solid #1d1e20; }
.pie__logo { width: 160px; }
.pie > .mono { font-size: 12px; font-weight: 800; }
.pie__enlaces { display: flex; gap: 22px; font-size: 12px; }
.pie__legal { font-size: 12px; color: var(--gris); max-width: 60ch; }

/* Barra de compra (celular) */
.barra-compra { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  background: var(--mate); color: #fff; text-decoration: none; font-weight: 800; font-size: 13px; border: 1px solid #2d2e31; transition: transform .35s var(--suave), opacity .35s; }
.barra-compra.oculta { transform: translateY(140%); opacity: 0; }
@media (min-width: 900px) { .barra-compra { left: auto; right: 24px; bottom: 24px; padding: 0 22px; } }

/* Menos movimiento: todo quieto y legible */
@media (prefers-reduced-motion: reduce) {
  .ruido, .adentro { height: auto; }
  .ruido__escena, .adentro__escena { position: relative; height: auto; min-height: 100svh; }
  .p { text-decoration: line-through; text-decoration-color: var(--senal); opacity: .25; }
  .ruido__frase { opacity: 1; }
  .adentro__bolsa, .adentro__lienzo { display: none; }
  .adentro__molecula { position: relative; clip-path: none; min-height: 100svh; }
  .adentro__escalas { display: none; }
}

/* Modo de prueba (?ver=): solo la sección pedida, fija en pantalla */
.prueba main > section:not(.ver), .prueba .pie, .prueba .barra-compra { display: none; }
.prueba .ruido.ver, .prueba .adentro.ver { height: 100svh; }
.prueba .ver .ruido__escena, .prueba .ver .adentro__escena { position: relative; }
