/* ============================================================
   Feelscape — pre-launch site
   Design tokens match the app (src/theme/tokens.ts)
   ============================================================ */

:root {
  --bg: #0B0A0E;
  --bg2: #100E15;
  --gold: #E8B864;
  --gold-soft: rgba(232, 184, 100, 0.16);
  --ink: #F4EFE6;
  --muted: #8A8594;
  --muted2: #5E5A68;
  --surface: rgba(255, 255, 255, 0.045);
  --surface2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);

  --serif: "Fraunces", Georgia, serif;
  --sans: "Hanken Grotesk", -apple-system, "Segoe UI", sans-serif;

  /* ============================================================
     ★ FILM GRAIN — dial it up or down here.
       0 = none · 0.10 = whisper · 0.18 = clearly filmic · 0.30 = heavy
     ============================================================ */
  --grain: 0.18;

  /* vintage color grade applied to the hero video + its poster:
     slightly warmer, a touch desaturated, a little more contrast */
  --grade: sepia(0.22) saturate(0.84) contrast(1.07) brightness(0.93);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  background-image: radial-gradient(120% 80% at 50% 0%, #15121c 0%, #0B0A0E 55%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* clip (not hidden) prevents sideways scroll WITHOUT breaking the
     pinned sneak-peek section's position: sticky */
  overflow-x: clip;
}

::selection { background: var(--gold-soft); color: var(--ink); }

.container {
  width: min(1080px, 92vw);
  margin: 0 auto;
}
.container.narrow { width: min(660px, 92vw); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- typography ---------- */

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 18px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; }

h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

em, .gold-it { font-style: italic; color: var(--gold); }

/* ---------- header (floats over the video) ---------- */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 26px max(4vw, 20px) 0;
}
.header-cta {
  background: rgba(11, 10, 14, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(232, 184, 100, 0.35);
  border-radius: 999px;
  padding: 9px 18px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.header-cta:hover { background: var(--gold-soft); border-color: var(--gold); }

/* ---------- full-screen video hero ---------- */

.hero {
  position: relative;
  height: 100vh;   /* fallback for older browsers */
  height: 100svh;  /* fills the visible screen correctly on mobile */
  min-height: 540px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* still image under the video: shows while it loads, if the file is
   missing, and instead of the video for reduced-motion visitors */
.hero-still {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--bg);
  background-image: url("video/hero-poster.jpg"),
    radial-gradient(120% 80% at 50% 30%, #1a1524 0%, #0B0A0E 70%);
  background-size: cover, cover;
  background-position: center, center;
  filter: var(--grade);
}

.hero-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: var(--grade);
}

/* soft darkened edges, like an old lens */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(115% 90% at 50% 45%, transparent 52%, rgba(0, 0, 0, 0.55) 100%);
}

/* animated film grain — intensity lives in --grain at the top of this file */
.hero-grain {
  position: absolute;
  inset: -48px;
  z-index: 3;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  mix-blend-mode: overlay;
  opacity: var(--grain);
  animation: grain-shift 0.8s steps(1) infinite;
}
@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-14px, 9px); }
  20% { transform: translate(16px, -7px); }
  30% { transform: translate(-9px, -16px); }
  40% { transform: translate(11px, 13px); }
  50% { transform: translate(-16px, 5px); }
  60% { transform: translate(13px, -11px); }
  70% { transform: translate(-7px, 16px); }
  80% { transform: translate(9px, -13px); }
  90% { transform: translate(-11px, -9px); }
}

/* dark scrim so the text stays readable over the moving video;
   the bottom fades fully into the page background */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(11, 10, 14, 0.5) 0%, rgba(11, 10, 14, 0) 24%),
    radial-gradient(78% 60% at 50% 52%, rgba(11, 10, 14, 0.62) 0%, rgba(11, 10, 14, 0.28) 45%, rgba(11, 10, 14, 0) 78%),
    linear-gradient(to top, #0B0A0E 0%, rgba(11, 10, 14, 0.45) 16%, rgba(11, 10, 14, 0) 46%);
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 0 max(6vw, 24px);
  max-width: 900px;
}

.hero-wordmark {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 26px;
}

