/* ============================================================
   FORMULA BREAKER — dark-mode adaptation of the Highdive system.
   Brand inks: Orange #FF3014, Cream #F4EFE5, Black #0A0A0A.
   No gradients. Flat, editorial, hairline strokes.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap");

@font-face {
  font-family: "ABC Gravity";
  src: url("../assets/fonts/ABCGravity-Compressed-Trial.otf") format("opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "SAA Series";
  src: url("../assets/fonts/SAASeriesW01-BD.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --hd-orange:     #FF3014;
  --hd-orange-ink: #E62200;
  --hd-cream:      #F4EFE5;
  --hd-black:      #0A0A0A;

  /* dark-mode surfaces */
  --ink-0:  #0A0A0A;   /* page */
  --ink-1:  #121211;   /* raised block */
  --ink-2:  #1A1A18;   /* card */

  /* text on dark */
  --fg-1:   #F4EFE5;            /* primary cream */
  --fg-2:   rgba(244,239,229,0.62);
  --fg-3:   rgba(244,239,229,0.40);
  --accent: #FF3014;

  --line:        rgba(244,239,229,0.16);
  --line-strong: rgba(244,239,229,0.30);

  --font-display: "ABC Gravity", "Anton", "Impact", sans-serif;
  --font-sans:    "SAA Series", "DM Sans", system-ui, sans-serif;
  --font-body:    "DM Sans", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur: 220ms;

  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px;
  --sp-6:32px; --sp-7:48px; --sp-8:64px; --sp-9:96px; --sp-10:128px;
}

.fb-display {
  font-family: var(--font-display);
  text-transform: uppercase;
  line-height: 0.84;
  letter-spacing: -0.01em;
  font-weight: 900;
}
.fb-eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.20em;
  line-height: 1;
}
.fb-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--fg-2);
}

/* ============================================================
   Page styles (extracted from the prototype <style> block).
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--ink-0); color: var(--fg-1); font-family: var(--font-body); }
::selection { background: var(--hd-orange); color: #fff; }

/* ---- scroll progress ---- */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0%; background: var(--accent); z-index: 60; transition: width 90ms linear; }

/* ---- top bar ---- */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(10,10,10,0.82); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.topbar .wm { height: 17px; display: block; }
.topbar .right { color: var(--fg-3); }
.topbar .cta { color: var(--fg-1); text-decoration: none; transition: color var(--dur) var(--ease-out); }
.topbar .cta .cta-arw { color: var(--accent); }
.topbar .cta:hover { color: var(--accent); }

/* ---- floating section index ---- */
.index { position: fixed; top: 50%; right: 22px; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 2px; }
.index a { display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  text-decoration: none; color: var(--fg-3); padding: 3px 0; transition: color var(--dur) var(--ease-out); }
.index a .lbl { font-family: var(--font-body); font-size: 11px; letter-spacing: 0.04em;
  opacity: 0; transform: translateX(6px); transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out); white-space: nowrap; }
.index a .dot { width: 22px; height: 2px; background: currentColor; flex: none; }
.index a:hover, .index a.active { color: var(--fg-1); }
.index a:hover .lbl { opacity: 1; transform: none; }
.index a.active { color: var(--accent); }
.index a.active .dot { width: 34px; }
.index a.active .lbl { opacity: 1; transform: none; }
@media (max-width: 1180px) { .index { display: none; } }

