/* Brodie Labs — site styles */

@font-face {
  font-family: "Unbounded";
  src: url("/static/fonts/unbounded-latin-wght-normal.woff2") format("woff2-variations"),
       url("/static/fonts/unbounded-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --deep: #121A3D;      /* page */
  --panel: #1A2452;     /* raised surfaces */
  --line: #2C3870;      /* rules and outlines */
  --paper: #ECEFF8;     /* primary text */
  --mist: #A9B2D6;      /* secondary text */
  --studio: #5FDCCB;    /* studio accent: the teal in the Brodie Labs mark */
  --ember: #F29B4B;     /* warm accent from the Junkyard Empire planet */
  --game: var(--studio);/* overridden per game */

  --display: "Unbounded", "Inter Display", system-ui, sans-serif;
  --text: "Instrument Sans", "Inter", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --step-4: clamp(2.4rem, 1.4rem + 4.2vw, 4.75rem);

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 76rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--deep);
  color: var(--paper);
  font: 400 var(--step-0)/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--game); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--paper); color: var(--deep); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--mist); }
mark.todo { background: #FFE36E; color: #2A1F00; padding: 0 .3em; border-radius: 3px; font: 600 .85em/1.4 var(--text); }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1rem var(--gutter);
  max-width: none; width: 100%; margin: 0;
  transition: background-color .25s ease, padding .25s ease, backdrop-filter .25s ease;
}
.site-header > * { position: relative; z-index: 2; }
.site-header.is-scrolled {
  padding-block: .6rem;
  background: color-mix(in srgb, var(--deep) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font: 600 1.05rem/1 var(--display); letter-spacing: -0.01em; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; transition: transform .25s ease; }
.is-scrolled .brand-logo { transform: scale(.82); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 12%, var(--studio) 40%, transparent 72%);
  box-shadow: 0 0 0 2px var(--deep), 0 0 0 3px var(--studio);
}
.site-header nav { display: flex; flex-wrap: wrap; gap: clamp(.9rem, 2.5vw, 2rem); }
.site-header nav a { text-decoration: none; color: var(--mist); font-size: var(--step--1); font-weight: 500; }
.site-header nav a:hover { color: var(--paper); }

.menu-toggle { display: none; }
@media (max-width: 47.99rem) {
  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .9rem;
    background: transparent; color: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
    font: 600 var(--step--1)/1 var(--text); cursor: pointer;
  }
  .menu-bars, .menu-bars::before { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s ease; }
  .menu-bars { position: relative; transform: translateY(-3px); }
  .menu-bars::before { content: ""; position: absolute; left: 0; top: 6px; }
  .is-open .menu-bars { transform: translateY(0) rotate(45deg); }
  .is-open .menu-bars::before { top: 0; transform: rotate(-90deg); }
  .js .site-header nav {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; justify-content: center; gap: 1.25rem;
    padding: 5rem var(--gutter) 2rem; background: var(--deep);
    visibility: hidden; opacity: 0; transition: opacity .25s ease, visibility 0s linear .25s;
  }
  .js .is-open nav { visibility: visible; opacity: 1; transition: opacity .25s ease; }
  .js .site-header nav a { font: 700 clamp(1.75rem, 8vw, 2.5rem)/1.1 var(--display); color: var(--paper); }
  .menu-open { overflow: hidden; }
}

.site-footer {
  display: grid; grid-template-columns: 1fr auto; gap: 2rem var(--gutter);
  padding: 3rem var(--gutter) 2rem; margin-top: 5rem;
  border-top: 1px solid var(--line);
  max-width: calc(var(--max) + 2 * var(--gutter)); width: 100%; margin-inline: auto;
  color: var(--mist); font-size: var(--step--1);
}
.site-footer p { margin: 0 0 .35em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35em; }
.site-footer a { color: var(--paper); text-decoration-color: var(--line); text-underline-offset: 3px; }
.foot-name { font: 800 1.25rem/1.2 var(--display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--paper); }
.foot-head { color: var(--paper); font-weight: 600; }
.foot-legal { grid-column: 1 / -1; padding-top: 1.5rem; }

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: .7rem 1.4rem;
  border-radius: 999px; background: var(--game); color: var(--deep);
  font-weight: 600; text-decoration: none; border: 1.5px solid var(--game);
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--game); }
.text-link { color: var(--game); font-weight: 600; text-underline-offset: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- home hero ---------- */
.hero {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(2rem, 8vw, 6rem) var(--gutter) clamp(2rem, 5vw, 4rem);
  min-height: min(78vh, 46rem); display: flex; flex-direction: column; justify-content: center;
}
.hero-title {
  font-family: var(--display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.5rem, 1rem + 8.5vw, 7rem); line-height: .95; letter-spacing: -0.015em;
  margin: 0 0 .35em; max-width: 100%; overflow-wrap: anywhere;
}
.hero-word { display: block; }
.hero-word + .hero-word { color: var(--studio); }
.hero-tagline { font: 600 var(--step-1)/1.3 var(--display); letter-spacing: -0.01em; margin: 0 0 .75rem; color: var(--paper); }
.lede { font-size: var(--step-0); color: var(--mist); max-width: 36ch; line-height: 1.55; margin-bottom: 2rem; }
@media (min-width: 64rem) {
  .hero-word { display: inline-block; }
  .hero-word + .hero-word { margin-left: .25em; }
  .lede { font-size: var(--step-1); }
}

/* letter intro: hidden states only apply when boot.js set .motion (never for reduced motion / no JS) */
.ch { display: inline-block; translate: 0 calc(var(--lift, 0) * -1px); transition: translate .25s ease-out; }
.motion .hero-title:not(.is-split) { opacity: 0; animation: title-fallback .01s 1.5s forwards; }
.motion .hero-title.is-split .ch { opacity: 0; transform: translateY(-.7em) rotate(-8deg); }
.motion .hero-title.is-in .ch {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, 1.3, .4, 1), translate .25s ease-out;
  transition-delay: calc(var(--i, 0) * 45ms), calc(var(--i, 0) * 45ms), 0s;
}
@keyframes title-fallback { to { opacity: 1; } }

