/* ------------------------------------------------------------------
   Zion-Eli's Fast One — cinematic invitation
   Palette: vintage slate blue · black · cream · amber (headlamps/lights)
   ------------------------------------------------------------------ */

:root {
  --ink: #07090c;
  --ink-2: #0d1117;
  --slate: #5b7a96;
  --slate-deep: #2f4559;
  --slate-light: #98abbb;
  --cream: #f1ecdf;
  --cream-dim: rgba(241, 236, 223, 0.62);
  --amber: #f2b33d;
  --amber-hot: #ffd27a;
  --red: #c8201e;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", sans-serif;
  --accent: "Racing Sans One", "Barlow Condensed", sans-serif;

  --stage-w: min(100vw, 480px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ---------- Stage: full-bleed on phones, a 9:16 column on desktop ---------- */

.stage {
  position: relative;
  width: var(--stage-w);
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

@media (min-width: 481px) {
  body {
    background:
      radial-gradient(ellipse at 50% 120%, rgba(91, 122, 150, 0.22), transparent 60%),
      var(--ink);
  }
  .stage {
    box-shadow: 0 0 0 1px rgba(241, 236, 223, 0.06), 0 40px 120px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- Atmosphere ---------- */

.grain {
  position: absolute; inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: absolute; inset: 0;
  z-index: 49;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- Scenes ---------- */

.scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) 24px calc(24px + var(--safe-b));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.scene.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease;
}

/* ---------- 0 · Gate ---------- */

.gate { z-index: 40; gap: 40px; text-align: center; }

.gate__eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--slate-light);
  padding-left: 0.42em; /* optical centre with tracking */
}

.gate__hint {
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--cream-dim);
}

.ignition {
  position: relative;
  width: 184px; height: 184px;
  border-radius: 50%;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
}
.ignition__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(241, 236, 223, 0.22);
  animation: ring 2.6s cubic-bezier(0.2, 0.6, 0.2, 1) infinite;
}
.ignition__ring--2 { animation-delay: 1.3s; }
@keyframes ring {
  0% { transform: scale(0.72); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1.18); opacity: 0; }
}
.ignition__core {
  width: 132px; height: 132px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(160deg, var(--slate) 0%, var(--slate-deep) 70%);
  box-shadow:
    inset 0 -6px 14px rgba(0, 0, 0, 0.45),
    inset 0 2px 2px rgba(255, 255, 255, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.6),
    0 0 0 6px var(--ink),
    0 0 0 7px rgba(241, 236, 223, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ignition:active .ignition__core { transform: scale(0.95); }
.ignition__label {
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.05;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
  text-align: center;
  padding-left: 0.22em;
}

/* ---------- 1 · Headlamps + presents ---------- */

.presents { background: var(--ink); }

.lamp {
  position: absolute;
  top: 46%;
  width: 36vmin; height: 36vmin;
  max-width: 190px; max-height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--amber-hot) 0%, var(--amber) 18%, rgba(242, 179, 61, 0.35) 38%, transparent 66%);
  filter: blur(2px);
  opacity: 0;
  transform: translateY(-50%) scale(0.2);
}
.lamp--l { left: 8%; }
.lamp--r { right: 8%; }
.presents.is-active .lamp { animation: lamp 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.presents.is-active .lamp--r { animation-delay: 0.12s; }
@keyframes lamp {
  0% { opacity: 0; transform: translateY(-50%) scale(0.2); }
  12% { opacity: 1; transform: translateY(-50%) scale(0.5); }
  18% { opacity: 0.55; }
  26% { opacity: 1; transform: translateY(-50%) scale(1); }
  70% { opacity: 1; transform: translateY(-50%) scale(1.05); }
  100% { opacity: 0; transform: translateY(-50%) scale(1.4); }
}

.presents__line {
  position: relative;
  z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  text-align: center;
}
.presents__word {
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(46px, 14vw, 70px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0;
  transform: translateY(18px);
  filter: blur(6px);
}
.presents__word--serif {
  font-family: var(--accent);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(20px, 6vw, 28px);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--slate-light);
  margin-top: 10px;
}
.presents.is-active .presents__word { animation: rise 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.presents.is-active .presents__word:nth-child(1) { animation-delay: 0.9s; }
.presents.is-active .presents__word:nth-child(2) { animation-delay: 1.05s; }
.presents.is-active .presents__word:nth-child(3) { animation-delay: 1.5s; }
@keyframes rise {
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ---------- 2 · Start lights ---------- */

.lights { background: var(--ink); gap: 48px; }

.gantry { display: flex; flex-direction: column; align-items: center; gap: 0; }
.gantry__bar {
  width: 92%;
  max-width: 360px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a2f36, #15181d);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.05) inset, 0 10px 30px rgba(0, 0, 0, 0.6);
}
.gantry__row {
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #171a20, #0b0d11);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.light {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 6px;
  border-radius: 10px;
  background: #090b0e;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.light i {
  display: block;
  width: clamp(38px, 11vw, 50px);
  height: clamp(38px, 11vw, 50px);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a1512 0%, #1d0a09 60%, #120606 100%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.6), inset 0 -4px 8px rgba(0, 0, 0, 0.6);
  transition: background 0.08s ease, box-shadow 0.12s ease;
}
.light.is-on i {
  background: radial-gradient(circle at 40% 35%, #ff8a7a 0%, var(--red) 45%, #7a0f0e 100%);
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.3),
    0 0 18px rgba(200, 32, 30, 0.9),
    0 0 60px rgba(200, 32, 30, 0.45);
}
.lights__caption {
  font-family: var(--display);
  font-weight: 600;
  font-style: italic;
  font-size: 24px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.lights.is-out .lights__caption { opacity: 1; }

/* ---------- 3 · Hero ---------- */

.hero { padding: 0; background: var(--ink); }

.hero__img-wrap {
  position: absolute; inset: 0;
  overflow: hidden;
}
.hero__media {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  transform: scale(1.08);
  transform-origin: 50% 38%;
  filter: brightness(0.3) saturate(0.6);
}
.hero.is-active .hero__media {
  animation:
    heroPush 6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards,
    heroLight 1.6s ease-out forwards,
    idle 0.09s steps(2) 1.6s 40;
}
@keyframes heroPush { to { transform: scale(1.0); } }
@keyframes heroLight { to { filter: brightness(1) saturate(1); } }
/* barely-there engine idle shake */
@keyframes idle {
  0% { translate: 0 0; }
  50% { translate: 0 0.6px; }
  100% { translate: 0.4px 0; }
}
.hero.is-settled .hero__media {
  animation: none;
  transform: scale(1.04);
  filter: brightness(0.62) saturate(0.85) blur(2px);
  transition: filter 1.2s ease, transform 1.2s ease;
}

.hero__sweep {
  position: absolute; inset: -20%;
  background: linear-gradient(115deg, transparent 40%, rgba(241, 236, 223, 0.16) 50%, transparent 60%);
  transform: translateX(-120%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.hero.is-active .hero__sweep { animation: sweep 2.4s cubic-bezier(0.4, 0, 0.2, 1) 2.2s forwards; }
@keyframes sweep { to { transform: translateX(120%); } }

.confetti {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* chequered flag wipe used as the transition INTO the hero */
.flagwipe {
  position: absolute; inset: 0;
  pointer-events: none;
  --sq: 11.111vw;
  background:
    repeating-conic-gradient(var(--cream) 0 25%, var(--ink) 0 50%) 0 0 / var(--sq) var(--sq);
  clip-path: inset(0 0 100% 0);
  opacity: 0;
}
@media (min-width: 481px) { .flagwipe { --sq: 53.33px; } }
.hero.is-active .flagwipe { animation: flagwipe 1.1s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
@keyframes flagwipe {
  0% { clip-path: inset(0 0 100% 0); opacity: 1; }
  45% { clip-path: inset(0 0 0 0); opacity: 1; }
  55% { clip-path: inset(0 0 0 0); opacity: 1; }
  100% { clip-path: inset(100% 0 0 0); opacity: 1; }
}

/* ---------- 4 · Title (overlays hero) ---------- */

.title {
  justify-content: flex-end;
  padding-bottom: calc(14vh + var(--safe-b));
  background: linear-gradient(180deg, transparent 35%, rgba(7, 9, 12, 0.72) 75%, rgba(7, 9, 12, 0.92) 100%);
  text-align: center;
  pointer-events: none;
}
.title__word {
  display: flex; flex-direction: column; align-items: center;
  line-height: 0.82;
}
.title__letters {
  display: inline-flex;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: clamp(88px, 28vw, 142px);
  letter-spacing: 0;
  padding-right: 0.06em; /* italic overhang */
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.title__letters--2 {
  color: transparent;
  -webkit-text-stroke: 2px var(--cream);
  margin-top: -0.02em;
}
.title__letters span {
  display: inline-block;
  opacity: 0;
  transform: translateY(40%) scale(1.35);
  filter: blur(8px);
}
.title.is-active .title__letters span { animation: slam 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes slam { to { opacity: 1; transform: none; filter: blur(0); } }

.title__sub {
  margin-top: 22px;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 6.4vw, 30px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream-dim);
  opacity: 0;
  transform: translateY(10px);
}
.title__sub em {
  font-family: var(--accent);
  font-style: normal;
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  font-size: 1.15em;
  color: var(--amber);
}
.title.is-active .title__sub { animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) 0.9s forwards; }

/* ---------- 5 · Card ---------- */

.card-scene {
  justify-content: flex-end;
  padding: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(7, 9, 12, 0.55) 60%, rgba(7, 9, 12, 0.9) 100%);
}
.card {
  width: 100%;
  padding: 28px 26px calc(26px + var(--safe-b));
  border-radius: 28px 28px 0 0;
  background:
    linear-gradient(180deg, rgba(241, 236, 223, 0.06), transparent 30%),
    linear-gradient(180deg, #121821 0%, #0b0f15 100%);
  box-shadow:
    0 -1px 0 rgba(241, 236, 223, 0.14),
    0 -30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(104%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.card-scene.is-active .card { transform: none; }

.card__head { position: relative; padding-top: 4px; margin-bottom: 22px; }
.card__chequer {
  position: absolute;
  top: -28px; right: -26px;
  width: 96px; height: 28px;
  background: repeating-conic-gradient(var(--cream) 0 25%, transparent 0 50%) 0 0 / 14px 14px;
  opacity: 0.9;
  transform: skewX(-18deg);
}
.card__eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 6px;
}
.card__name {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--display);
  font-weight: 900;
  font-style: italic;
  font-size: 56px;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--cream);
}
.card__age {
  font-family: var(--accent);
  font-style: normal;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--amber);
}

.card__facts {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid rgba(241, 236, 223, 0.1);
  border-bottom: 1px solid rgba(241, 236, 223, 0.1);
}
.fact { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: baseline; }
.fact dt {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--slate-light);
}
.fact dd {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--cream);
}
.fact dd sup { font-size: 0.55em; vertical-align: 0.7em; margin-left: 1px; }
.fact__note {
  display: block;
  margin-top: 2px;
  font-family: var(--body);
  font-weight: 400;
  font-size: 15px;
  color: var(--cream-dim);
}

.card__copy {
  margin: 20px auto 24px;
  max-width: 34ch;
  text-align: center;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cream-dim);
}

.card__actions { display: flex; gap: 10px; }
.card__actions .btn--primary { flex: 1; }
.card__actions .btn--ghost { flex: 0 0 52px; padding: 0; font-size: 22px; }
.btn {
  flex: 1;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  color: var(--ink);
  background: var(--cream);
  box-shadow: 0 10px 30px rgba(241, 236, 223, 0.15);
}
.btn--ghost {
  color: var(--cream);
  background: rgba(241, 236, 223, 0.06);
  box-shadow: inset 0 0 0 1px rgba(241, 236, 223, 0.16);
}
.btn--ghost:hover { background: rgba(241, 236, 223, 0.1); }

.card__foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 22px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.card__roundel {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 900;
  font-size: 16px;
  font-style: italic;
}

/* ---------- Skip ---------- */

.skip {
  position: absolute;
  top: calc(16px + var(--safe-t));
  right: 16px;
  z-index: 60;
  padding: 8px 12px;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
  background: rgba(7, 9, 12, 0.4);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.skip:not([hidden]) { opacity: 1; }
.skip:hover { color: var(--cream); }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .ignition__ring { animation: none; opacity: 0.4; transform: none; }
}
