/* =====================================================================
   studio.css — the Wacko Gecko Studios chapter + shared scroll effects
   ===================================================================== */

/* metallic masked logo with a slow light sweep */
.metal-mask {
  display: block;
  background: linear-gradient(105deg, #6b6c6e 0%, #b9bbbe 30%, #f4f5f6 45%, #b9bbbe 55%, #7d7e81 75%, #58595b 100%);
  background-size: 260% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-position: center; mask-position: center;
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0% 0; } }

/* ---------- studio hero */
.sh__stage { position: relative; height: 100svh; min-height: 560px; overflow: hidden; display: grid; place-items: center; background: #030406; }
.sh__bg { position: absolute; inset: 0; }
.sh__space { position: absolute; inset: -6%; will-change: transform; }
.sh__stars--a { opacity: .9; animation: starDrift 140s linear infinite; }
.sh__stars--b { opacity: .5; background-size: 520px 520px, 430px 430px, 760px 760px, 380px 380px, 610px 610px, 300px 300px, 470px 470px, 690px 690px; animation: starDrift 220s linear infinite reverse; }
@keyframes starDrift { to { background-position: 340px 120px, 280px -90px, 520px 200px, -240px 140px, 410px -60px, 190px 210px, -300px 80px, 460px -150px; } }
.sh__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; opacity: 0; transition: opacity 3s; filter: saturate(.6) brightness(.8); }
.sh__video.is-playing { opacity: .55; }
.sh__nebula {
  position: absolute; inset: 0; mix-blend-mode: screen; opacity: .8;
  background:
    radial-gradient(40% 35% at 22% 30%, rgba(120, 100, 200, .22), transparent 70%),
    radial-gradient(35% 40% at 80% 70%, rgba(60, 150, 210, .16), transparent 70%),
    radial-gradient(30% 25% at 60% 18%, rgba(255, 140, 60, .08), transparent 70%);
  animation: nebula 26s ease-in-out infinite alternate;
}
@keyframes nebula { to { transform: scale(1.12) translate(2%, -1%); opacity: .95; } }
.sh__planet {
  position: absolute; right: -14vmin; bottom: -34vmin; width: 92vmin; max-width: none; aspect-ratio: 1; object-fit: cover; mix-blend-mode: screen; opacity: .85;
  -webkit-mask-image: radial-gradient(closest-side, #000 84%, transparent 100%); mask-image: radial-gradient(closest-side, #000 84%, transparent 100%);
  animation: planetSpin 160s linear infinite; will-change: transform;
}
@keyframes planetSpin { to { rotate: 360deg; } }
.sh__dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sh__center { position: relative; z-index: 2; display: grid; justify-items: center; gap: clamp(18px, 3vh, 30px); text-align: center; padding: 0 var(--gutter); will-change: transform; }
.sh__emblem { position: relative; width: clamp(170px, 26vmin, 290px); aspect-ratio: 1; display: grid; place-items: center; }
.sh__ring { position: absolute; inset: -18%; width: 136%; height: 136%; max-width: none; overflow: visible; }
.sh__ring-outer { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 1; }
.sh__ring-dash { fill: none; stroke: rgba(255,255,255,.22); stroke-width: 1; stroke-dasharray: 2 10; transform-origin: 200px 200px; animation: spin 90s linear infinite; }
.sh__orbiter { transform-origin: 200px 200px; animation: spin 14s linear infinite; }
.sh__orbiter circle { fill: var(--ignite); filter: drop-shadow(0 0 6px var(--ignite)); }
.sh__mark { width: 78%; aspect-ratio: 900 / 934; -webkit-mask-image: url(../assets/img/brand/logo-white-icon.png); mask-image: url(../assets/img/brand/logo-white-icon.png); filter: drop-shadow(0 10px 40px rgba(0,0,0,.6)); }
.sh__word { margin: 0; }
.sh__wordmark { width: clamp(260px, 44vw, 620px); aspect-ratio: 1400 / 288; -webkit-mask-image: url(../assets/img/brand/logo-white-wordmark.png); mask-image: url(../assets/img/brand/logo-white-wordmark.png); animation-delay: -2s; }
.sh__tag { font-size: clamp(1rem, 1.5vw, 1.3rem); font-weight: 300; color: var(--text-dim); max-width: 34ch; }
.sh__tag em { font-style: normal; color: var(--text); }
.sh__corners { position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(24px, 4vh, 40px); display: flex; justify-content: space-between; gap: 16px; }
.sh__now { display: inline-flex; align-items: center; gap: 10px; }
.sh__cue { position: absolute; z-index: 2; left: 50%; bottom: clamp(70px, 10vh, 110px); transform: translateX(-50%); }
.sh__cue .cue { gap: 12px; }
@media (max-width: 700px) {
  .sh__corners { flex-direction: column; align-items: flex-start; }
  .sh__cue { display: none; }
  .sh__planet { width: 120vmin; right: -40vmin; bottom: -50vmin; }
}

/* ---------- manifesto (words light up while scrolling) */
.about { background: var(--void); }
.about__stage { min-height: 100svh; display: grid; align-content: center; gap: clamp(28px, 5vh, 56px); padding-block: calc(var(--topbar-h) + 40px) 60px; }
.about__text { font-family: var(--f-body); font-weight: 300; font-size: clamp(1.6rem, 3.6vw, 3.6rem); line-height: 1.22; letter-spacing: -0.005em; max-width: 26ch; }
.about__text .w { opacity: .14; transition: opacity .3s linear; }
.about__text .w.is-lit { opacity: 1; }
.about__text em { font-style: normal; color: var(--ignite-hot); }
.about__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; padding-top: 22px; border-top: 1px solid var(--line); max-width: 980px; }

