:root {
  --bg: #05060a;
  --ink: #f7f3eb;
  --muted: rgba(232, 224, 210, 0.82);
  --amber: #e0c08a;
  --green: #3f916c;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
  --xfade: 2.4s;
  --ease-film: cubic-bezier(0.45, 0.05, 0.25, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --pad-x: clamp(1rem, 5vw, 7vw);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  margin: 0;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
}

img:not(.shot), video:not(.shot), iframe, svg {
  max-width: 100%;
  height: auto;
}

/* —— Film stage —— */
.film {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
}
.film-stage {
  position: absolute;
  inset: 0;
  will-change: transform;
  background: #000;
}
.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(1.02) translate3d(0, 0, 0);
  filter: brightness(0.97);
  transition:
    opacity var(--xfade) var(--ease-film),
    transform 9s linear,
    filter 0.55s ease;
  will-change: opacity, transform;
  backface-visibility: hidden;
  background: #000;
}
video.shot {
  object-fit: contain;
  pointer-events: none;
}
.shot.on {
  opacity: 1;
  filter: brightness(1);
  z-index: 2;
}
.shot.on.kb-in { transform: scale(1.01); animation: kbIn 18s linear forwards; }
.shot.on.kb-out { transform: scale(1.01); animation: kbOut 18s linear forwards; }
.shot.on.kb-left { transform: scale(1.03); animation: kbLeft 20s linear forwards; }
.shot.on.kb-right { transform: scale(1.03); animation: kbRight 20s linear forwards; }
.shot.cut-fast { transition-duration: 2.2s, 6s, 0.8s; }
.shot.from-next { transform: scale(1.05) translate3d(1.2%, 0, 0); }
.shot.from-prev { transform: scale(1.05) translate3d(-1.2%, 0, 0); }

@keyframes kbIn {
  from { transform: scale(1.01); }
  to { transform: scale(1.04); }
}
@keyframes kbOut {
  from { transform: scale(1.04); }
  to { transform: scale(1.01); }
}
@keyframes kbLeft {
  from { transform: scale(1.025) translate3d(1.2%, 0, 0); }
  to { transform: scale(1.025) translate3d(-1.2%, 0, 0); }
}
@keyframes kbRight {
  from { transform: scale(1.025) translate3d(-1.2%, 0, 0); }
  to { transform: scale(1.025) translate3d(1.2%, 0, 0); }
}

.shade {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(95% 70% at 14% 88%, rgba(5,6,10,.55) 0%, rgba(5,6,10,.12) 38%, transparent 68%),
    linear-gradient(90deg, rgba(5,6,10,.28) 0%, transparent 42%),
    linear-gradient(0deg, rgba(5,6,10,.42) 0%, transparent 36%);
}
.grain {
  position: absolute;
  inset: -10%;
  z-index: 5;
  pointer-events: none;
  opacity: .03;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
  animation: grainShift 0.55s steps(2) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-1%, 0.8%); }
  100% { transform: translate(0.8%, -0.8%); }
}
.letterbox {
  position: absolute;
  left: 0; right: 0;
  z-index: 6;
  height: clamp(8px, 2vh, 24px);
  background: #000;
  pointer-events: none;
}
.letterbox.top { top: 0; }
.letterbox.bot { bottom: 0; }
.dip {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-film);
}
.dip.on { opacity: 0.5; }
.flash {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: radial-gradient(circle at 50% 45%, rgba(255,220,190,.12), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.flash.on { opacity: 1; }

/* —— Chrome —— */
.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) max(14px, var(--pad-x)) 12px;
  pointer-events: none;
  width: 100%;
  max-width: 100vw;
}
.brand {
  pointer-events: auto;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(0.78rem, 2.4vw, 0.92rem);
  text-shadow: 0 1px 14px rgba(0,0,0,.55);
}
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; }
#prog {
  flex-shrink: 0;
  font-size: clamp(0.58rem, 2vw, 0.68rem);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(197,185,167,.85);
  text-shadow: 0 1px 12px rgba(0,0,0,.55);
}

.arrow {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 20;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(243,239,230,.14);
  background: rgba(5,6,10,.35);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(10px);
  font-size: 1.05rem;
  touch-action: manipulation;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}
.arrow.up { bottom: calc(78px + var(--safe-b)); }
.arrow.down { bottom: calc(22px + var(--safe-b)); }
.arrow:hover { border-color: var(--amber); background: rgba(5,6,10,.55); }
.arrow:active { transform: scale(0.96); }

.rail {
  position: fixed;
  left: max(8px, env(safe-area-inset-left, 0px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(70vh, 520px);
  overflow: hidden;
}
.rail button {
  width: 6px;
  height: 6px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(243,239,230,.22);
  cursor: pointer;
  touch-action: manipulation;
  transition: background .35s ease, height .35s ease, box-shadow .35s ease;
}
.rail button.on {
  background: var(--amber);
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(212,179,122,.14);
}

/* —— Scenes —— */
#scrollRoot {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 100vw;
}
.scene {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--pad-x) calc(10vh + var(--safe-b));
  padding-left: max(var(--pad-x), calc(var(--pad-x) + 12px));
  pointer-events: none;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}
