/* ============================================================================
   Good Boys Group — scroll-driven landing
   ========================================================================== */

/* ---- Reset + tokens ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: auto; background: #0a0a0a; }
body {
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  color: #f5f0e8;
  background: #0a0a0a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

:root {
  --wine-red: #72031E;
  --ocean-blue: #13374D;
  --sand: #E3AA85;
  --tennis-green: #315B35;
  --black: #0a0a0a;
  --cream: #f5f0e8;
  /* Apple-style: snappy on impact, glides to rest. Shorter durations
     and tighter ease-out feel more refined than the previous theatrical
     1.4–1.8s curves. */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-clip: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fade: 0.85s;
  --dur-transform: 1s;
  --dur-words: 0.75s;
  --dur-clip: 1s;
}

img { max-width: 100%; display: block; }

/* ---- Hero frame (canvas, drawn by scroll-scrubber.js) ---- */
#hero-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: #0a0a0a;
  will-change: contents;
  display: block;
}

/* ---- Loader ---- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { width: min(280px, 60vw); text-align: center; }
.loader-bar {
  height: 1px;
  background: rgba(245, 240, 232, 0.18);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--cream);
  transition: width 0.2s linear;
}
.loader-label {
  margin-top: 14px;
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.55);
}

/* ---- Layout: sections + sticky containers ---- */
main { position: relative; z-index: 1; }
.section {
  position: relative;
  width: 100%;
  /* each section gets ~170vh — gives the sticky inner 70vh of scroll runway */
  height: 170vh;
}
.section-hero { height: 170vh; }
.section-culture { height: 170vh; }
.section-winners { height: 180vh; }
.section-growing { height: 180vh; }
.section-community { height: 80vh; }
.section-checkin { height: 200vh; }

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

/* ---- Typography ---- */
.headline {
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.98;
  color: var(--cream);
  margin: 0;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.65),
    0 1px 3px rgba(0, 0, 0, 0.7);
  padding: 0.2em 0.3em;
  background: radial-gradient(ellipse 70% 80% at center,
    rgba(0, 0, 0, 0.38) 0%,
    rgba(0, 0, 0, 0.18) 45%,
    rgba(0, 0, 0, 0) 75%);
}
.headline-xl { font-size: clamp(2.25rem, 6.5vw, 5.5rem); }
.headline-lg { font-size: clamp(1.875rem, 5vw, 4.5rem); }

/* ---- Animation system (.fade) ---- */
.fade {
  opacity: 0;
  transition:
    opacity var(--dur-fade) var(--ease-out),
    transform var(--dur-transform) var(--ease-out),
    filter var(--dur-fade) var(--ease-out);
  will-change: opacity, transform, filter;
  filter: blur(6px);
}
/* Apple-style: minimal translate, more reliance on opacity + blur. */
.fade.from-left   { transform: translate3d(-3.5vw, 0, 0); }
.fade.from-right  { transform: translate3d( 3.5vw, 0, 0); }
.fade.from-top    { transform: translate3d(0, -2.5vh, 0); }
.fade.from-bottom { transform: translate3d(0,  2.5vh, 0); }

.fade.in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

.delay-1 { transition-delay: 0.18s; }
.delay-2 { transition-delay: 0.36s; }
.delay-3 { transition-delay: 0.56s; }

/* ---- Word-split system ---- */
.word-split {
  display: inline-block;
  white-space: normal;
}
.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
  /* Slight padding so descenders (like "g", "y") aren't clipped */
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.word {
  display: inline-block;
  transform: translate3d(0, 50%, 0);
  transition:
    transform var(--dur-words) var(--ease-out),
    opacity var(--dur-words) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
  will-change: transform, opacity;
  opacity: 0;
  letter-spacing: -0.03em;
}
.word-split.in .word {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  letter-spacing: -0.02em;
  transition:
    transform var(--dur-words) var(--ease-out),
    opacity 0.5s var(--ease-out),
    letter-spacing 1s var(--ease-out);
}
/* When a word-split is also .fade, suppress the outer blur — the words
   handle the reveal themselves for a cleaner, more layered feel */
