@font-face {
  font-family: 'Noto Serif';
  src: url('../fonts/NotoSerif-latin.3d360230.woff2') format('woff2'); /* Latin cut of Noto Serif, tools/make_assets.py --only font */
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --gold: #F3C98B;
  --bone: #E8DCC8;
  --ember: #FF6A10;
  --black: #050302;
  --serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

html { background: var(--black); }

body {
  margin: 0;
  background: var(--black);
  color: var(--bone);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Top bar: the name small at the left, section links at the right. */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(18px, 4vw, 48px);
  font-size: 12px;
  letter-spacing: .24em;
  color: rgba(232, 220, 200, .78);
}
.topbar nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.topbar a { padding: 8px 0; transition: color .2s; }
.topbar a:hover, .topbar a:focus-visible { color: var(--gold); }

/* First screen. The background colour is the fallback when the still is slow or blocked. */
#hero {
  position: relative;
  min-height: 560px;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background-color: var(--black);
}

#hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 20%;
}

#hero-canvas-slot { position: absolute; inset: 0; pointer-events: none; }

/* The film's soft vignette over the still's box, the same on the plain still and the WebGL canvas,
   so nothing changes at the swap. The stops follow 0.2 * smoothstep(0.45, 1, d) to the corners. */
.vignette {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(ellipse farthest-corner at 50% 50%, rgba(5, 3, 2, 0) 45%, rgba(5, 3, 2, .031) 58.75%, rgba(5, 3, 2, .1) 72.5%, rgba(5, 3, 2, .169) 86.25%, rgba(5, 3, 2, .2) 100%);
}

/* Dark toward the right and the bottom so the name and buttons read. */
.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 3, 2, 0) 28%, rgba(5, 3, 2, .72) 62%, rgba(5, 3, 2, .9) 100%),
    linear-gradient(0deg, rgba(5, 3, 2, .72), rgba(5, 3, 2, 0) 42%),
    linear-gradient(180deg, rgba(5, 3, 2, .55), rgba(5, 3, 2, 0) 18%);
}

