/* ============================================================
   KEVIN ZOSS — night-mode scroll journey (LBA-flavored)
   Fixed stacked scenes, dissolve seams, AI diorama backdrops.
   --p linear · --pe eased · --copy copy opacity (set by kz.js)
   ============================================================ */

:root {
  --bg: #0B0B0E;
  --ink: #FAFAF8;
  --ink-soft: #C9C9CE;
  --muted: #8B8B94;
  --red: #D80707;
  --red-soft: #FF4D3D;
  --navy: #191D3F;
  --amber: #FFB347;
  --hairline: rgba(250, 250, 248, 0.14);
  --display: "Archivo Black", "Arial Black", sans-serif;
  --sans: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
::selection { background: var(--red); color: #fff; }

/* ---------- fixed chrome ---------- */
.kz-brand {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(18px, 3.5vw, 40px); pointer-events: none;
}
.kz-brand a { pointer-events: auto; }
.kz-name {
  font-family: var(--display); font-size: 15px; letter-spacing: 0.06em;
  color: var(--ink); text-decoration: none; text-transform: uppercase;
}
.kz-name b { color: var(--red-soft); }
.kz-pill {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; border: 1.5px solid var(--hairline);
  border-radius: 99px; padding: 9px 16px; background: rgba(11, 11, 14, 0.6);
  backdrop-filter: none; transition: border-color .2s, color .2s;
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 200;
}
.kz-pill:hover { border-color: var(--red-soft); color: var(--red-soft); }

.kz-rail {
  position: fixed; right: clamp(12px, 2.5vw, 28px); top: 50%; transform: translateY(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 14px;
}
.kz-rail a { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.kz-rail .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--ink); opacity: .4; transition: all .25s;
}
.kz-rail .lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); opacity: 0; transform: translateX(4px); transition: all .25s;
}
.kz-rail a.active .dot { background: var(--red-soft); border-color: var(--red-soft); opacity: 1; transform: scale(1.3); }
.kz-rail a:hover .lbl, .kz-rail a.active .lbl { opacity: .85; transform: none; }

.kz-hint {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90;
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-soft); opacity: .7; transition: opacity .4s;
  display: flex; align-items: center; gap: 8px;
}
.kz-hint::after { content: "↓"; color: var(--red-soft); animation: kz-bob 1.6s ease-in-out infinite; }
@keyframes kz-bob { 50% { transform: translateY(4px); } }
.kz-hint.gone { opacity: 0; pointer-events: none; }

/* ---------- scenes ---------- */
.scene-span { position: relative; }
.scene-stage {
  --p: 1; --pe: 1; --copy: 1;
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden; display: grid; place-items: center; background: var(--bg);
}
.j-scrub .scene-stage { position: fixed; inset: 0; height: 100vh; height: 100svh; }
.j-scrub .scene-span { visibility: hidden; }
.j-scrub .scene-span .scene-stage { visibility: visible; }

.scene-bg {
  position: absolute; inset: -8%;
  background-size: cover; background-position: center;
  /* The camera: arrives small, flies THROUGH the world, exits past it.
     Big scale range + per-scene drift/roll is what reads as a dive rather
     than a fade. Blur only spikes at the seams (--edge), so mid-scene stays
     crisp and cheap. */
  transform:
    scale(calc(0.90 + var(--pe, 1) * 0.46 + var(--edge, 0) * 0.10))
    translate3d(calc(var(--driftx, 0px) * var(--pe, 1)),
                calc(var(--drifty, -3vh) * var(--pe, 1)), 0)
    rotate(calc(var(--rot, 0deg) * var(--pe, 1)));
  filter: saturate(1.05);
  will-change: transform;
}
/* Accent bloom: the world flashes its own color as you punch through the seam. */
/* Seam-only cost: the blur + bloom are the expensive passes, so they only
   exist while .is-seam is on (JS adds it when --edge > 0.01). Mid-scene —
   i.e. the whole time the copy is being read — the compositor does nothing
   but a cheap transform. */