.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1; width: 30rem; height: 30rem; margin: -15rem 0 0 -15rem;
  border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--studio) 20%, transparent), transparent);
  transform: translate(var(--gx, -999px), var(--gy, -999px));
}
.cursor-glow.is-on { opacity: 1; }

/* GSAP drives these: neutralise the CSS fallback states and transitions */
.motion .hero-title.is-gsap .ch { transform: none; transition: none; }
.game-card.is-gsap { transition: box-shadow .3s ease; }

/* ---------- ticker ---------- */
.ticker { border-block: 1px solid var(--line); overflow: hidden; }
.ticker-viewport { overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: ticker 32s linear infinite; }
.ticker-track:hover, .ticker-track:focus-within { animation-play-state: paused; }
.ticker ul { display: flex; list-style: none; margin: 0; padding: 0; flex: none; }
.ticker a {
  display: flex; align-items: baseline; gap: .9rem; padding: 1rem clamp(1.25rem, 4vw, 2.5rem); text-decoration: none; white-space: nowrap;
}
.tick-name { font: 700 clamp(1.1rem, .9rem + 1.4vw, 1.75rem)/1 var(--display); letter-spacing: -0.02em; text-transform: uppercase; }
.tick-status { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.ticker a::after { content: "\2726"; color: var(--game); margin-left: clamp(1.25rem, 4vw, 2.5rem); }
.ticker a:hover .tick-name, .ticker a:focus-visible .tick-name { color: var(--game); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section > h2 { position: relative; padding-top: 1.1rem; text-transform: uppercase; letter-spacing: -0.02em; }
.section > h2::before { content: ""; position: absolute; left: 0; top: 0; width: 3rem; height: 4px; border-radius: 2px; background: var(--ember); }
.studio .prose p:first-child { font: 600 clamp(1.2rem, 1rem + 1.4vw, 1.85rem)/1.35 var(--display); letter-spacing: -0.015em; }
.section { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) var(--gutter) 0; }
.section.narrow { max-width: calc(46rem + 2 * var(--gutter)); }

.game-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.game-card {
  position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; background: var(--panel); box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .3s ease, opacity .6s ease var(--d, 0s), transform .6s ease var(--d, 0s);
}
.game-card:hover, .game-card:focus-within { box-shadow: 0 0 0 1.5px var(--game), 0 24px 60px -30px var(--game); }
.game-card-art {
  display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; text-decoration: none;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--game) 22%, var(--panel)), var(--panel) 70%);
  transition: transform .15s ease-out; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}
.game-logo { max-height: 80%; max-width: 85%; object-fit: contain; }
.game-cover { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.game-card:hover .game-cover { transform: scale(1.04); }
.game-logo.wordmark { font: 700 1.25rem/1.1 var(--display); color: var(--game); text-align: center; padding: 0 .75rem; overflow-wrap: anywhere; }
.game-card-body { min-width: 0; padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.game-card h3 { font-size: var(--step-2); margin: 0; overflow-wrap: anywhere; }
.game-card h3 a { text-decoration: none; }
.game-card h3 a:hover { color: var(--game); }
.game-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; color: var(--mist); font-size: var(--step--1); margin: 0; }
.game-card-pitch { margin: 0 0 .75rem; color: var(--paper); overflow-wrap: anywhere; }
.game-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: auto; }
@media (min-width: 48rem) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* scroll reveal: hidden only once kinetic.js has flagged the page ready (never without JS / reduced motion) */
.motion.reveal-ready [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(28px); }

.status { display: inline-flex; align-items: center; gap: .45rem; font-size: var(--step--1); font-weight: 600; color: var(--paper); }
.status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--game); }
.status-in-development::before, .status-announced::before { background: transparent; box-shadow: inset 0 0 0 2px var(--game); }

