/* ═══════════════════════════════════════════════════════════════════════
   BETTORTOKEN — GENESIS · KINETIC CUT (V7)
   SaaS-explainer motion language: kinetic type, floating product panels,
   hard scene cuts, spring easing. One master clock in bt-genesis-kinetic.js.
   ═══════════════════════════════════════════════════════════════════════ */

html.btgk-lock, body.btgk-lock { overflow: hidden !important; height: 100%; }

#btgk {
  position: fixed; inset: 0; z-index: 9999;
  background: #04122B;
  color: #fff;
  font-family: 'Inter', -apple-system, sans-serif;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.9s ease;
  -webkit-font-smoothing: antialiased;
}
#btgk.is-done { opacity: 0; pointer-events: none; }
#btgk[hidden] { display: none; }

/* ---------- ambient background: aurora blobs + faint grid ---------- */
.gk-bg {
  position: absolute; inset: -12%;
  background:
    radial-gradient(42% 46% at 22% 24%, rgba(2,92,189,0.34), transparent 70%),
    radial-gradient(38% 42% at 80% 72%, rgba(14,165,233,0.16), transparent 70%),
    radial-gradient(30% 34% at 68% 18%, var(--gk-accent-glow, rgba(232,201,122,0.10)), transparent 72%),
    linear-gradient(165deg, #04122B 0%, #010B20 100%);
  transition: filter 0.8s ease;
  animation: gk-drift 26s ease-in-out infinite alternate;
}
@keyframes gk-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to   { transform: translate3d(1.5%, 1.2%, 0) scale(1.045); }
}
.gk-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(120,160,220,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,160,220,0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(75% 70% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 70% at 50% 50%, #000 30%, transparent 100%);
}
.gk-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 110% at 50% 50%, transparent 55%, rgba(1,6,18,0.62) 100%);
}
/* full-frame flash on hard cuts */
.gk-cut {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 50%, rgba(232,201,122,0.14), transparent 75%);
  opacity: 0;
}
.gk-cut.pop { animation: gk-cutpop 0.42s ease-out; }
@keyframes gk-cutpop { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- chrome / HUD ---------- */
.gk-brand {
  position: absolute; top: 26px; left: 30px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.34em; color: rgba(255,255,255,0.82); z-index: 6;
}
.gk-tc {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.22em; color: rgba(160,196,255,0.75); z-index: 6;
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
}
.gk-tc .rec { width: 7px; height: 7px; border-radius: 50%; background: #E86A6A; animation: gk-blink 1.4s steps(2) infinite; }
@keyframes gk-blink { 50% { opacity: 0.25; } }
.gk-controls { position: absolute; top: 20px; right: 24px; z-index: 8; display: flex; gap: 10px; }
.gk-btn {
  appearance: none; cursor: pointer;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(255,255,255,0.9);
  background: rgba(6,20,44,0.55); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px; padding: 10px 18px;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.gk-btn:hover, .gk-btn:focus-visible { border-color: #0EA5E9; background: rgba(14,165,233,0.14); transform: translateY(-1px); }
.gk-btn svg { width: 13px; height: 13px; }
.gk-btn[aria-pressed="true"] { border-color: #E8C97A; color: #E8C97A; }
.gk-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.08); z-index: 7; }
.gk-progress i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #0EA5E9, #E8C97A); transform-origin: 0 50%; transform: scaleX(0); }
.gk-hint {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.3em;
  text-transform: uppercase; color: rgba(255,255,255,0.4); z-index: 6;
}

/* ---------- scene machinery ---------- */
.gk-stage { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; perspective: 1300px; }
.gk-scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 72px 6vw; gap: 22px;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.gk-scene.is-in { opacity: 1; visibility: visible; }
.gk-scene.is-out { opacity: 0; visibility: hidden; transition: opacity 0.22s ease-in; }
.gk-scene.is-in .kt-w,
.gk-scene.is-in .gk-rise,
.gk-scene.is-in .gk-panel,
.gk-scene.is-in .gk-pop { animation-play-state: running; }

/* kinetic type: each word snaps in — scale/blur/rise with spring */
.gk-h,
#btgk h2 {
  color: #fff; /* the site's global h2 rule sets ink — force white on the ink-blue overlay */
}
.gk-h {
  font-family: 'Inter', sans-serif; font-weight: 700;
  font-size: clamp(34px, 5.6vw, 72px); line-height: 1.06; letter-spacing: -0.028em;
  max-width: 1060px; margin: 0;
}
.gk-h em {
  font-family: 'Cormorant Garamond', Georgia, serif; font-style: italic; font-weight: 500;
  color: #E8C97A; letter-spacing: -0.01em; font-size: 1.06em;
}
.kt-w {
  display: inline-block; white-space: pre;
  opacity: 0; transform: translateY(0.55em) scale(1.12); filter: blur(7px);
  animation: gk-word 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-play-state: paused;
  animation-delay: var(--d, 0ms);
  will-change: transform, filter, opacity;
}
@keyframes gk-word {
  60% { filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.gk-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: clamp(10px, 1.1vw, 12px);
  letter-spacing: 0.34em; text-transform: uppercase; color: #E8C97A;
}
.gk-sub {
  font-size: clamp(14px, 1.6vw, 19px); font-weight: 400; color: rgba(255,255,255,0.72);
  max-width: 720px; line-height: 1.55;
}
.gk-sub strong { color: #fff; font-weight: 600; }
.gk-mono {
  font-family: 'JetBrains Mono', monospace; font-size: clamp(10px, 1.15vw, 12.5px);
  letter-spacing: 0.24em; text-transform: uppercase; color: rgba(160,196,255,0.8);
}
.gk-rise {
  opacity: 0; transform: translateY(26px);
  animation: gk-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-play-state: paused; animation-delay: var(--d, 0ms);
}
@keyframes gk-rise { to { opacity: 1; transform: translateY(0); } }
.gk-pop {
  opacity: 0; transform: scale(0.6);
  animation: gk-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-play-state: paused; animation-delay: var(--d, 0ms);
}
@keyframes gk-pop { to { opacity: 1; transform: scale(1); } }

/* MEGA type for The Turn */
.gk-mega {
  font-weight: 800; letter-spacing: -0.04em; line-height: 0.94;
  font-size: clamp(56px, 11.5vw, 152px);
  display: flex; flex-direction: column; align-items: center;
}
.gk-mega .gold {
  background: linear-gradient(95deg, #E8C97A 10%, #FFF0C8 45%, #B38E5D 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: gk-sheen 2.6s ease-in-out infinite;
}
@keyframes gk-sheen { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

/* ---------- floating product panels (the SaaS-explainer signature) ---------- */
.gk-panelrow { display: flex; gap: clamp(12px, 2vw, 26px); justify-content: center; flex-wrap: wrap; }
.gk-panel {
  position: relative;
  background: linear-gradient(160deg, rgba(255,255,255,0.085), rgba(255,255,255,0.028));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 20px 24px;
  min-width: clamp(150px, 17vw, 230px);
  text-align: left;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 28px 60px -28px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.1);
  opacity: 0; transform: perspective(1200px) rotateX(24deg) translateY(56px) scale(0.92);
  animation: gk-panel 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-play-state: paused; animation-delay: var(--d, 0ms);
  will-change: transform, opacity;
}
@keyframes gk-panel { to { opacity: 1; transform: perspective(1200px) rotateX(0) translateY(0) scale(1); } }
.gk-panel.gold-edge { border-color: rgba(232,201,122,0.4); }
.gk-panel .t {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.26em;
  text-transform: uppercase; color: rgba(255,255,255,0.55); margin-bottom: 10px;
}
.gk-panel .v { color: #fff; font-size: clamp(19px, 2.3vw, 27px); font-weight: 700; letter-spacing: -0.02em; }
.gk-panel .m { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: rgba(160,196,255,0.75); margin-top: 8px; letter-spacing: 0.08em; }
/* grey "old world" variant + its exit */
.gk-panel.grey { filter: saturate(0.15) brightness(0.86); }
#btgk .gk-scene.drop-panels .gk-panel {
  animation: gk-drop 0.55s cubic-bezier(0.5, 0, 0.9, 0.4) forwards;
  animation-delay: calc(var(--d, 0ms) * 0.4);
}
@keyframes gk-drop {
  to { opacity: 0; transform: perspective(1200px) rotateX(-26deg) rotate(var(--rot, -5deg)) translateY(46vh) scale(0.9); }
}
.gk-spark { display: block; margin-top: 12px; width: 100%; height: 26px; }
.gk-spark path { fill: none; stroke: rgba(255,255,255,0.5); stroke-width: 1.6; }

/* CHUNKER engine card */
.gk-engine {
  width: min(560px, 88vw); text-align: left;
  background: linear-gradient(165deg, rgba(6,24,52,0.92), rgba(2,12,30,0.9));
  border: 1px solid rgba(14,165,233,0.35); border-radius: 16px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,0.85), 0 0 0 1px rgba(14,165,233,0.08), 0 0 44px -8px rgba(14,165,233,0.25);
  overflow: hidden;
}
.gk-engine .hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,0.09);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
}
.gk-engine .hd .dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; box-shadow: 0 0 10px #34D399; display: inline-block; margin-right: 9px; }
.gk-engine .bd { padding: 16px 18px 18px; display: grid; gap: 11px; }
.gk-engine .row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'JetBrains Mono', monospace; font-size: clamp(11px, 1.3vw, 13px);
  color: rgba(210,228,255,0.9); letter-spacing: 0.06em;
}
.gk-engine .row .ok { color: #34D399; }
.gk-engine .bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden; margin-top: 4px; }
.gk-engine .bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #0EA5E9, #E8C97A); transition: width 1.3s cubic-bezier(0.16, 1, 0.3, 1); }

/* discipline counter */
.gk-counter {
  color: #fff;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum';
  font-weight: 800; letter-spacing: -0.04em; line-height: 1;
  font-size: clamp(72px, 15vw, 190px);
}
.gk-counter .to3 { color: #E8C97A; }
.gk-counter .of { font-size: 0.22em; font-weight: 500; color: rgba(255,255,255,0.6); letter-spacing: 0.02em; margin: 0 0.35em; vertical-align: 0.5em; }

/* token mint */
.gk-token { position: relative; width: clamp(120px, 16vw, 172px); height: clamp(120px, 16vw, 172px); display: grid; place-items: center; }
.gk-token .hex { width: 100%; height: 100%; }
.gk-token .hex path { fill: rgba(232,201,122,0.06); stroke: #E8C97A; stroke-width: 2; }
.gk-token .core {
  position: absolute; font-family: 'JetBrains Mono', monospace; font-weight: 500;
  font-size: clamp(15px, 1.8vw, 20px); letter-spacing: 0.18em; color: #E8C97A;
}
.gk-token .ring { position: absolute; inset: -14%; border: 1px solid rgba(232,201,122,0.5); border-radius: 50%; animation: gk-ring 1.7s ease-out infinite; }
.gk-token .ring.r2 { animation-delay: 0.55s; }
@keyframes gk-ring { from { transform: scale(0.62); opacity: 0.9; } to { transform: scale(1.22); opacity: 0; } }

/* correlation chart */
.gk-chart { width: min(620px, 88vw); height: clamp(120px, 20vh, 190px); }
.gk-chart path { fill: none; stroke-width: 2; stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.gk-scene.is-in .gk-chart path { animation: gk-draw 1.9s cubic-bezier(0.3, 0, 0.2, 1) forwards; }
.gk-chart .mkt { stroke: rgba(150,165,185,0.65); }
.gk-chart .spt { stroke: #E8C97A; animation-delay: 0.35s !important; }
@keyframes gk-draw { to { stroke-dashoffset: 0; } }
.gk-rho {
  font-family: 'JetBrains Mono', monospace; font-size: clamp(11px, 1.3vw, 14px); letter-spacing: 0.2em;
  color: #010B20; background: #E8C97A; border-radius: 999px; padding: 8px 18px; font-weight: 600;
}

/* the turn: athlete arc + tracking brackets */
.gk-arc { position: absolute; inset: 0; pointer-events: none; opacity: 0.85; }
.gk-arc path { fill: none; stroke: rgba(232,201,122,0.75); stroke-width: 1.6; stroke-dasharray: 900; stroke-dashoffset: 900; }
.gk-scene.is-in .gk-arc path { animation: gk-draw 1.6s ease-out 0.25s forwards; }
.gk-arc circle { fill: #E8C97A; opacity: 0; }
.gk-scene.is-in .gk-arc circle { animation: gk-pop 0.4s ease-out 1.55s forwards; }
.gk-brackets { position: absolute; width: clamp(200px, 30vw, 380px); height: clamp(140px, 22vw, 260px); pointer-events: none; }
.gk-brackets i { position: absolute; width: 26px; height: 26px; border: 2px solid rgba(160,196,255,0.7); }
.gk-brackets i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.gk-brackets i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.gk-brackets i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.gk-brackets i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.gk-scene.is-in .gk-brackets { animation: gk-track 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes gk-track { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* finale */
.gk-wordmark { width: clamp(220px, 26vw, 340px); height: auto; }
.gk-ctarow { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.gk-cta {
  font-family: 'Inter', sans-serif; font-size: 14.5px; font-weight: 600; letter-spacing: 0.01em;
  padding: 14px 26px; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.2s ease;
}
.gk-cta:hover, .gk-cta:focus-visible { transform: translateY(-2px); }
.gk-cta.gold { background: linear-gradient(120deg, #E8C97A, #C9A25C); color: #071022; box-shadow: 0 14px 34px -12px rgba(232,201,122,0.55); }
.gk-cta.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.gk-cta.ghost:hover { border-color: #0EA5E9; background: rgba(14,165,233,0.12); }
.gk-cred {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.26em;
  text-transform: uppercase; color: rgba(255,255,255,0.45); margin-top: 14px;
}

/* reduced-motion poster */
.gk-poster { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 0 6vw; z-index: 5; }
#btgk.is-poster .gk-poster { display: flex; }
#btgk.is-poster .gk-stage, #btgk.is-poster .gk-hint, #btgk.is-poster .gk-tc { display: none; }

.gk-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .gk-scene { padding: 84px 6vw 96px; gap: 16px; }
  .gk-brand { left: 20px; }
  .gk-tc { display: none; }
  .gk-panelrow { gap: 10px; }
  .gk-panel { padding: 14px 16px; min-width: 128px; }
  .gk-hint { bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gk-bg, .gk-token .ring { animation: none !important; }
}

/* ---------- V8 "Alive": FX canvas, camera stage, shake, float ---------- */
.gk-fx {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 2;
}
.gk-stage { z-index: 3; transform-origin: 50% 46%; will-change: transform; }
@keyframes gk-shakekf {
  0%,100% { translate: 0 0; }
  20% { translate: -7px 4px; }
  40% { translate: 6px -5px; }
  60% { translate: -4px -3px; }
  80% { translate: 3px 4px; }
}
.gk-stage.gk-shake { animation: gk-shakekf 0.34s linear; }
/* gentle float for panels/cards after their entrance settles */
@keyframes gk-floatkf {
  0%,100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}
.gk-scene.is-in .gk-floaty { animation-name: gk-panel, gk-floatkf; animation-duration: 0.7s, 6s;
  animation-timing-function: cubic-bezier(0.16,1,0.3,1), ease-in-out;
  animation-delay: var(--d, 0ms), calc(var(--d, 0ms) + 1100ms);
  animation-iteration-count: 1, infinite; animation-fill-mode: forwards, none;
}
.gk-scene.is-in .gk-engine.gk-floaty { animation-name: gk-pop, gk-floatkf; }
@media (prefers-reduced-motion: reduce) {
  .gk-stage.gk-shake, .gk-scene.is-in .gk-floaty { animation: none !important; }
}

/* ---------- V9 3D Cinema ---------- */
.gk-3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
#btgk.gk-3d .gk-fx { display: none; } /* 3D replaces the 2D FX layer */
#btgk.gk-3d .gk-grid { opacity: 0.22; }
/* bulletproof contrast: never allow the site's ink heading color inside the overlay */
#btgk h2, #btgk .gk-h, #btgk .gk-counter, #btgk .kt-w { color: #fff !important; }
#btgk .gk-h em, #btgk .kt-w em { color: #E8C97A !important; }
#btgk .gk-mega .gold { -webkit-text-fill-color: transparent; }
#btgk .gk-counter .to3 { color: #E8C97A !important; }