.hero-title {
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: rgba(244, 239, 230, 0.78);
  max-width: 46ch;
  margin: 0 auto;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}
.scroll-cue:hover { color: var(--gold); }
.scroll-cue svg { animation: cue-bob 2.4s ease-in-out infinite; }
@keyframes cue-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================================
   SNEAK PEEK — pinned, scroll-driven, two columns
   Text on the LEFT, a big phone on the RIGHT. The two columns are
   independent (each vertically centered), and the text block has a
   reserved height, so changing text length never moves the phone.
   .peek-stage pins (sticky); whole slides crossfade between beats.
   ============================================================ */

.peek {
  position: relative;
  background: var(--bg);
  /* (beats + 1) screens tall → 'beats' screens of pinned scroll,
     i.e. roughly one viewport of scroll per beat */
  height: calc((var(--beats, 5) + 1) * 100vh);
  height: calc((var(--beats, 5) + 1) * 100svh);
}

.peek-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.peek-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.99);
  transition: opacity 0.8s cubic-bezier(0.22, 0.6, 0.2, 1),
              transform 0.8s cubic-bezier(0.22, 0.6, 0.2, 1);
  pointer-events: none;
  will-change: opacity, transform;
}
.peek-slide.is-active { opacity: 1; transform: none; }

.peek-inner {
  width: min(1180px, 90vw);
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;   /* text block + phone each centered independently */
}

/* LEFT — text. Reserved (min) height + top-anchored title means the
   title sits at a fixed spot no matter how long the description is. */
.peek-text {
  position: relative;
  isolation: isolate;      /* keeps the glow tucked behind this column's text */
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
}
/* soft warm glow behind the words — large, blurred, low opacity */
.peek-text::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -60px -12% -60px -22%;
  background: radial-gradient(52% 56% at 37% 40%,
    rgba(232, 184, 100, 0.17) 0%,
    rgba(232, 184, 100, 0.06) 46%,
    transparent 72%);
  filter: blur(34px);
  pointer-events: none;
}
.peek-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.peek-desc {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 42ch;
}

/* RIGHT — the big phone (image already includes the frame; it floats).
   placeholder + real image are stacked; the real image sits on top. */
.peek-shot {
  display: grid;
  place-items: center;
  height: 100%;
}
.peek-shot > * { grid-area: 1 / 1; }
.peek-shot img {
  height: min(80svh, 880px);
  aspect-ratio: 602 / 1172;   /* a phone shape; crops empty sides if a */
  width: auto;                /* loosely-framed screenshot is dropped in */
  max-width: 100%;
  object-fit: cover;
  object-position: center;
}
.peek-ph {
  height: min(80svh, 880px);
  aspect-ratio: 602 / 1172;
  max-width: 100%;
}
.peek-ph svg { height: 100%; width: 100%; }
.peek-ph-name { font-family: var(--serif); font-size: 40px; fill: var(--gold); }
.peek-ph-tag  { font-family: var(--sans); font-size: 15px; letter-spacing: 0.14em; fill: #5E5A68; }

/* which beat you're on */
.peek-progress {
  position: absolute;
  bottom: clamp(20px, 4.5vh, 42px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 9px;
  z-index: 5;
}
.peek-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.2);
  transition: background 0.5s ease, width 0.5s ease;
}
.peek-dot.is-active { background: var(--gold); width: 22px; }

/* ---------- waitlist form ---------- */

