/* ============ Tokens ============ */
:root {
  --papel: #f3eee6;
  --papel-2: #e8e0d3;
  --papel-3: #ddd3c4;
  --noche: #1b1a19;
  --noche-2: #252321;
  --noche-3: #302d2a;
  --tinta: #1d1b19;
  --tinta-2: #57514a;
  --tinta-3: #8f877c;
  --crema: #f4ede2;
  --crema-2: #cfc6b8;
  --linea: rgba(29, 27, 25, 0.14);
  --linea-clara: rgba(244, 237, 226, 0.16);
  --rojo: #d7262b;
  --rojo-2: #b51d22;
  --oro: #c9a46a;
  --madera: #8a5a3b;
  --acento: var(--madera);

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --marca: "Russo One", "Arial Black", sans-serif;

  --margen: clamp(20px, 5.5vw, 96px);
  --ancho: 1360px;
  --radio: 18px;
  --radio-chico: 10px;
  --nav-h: 76px;
  --sale: cubic-bezier(0.16, 1, 0.3, 1);
  --cambia: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
/* pantallas táctiles: sin espera ni zoom por doble toque (pellizcar sigue funcionando) */
body { touch-action: manipulation; }
/* app instalada a pantalla completa (mostrador): sin selección accidental de texto al tocar */
@media (display-mode: fullscreen), (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; } }
html, body { overflow-x: clip; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.cargando { overflow: hidden; }
img, picture, canvas, video, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--rojo); color: #fff; }
:focus-visible { outline: 2px solid var(--rojo); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saltar { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--tinta); color: var(--crema); padding: 10px 14px; border-radius: 999px; }
.saltar:focus { top: 12px; }

/* ============ Tipografía ============ */
.contenedor { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; }
.ceja {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--madera);
}
.ceja--oro { color: var(--oro); }
.ceja--rojo { color: var(--rojo); }
.titulo-xl {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 144;
  font-size: clamp(44px, 6.6vw, 108px);
  line-height: 0.96;
  letter-spacing: -0.025em;
}
.titulo-l {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 120;
  font-size: clamp(34px, 4.2vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.titulo-m { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 38px); line-height: 1.08; letter-spacing: -0.01em; }
.titulo-xl em, .titulo-l em, .titulo-m em, .pie__frase em, .catalogo__final-ti em { font-style: italic; color: var(--acento); }
.titulo--claro { color: var(--crema); }
.texto-grande { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.45; color: var(--tinta-2); max-width: 30em; }
.texto-m { font-size: 17px; line-height: 1.55; color: var(--tinta-2); max-width: 34em; }
.texto--claro { color: var(--crema-2); }
.nota-fuente { font-size: 12px; color: var(--tinta-3); margin-top: 12px; }
.link { display: inline-block; position: relative; padding-bottom: 2px; font-weight: 500; }
.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform: scaleX(0.3); transform-origin: left; transition: transform 0.5s var(--sale); }
@media (hover: hover) { .link:hover::after { transform: scaleX(1); } }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.86); color: var(--tinta); font-size: 12px; }
.chip--validar { background: transparent; border: 1px dashed currentColor; color: var(--oro); }

/* ============ Entradas por hito (texto por tiempo, nunca atado al scroll) ============ */
.linea { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.linea > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--sale); }
.is-in .linea > span, .linea.is-in > span { transform: none; }
.linea:nth-child(2) > span { transition-delay: 0.08s; }
.sube { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--sale), transform 0.9s var(--sale); }
.sube.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .linea > span, .sube { transform: none !important; opacity: 1 !important; transition: none !important; }
}