.word-split.fade { filter: none !important; }
.word-split.fade.in { filter: none !important; }

/* ---- Section 1: Hero ---- */
.section-hero .sticky { align-items: flex-end; padding-bottom: 6vh; }
.scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.6s ease;
  animation: scroll-bob 2.8s ease-in-out infinite;
}
.scroll-hint.hidden { opacity: 0; pointer-events: none; }
.scroll-hint-label {
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.85);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.scroll-hint-line {
  width: 1px;
  height: 48px;
  background: rgba(245, 240, 232, 0.7);
}
@keyframes scroll-bob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(8px); }
}

/* ---- Section 2: Culture ---- */
.culture-stack {
  display: flex;
  flex-direction: column;
  gap: 0.08em;
  max-width: 86vw;
  text-align: left;
}
.culture-stack .headline:nth-child(2) { align-self: flex-end; text-align: right; }

/* ---- Section 3: Winners ---- */
.winners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4vw;
  width: min(1400px, 92vw);
  margin: 0 auto;
}
.winners-headline { text-align: left; }
.story-card {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  max-width: 38vh;
  margin-left: auto;
  overflow: hidden;
  border-radius: 14px;
  background: #0a0a0a;
  /* Cinematic reveal: clip-path wipes open from center, scales up slightly,
     drop shadow blooms as it settles */
  clip-path: inset(8% 16% 8% 16% round 14px);
  transform: scale(0.94);
  box-shadow: 0 0px 0px rgba(0,0,0,0.0);
  transition:
    clip-path var(--dur-clip) var(--ease-clip),
    transform var(--dur-clip) var(--ease-clip),
    box-shadow var(--dur-clip) var(--ease-clip),
    opacity var(--dur-fade) var(--ease-out),
    filter var(--dur-fade) var(--ease-out);
  will-change: clip-path, transform, box-shadow;
  filter: brightness(0.75) saturate(0.9);
}
/* When the card's parent section is .in, reveal */
.story-card.fade.in {
  clip-path: inset(0% 0% 0% 0% round 14px);
  transform: scale(1);
  filter: brightness(1) saturate(1);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.6),
    0 2px 14px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 1px rgba(245, 240, 232, 0.10);
}
/* Glass: a subtle diagonal highlight pass across the card surface,
   plus a thin translucent border. Sits above the video but below the
   audio-hint pill via z-index. Pointer-events disabled so clicks fall
   through to the card. */
.story-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0)    35%,
    rgba(255, 255, 255, 0)    65%,
    rgba(255, 255, 255, 0.04) 100%
  );
  mix-blend-mode: overlay;
  opacity: 0;
  transition: opacity var(--dur-fade) var(--ease-out);
}
.story-card.fade.in::after { opacity: 1; }
.story-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Audio hint pill (sits over story-card videos) ---- */
.audio-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%) translateY(6px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.42);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--cream);
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.5s var(--ease-out);
}
.audio-hint .audio-hint-icon {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
  opacity: 0.95;
}
.story-card.fade.in .audio-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 0.6s;
}
body.audio-on .audio-hint {
  opacity: 0 !important;
  transition-delay: 0s;
}
@media (max-width: 720px) {
  .audio-hint { font-size: 9px; padding: 7px 12px 7px 10px; bottom: 10px; }
}

/* ---- Section 4: Growing Together ---- */
.growing-grid {
  display: grid;
  grid-template-areas:
    "growing growing growing"
    ".       video   ."
    ".       .       together";
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 2vh 4vw;
  width: min(1400px, 92vw);
  align-items: center;
  justify-items: center;
}
.growing-word-1 { grid-area: growing; justify-self: start; text-align: left; }
.growing-grid .story-card { grid-area: video; max-width: 32vh; margin: 0 auto; }
.growing-word-2 { grid-area: together; justify-self: end; text-align: right; }

