/* ============================================================
   Frame Minion — single-page site
   Design foundation: tokens, type, motifs, components
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --deep:       #14101F;   /* page bg */
  --deep-2:     #1A1326;   /* alt section bg */
  --panel:      #241B38;   /* cards / raised */
  --panel-2:    #2A1F3D;   /* raised hover */
  --film-black: #0D0A14;   /* film bands, footer, wells */
  --flame-1:    #FF7A18;
  --flame-2:    #FF3D2E;
  --flame-3:    #E8290B;
  --text:       #F5F3FA;
  --muted:      #A89FC0;
  --muted-2:    #7E7499;
  --hairline:   rgba(255,255,255,0.08);
  --hairline-2: rgba(255,255,255,0.14);

  --flame: linear-gradient(180deg, var(--flame-1) 0%, var(--flame-2) 52%, var(--flame-3) 100%);
  --flame-h: linear-gradient(90deg, var(--flame-1) 0%, var(--flame-3) 100%);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 16px;

  /* sprocket tile — a light rounded hole on a dark band */
  --sprocket-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='30'%3E%3Crect x='8' y='9' width='28' height='12' rx='4' fill='%23E8E4F0'/%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--deep);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* page-wide grain / vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,122,24,0.06), transparent 60%),
    radial-gradient(100% 60% at 100% 110%, rgba(232,41,11,0.05), transparent 55%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); position: relative; z-index: 1; }
section { position: relative; z-index: 1; }
.section-pad { padding-block: clamp(72px, 11vw, 150px); }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--flame-2);
  box-shadow: 0 0 10px 1px rgba(255,61,46,0.7);
}
.eyebrow.no-dot::before { display: none; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }

.h-display {
  font-size: clamp(40px, 7.2vw, 92px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h-section {
  font-size: clamp(30px, 4.6vw, 56px);
  letter-spacing: -0.028em;
}
.h-sub {
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -0.02em;
}

.flame-text {
  background: var(--flame);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: clamp(17px, 1.55vw, 20px);
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-flame {
  background: var(--flame);
  color: #fff;
  box-shadow: 0 6px 24px -6px rgba(255,61,46,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-flame:hover { transform: translateY(-2px); box-shadow: 0 12px 38px -8px rgba(255,61,46,0.75), inset 0 1px 0 rgba(255,255,255,0.3); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--hairline-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.24); transform: translateY(-2px); }
.btn.is-disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: grayscale(.35); }
.btn.is-disabled:hover { transform: none; background: rgba(255,255,255,0.04); border-color: var(--hairline-2); }
.btn .soon {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--hairline-2); border-radius: 5px; padding: 2px 6px; margin-left: 4px;
}
.btn .ico { width: 17px; height: 17px; display: block; }

/* ---------- Chips ---------- */
.chip {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 7px 12px;
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--flame-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }

/* ---------- Sprocket strip ---------- */
.sprockets {
  height: 30px;
  background: var(--film-black);
  background-image: var(--sprocket-tile);
  background-repeat: repeat-x;
  background-position: center;
  border-block: 1px solid rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
}
.sprockets.thin { height: 24px; }

/* ---------- Editor / window chrome ---------- */
.window {
  border-radius: 14px;
  background: #160F22;
  border: 1px solid var(--hairline-2);
  overflow: hidden;
  box-shadow: 0 40px 120px -40px rgba(0,0,0,0.9), 0 0 0 1px rgba(0,0,0,0.4);
}
.window-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 16px;
  background: #0F0A18;
  border-bottom: 1px solid var(--hairline);
}
.traffic { display: flex; gap: 8px; }
.traffic span { width: 12px; height: 12px; border-radius: 50%; background: #3a3348; }
.traffic span:nth-child(1){ background:#ff5f57; } .traffic span:nth-child(2){ background:#febc2e; } .traffic span:nth-child(3){ background:#28c840; }
.window-tab {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 7px;
  border: 1px solid var(--hairline);
  white-space: nowrap;
}
.window-tab .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--flame-2); }
.window-body { background: #1c140f; }
.window-body img { width: 100%; display: block; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 26px;
}
.card-tight { padding: 20px; }

/* panel frame for tall sidebar shots */
.panel-shot {
  border-radius: 14px;
  border: 1px solid var(--hairline-2);
  overflow: hidden;
  background: #1c140f;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,0.8);
}
.panel-shot .panel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 9px;
  padding: 9px 13px;
  background: #0F0A18;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted-2);
}
.panel-shot .panel-bar .pbar-label { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.panel-shot .panel-bar .pdot { width: 8px; height: 8px; border-radius: 2px; background: var(--flame-2); }

/* A/B image switcher inside a panel-shot */
.gtabs { display: inline-flex; gap: 4px; }
.gtab {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em;
  color: var(--muted); background: rgba(255,255,255,0.04);
  border: 1px solid var(--hairline); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.gtab:hover { color: var(--text); }
.gtab.is-active { color: var(--flame-1); background: rgba(255,122,24,0.1); border-color: rgba(255,122,24,0.35); }
.gstage { position: relative; background: #0c0712; }
.gstage .gimg { width: 100%; display: none; }
.gstage .gimg.is-active { display: block; animation: gfade .35s ease; }
@keyframes gfade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce){ .gstage .gimg.is-active { animation: none; } }
/* tall captures: cap height, soft fade to signal more below */
.gstage.tall { max-height: 600px; overflow: hidden; }
.gstage.tall::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70px;
  background: linear-gradient(180deg, transparent, #0c0712);
  pointer-events: none;
}

/* ---------- Clickable stacked deck (multi-shot step) ---------- */
.deck { position: relative; padding: 6px 30px 28px 0; }
.deck-stage { position: relative; transition: height .42s cubic-bezier(.2,.7,.2,1); }
.deck-card {
  position: absolute; top: 0; left: 0; width: 100%;
  transform-origin: top center;
  transition: transform .42s cubic-bezier(.2,.7,.2,1), opacity .35s ease, filter .35s ease;
  cursor: pointer;
}
.deck-card.is-front { z-index: 5; transform: none; opacity: 1; filter: none; }
.deck-card.is-front:hover { transform: translateY(-3px); }
.deck-card.is-2 { z-index: 4; transform: translate(13px,13px) scale(.965) rotate(1.3deg); opacity: .78; filter: brightness(.82); }
.deck-card.is-3 { z-index: 3; transform: translate(25px,24px) scale(.93) rotate(2.4deg); opacity: .5; filter: brightness(.66); }
.deck-card .panel-bar { justify-content: space-between; }
.deck-card .deck-hint { font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; color: var(--muted-2); display: inline-flex; align-items: center; gap: 5px; }
.deck-card.is-front .deck-hint { color: var(--flame-1); opacity: .9; }
.dimg { position: relative; overflow: hidden; background: #0c0712; }
.dimg img { width: 100%; display: block; }
.dimg.cap { max-height: 560px; }
.dimg.cap::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(180deg, transparent, #0c0712); pointer-events: none; }
.deck-dots { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.deck-dots .dd { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline-2); cursor: pointer; transition: background .2s, transform .2s; padding: 0; border: none; }
.deck-dots .dd.is-active { background: var(--flame-2); transform: scale(1.2); box-shadow: 0 0 8px 1px rgba(255,61,46,.5); }
/* floating accent (history indicator) on a deck */
.deck-accent {
  position: absolute; z-index: 6; right: -6px; bottom: 12px; width: 132px;
  border-radius: 12px; overflow: hidden; border: 1px solid var(--hairline-2);
  box-shadow: 0 18px 44px -14px rgba(0,0,0,.85); background: #0c0712;
  pointer-events: none;
}
.deck-accent img { width: 100%; display: block; }
.deck-accent .acc-tag { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 8px; font-family: var(--font-mono); font-size: 9.5px; color: var(--text); background: linear-gradient(180deg, transparent, rgba(12,7,18,.92)); text-align: center; }
@media (max-width: 600px){ .deck-accent { width: 96px; } }

/* fade-masked tall screenshot */
.shot-clip { overflow: hidden; position: relative; }
.shot-clip.fade::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(180deg, transparent, #1c140f);
  pointer-events: none;
}

/* glow wrap */
.glow-wrap { position: relative; }
.glow-wrap::before {
  content: ''; position: absolute; inset: -8% -4%;
  background: radial-gradient(60% 55% at 50% 45%, rgba(255,93,30,0.28), transparent 70%);
  filter: blur(40px); z-index: -1;
}

/* ---------- Reveal animation ----------
   Transition-based (not keyframes): an animation in the `running` state
   overrides the declared opacity with its current frame, so a throttled
   animation clock can freeze content at opacity 0. A transition lets the
   declared `.in` value (opacity:1) govern; the JS backstop additionally
   forces inline visibility with transition disabled — unfreezeable. */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Divider sprocket rail (scroll) ---------- */
.rail {
  position: fixed; top: 0; bottom: 0; width: 26px;
  background: var(--film-black);
  background-image: var(--sprocket-tile);
  background-size: 26px 38px;
  background-repeat: repeat-y;
  background-position: center 0;
  z-index: 30;
  border-inline: 1px solid rgba(0,0,0,0.6);
  opacity: 0.55;
  pointer-events: none;
}
.rail.left { left: 0; }
.rail.right { right: 0; }
@media (max-width: 900px) { .rail { display: none; } }

a:focus-visible, button:focus-visible, .acc-q:focus-visible {
  outline: 2px solid var(--flame-1); outline-offset: 3px; border-radius: 6px;
}