/* ============ Botones ============ */
.boton {
  --b-bg: var(--tinta); --b-fg: var(--crema); --b-hover: var(--rojo);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 0 12px 0 26px;
  border-radius: 999px; background: var(--b-bg); color: var(--b-fg);
  font-size: 16px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap;
  transition: transform 0.25s var(--sale), color 0.35s;
}
.boton::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--b-hover); transform: translateY(101%); transition: transform 0.55s var(--sale); }
.boton__flecha { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); transition: transform 0.5s var(--sale); }
@media (hover: hover) {
  .boton:hover::before { transform: none; }
  .boton:hover .boton__flecha { transform: rotate(45deg); }
}
.boton:active { transform: scale(0.97); }
.boton--rojo { --b-bg: var(--rojo); --b-fg: #fff; --b-hover: var(--tinta); }
.boton--claro { --b-bg: var(--crema); --b-fg: var(--tinta); --b-hover: #fff; }
.boton--claro .boton__flecha { background: rgba(0, 0, 0, 0.07); }
.boton--linea-clara { --b-bg: transparent; --b-fg: var(--crema); --b-hover: rgba(255, 255, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(244, 237, 226, 0.5); padding: 0 24px; }
.boton--linea-oscura { --b-bg: transparent; --b-fg: var(--tinta); --b-hover: rgba(29, 27, 25, 0.07); box-shadow: inset 0 0 0 1px rgba(29, 27, 25, 0.32); padding: 0 24px; }
.boton--chico { min-height: 42px; font-size: 14px; padding-left: 18px; }
.boton--chico.boton--linea-oscura { padding: 0 18px; }
.boton--chico.boton--linea-clara, .boton--chico.boton--claro:not(:has(.boton__flecha)) { padding: 0 18px; }
.boton--chico .boton__flecha { width: 26px; height: 26px; }
.boton--ancho { width: 100%; justify-content: space-between; }
.chip-f {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--linea); color: var(--tinta-2);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.chip-f.is-activo { background: var(--tinta); color: var(--crema); box-shadow: none; }
@media (hover: hover) { .chip-f:not(.is-activo):hover { box-shadow: inset 0 0 0 1px var(--tinta); color: var(--tinta); } }

/* ============ Apertura ============ */
.intro {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  background: var(--papel);
  transition: opacity 0.5s, visibility 0.5s;
}
.intro.is-aberta { background: transparent; }
.intro.is-fim { opacity: 0; visibility: hidden; pointer-events: none; }
.intro__plano { display: grid; justify-items: center; gap: 14px; transition: opacity 0.2s; }
.intro.is-3d .intro__plano .logo-plano { opacity: 0; }
.intro.is-aberta .intro__lema, .intro.is-aberta .intro__carga { opacity: 0; transition: opacity 0.3s; }
.intro__canvas { position: absolute; inset: 0; pointer-events: none; }
.intro__canvas canvas { width: 100%; height: 100%; }
.intro__lema { font-family: var(--sans); font-style: italic; font-size: 15px; color: var(--tinta-2); transform: translateY(min(14vw, 120px)); }
.intro__lema b { font-weight: 600; }
.intro__carga { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; color: var(--tinta-3); }
.logo-plano {
  display: inline-grid; place-items: center;
  width: min(52vw, 560px); aspect-ratio: 4.2 / 1;
  background: var(--rojo);
  clip-path: polygon(6% 0, 100% 0, 94% 100%, 0 100%);
  color: #fff; font-family: var(--marca); font-size: min(6.6vw, 70px); letter-spacing: 0.01em;
}

/* ============ Barra ============ */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--margen);
  color: var(--crema);
  transition: transform 0.5s var(--sale), background 0.4s, color 0.4s, box-shadow 0.4s;
}
.nav::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to bottom, rgba(20, 18, 16, 0.55), rgba(20, 18, 16, 0)); transition: opacity 0.4s; }
.nav.is-solida { color: var(--tinta); }
.nav.is-solida::before { opacity: 0; }
.nav.is-solida { background: rgba(243, 238, 230, 0.86); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 1px 0 var(--linea); }
.nav.is-escura { background: rgba(27, 26, 25, 0.82); color: var(--crema); box-shadow: 0 1px 0 var(--linea-clara); }
.nav.is-oculta { transform: translateY(-100%); }
.nav__marca { display: flex; align-items: center; gap: 12px; }
.nav__logo3d { width: 150px; height: 42px; }
.nav__lema { font-size: 12px; font-style: italic; opacity: 0.75; white-space: nowrap; }
.nav__lema b { font-weight: 600; }
.nav__links { display: flex; gap: 4px; }
.nav__links a { position: relative; padding: 8px 12px; border-radius: 999px; font-size: 14px; transition: background 0.3s; }
.nav__links a::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--rojo); opacity: 0; transform: scale(0); transition: 0.4s var(--sale); }
.nav__links a.is-ativo::after { opacity: 1; transform: none; }
@media (hover: hover) { .nav__links a:hover { background: rgba(127, 120, 110, 0.16); } }
.nav__acciones { display: flex; align-items: center; gap: 10px; }
.nav__menu { display: none; padding: 10px 16px; border-radius: 999px; box-shadow: inset 0 0 0 1px currentColor; font-size: 14px; }
.menu-movil { position: fixed; inset: var(--nav-h) 0 auto; z-index: 99; display: grid; padding: 12px var(--margen) 28px; background: var(--noche); color: var(--crema); }
.menu-movil[hidden] { display: none; }
.menu-movil a { padding: 14px 0; border-bottom: 1px solid var(--linea-clara); font-family: var(--serif); font-size: 28px; font-weight: 300; }
/* Pista para deslizar: a los 10 s sin bajar, un dedo semitransparente hace un solo deslizamiento hacia arriba (lo que
   dura un gesto real, ~1.6 s) y desaparece. No se puede tocar ni tapa nada por mucho tiempo. */
