/* Distriplinios — «Un día con ellos» · demo concepto
   Tokens: una fuente (Nunito), paleta pastel del mundo, una acción. */

:root {
  --surface: #FAF3E7;        /* crema */
  --surface-deep: #241B14;   /* noche del final */
  --ink: #3E2F23;            /* marrón tinta */
  --ink-soft: #7A6A58;
  /* Marca (logo Distriplinios: carrito ROJO + letras negras), 10-nov-2026.
     El coral #D32F2F no es de la marca y con texto blanco daba 2,5:1.
     #D32F2F: 5,0:1 con texto blanco y 4,5:1 sobre la crema. */
  --accent: #D32F2F;
  --accent-deep: #B71C1C;
  --sage: #A8BFA0;
  --honey: #F2C879;
  --glass: rgba(250, 243, 231, 0.55);
  --glass-border: rgba(62, 47, 35, 0.12);
  --radius: 18px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: "Nunito", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  overflow-x: hidden;
}

/* ───────── Loader ───────── */
#loader {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-content: center; gap: 14px; justify-items: center;
  background: var(--surface);
  transition: opacity .5s var(--ease), visibility .5s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-paw { font-size: 42px; animation: paw 1.2s var(--ease) infinite alternate; }
@keyframes paw { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.18) rotate(6deg); } }
.loader-bar { width: 180px; height: 4px; border-radius: 99px; background: rgba(62,47,35,.12); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 99px; transition: width .2s; }
#loaderTxt { font-size: 13px; color: var(--ink-soft); }

/* ───────── Nav isla ───────── */
#glassNav {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 50; display: flex; align-items: center; gap: 22px;
  /* Sin ancho propio la isla se encogía a media pantalla y el CTA se partía
     en dos líneas en el móvil (mismo arreglo que MIIGO y CHH). */
  width: max-content; max-width: calc(100vw - 24px);
  padding: 10px 12px 10px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(36, 27, 20, 0.12);
}
.brand {
  display: grid; place-items: center;
  border-radius: 12px; overflow: hidden;
  transition: transform .25s var(--ease);
}
.brand:hover { transform: scale(1.05); }
.brand img { display: block; height: 34px; width: auto; }

/* ───────── Botones ───────── */
.cta {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(183, 28, 28, .4);
  transition: transform .25s var(--ease), background .25s;
}
.cta:hover { transform: translateY(-2px) scale(1.03); background: var(--accent-deep); }
.ghost {
  display: inline-block;
  border: 1.5px solid rgba(62,47,35,.35); color: var(--ink);
  font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; text-decoration: none;
  transition: background .25s, border-color .25s;
}
.ghost:hover { background: rgba(62,47,35,.06); border-color: var(--ink); }

/* ───────── Rail de escenas ───────── */
#sceneRail {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 10px;
}
#sceneRail .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(62,47,35,.22);
  transition: all .35s var(--ease);
}
#sceneRail .dot.on { background: var(--accent); transform: scale(1.5); box-shadow: 0 0 0 5px rgba(211, 47, 47,.18); }
#sceneRail .dot[data-tip]:hover::before {
  content: attr(data-tip);
  position: absolute; right: 22px; white-space: nowrap;
  font-size: 12px; font-weight: 800; color: var(--ink);
  background: var(--glass); border: 1px solid var(--glass-border);
  padding: 4px 10px; border-radius: 99px; backdrop-filter: blur(10px);
}

/* ───────── Escenario ───────── */
#track { height: 960vh; position: relative; }
#stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
#scrub, #poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
#poster { z-index: 1; transition: opacity .5s; }
#scrub  { z-index: 2; }
#scrub.ready + #poster { display: none; }

/* ───────── Copy ───────── */
.copy {
  position: absolute; z-index: 10;
  left: clamp(20px, 7vw, 110px);
  bottom: clamp(70px, 14vh, 150px);
  max-width: min(560px, 82vw);
  opacity: 0; transform: translateY(26px);
  pointer-events: none;
  text-shadow: 0 1px 24px rgba(250,243,231,.5);
}
.copy[data-scene="5"], .copy[data-scene="6"] { color: #fff; text-shadow: 0 1px 24px rgba(0,0,0,.35); }
.kicker {
  font-size: clamp(12px, 1.4vw, 13px); font-weight: 900;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-deep); margin-bottom: 12px;
}
.copy[data-scene="5"] .kicker, .copy[data-scene="6"] .kicker { color: var(--honey); }
h1, h2 {
  font-weight: 900; line-height: 1.04;
  font-size: clamp(30px, 5.4vw, 62px);
  letter-spacing: -0.01em;
}
.sub {
  margin-top: 14px; font-size: clamp(14px, 1.8vw, 18px);
  font-weight: 600; color: var(--ink-soft); line-height: 1.5;
}
.copy[data-scene="5"] .sub, .copy[data-scene="6"] .sub { color: rgba(255,255,255,.85); }
.sub strong { color: var(--honey); font-weight: 900; }
.copy.vis { opacity: 1; transform: translateY(0); transition: opacity .6s var(--ease), transform .6s var(--ease); }