/* ---- hero ---- */
.hero { position: relative; min-height: 94vh; padding: 120px 7vw 80px;
  display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hero > *:not(.diver) { position: relative; z-index: 2; }
.hero h1 { font-family: var(--font-display); text-transform: uppercase; font-weight: 900;
  line-height: 0.82; letter-spacing: -0.01em; margin: 0; font-size: clamp(78px, 15vw, 240px); }
.hero h1 .br { color: var(--accent); display: block; }
.hero .lead { max-width: 620px; margin: 40px 0 0; font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55; color: var(--fg-2); }
.hero .lead strong { color: var(--fg-1); font-weight: 600; }
.hero .diver { position: absolute; right: -3vw; bottom: 4vh; width: clamp(340px, 46vw, 640px);
  height: auto; opacity: 0.92; pointer-events: none; user-select: none; z-index: 0; }
@media (max-width: 920px) { .hero .diver { width: 64vw; right: -8vw; bottom: 3vh; opacity: 0.38; } }

/* ---- category section (Cinematic Split) ---- */
.cat { display: grid; grid-template-columns: 42% 58%;
  border-top: 1px solid var(--line); }
.cat .left { background: var(--ink-1); padding: clamp(48px, 6vw, 96px) clamp(36px, 4vw, 64px);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.cat .name { font-family: var(--font-display); text-transform: uppercase; font-weight: 900;
  line-height: 0.82; letter-spacing: -0.01em; font-size: clamp(56px, 6.5vw, 104px); margin: 0; }
.cat .lead { font-family: var(--font-body); font-weight: 500; font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.4; color: var(--fg-1); margin: 26px 0 36px; max-width: 30ch; }
.cat .stills { display: flex; flex-direction: column; gap: 14px; }

.cat .right { padding: clamp(48px, 6vw, 96px) clamp(36px, 4vw, 72px) clamp(48px, 6vw, 96px) clamp(36px, 4vw, 56px); }
/* the two section labels are one matched pair: THE FORMULA (right) / THE EVIDENCE (left) */
.cat .beats-label, .cat .stills-label {
  color: var(--fg-1);
  font-size: 15px;
  letter-spacing: 0.22em;
}
.cat .beats-label { margin-bottom: 14px; }
.beats { list-style: none; margin: 0; padding: 0; }
.beats li { display: grid; grid-template-columns: 30px 1fr; gap: 20px; align-items: start;
  padding: 26px 0; border-bottom: 1px solid var(--line); }
.beats li:last-child { border-bottom: 0; }
.beats .arw { color: var(--accent); font-size: 20px; line-height: 1.35; font-weight: 700; }
.beats .t { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--fg-1); }
@media (max-width: 860px) {
  .cat { grid-template-columns: 1fr; }
  .cat .left { position: relative; top: 0; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---- stills (production replaces the design-tool image-slot) ---- */
.still { margin: 0; position: relative; overflow: hidden; border: 1px solid var(--line); }
.still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.still[data-yt] { cursor: pointer; }
.still[data-yt]:hover img, .still[data-yt]:focus-visible img { opacity: 0.85; }
.still figcaption { position: absolute; left: 0; bottom: 0; right: 0; padding: 8px 12px;
  background: var(--ink-0); color: var(--fg-2); font-size: 10px; border-top: 1px solid var(--line); }

/* ---- footer / closing band ---- */
.outro { background: var(--accent); color: var(--hd-black); padding: clamp(80px, 12vw, 180px) 7vw;
  text-align: center; }
.outro .k { font-family: var(--font-display); text-transform: uppercase; font-weight: 900;
  line-height: 0.84; letter-spacing: -0.01em; font-size: clamp(56px, 10vw, 150px); margin: 0; }
.outro .sub { font-size: clamp(17px, 2vw, 22px); max-width: 540px; margin: 28px auto 0; line-height: 1.5; font-weight: 500; }
.foot { background: var(--ink-0); padding: 56px 7vw; display: flex; flex-wrap: wrap; gap: 28px;
  align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.foot .stamp { height: 96px; }
.foot .meta { color: var(--fg-3); font-size: 13px; line-height: 1.7; }
.foot .tag { font-family: var(--font-body); color: var(--fg-1); font-size: 15px; }

/* ---- reveal motion (only when JS is active; print & no-JS show content) ---- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
  .js .reveal.in { opacity: 1; transform: none; }
  .js .beats li { opacity: 0; transform: translateY(14px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); }
  .js .beats.in li { opacity: 1; transform: none; }
  .js .beats.in li:nth-child(1){transition-delay:.04s}
  .js .beats.in li:nth-child(2){transition-delay:.10s}
  .js .beats.in li:nth-child(3){transition-delay:.16s}
  .js .beats.in li:nth-child(4){transition-delay:.22s}
  .js .beats.in li:nth-child(5){transition-delay:.28s}
  .js .beats.in li:nth-child(6){transition-delay:.34s}
}
@media print {
  .reveal, .reveal.in, .beats li, .beats.in li { opacity: 1 !important; transform: none !important; }
  .topbar, .index, #progress { display: none !important; }
}

/* ---- lightbox ---- */
#lightbox { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
#lightbox[hidden] { display: none; }
#lightbox .lb-backdrop { position: absolute; inset: 0; background: var(--ink-0); opacity: 0.94; }
#lightbox .lb-panel { position: relative; width: min(960px, 92vw); }
#lightbox .lb-frame { aspect-ratio: 16 / 9; border: 1px solid var(--line-strong); background: var(--ink-1); }
#lightbox .lb-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
#lightbox .lb-cap { color: var(--fg-2); margin: 14px 0 0; }
#lightbox .lb-fallback { color: var(--accent); display: inline-block; margin-top: 10px; text-decoration: none; }
#lightbox .lb-close { position: absolute; top: -44px; right: 0; width: 36px; height: 36px;
  background: none; border: 1px solid var(--line-strong); color: var(--fg-1);
  font-size: 20px; line-height: 1; cursor: pointer; }
#lightbox .lb-close:hover { border-color: var(--accent); color: var(--accent); }

/* ---- beat hover: evidence galleries (mousing a beat swaps the visuals to that formula) ---- */
.cat .stills .still-set { display: none; }
.cat .stills .still-set.active {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cat .still.s-hero { grid-column: 1 / -1; height: 250px; }
.cat .still.s-thumb { height: 92px; }
.cat .still.s-thumb figcaption { padding: 4px 8px; }
.cat .stills .still-set.active .still { animation: fbSetIn 0.18s var(--ease-out); }
@keyframes fbSetIn { from { opacity: 0; } to { opacity: 1; } }
.beats li { transition: background 0.15s var(--ease-out); }
.beats li:hover { background: rgba(244, 239, 229, 0.035); }
.beats li:hover .t { color: var(--fg-1); }
.beats li[data-viz] { cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .cat .stills .still-set.active .still { animation: none; }
}