/* ---- Section 5: Community ---- */
.section-community .sticky { align-items: flex-end; padding-bottom: 14vh; }
.community-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.16;
  filter: blur(6px) saturate(85%);
  transform: scale(1.08); /* hide blur edge bleed */
}
.community-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at center 70%,
      rgba(10,10,10,0.55) 0%,
      rgba(10,10,10,0.25) 50%,
      rgba(10,10,10,0) 90%),
    linear-gradient(to top,
      rgba(10,10,10,0.55) 0%,
      rgba(10,10,10,0.05) 55%,
      rgba(10,10,10,0) 100%);
  z-index: 1;
}
.community-headline {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 92vw;
}

/* ---- Section 6: Check In ----
   Two layouts:
   - Desktop (>=721px): side-by-side. Phone-shaped video frame on the
     left, brand wordmark + headline + CTA stack on the right.
   - Mobile (<=720px): video as full-bleed background, content overlay
     stacks vertically on top with a subtle scrim for legibility.
   The base .sticky already provides position: sticky; top: 0; height:
   100vh; display: flex — we only need to direct/space children here. */

.checkin-video-frame {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
}
.checkin-bg-video {
  width: 100%;
  height: 100%;
  display: block;
}

.checkin-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.checkin-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}
.checkin-wordmark {
  height: auto;
  display: block;
  filter:
    drop-shadow(0 6px 22px rgba(0,0,0,0.55))
    drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}
.checkin-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* DESKTOP: 2-column. Video left, content right (centered as a stack
   so the wordmark, headline, and CTA all share the same vertical axis
   — consistent alignment reads cleaner than mixing left-aligned text
   with a centered-by-padding wordmark image). */
@media (min-width: 721px) {
  .section-checkin .sticky {
    flex-direction: row;
    gap: 6vw;
    padding: 6vh 6vw;
  }
  .checkin-video-frame {
    aspect-ratio: 9 / 16;
    height: min(82vh, 760px);
    flex-shrink: 0;
    border-radius: 18px;
    box-shadow:
      0 30px 80px rgba(0,0,0,0.55),
      0 0 0 1px rgba(255,255,255,0.06),
      inset 0 1px 0 rgba(255,255,255,0.10);
  }
  .checkin-bg-video {
    object-fit: cover;
    border-radius: inherit;
  }
  .checkin-content {
    align-items: center;
    text-align: center;
    gap: 32px;
    max-width: 460px;
  }
  .checkin-content .headline {
    text-align: center;
    background: none;
    text-shadow: none;
    padding: 0;
    line-height: 1.02;
  }
  .checkin-wordmark {
    width: min(260px, 24vw);
  }
  .checkin-cta { align-items: center; }
  .checkin-scrim { display: none; }
}