.card {
  width: min(34rem, 100%);
  max-width: 100%;
  padding: clamp(0.85rem, 2.5vw, 1.35rem) clamp(0.85rem, 2.5vw, 1.4rem);
  border: 0;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(8,10,14,.28) 0%, rgba(8,10,14,.08) 55%, transparent 100%);
  backdrop-filter: blur(3px) saturate(1.05);
  -webkit-backdrop-filter: blur(3px) saturate(1.05);
}
.card > *,
.cta > .n,
.cta > h2,
.cta > p:not(.status) {
  opacity: 0;
  transform: translateY(18px);
}
.n {
  margin: 0 0 8px;
  font-size: clamp(0.58rem, 1.8vw, 0.66rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 600;
  text-shadow: 0 0 20px rgba(0,0,0,.35), 0 1px 8px rgba(0,0,0,.45);
}
h1, h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: rgba(247,243,235,.96);
  text-shadow: 0 0 28px rgba(0,0,0,.4), 0 2px 18px rgba(0,0,0,.5);
  overflow-wrap: anywhere;
  word-break: break-word;
}
h1 { font-size: clamp(1.85rem, 6.5vw, 4.2rem); }
h2 { font-size: clamp(1.55rem, 5vw, 3rem); }
.card p:last-child, .cta > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  font-weight: 500;
  text-shadow: 0 0 22px rgba(0,0,0,.45), 0 1px 10px rgba(0,0,0,.55);
  max-width: 30rem;
}

.scene.end {
  align-items: center;
  justify-content: center;
  padding: calc(8vh + var(--safe-t)) var(--pad-x) calc(8vh + var(--safe-b));
  pointer-events: auto;
}
.cta {
  width: min(470px, 100%);
  max-width: 100%;
  padding: clamp(18px, 4vw, 26px);
  border: 1px solid rgba(243,239,230,.1);
  border-radius: 18px;
  background: rgba(5,6,10,.48);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  pointer-events: auto;
}
.cta > .actions {
  opacity: 0;
  transform: translateY(12px);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  width: 100%;
}
.btn {
  min-height: 48px;
  min-width: min(100%, 140px);
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  flex: 1 1 auto;
}
.btn.wa { background: var(--green); color: #fff; }
.btn.mail { background: var(--amber); color: #16120c; }
.form { display: grid; gap: 11px; margin-top: 16px; width: 100%; }
.form[hidden] { display: none !important; }
.form label { display: grid; gap: 5px; font-size: .8rem; color: var(--muted); }
.form input, .form textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(243,239,230,.14);
  border-radius: 10px;
  background: #11141a;
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
}
.status { margin: 0; min-height: 1.2em; color: var(--amber); font-size: .88rem; }

/* Mobile: show FULL scene (contain) — no cover crop / snipping */
@media (max-width: 720px) {
  .shade {
    background:
      linear-gradient(180deg, rgba(5,6,10,.08) 0%, rgba(5,6,10,.2) 40%, rgba(5,6,10,.82) 100%);
  }
  .grain { display: none; }
  .letterbox { height: 0; }
  .rail {
    left: 6px;
    gap: 5px;
    max-height: 50vh;
  }
  .rail button { width: 5px; height: 5px; }
  .rail button.on { height: 12px; }
  .film-stage { inset: 0; }
  .shot,
  .shot.on,
  .shot.on.kb-in,
  .shot.on.kb-out,
  .shot.on.kb-left,
  .shot.on.kb-right,
  .shot.from-next,
  .shot.from-prev,
  video.shot {
    object-fit: contain !important;
    object-position: center center !important;
    transform: none !important;
    animation: none !important;
    filter: none !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }
  .scene {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0 14px calc(6.8rem + var(--safe-b));
    padding-left: 20px;
    overflow: visible;
  }
  .card {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(180deg, rgba(8,10,14,.55) 0%, rgba(8,10,14,.28) 100%);
  }
  .arrow {
    width: 42px;
    height: 42px;
  }
  .arrow.up { bottom: calc(4.6rem + var(--safe-b)); }
  .arrow.down { bottom: calc(1rem + var(--safe-b)); }
  .top { padding-inline: 14px; }
  .brand span { max-width: 42vw; }
}

@media (max-width: 420px) {
  h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  h2 { font-size: clamp(1.4rem, 7vw, 1.85rem); }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .dip, .flash, .grain, .arrow {
    animation: none !important;
    transition-duration: .12s !important;
  }
  /* Large-scale motion (pan/zoom/parallax) is what actually causes vestibular
     discomfort — a plain crossfade in place is not, so .shot keeps a real
     (if shorter) fade instead of snapping instantly. An instant 0.12s swap
     between sequence frames reads as a flicker/glitch, not an accessible
     fallback, on a page whose whole point is showing a story unfold. */
  .shot {
    animation: none !important;
    transition-duration: .7s !important;
    filter: none;
    transform: scale(1.01) !important;
  }
  .grain { display: none; }
  html { scroll-behavior: auto; }
}
