/* style.css - starter styles for scrollfilm.js (original, BGM / SkyWebAI).
   Default (no JS, or html.sf-still) = stacked readable sections.
   html.sf-live = pinned film with scene cards fading over it. */

:root {
  --ink: #f4f1ea;          /* text on dark film */
  --ink-dark: #15140f;     /* text on bright film stretches */
  --paper: #0d0d0c;        /* page ground */
  --paper-alt: #171613;
  --accent: #e8a33d;
  --muted: rgba(244, 241, 234, 0.72);
  --font-display: Georgia, "Times New Roman", serif;   /* swap for the brand pair */
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --sf-progress: 0;
  --sf-buffered: 0;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); -webkit-text-size-adjust: 100%; }
/* No smooth scroll-behavior: it makes scripted QA scrolls land mid-flight. */
body { margin: 0; font-family: var(--font-ui); line-height: 1.5; overflow-x: hidden; }
img, canvas { display: block; max-width: 100%; }
a { color: inherit; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  color: var(--ink);
  transition: color .3s ease;
}
html:not(.sf-live) .site-head { position: absolute; }   /* still pages: header scrolls away */
.site-head__brand { font-family: var(--font-display); font-size: 20px; text-decoration: none; letter-spacing: .01em; }
.site-head__nav { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 28px); font-size: 14px; }
.site-head__nav a:not(.btn) { text-decoration: none; opacity: .85; }
.site-head__nav a:not(.btn):hover { opacity: 1; text-decoration: underline; }
.sf-bright .site-head { color: var(--ink-dark); }
.sf-meter { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.sf-meter__bar { display: block; height: 100%; width: calc(var(--sf-progress) * 100%); background: var(--accent); }
html:not(.sf-live) .sf-meter { display: none; }

.btn {
  display: inline-block; padding: 12px 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #17120a; font: 600 15px/1.2 var(--font-ui); text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-1px); background: #f2b453; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn--small { padding: 8px 14px; font-size: 13px; }

/* ---------- film layer (live mode only) ---------- */
.sf-backdrop { display: none; }
.sf-live .sf-backdrop { display: block; position: fixed; inset: 0; z-index: 0; background: #000; }
.sf-live .sf-backdrop.is-done { visibility: hidden; }
.sf-backdrop canvas { width: 100%; height: 100%; }
/* A soft shade keeps copy readable on every frame without recolouring the film. */
.sf-backdrop__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 22%),
    linear-gradient(0deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%);
}
.sf-backdrop__buffer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; }
.sf-backdrop__buffer span { display: block; height: 100%; width: calc(var(--sf-buffered) * 100%); background: rgba(255,255,255,.5); transition: width .2s linear; }
.sf-ready .sf-backdrop__buffer { opacity: .5; }

/* ---------- track and scene cards ---------- */
.sf-track { position: relative; z-index: 1; }

/* Default / still: readable stacked sections, one still behind each card. */
.sf-card {
  position: relative; min-height: 88vh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) 72px;
  background-color: var(--paper-alt);
  background-image: linear-gradient(0deg, rgba(0,0,0,.72) 0%, rgba(0,0,0,.15) 60%), var(--card-still, var(--sf-poster, none));
  background-size: cover; background-position: center;
}
.sf-card > * { max-width: 34rem; }
.sf-card[data-place="end"] { align-items: flex-end; text-align: right; }
.sf-card[data-place="middle"] { align-items: center; text-align: center; }
.sf-card__kicker { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sf-card__head { margin: 0 0 12px; font-family: var(--font-display); font-weight: 400; font-size: clamp(34px, 6vw, 76px); line-height: 1.02; letter-spacing: -.01em; }
.sf-card__text { margin: 0; font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); }
.sf-card__action { margin: 20px 0 0; }

/* Live mode: the pin holds every card over the canvas for the whole track. */
.sf-live .sf-track { height: var(--sf-length, 600vh); }
.sf-live .sf-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.sf-live .sf-card {
  position: absolute; inset: 0; min-height: 0; background: none;
  padding: 0 var(--gutter); justify-content: center;
  opacity: 0; pointer-events: none;
  transform: translateY(calc(var(--card-t, 0) * -22px));
  will-change: opacity, transform;
}
.sf-live .sf-card.is-on { pointer-events: auto; }
.sf-live .sf-card--last { justify-content: flex-end; padding-bottom: 14vh; }
/* Text scrim: a local gradient behind the words, not a recolour of the film. */
.sf-live .sf-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 55% at 22% 50%, rgba(0,0,0,.42), rgba(0,0,0,0) 70%);
}
.sf-live .sf-card[data-place="end"]::before { background: radial-gradient(60% 55% at 78% 50%, rgba(0,0,0,.42), rgba(0,0,0,0) 70%); }
.sf-live .sf-card[data-place="middle"]::before { background: radial-gradient(70% 50% at 50% 80%, rgba(0,0,0,.45), rgba(0,0,0,0) 70%); }
.sf-bright.sf-live .sf-card { color: var(--ink-dark); }
.sf-bright.sf-live .sf-card__text, .sf-bright.sf-live .sf-card__kicker { color: rgba(21,20,15,.75); }
.sf-bright.sf-live .sf-card::before { background: radial-gradient(60% 55% at 22% 50%, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); }

/* ---------- normal page below the film ---------- */
.page-block { position: relative; z-index: 2; background: var(--paper); padding: clamp(64px, 10vw, 140px) 0; }
.page-block--alt { background: var(--paper-alt); }
.wrap { width: min(1100px, 100% - 2 * var(--gutter)); margin: 0 auto; }
.page-block h1, .page-block h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(28px, 4vw, 48px); margin: 0 0 16px; }
.page-block p, .page-block li { max-width: 40rem; color: var(--muted); }
.site-foot { position: relative; z-index: 2; background: #000; padding: 28px 0; font-size: 13px; color: var(--muted); }
.site-foot__row { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  .site-head__nav a:not(.btn) { display: none; }
  .sf-card[data-place="end"] { align-items: flex-start; text-align: left; }
  .sf-live .sf-card { justify-content: flex-end; padding-bottom: 16vh; }
  .sf-live .sf-card::before, .sf-live .sf-card[data-place="end"]::before { background: linear-gradient(0deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 55%); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