/* ───────── Final ───────── */
#final {
  position: relative; z-index: 5;
  min-height: 92vh; display: grid; place-content: center; text-align: center;
  background: var(--surface-deep); color: #fff;
  padding: 90px 20px 60px;
}
#final .kicker { color: var(--honey); }
.final-logo { margin-bottom: 18px; filter: drop-shadow(0 6px 24px rgba(0,0,0,.45)); }
#final h2 { font-size: clamp(28px, 4.6vw, 52px); margin-bottom: 34px; }
.final-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.cta.big { font-size: 16px; padding: 15px 30px; }
#final .fine { font-size: 13px; color: rgba(255,255,255,.55); }

footer {
  background: var(--surface-deep); color: rgba(255,255,255,.35);
  text-align: center; padding: 18px; font-size: 12px;
}

/* ───────── Reduced motion: la historia no cambia ───────── */
@media (prefers-reduced-motion: reduce) {
  #track { height: auto; }
  #loader { display: none; }
}
.rscene { position: relative; height: 74vh; overflow: hidden; }
.rscene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rscene .copy { position: absolute; opacity: 1; transform: none; }

/* ───────── Móvil ───────── */
@media (max-width: 640px) {
  #glassNav { gap: 12px; padding: 8px 8px 8px 12px; }
  .brand img { height: 28px; }
  #sceneRail { right: 10px; gap: 8px; }
  .copy { left: 20px; right: 20px; bottom: 84px; }
  .sub { font-size: 15px; }
}

/* ───────── Pista de scroll (onboarding) ───────── */
.scroll-cue {
  position: absolute; z-index: 12; left: 50%; bottom: 26px;
  transform: translateX(-50%);
  display: grid; justify-items: center; gap: 6px;
  color: var(--ink); text-align: center;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  pointer-events: none;
}
.scroll-cue.oculto { opacity: 0; transform: translateX(-50%) translateY(14px); }
.cue-mouse {
  width: 26px; height: 40px; border: 2.5px solid var(--ink); border-radius: 14px;
  display: grid; justify-items: center; padding-top: 7px;
  background: rgba(250,243,231,.6); backdrop-filter: blur(4px);
}
.cue-dot {
  width: 4px; height: 8px; border-radius: 99px; background: var(--accent);
  animation: rueda 1.6s var(--ease) infinite;
}
@keyframes rueda {
  0% { transform: translateY(0); opacity: 1 }
  60% { transform: translateY(10px); opacity: 0 }
  61% { transform: translateY(0); opacity: 0 }
  100% { opacity: 1 }
}
.cue-text { font-size: 13px; font-weight: 900; letter-spacing: .02em; }
.cue-flecha { font-size: 16px; font-weight: 900; animation: saltito 1.6s ease-in-out infinite; }
@keyframes saltito { 0%,100% { transform: translateY(0) } 50% { transform: translateY(5px) } }
@media (prefers-reduced-motion: reduce) { .scroll-cue { display: none } }

/* ───────── Contraste en panel final ───────── */
#final .ghost { color: #fff; border-color: rgba(255,255,255,.45); }
#final .ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* ───────── Responsive del concepto ───────── */
@media (max-width: 640px) {
  .copy { left: 16px; right: 16px; bottom: 96px; max-width: none; }
  h1, h2 { font-size: clamp(26px, 8vw, 42px); }
  .sub { font-size: 15px; margin-top: 10px; }
  .kicker { font-size: 12px; margin-bottom: 8px; }
  #sceneRail { display: none; }
  .scroll-cue { bottom: 12px; }
  .cue-text { font-size: 12px; }
  #final { min-height: 86vh; padding: 56px 16px 40px; }
  .final-ctas { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; margin: 0 auto 34px; }
  .final-ctas a { width: 100%; text-align: center; }
  .final-logo { height: 110px !important; width: auto; }
  #final .fine { font-size: 12px; line-height: 1.6; }
  #glassNav { gap: 10px; padding: 7px 8px 7px 12px; }
  .brand img { height: 28px; }
  #glassNav .cta { font-size: 12.5px; padding: 8px 13px; }
}

/* Legibilidad en el móvil (10-nov-2026): en las escenas claras el copy se
   posaba directo sobre la arcilla y el subtítulo #7A6A58 no se leía. Un vidrio
   crema detrás del texto, solo en escenas 1-4 (las 5-6 son de noche). */
@media (max-width: 700px) {
  .copy:not([data-scene="5"]):not([data-scene="6"]) {
    padding: 14px 16px; border-radius: var(--radius);
    background: rgba(250, 243, 231, 0.8);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    text-shadow: none;
  }
  .copy:not([data-scene="5"]):not([data-scene="6"]) .sub { color: var(--ink); }
}