.studio-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.prose { max-width: 66ch; }
.prose p, .prose li { color: var(--paper); }
.facts { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--mist); font-size: var(--step--1); padding-top: .15rem; }
.facts dd { margin: 0; }
.plain { list-style: none; margin: 0; padding: 0; }

.contact p { max-width: 50ch; color: var(--mist); }
.contact-mail {
  font: 600 1.5rem/1.15 var(--display); font-size: clamp(1rem, 6vw, 2.25rem); letter-spacing: -0.02em; color: var(--paper);
  text-decoration: none; white-space: nowrap;
  background: linear-gradient(var(--studio), var(--studio)) 0 100% / 0 3px no-repeat;
  transition: background-size .35s ease;
}
.contact-mail:hover, .contact-mail:focus-visible { background-size: 100% 3px; }

/* ---------- game page ---------- */
.game-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; justify-items: center; text-align: center; gap: .5rem;
  padding: clamp(3rem, 8vw, 6.5rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
}
.game-hero-glow {
  position: absolute; z-index: -1; left: 50%; top: 45%; width: min(52rem, 150vw); aspect-ratio: 2.6 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--game) 38%, transparent), transparent);
  opacity: .55;
}
.game-art { position: relative; margin: 0 0 1.75rem; width: min(60rem, 100%); border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--game) 35%, transparent), 0 30px 80px -30px color-mix(in srgb, var(--game) 55%, transparent); }
.game-art > img:first-child { width: 100%; }
.cover-logo { position: absolute; left: 50%; top: 40%; width: 62%; transform: translate(-50%, -50%);
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.7)); }
.game-hero-logo { max-width: min(34rem, 85vw); max-height: 15rem; object-fit: contain; margin-bottom: 1rem; }
.game-hero-logo.wordmark, .game-title { font: 800 var(--step-4)/1 var(--display); letter-spacing: -0.04em; color: var(--paper); margin: 0 0 .4em; }
span.game-hero-logo.wordmark + .game-title { display: none; }
.game-pitch { font-size: var(--step-1); color: var(--mist); max-width: 42ch; }
.game-hero .hero-actions { justify-content: center; margin-top: 1rem; }

.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: min(80%, 34rem); gap: 1rem; overflow-x: auto;
  padding: 0 var(--gutter) 1rem; scroll-snap-type: x mandatory; }
.gallery img { border-radius: 12px; scroll-snap-align: start; border: 1px solid var(--line); }

.game-detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 3rem; align-items: start; padding-top: 2rem; }
.game-detail h2 { font-size: var(--step-2); margin-top: 1.5rem; }
.game-detail h2:first-child { margin-top: 0; }
.features { padding-left: 1.2rem; }
.features li { margin-bottom: .5rem; }
.features li::marker { color: var(--game); }
.game-facts { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }

/* ---------- privacy ---------- */
.policy-head { max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) var(--gutter) 1rem; }
.policy-head h1 { font-size: var(--step-3); max-width: 22ch; }
.crumbs { margin-bottom: 1rem; font-size: var(--step--1); }
.crumbs a { color: var(--game); text-underline-offset: 3px; }
.policy-grid { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 1rem var(--gutter) 0; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: var(--step--1); }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 1px solid var(--line); display: grid; gap: .55rem; }
.toc a { color: var(--mist); text-decoration: none; }
.toc a:hover { color: var(--paper); }
.policy-body { max-width: 68ch; }
.policy-body section { padding-top: .5rem; margin-bottom: 2rem; scroll-margin-top: 1.5rem; }
.policy-body h2 { font-size: var(--step-1); font-weight: 600; }
.policy-body h3 { font: 600 1rem/1.4 var(--text); margin-top: 1rem; color: var(--mist); }
.policy-body ul { padding-left: 1.2rem; }
.policy-body li { margin-bottom: .6rem; }
.policy-body li::marker { color: var(--game); }
.policy-body a { color: var(--game); text-underline-offset: 3px; }

.policy-list { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--line); }
.policy-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 2rem;
  padding: 1.25rem 0 1.25rem 1.25rem; border-bottom: 1px solid var(--line); position: relative; }
.policy-list li::before { content: ""; position: absolute; left: 0; top: 50%; width: .55rem; height: .55rem; margin-top: -.275rem; border-radius: 50%; background: var(--game); }
.policy-list a { font: 600 var(--step-1)/1.2 var(--display); text-decoration: none; }
.policy-list a:hover { color: var(--game); }

.notfound h1 { font-size: var(--step-3); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .studio-grid, .game-detail { grid-template-columns: 1fr; }
  .game-facts { position: static; }
  .policy-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .toc { position: static; }
}
@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; gap: .75rem; }
  .site-header nav { gap: 1.1rem; }
  .facts > div { grid-template-columns: 6.5rem 1fr; }
  .site-footer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  .ticker-track { animation: none; width: auto; flex-wrap: wrap; }
  .ticker ul[aria-hidden="true"], .cursor-glow { display: none; }
}