.waitlist-form { max-width: 480px; }
.waitlist-form-center { margin: 0 auto; }

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waitlist-form input {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 18px;
  outline: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.waitlist-form input::placeholder { color: var(--muted2); }
.waitlist-form input:focus {
  border-color: rgba(232, 184, 100, 0.5);
  background: var(--surface2);
}
.waitlist-form input.field-error { border-color: rgba(168, 92, 90, 0.7); }

.waitlist-form button {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1a1408;
  background: var(--gold);
  border: none;
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: box-shadow 0.35s ease, transform 0.35s ease, opacity 0.3s ease;
}
.waitlist-form button:hover {
  box-shadow: 0 0 34px rgba(232, 184, 100, 0.35);
  transform: translateY(-1px);
}
.waitlist-form button:disabled { opacity: 0.6; cursor: wait; transform: none; }

.form-status { min-height: 0; font-size: 14px; color: var(--muted); }
.form-status:not(:empty) { margin-top: 14px; }
.form-status.is-success { color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 17px; }
.form-status.is-error { color: #c98a88; }
.form-status a { color: var(--gold); }

.form-note { margin-top: 12px; font-size: 13px; color: var(--muted2); }

.form-done .form-fields, .form-done .form-note { display: none; }

/* ---------- personal note (over the vinyl record) ---------- */

.note {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 12vh, 140px) 0;
}
.note-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("images/vinyl.jpg") center / cover no-repeat;
}
/* darken for readability + fade the top & bottom edges into the page bg */
.note-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      #0B0A0E 0%,
      rgba(11, 10, 14, 0.55) 14%,
      rgba(11, 10, 14, 0.34) 42%,
      rgba(11, 10, 14, 0.46) 74%,
      #0B0A0E 100%);
}
.note-content { position: relative; z-index: 2; }

.note-intro { text-align: center; margin-bottom: clamp(34px, 5vh, 54px); }
.note-heading {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 18px;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.6);
}
.note-lede {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
  color: rgba(244, 239, 230, 0.74);
  max-width: 54ch;
  margin: 0 auto;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
}

/* frosted-glass card so the note floats on the vinyl and stays readable */
.note-card {
  background: rgba(13, 11, 18, 0.55);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  padding: clamp(32px, 5vw, 56px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.note-card .eyebrow { color: rgba(244, 239, 230, 0.5); }
.note-card p { color: rgba(244, 239, 230, 0.82); margin-bottom: 18px; }
.note-card p:nth-of-type(2) { color: var(--ink); }   /* first body paragraph brightest */
.note-sign {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--gold) !important;
  margin-top: 26px;
  margin-bottom: 0 !important;
}

/* ---------- closing CTA ---------- */

.closing { padding: clamp(90px, 14vh, 160px) 0; text-align: center; }
.closing-title {
  font-size: clamp(32px, 4.6vw, 50px);
  margin-bottom: 36px;
}
.waitlist-form-center .form-fields { margin: 0 auto; max-width: 420px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 14px;
  color: var(--muted2);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}
.site-footer a:hover { color: var(--gold); }

/* ---------- reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1s cubic-bezier(0.22, 0.6, 0.2, 1), transform 1s cubic-bezier(0.22, 0.6, 0.2, 1);
}
.reveal.delay-1 { transition-delay: 0.12s; }
.reveal.delay-2 { transition-delay: 0.24s; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================
   REDUCED MOTION — no pinning, no crossfade. The 5 beats simply
   stack and scroll normally, each with its line above it.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-video { display: none; }     /* the poster still shows instead */
  .hero-grain { animation: none; }   /* grain stays, but stops flickering */
  .scroll-cue svg { animation: none; }

  .peek { height: auto; }
  .peek-stage {
    position: static;
    height: auto;
    display: block;
    overflow: visible;
    padding: clamp(30px, 6vh, 70px) 0;
  }
  .peek-slide {
    position: relative;
    inset: auto;
    opacity: 1;
    transform: none;
    transition: none;
    padding: clamp(40px, 8vh, 90px) 0;
  }
  .peek-inner { height: auto; }
  .peek-progress { display: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  body { font-size: 16px; }

  .waitlist-form { margin: 0 auto; }
  .footer-row { flex-direction: column; text-align: center; }

  /* sneak peek: stack text on top, phone below. Text keeps a reserved
     height so the phone still doesn't shift as the description changes. */
  .peek-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: clamp(18px, 3vh, 30px);
    align-content: center;
    justify-items: center;
    text-align: center;
  }
  .peek-text {
    min-height: 150px;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
  }
  .peek-desc { max-width: 34ch; }
  .peek-shot { height: auto; }
  .peek-shot img,
  .peek-ph { height: min(56svh, 540px); }
  /* center the warm glow behind the now-centered text */
  .peek-text::before {
    inset: -36px -10%;
    background: radial-gradient(58% 52% at 50% 44%,
      rgba(232, 184, 100, 0.16) 0%,
      rgba(232, 184, 100, 0.05) 48%,
      transparent 74%);
  }
}