/* MOBILE: full-bleed video with overlaid content. */
@media (max-width: 720px) {
  .section-checkin .sticky {
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    padding: 6vh 6vw;
  }
  .checkin-video-frame {
    position: absolute;
    inset: 0;
    z-index: 0;
  }
  .checkin-bg-video {
    object-fit: contain;
  }
  .checkin-scrim {
    background:
      linear-gradient(to bottom,
        rgba(10,10,10,0.7) 0%,
        rgba(10,10,10,0.35) 20%,
        rgba(10,10,10,0.05) 45%,
        rgba(10,10,10,0.40) 80%,
        rgba(10,10,10,0.80) 100%);
  }
  .checkin-content {
    height: 100%;
    align-items: center;
    text-align: center;
    justify-content: space-between;
  }
  .checkin-wordmark { display: none; }
  .checkin-cta {
    align-items: center;
    margin-top: auto;
  }
}
.enter-button {
  display: inline-block;
  font-family: 'Times New Roman', Times, serif;
  text-transform: uppercase;
  letter-spacing: 0.48em;
  font-size: 14px;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(245,240,232,0.75);
  padding: 16px 42px 16px 48px; /* right-biased to balance letter-spacing */
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.enter-button:hover {
  background: var(--cream);
  color: var(--black);
  border-color: var(--cream);
}
.enter-caption {
  display: block;
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  font-size: 10px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(245, 240, 232, 0.6);
  margin-top: -2px;
}
.gift-store-link,
.gift-store-footer {
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: rgba(245,240,232,0.7);
  text-decoration: none;
  border-bottom: 1px solid rgba(245,240,232,0.35);
  padding-bottom: 3px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.gift-store-link:hover,
.gift-store-footer:hover {
  color: var(--cream);
  border-color: var(--cream);
}
.gift-store-footer {
  position: absolute;
  right: 32px;
  bottom: 28px;
  z-index: 3;
}
@media (max-width: 720px) {
  .gift-store-footer { right: 16px; bottom: 18px; font-size: 10px; letter-spacing: 0.26em; }
}

/* ---- Hero brand logo (top of hero, fades out on scroll past first viewport) ---- */
#hero-brand {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.55s ease;
  will-change: opacity;
}
#hero-brand.hidden { opacity: 0; }
.hero-brand-logo {
  width: min(330px, 54vw);
  height: auto;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.55))
          drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  transform-origin: center center;
  animation: hero-logo-entrance 1.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes hero-logo-entrance {
  0%   { transform: scale(0.08); opacity: 0; }
  22%  { opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}
@media (max-width: 720px) {
  #hero-brand { top: 20px; }
  .hero-brand-logo { width: min(240px, 60vw); }
}

/* ---- Gift Store pill (top right) ---- */
.gift-store-pill {
  position: fixed;
  top: 26px;
  right: 32px;
  z-index: 10;
  font-family: 'Times New Roman', Times, 'Liberation Serif', serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(245, 240, 232, 0.24);
  border-radius: 999px;
  padding: 10px 20px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease, background 0.25s ease, border-color 0.25s ease;
}
.gift-store-pill.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.gift-store-pill:hover {
  background: rgba(245, 240, 232, 0.9);
  color: var(--black);
  border-color: var(--cream);
}

/* ---- Progress dots (bottom left) ---- */
.progress-dots {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.progress-dots.visible { opacity: 1; }
.progress-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(245, 240, 232, 0.35);
  transition: background 0.3s ease, transform 0.3s ease;
}
.progress-dots .dot.active {
  background: var(--cream);
  transform: scale(1.6);
}

/* ---- Responsive / mobile tweaks ---- */
@media (max-width: 720px) {
  .section, .section-hero, .section-culture, .section-winners, .section-growing { height: 150vh; }
  .section-community { height: 70vh; }
  .section-checkin { height: 180vh; }

  .headline-xl { font-size: clamp(1.875rem, 9vw, 4rem); }
  .headline-lg { font-size: clamp(1.5rem, 7vw, 3.25rem); }

  .winners-grid { grid-template-columns: 1fr; gap: 3vh; }
  .winners-grid .story-card { max-width: 70vw; margin: 0 auto; }
  .winners-headline { text-align: center; }

  .growing-grid {
    grid-template-areas:
      "growing"
      "video"
      "together";
    grid-template-columns: 1fr;
  }
  .growing-word-1, .growing-word-2 { justify-self: center; text-align: center; }
  .growing-grid .story-card { max-width: 60vw; }

  .gift-store-pill { top: 16px; right: 16px; padding: 8px 16px; font-size: 10px; }
  .progress-dots { left: 16px; bottom: 16px; gap: 10px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .fade, .word {
    transition: opacity 0.4s ease !important;
    transform: none !important;
  }
  .fade.from-left, .fade.from-right, .fade.from-top, .fade.from-bottom { transform: none; }
  .word { transform: none; }
  .scroll-hint { animation: none; }
}