.hero-copy {
  position: absolute;
  z-index: 2;
  right: clamp(24px, 8vw, 120px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.name {
  margin: 0;
  font-weight: 600;
  font-size: clamp(36px, 4.2vw, 72px);
  letter-spacing: .5em;
  margin-right: -.5em; /* the last letter's trailing space would push the name off the right edge */
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255, 106, 16, .38);
}

.tagline {
  margin: clamp(14px, 2vh, 24px) 0 clamp(26px, 4vh, 44px);
  font-size: clamp(11px, 1.05vw, 15px);
  letter-spacing: .3em;
  margin-right: -.3em;
  color: var(--bone);
  opacity: .88;
}

.nb { white-space: nowrap; }

.actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

.btn {
  font: 600 12px/1 var(--serif);
  letter-spacing: .2em;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: filter .2s, border-color .2s, background-color .2s;
}
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-outline {
  color: #F3E6CF;
  border: 1px solid rgba(243, 201, 139, .6);
  background: rgba(0, 0, 0, .25);
}
.btn-outline:hover { border-color: var(--gold); background: rgba(0, 0, 0, .4); }
.play { font-size: 9px; letter-spacing: 0; }

.btn-gold {
  color: #1a0c04;
  border: 1px solid transparent;
  background: linear-gradient(#e9b56a, #c8863a);
}
.btn-gold:hover { filter: brightness(1.1); }

/* Later sections start as empty shells. */
#story, #stills, #wishlist { background: var(--black); }

/* Phones and portrait screens: the face at the top, the name and buttons below it. */
@media (max-width: 700px), (orientation: portrait) {
  #hero { min-height: 600px; }

  #hero-still {
    height: 62%;
    object-position: 30% 15%; /* both faces in the narrow window (his face starts 21% across the still) */
  }
  .vignette { height: 62%; }

  .shade {
    background:
      linear-gradient(0deg, var(--black) 38%, rgba(5, 3, 2, 0) 68%),
      linear-gradient(180deg, rgba(5, 3, 2, .55), rgba(5, 3, 2, 0) 16%);
  }

  .hero-copy {
    left: 0; right: 0; top: auto; bottom: 0;
    transform: none;
    align-items: center;
    text-align: center;
    padding: 0 24px max(36px, env(safe-area-inset-bottom));
  }

  .name { font-size: clamp(34px, 9vw, 64px); }
  .tagline { font-size: clamp(10px, 2.9vw, 14px); line-height: 1.9; margin-bottom: 28px; text-wrap: balance; }
  .topbar { padding: 14px 18px; font-size: 10px; letter-spacing: .18em; }
  .topbar nav { gap: 16px; }
  .actions { flex-direction: column; align-items: stretch; width: min(100%, 320px); justify-content: center; }
}

/* Short portrait screens (a phone inside the Instagram or YouTube app): the first screen is the viewport,
   not 600 px, so the gold WISHLIST button stays on it. The shorter still ends 46% up from the bottom, so the
   shade turns solid there (not at 38%) and fades over the lower half of the still, as in the taller layout. */
@media (orientation: portrait) and (max-height: 600px) {
  #hero { min-height: 0; }
  #hero-still, .vignette { height: 54%; }
  .shade {
    background:
      linear-gradient(0deg, var(--black) 46%, rgba(5, 3, 2, 0) 72%),
      linear-gradient(180deg, rgba(5, 3, 2, .55), rgba(5, 3, 2, 0) 16%);
  }
  .tagline { margin-bottom: 18px; }
  .hero-copy { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}

/* Landscape phones and other short screens: the side-by-side layout, scaled down, so the name and buttons fit. */
@media (max-height: 520px) and (orientation: landscape) {
  #hero { min-height: 0; }
  #hero-still { height: 100%; object-position: 100% 20%; }
  .vignette { height: 100%; }
  .shade {
    background:
      linear-gradient(90deg, rgba(5, 3, 2, 0) 28%, rgba(5, 3, 2, .72) 62%, rgba(5, 3, 2, .9) 100%),
      linear-gradient(0deg, rgba(5, 3, 2, .72), rgba(5, 3, 2, 0) 42%),
      linear-gradient(180deg, rgba(5, 3, 2, .55), rgba(5, 3, 2, 0) 18%);
  }
  .hero-copy {
    left: auto; right: clamp(24px, 6vw, 72px); top: 50%; bottom: auto;
    transform: translateY(-50%);
    align-items: flex-end;
    text-align: right;
    padding: 0;
  }
  .name { font-size: clamp(26px, 6vh, 44px); }
  .tagline { font-size: 10px; line-height: 1.4; margin: 10px 0 20px; text-wrap: initial; }
  .actions { flex-direction: row; align-items: center; width: auto; justify-content: flex-end; }
  .topbar { padding: 10px 24px; }
}

/* ---------- Story: the four lines over a dark, slow still from the trailer. ---------- */
#story {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(520px, 92vh, 860px);
  padding: clamp(72px, 12vh, 140px) clamp(24px, 8vw, 120px);
}

.story-bg { --story-dark: .42; position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--black); }
.story-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  transform-origin: 50% 50%;
  animation: story-drift 56s ease-in-out infinite alternate;
  will-change: transform;
}
/* The darkening lives on top of the picture, heavier toward the text, so the lines read at every size. */
.story-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(5, 3, 2, .62) 0%, rgba(5, 3, 2, .22) 100%),
    linear-gradient(180deg, var(--black), rgba(5, 3, 2, 0) 18%, rgba(5, 3, 2, 0) 82%, var(--black));
  background-color: rgba(5, 3, 2, var(--story-dark));
}
@keyframes story-drift {
  from { transform: scale(1.04) translate3d(-1.2%, 0, 0); }
  to { transform: scale(1.12) translate3d(1.2%, -1%, 0); }
}

.story-text {
  width: min(100%, 36rem);
  margin: 0 auto;
  text-align: center;
}
.story-text p {
  margin: 0 0 clamp(26px, 4.5vh, 42px);
  font-size: clamp(18px, 1.6vw + 12px, 26px);
  line-height: 1.75;
  letter-spacing: .02em;
  color: var(--bone);
  text-wrap: balance;
  text-shadow: 0 1px 18px rgba(5, 3, 2, .9);
}
.story-text p:last-child { margin-bottom: 0; color: var(--gold); }