.scene-stage.is-seam .scene-bg {
  filter: saturate(calc(1.05 + var(--edge, 0) * 0.35)) blur(calc(var(--edge, 0) * 4px));
  will-change: transform, filter;
}
.scene-stage.is-seam::after {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%,
    color-mix(in srgb, var(--scene-accent, #FF4D3D) 55%, transparent) 0%,
    transparent 70%);
  opacity: calc(var(--edge, 0) * 0.42);
  mix-blend-mode: screen;
}
.scene-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11,11,14,.55) 0%, rgba(11,11,14,.08) 30%, rgba(11,11,14,.08) 55%, rgba(11,11,14,.82) 100%);
}
.scene-copy {
  position: relative; z-index: 5; width: 100%; max-width: 1120px;
  padding: 0 clamp(22px, 5vw, 56px);
  align-self: end; padding-bottom: clamp(64px, 11vh, 128px);
  opacity: var(--copy, 1);
  transform:
    translate3d(calc((1 - var(--copy, 1)) * var(--copyx, 0px)),
                calc((1 - var(--copy, 1)) * 34px), 0)
    scale(calc(0.965 + var(--copy, 1) * 0.035));
  filter: blur(calc((1 - var(--copy, 1)) * 3px));
  will-change: opacity, transform, filter;
}
.scene-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--scene-accent, var(--red-soft)); margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.scene-eyebrow::before { content: ""; width: 34px; height: 3px; background: var(--scene-accent, var(--red)); }
.scene-title {
  font-family: var(--display); text-transform: uppercase;
  font-size: clamp(34px, 6.2vw, 78px); line-height: 0.98; letter-spacing: -0.005em;
  color: var(--ink); margin-bottom: 18px; max-width: 18ch; text-wrap: balance;
}
.scene-title em { font-style: normal; color: var(--scene-accent, var(--red-soft)); }
.scene-body {
  font-size: clamp(15px, 1.8vw, 18px); color: var(--ink-soft);
  max-width: 58ch; line-height: 1.6; margin-bottom: 18px;
}
.scene-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.scene-tags span {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink); border: 1px solid var(--hairline); border-radius: 99px;
  padding: 6px 13px; background: rgba(11,11,14,.45);
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-size: 15px; font-weight: 700; padding: 15px 28px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; border: 1.5px solid var(--red); }
.btn-primary:hover { background: var(--red-soft); border-color: var(--red-soft); }
.btn-ghost { background: rgba(11,11,14,.4); color: var(--ink); border: 1.5px solid var(--hairline); }
.btn-ghost:hover { border-color: var(--red-soft); color: var(--red-soft); }

.kz-foot {
  background: var(--bg); border-top: 1px solid var(--hairline);
  padding: 22px clamp(18px, 3.5vw, 40px); font-size: 12.5px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: relative; z-index: 60;
}
.kz-foot a { color: var(--red-soft); text-decoration: none; font-weight: 600; }

/* grain */
.grain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; opacity: .07; mix-blend-mode: overlay; }

/* ---------- static fallback (reduced motion / small screens / no JS) ---------- */
.j-static .scene-span { height: auto !important; }
.j-static .scene-stage { position: relative; height: auto; min-height: 96vh; padding: 90px 0 0; }
.j-static .scene-bg { position: absolute; transform: none; }
.j-static .kz-hint, .j-static .kz-rail { display: none; }
@media (prefers-reduced-motion: reduce) {
  .kz-hint::after { animation: none; }
  .scene-bg { transform: none !important; filter: saturate(1.05) !important; }
  .scene-stage::after { display: none; }
  .scene-copy { transform: none !important; filter: none !important; }
}


/* ---------- narrative (journey) variant ---------- */
.journey .scene-title {
  font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 600;
  text-transform: none; letter-spacing: -0.015em; line-height: 1.04;
  font-size: clamp(36px, 6.4vw, 84px); max-width: 17ch;
}
.journey .scene-title em { font-style: italic; color: var(--scene-accent, var(--red-soft)); }
.journey .scene-body { font-size: clamp(15.5px, 1.9vw, 18.5px); max-width: 56ch; }
.journey .kz-hint::after { color: var(--ink); }
.journey .kz-rail a.active .dot { background: var(--ink); border-color: var(--ink); }
