/* ── RESET & ROOT ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #0D1B2A;
  --white:   #FFFFFF;
  --yg:      #CDE51D;
  --gold:    #C9A84C;
  --cool-wh: #E8EDF2;
  --mid:     #5A6270;
  --border:  rgba(13, 27, 42, 0.08);
  --font-d:  'Hanken Grotesk', sans-serif;
  --font-b:  'Instrument Sans', sans-serif;
}

html { scroll-behavior: auto; }

body {
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-b);
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* ── LOADER ─────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 9999;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.loader-brand {
  font-family: var(--font-b);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: var(--navy);
}

#loader-bar {
  width: 180px; height: 1px;
  background: var(--cool-wh);
  overflow: hidden;
}

#loader-fill {
  height: 100%; width: 0%;
  background: var(--yg);
  transition: width 0.1s linear;
}

#loader-percent {
  font-family: var(--font-d);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--mid);
}


/* ── HERO ───────────────────────────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6vw;
  background: var(--white);
}

.hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.hero-label {
  font-family: var(--font-b);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
  opacity: 0;
}

.hero-heading {
  font-family: var(--font-d);
  font-size: clamp(4.5rem, 12vw, 11rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.06em;
}

.word { display: block; overflow: hidden; }

.word-inner {
  display: block;
  transform: translateY(110%);
}

.hero-sub {
  font-family: var(--font-b);
  font-size: clamp(0.95rem, 1.5vw, 1.15rem);
  font-weight: 400;
  color: var(--mid);
  max-width: 36ch;
  text-align: center;
  line-height: 1.6;
  opacity: 0;
}

.hero-scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  margin-top: 1rem;
}

.hero-scroll-cue span {
  font-family: var(--font-b);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--mid);
}

.cue-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--mid) 0%, transparent 100%);
  animation: lineDown 2s ease-in-out infinite;
}

@keyframes lineDown {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  80%  { transform: scaleY(1); opacity: 0; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ── SCROLL SCENE ───────────────────────────────────────────── */
/*
  Desktop:
    - #scroll-scene is 500vh tall, position: relative
    - #canvas-pane is sticky, 100vh, always centred
    - .feature-panel is position: absolute, left/right sides
    - JS sets `top` to midpoint of each feature's scroll range
    - JS animates opacity + translateY via inline style

  Mobile (≤768px):
    - Same scroll-scene height
    - canvas-pane is sticky, 50vh (top half of viewport)
    - feature panels are full-width, appearing below the canvas
    - JS offsets panel `top` by +50vh so text lands in bottom half
*/

#scroll-scene {
  position: relative;
  height: 500vh;
}

/* ── CANVAS PANE ─────────────────────────────────────────────── */
#canvas-pane {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

#canvas {
  /* Sized to leave room for side text on desktop.
     The video is 768×512 (3:2). We constrain so it sits in the
     central ~44% of viewport width, vertically centred. */
  display: block;
  width: min(44vw, calc(85vh * 1.5));
  height: auto;
  aspect-ratio: 3 / 2;
  background: var(--white); /* matches page */
}

/* ── FEATURE DOTS ────────────────────────────────────────────── */
#feature-dots {
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  pointer-events: all;
  z-index: 10;
}

.fdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid rgba(13,27,42,0.3);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.fdot.active {
  background: var(--navy);
  border-color: var(--navy);
  transform: scale(1.4);
}

/* ── FEATURE PANELS ──────────────────────────────────────────── */
.feature-panel {
  position: absolute;
  /* top set by JS */
  opacity: 0;               /* start hidden; JS animates */
  will-change: opacity, transform;
  z-index: 5;
  pointer-events: none;     /* scroll clicks pass through */
}

.feature-panel.side-left {
  left: 3vw;
  width: min(26vw, 360px);
}

.feature-panel.side-right {
  right: 3vw;
  width: min(26vw, 360px);
  left: auto;
}

/* ── FEATURE PANEL INNER CONTENT ──────────────────────────────── */
.fp-inner {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.fp-label {
  font-family: var(--font-b);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.fp-heading {
  font-family: var(--font-d);
  font-size: clamp(1.7rem, 2.2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--navy);
}

.fp-body {
  font-family: var(--font-b);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.72;
  max-width: 38ch;
}

/* Stat block (Feature 1) */
.fp-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--gold);
  background: rgba(201,168,76,0.06);
  border-radius: 0 4px 4px 0;
  margin-top: 0.4rem;
}

.fp-stat-num {
  font-family: var(--font-d);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  white-space: nowrap;
}

.fp-stat-num sup {
  font-size: 1.2rem;
  font-weight: 700;
  vertical-align: super;
}

.fp-stat-label {
  font-family: var(--font-b);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--mid);
  line-height: 1.45;
}

/* Tag list (Feature 2) */
.fp-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.fp-tag {
  font-family: var(--font-b);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  padding: 0.35rem 0.8rem;
  border: 1.5px solid rgba(13,27,42,0.18);
  border-radius: 2px;
}

/* Spec list (Feature 3) */
.fp-spec-list {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.6rem;
}

.fp-spec {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fp-spec-val {
  font-family: var(--font-d);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.fp-spec-key {
  font-family: var(--font-b);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--mid);
  letter-spacing: 0.05em;
  line-height: 1.3;
}

/* ── MARQUEE ─────────────────────────────────────────────────── */
.marquee-wrap {
  overflow: hidden;
  padding: 1.6rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}

.marquee-text {
  font-family: var(--font-b);
  font-size: clamp(1.3rem, 3vw, 2.6rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.1;
  flex-shrink: 0;
  white-space: nowrap;
}


/* ── MOBILE ──────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Canvas takes top ~50vh on mobile */
  #canvas-pane {
    height: 52vh;
    align-items: flex-start;
    padding-top: 4rem; /* below nav */
  }

  #canvas {
    /* Full width on mobile, constrained by 3:2 ratio */
    width: min(90vw, calc(48vh * 1.5));
  }

  #feature-dots {
    right: 1.2rem;
    top: 26vh; /* centre within canvas area */
  }

  /*
    Feature panels on mobile: full-width, appear below canvas.
    JS will add 50vh to their `top` value so they sit in the
    bottom half of the viewport when their scroll range is active.
  */
  .feature-panel,
  .feature-panel.side-left,
  .feature-panel.side-right {
    left: 6vw !important;
    right: 6vw !important;
    width: 88vw !important;
    text-align: left;
  }

  .fp-heading {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .fp-body {
    max-width: 100%;
  }

  #hero {
    padding-top: 0;
  }

  .hero-heading {
    font-size: clamp(3.5rem, 15vw, 6rem);
  }

  .cta-heading {
    font-size: clamp(2.8rem, 11vw, 4rem);
  }

  .marquee-text {
    font-size: clamp(1.1rem, 5vw, 1.8rem);
  }
}