/* ---------- Stills: eight thumbnails that open the lightbox. ---------- */
#stills { padding: clamp(40px, 7vh, 88px) clamp(18px, 4vw, 48px); }

.still-grid {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 16px);
}
.still-grid li { margin: 0; min-width: 0; }

.still {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(243, 201, 139, .18);
  border-radius: 2px;
  background: #0b0705;
  line-height: 0;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.still img { display: block; width: 100%; height: auto; aspect-ratio: 480 / 270; object-fit: cover; transition: filter .25s; filter: brightness(.9); }
.still:hover, .still:focus-visible { border-color: var(--gold); }
.still:hover img, .still:focus-visible img { filter: brightness(1.08); }
.still:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 700px) {
  .still-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Lightbox. ---------- */
html.lightbox-open { overflow: hidden; }

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050302;
  touch-action: pan-y pinch-zoom;
  animation: lb-in .22s ease-out;
}
#lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lb-img {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0 80px rgba(255, 106, 16, .08);
  user-select: none;
  -webkit-user-drag: none;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  font: 600 12px/1 var(--serif);
  letter-spacing: .2em;
  color: var(--bone);
  background: rgba(5, 3, 2, .55);
  border: 1px solid rgba(243, 201, 139, .45);
  border-radius: 2px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, border-color .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--gold); border-color: var(--gold); }
.lb-close:focus-visible, .lb-prev:focus-visible, .lb-next:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.lb-close { top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); padding: 0 18px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 30px; letter-spacing: 0; padding: 0 0 4px; width: 48px; height: 64px; }
.lb-prev { left: max(10px, env(safe-area-inset-left)); }
.lb-next { right: max(10px, env(safe-area-inset-right)); }
.lb-count {
  position: absolute;
  left: 0; right: 0;
  bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .24em;
  color: rgba(232, 220, 200, .78);
  text-shadow: 0 1px 8px rgba(5, 3, 2, .9);
  pointer-events: none;
}

/* ---------- Footer. ---------- */
.site-footer {
  background: var(--black);
  border-top: 1px solid rgba(243, 201, 139, .14);
  padding: clamp(32px, 6vh, 56px) clamp(24px, 8vw, 120px) max(32px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: .04em;
  color: rgba(232, 220, 200, .72);
}
.site-footer p { margin: 0 auto 12px; max-width: 40rem; text-wrap: balance; }
.site-footer .ai-line { color: var(--bone); }
.site-footer .legal { margin-bottom: 0; letter-spacing: .16em; font-size: 12px; }
.site-footer .copyright { margin-right: 18px; }
.site-footer a { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(243, 201, 139, .4); padding: 12px 0; display: inline-block; }
.site-footer a:hover { text-decoration-color: var(--gold); }
.site-footer a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- The "You're on the list" page. ---------- */
.confirmed {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 96px 24px;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 106, 16, .12), rgba(5, 3, 2, 0) 62%), var(--black);
}
.confirmed h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(28px, 4.2vw, 56px);
  line-height: 1.25;
  letter-spacing: .08em;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255, 106, 16, .38);
  text-wrap: balance;
}
.confirmed p {
  margin: clamp(16px, 3vh, 26px) 0 clamp(28px, 5vh, 44px);
  max-width: 30rem;
  font-size: clamp(16px, 1.2vw + 10px, 20px);
  line-height: 1.7;
  letter-spacing: .02em;
  color: var(--bone);
  text-wrap: balance;
}
.confirmed .btn { text-decoration: none; }

@media (max-width: 700px) {
  .site-footer .copyright { display: block; margin: 0 0 4px; }
  .story-text { text-align: left; }
  .story-text p { text-wrap: pretty; }
}

@media (prefers-reduced-motion: reduce) {
  .story-bg img { animation: none; transform: scale(1.04); will-change: auto; }
  #lightbox { animation: none; }
  .still, .still img { transition: none; }
}