/* ---------- marquee (speed reacts to scroll velocity) */
.marquee { position: relative; overflow: hidden; padding: clamp(18px, 3vh, 34px) 0; border-block: 1px solid var(--line); background: var(--void); }
.marquee__track { display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); width: max-content; will-change: transform; }
.marquee__track span { font-family: var(--f-display); text-transform: uppercase; font-size: clamp(2rem, 6.4vw, 6rem); line-height: 1; letter-spacing: .02em; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.32); white-space: nowrap; }
.marquee__track span:nth-of-type(3n+2) { -webkit-text-stroke: 0; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marquee__track i { font-style: normal; color: var(--ignite); font-size: clamp(1rem, 2vw, 1.8rem); }
.marquee--asa .marquee__track span:nth-of-type(3n+2) { background: linear-gradient(100deg, #ffd8a8, var(--ignite)); -webkit-background-clip: text; background-clip: text; }

/* ---------- principles: sticky stacking cards */
.principles { background: var(--void); padding-block: clamp(100px, 14vh, 160px) clamp(60px, 10vh, 120px); }
.principles__head { margin-bottom: clamp(40px, 7vh, 70px); }
.principles__head h2 { margin-top: 20px; }
.stack-cards { display: grid; gap: 0; }
.scard {
  position: sticky; top: calc(var(--topbar-h) + 24px + var(--i) * 22px);
  display: grid; overflow: hidden; margin-bottom: 8vh;
  min-height: min(72svh, 640px); border: 1px solid var(--line-strong); background: var(--ink-900);
  transform-origin: 50% 0%; will-change: transform, filter;
  box-shadow: 0 -30px 60px rgba(0,0,0,.45);
}
.scard:last-child { margin-bottom: 0; }
@media (min-width: 900px) { .scard { grid-template-columns: 1.15fr .85fr; } }
.scard__media { position: relative; overflow: hidden; min-height: 240px; }
.scard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); will-change: transform; }
.scard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, var(--ink-900)); }
@media (max-width: 899px) { .scard__media::after { background: linear-gradient(0deg, var(--ink-900), transparent 50%); } }
.scard__body { display: grid; align-content: center; gap: 18px; padding: clamp(24px, 4vw, 56px); position: relative; }
.scard__n { color: var(--ignite); font-size: .9rem; letter-spacing: .3em; }
.scard__body p { color: var(--text-dim); font-size: clamp(1rem, 1.15vw, 1.1rem); max-width: 42ch; }

/* ---------- founders */
.founders-sec { background: radial-gradient(60% 50% at 80% 50%, #0d121a 0%, var(--void) 70%); }
.founders-sec__grid { display: grid; gap: clamp(36px, 5vw, 80px); align-items: center; }
@media (min-width: 980px) { .founders-sec__grid { grid-template-columns: 1fr 1fr; } }
.founders-sec__copy { display: grid; gap: 22px; }
.founders-sec__cards { display: grid; gap: 16px; }
.founder { display: flex; align-items: center; gap: 22px; }
.founder__badge { flex: none; width: 72px; height: 72px; display: grid; place-items: center; border: 1px solid var(--line-strong); font-size: .9rem; color: var(--silver-hi); background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.06), transparent 70%); position: relative; }
.founder__badge::after { content: ""; position: absolute; inset: -6px; border: 1px solid var(--line); border-radius: 50%; }
.founder .label { margin-top: 6px; color: var(--ignite); }
.founders-sec__vision { margin-top: 18px; display: grid; gap: 14px; padding-left: 22px; border-left: 1px solid var(--ignite); }
.founders-sec__vision .quote { font-size: clamp(1.1rem, 1.8vw, 1.6rem); }

