: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: 1.25s;
  --ease-film: cubic-bezier(0.45, 0.05, 0.25, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* —— Film stage (sharp full-bleed) —— */
.film {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  overflow: hidden;
  perspective: 1400px;
}
.film-stage {
  position: absolute;
  inset: -1.2%;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.6s var(--ease-out);
}
.shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
  -ms-interpolation-mode: bicubic;
  opacity: 0;
  transform: scale(1.04) 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;
}
.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.035); animation: kbLeft 20s linear forwards; }
.shot.on.kb-right { transform: scale(1.035); animation: kbRight 20s linear forwards; }
.shot.cut-fast {
  transition-duration: 0.45s, 6s, 0.35s;
}
.shot.from-next { transform: scale(1.06) translate3d(1.5%, 0, 0); }
.shot.from-prev { transform: scale(1.06) translate3d(-1.5%, 0, 0); }

@keyframes kbIn {
  from { transform: scale(1.01); }
  to { transform: scale(1.045); }
}
@keyframes kbOut {
  from { transform: scale(1.045); }
  to { transform: scale(1.01); }
}
@keyframes kbLeft {
  from { transform: scale(1.03) translate3d(1.4%, 0, 0); }
  to { transform: scale(1.03) translate3d(-1.4%, 0, 0); }
}
@keyframes kbRight {
  from { transform: scale(1.03) translate3d(-1.4%, 0, 0); }
  to { transform: scale(1.03) translate3d(1.4%, 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: -20%;
  z-index: 5;
  pointer-events: none;
  opacity: .035;
  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(10px, 2.6vh, 28px);
  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.55; }
.flash {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: radial-gradient(circle at 50% 45%, rgba(255,220,190,.14), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.flash.on { opacity: 1; }

/* —— Chrome —— */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; pointer-events: none;
}
.brand {
  pointer-events: auto; display: inline-flex; gap: 10px; align-items: center;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.92rem;
  text-shadow: 0 1px 14px rgba(0,0,0,.55);
  transition: opacity .25s ease;
}
.brand:hover { opacity: .85; }
.brand img { border-radius: 7px; }
#prog {
  font-size: 0.68rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(197,185,167,.85); text-shadow: 0 1px 12px rgba(0,0,0,.55);
}

.arrow {
  position: fixed; right: 18px; z-index: 20; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(243,239,230,.14); background: rgba(5,6,10,.28); color: var(--ink);
  cursor: pointer; backdrop-filter: blur(10px); font-size: 1.05rem;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}
.arrow.up { bottom: 82px; }
.arrow.down { bottom: 26px; }
.arrow:hover { border-color: var(--amber); background: rgba(5,6,10,.5); transform: scale(1.05); }
.arrow:active { transform: scale(0.96); }

.rail {
  position: fixed; left: 14px; top: 50%; transform: translateY(-50%); z-index: 20;
  display: flex; flex-direction: column; gap: 7px;
  max-height: 70vh;
}
.rail button {
  width: 6px; height: 6px; border: 0; border-radius: 50%; padding: 0;
  background: rgba(243,239,230,.2); cursor: pointer;
  transition: background .35s ease, height .35s ease, box-shadow .35s ease;
}
.rail button.on {
  background: var(--amber);
  height: 16px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(212,179,122,.14);
}

/* —— Captions: soft blend into scene (no hard bubble) —— */
#scrollRoot {
  position: relative;
  z-index: 10;
  scroll-snap-type: y mandatory;
}
.scene {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 0 7vw 11vh;
  pointer-events: none;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.card {
  max-width: 34rem;
  padding: 1.35rem 1.4rem 1.25rem;
  border: 0;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(8,10,14,.22) 0%, rgba(8,10,14,.06) 55%, transparent 100%);
  backdrop-filter: blur(2px) saturate(1.05);
  -webkit-backdrop-filter: blur(2px) saturate(1.05);
  box-shadow: none;
}
.card > *,
.cta > .n,
.cta > h2,
.cta > p:not(.status) {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}
.scene.in-view .card > *:nth-child(1),
.scene.in-view .cta > .n { transition-delay: .1s; }
.scene.in-view .card > *:nth-child(2),
.scene.in-view .cta > h2 { transition-delay: .24s; }
.scene.in-view .card > *:nth-child(3),
.scene.in-view .cta > p:not(.status) { transition-delay: .38s; }
.scene.in-view .cta > .actions { transition-delay: .5s; }
.scene.in-view .card > *,
.scene.in-view .cta > .n,
.scene.in-view .cta > h2,
.scene.in-view .cta > p:not(.status),
.scene.in-view .cta > .actions {
  opacity: 1;
  transform: translateY(0);
}
.n {
  margin: 0 0 8px; font-size: .66rem; letter-spacing: .2em;
  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.06; letter-spacing: -.025em;
  color: rgba(247,243,235,.96);
  text-shadow:
    0 0 28px rgba(0,0,0,.4),
    0 2px 18px rgba(0,0,0,.5);
}
h1 { font-size: clamp(2.5rem, 5.8vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
.card p:last-child, .cta > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 1.02rem;
  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: 10vh 6vw;
  pointer-events: auto;
}
.cta {
  width: min(470px, 100%);
  max-width: 34rem;
  padding: 26px 24px;
  border: 1px solid rgba(243,239,230,.1);
  border-radius: 18px;
  background: rgba(5,6,10,.42);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  pointer-events: auto;
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.cta > .actions {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .85s var(--ease-out), transform .85s var(--ease-out);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.btn {
  min-height: 48px; padding: 0 20px; 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;
  transition: transform .2s ease, filter .2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn.wa { background: var(--green); color: #fff; }
.btn.mail { background: var(--amber); color: #16120c; }
.form { display: grid; gap: 11px; margin-top: 16px; }
.form[hidden] { display: none !important; }
.form label { display: grid; gap: 5px; font-size: .8rem; color: var(--muted); }
.form input, .form textarea {
  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; }

@media (max-width: 720px) {
  .shade {
    background:
      linear-gradient(180deg, rgba(5,6,10,.1) 0%, rgba(5,6,10,.28) 48%, rgba(5,6,10,.72) 100%);
  }
  .card {
    padding: 1rem 1.05rem;
    background: linear-gradient(180deg, rgba(8,10,14,.18) 0%, rgba(8,10,14,.08) 100%);
  }
  .scene { padding: 0 5vw 9vh; }
  .rail { left: 8px; gap: 6px; }
  .letterbox { height: 8px; }
  .grain { opacity: .025; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot, .card > *, .cta > *, .dip, .flash, .grain {
    animation: none !important;
    transition-duration: .15s !important;
  }
  .shot { filter: none; transform: scale(1.01); }
  .shot.on { transform: scale(1.01); }
  .grain { display: none; }
}