.pista-dedo { --recorrido: clamp(120px, 18vh, 200px); position: fixed; z-index: 90; left: 50%; top: 46%; width: 52px; height: 62px; pointer-events: none; opacity: 0; transform: translate(-50%, 0); animation: pistaDedo 1.6s linear forwards; }
.pista-dedo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }
.pista-dedo__toque { position: absolute; left: calc(46.9% - 13px); top: -6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); opacity: 0; animation: pistaToque 1.6s linear forwards; }
.pista-dedo__estela { position: absolute; left: calc(46.9% - 2px); top: 8px; width: 4px; height: 0; border-radius: 4px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); opacity: 0; animation: pistaEstela 1.6s linear forwards; }
@keyframes pistaDedo {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(1.08); }
  16% { opacity: 0.78; transform: translate(-50%, 0) scale(1); }
  26% { opacity: 0.78; transform: translate(-50%, 0) scale(0.96); animation-timing-function: cubic-bezier(0.5, 0, 0.22, 1); }
  70% { opacity: 0.74; transform: translate(-50%, calc(-1 * var(--recorrido))) scale(0.96); animation-timing-function: ease-out; }
  86% { opacity: 0.45; transform: translate(-50%, calc(-1 * var(--recorrido) - 16px)) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, calc(-1 * var(--recorrido) - 26px)) scale(1.05); }
}
@keyframes pistaToque {
  0%, 18% { opacity: 0; transform: scale(0.4); }
  28% { opacity: 0.6; transform: scale(1); }
  66% { opacity: 0.45; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(1.5); }
}
@keyframes pistaEstela {
  0%, 26% { opacity: 0; height: 0; animation-timing-function: cubic-bezier(0.5, 0, 0.22, 1); }
  70% { opacity: 1; height: var(--recorrido); }
  100% { opacity: 0; height: var(--recorrido); }
}
@media (max-width: 760px) { .pista-dedo { --recorrido: clamp(90px, 14vh, 140px); top: 31%; width: 46px; height: 55px; } }
@media (max-height: 520px) { .pista-dedo { --recorrido: 90px; top: 52%; } }

/* selector de calidad del 3D (menú del celular y pie) */
.calidad-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; color: rgba(244, 237, 226, 0.78); }
.menu-movil .calidad-sel { padding-top: 18px; }
.calidad-sel__ti small { display: block; font-size: 11px; opacity: 0.7; }
.calidad-sel__op { display: inline-flex; padding: 3px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--linea-clara); }
.calidad-sel__op button { min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; color: inherit; transition: background 0.25s, color 0.25s; }
.calidad-sel__op button[aria-pressed="true"] { background: var(--crema); color: var(--tinta); }
@media (hover: hover) { .calidad-sel__op button[aria-pressed="false"]:hover { background: rgba(244, 237, 226, 0.12); } }
.aviso-calidad { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 160; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 10px 10px 10px 16px; border-radius: 999px; background: rgba(27, 26, 25, 0.94); color: var(--crema); font-size: 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); }
.aviso-calidad button { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--crema); color: var(--tinta); font-size: 12.5px; }

@media (max-width: 1100px) { .nav__lema { display: none; } .nav__links a { padding: 8px 9px; } }
@media (max-width: 920px) {
  .nav__links { display: none; }
  .nav__menu { display: inline-block; }
  :root { --nav-h: 64px; }
  .nav__logo3d { width: 128px; height: 36px; }
}