/* ---------- games */
.games { background: var(--void); }
.games__head { display: grid; gap: 20px; margin-bottom: clamp(36px, 6vh, 64px); }
.games__grid { display: grid; gap: clamp(16px, 2vw, 28px); perspective: 1400px; }
@media (min-width: 980px) { .games__grid { grid-template-columns: 1.6fr 1fr; } }
.gcard { position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden; border: 1px solid var(--line-strong); background: var(--ink-900); transition: border-color .4s; transform-style: preserve-3d; will-change: transform; }
.gcard:hover { border-color: var(--silver); }
.gcard__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.gcard__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s var(--ease-out); }
.gcard--live:hover .gcard__media img { transform: scale(1.0); }
.gcard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--ink-900), transparent 55%); }
.gcard__glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.09), transparent 60%); opacity: 0; transition: opacity .4s; z-index: 2; }
.gcard:hover .gcard__glare { opacity: 1; }
.gcard__body { display: grid; gap: 14px; align-content: start; padding: clamp(20px, 2.6vw, 34px); }
.gcard__body > p:not(.label) { color: var(--text-dim); max-width: 52ch; }
.gcard__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.gcard__cta { justify-self: start; margin-top: 6px; }
.gcard--locked .gcard__media--static { background: #050608; display: grid; place-items: center; }
.gcard__noise { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.gcard__ghost { position: relative; width: 26%; opacity: .1; filter: blur(1px); }
.gcard--locked h3 { color: var(--text-dim); }

/* ---------- featured-game frame on the launch stage (card → full bleed) */
.launch__stage { background: var(--void); }
.launch__frame { position: absolute; inset: 0; overflow: hidden; will-change: clip-path; }
.launch__featured { position: absolute; z-index: 6; left: 0; right: 0; top: calc(var(--topbar-h) + 2vh); display: flex; justify-content: space-between; padding: 0 var(--gutter); pointer-events: none; }

/* ---------- split headings (scroll-scrubbed word rise) */
[data-split] .sw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
[data-split] .sw > span { display: inline-block; will-change: transform; }

/* ---------- parallax images need headroom */
img[data-parallax] { height: 118% !important; top: -9%; position: relative; }

/* ---------- topbar brand hidden over the studio hero (the hero IS the logo) */
.topbar .brand { transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.on-hero .topbar .brand { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.hud, .hud__sys { transition: opacity .6s; }
.chapter-studio .hud, .chapter-studio .hud__sys { opacity: 0 !important; }

/* launch hero: the HUD already carries the countdown */
.launch__count { display: none !important; }
.launch__meta { bottom: clamp(84px, 11vh, 110px); }
@media (max-height: 760px) { .launch__chips { display: none; } .launch__hero { bottom: clamp(100px, 16vh, 150px); } }
@media (max-width: 1000px) { .sh__planet { right: -30vmin; bottom: -44vmin; } }

/* single-column grids must not size their implicit track to max-content (auto-fit children would overflow on phones) */
.about__stage, .playstyles, .research, .research__head, .beyond__after, .games__head, .codex__head, .coop__head,
.planner-head, .founders-sec__copy, .founders-sec__cards, .roadmap__head, .later, .contact__actions, .mode,
.scard__body, .gcard__body, .stack-cards, .games__grid, .founders-sec__grid, .orbit__cols, .studio__hero, .roadmap, .contact { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) {
  .games__grid { grid-template-columns: 1.6fr 1fr; }
  .founders-sec__grid { grid-template-columns: 1fr 1fr; }
  .orbit__cols { grid-template-columns: 1.1fr .9fr; }
  .roadmap { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr auto; }
  .research__head { grid-template-columns: .8fr 1.2fr; }
}
@media (min-width: 900px) { .scard { grid-template-columns: 1.15fr .85fr; } }

/* orbit: homeworld horizon sits behind the headline */
.orbit__img {
  left: 0 !important; right: 0; top: 0 !important; bottom: auto !important; width: 100% !important; height: 115svh !important; max-width: none;
  object-fit: cover; object-position: 60% 70%; transform: none; opacity: .62 !important;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 55%, transparent 100%) !important;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 55%, transparent 100%) !important;
}
.orbit__vid { top: 10svh; bottom: auto !important; height: 90svh !important; }
.orbit .orbit__intro .prose p { text-shadow: 0 1px 18px rgba(0,0,0,.8); }

/* ---------- cursor ring (desktop only; native cursor stays) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 300; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(255,255,255,.45); border-radius: 50%; pointer-events: none;
  display: grid; place-items: center; opacity: 0; transition: opacity .3s, width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), border-color .3s, background .3s;
  mix-blend-mode: difference;
}
.cursor.is-on { opacity: 1; }
.cursor.is-link { width: 56px; height: 56px; margin: -28px 0 0 -28px; border-color: var(--ignite); background: rgba(255,138,42,.08); mix-blend-mode: normal; }
.cursor.is-drag { width: 72px; height: 72px; margin: -36px 0 0 -36px; border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.06); mix-blend-mode: normal; }
.cursor__label { font-family: var(--f-display); font-size: .5rem; letter-spacing: .22em; text-transform: uppercase; color: #fff; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
