/**
 * Shared studio styling.
 *
 * One source of truth for the brand, copied into each site's public/ by
 * `npm run sync` before deploy. Each site is its own Worker, so they cannot
 * share a stylesheet over the wire — but they can share it in the repo.
 */
:root {
  --ground: #0f131a;
  --surface: #161c25;
  --rule: #2b3440;
  --ink: #e5eaf1;
  --ink-2: #9aa6b6;
  --accent: #d9a441;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* A low sunset glow at the horizon, gone by the top of the bar. */
.top {
  border-bottom: 1px solid var(--rule);
  background: radial-gradient(120% 340% at 50% 130%, #4a2a2e 0%, #241d2c 42%, var(--ground) 72%);
}

.bar {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.sun {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #f6c15c, #e5734f);
  box-shadow: 0 0 14px rgba(230, 140, 80, 0.55);
  flex: none;
}

nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.75rem; }

nav a {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

nav a:hover, nav a:focus-visible { color: var(--ink); border-bottom-color: var(--accent); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

main {
  flex: 1;
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-weight: 700;
  text-wrap: balance;
}

.lede {
  margin: 0;
  max-width: 38rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-2);
}

h2 {
  margin: 3rem 0 1rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 400;
}

/* A card grid that reads as deliberate whether it holds one item or six. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms ease, transform 140ms ease;
}

a.card:hover, a.card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 0.88rem; line-height: 1.55; color: var(--ink-2); }

.tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 2px;
  background: rgba(217, 164, 65, 0.14);
  color: var(--accent);
}

.tag.soon { background: rgba(154, 166, 182, 0.14); color: var(--ink-2); }

.card.placeholder { border-style: dashed; opacity: 0.75; }

.note {
  margin: 2.5rem 0 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 42rem;
}

footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-2);
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  nav a, .card { transition: none; }
  a.card:hover, a.card:focus-visible { transform: none; }
}

/* ---------- home hero ---------- */

/**
 * The backdrop is layered under a gradient scrim.
 *
 * If backdrop.png is absent the url() layer simply paints nothing and the
 * gradient stands alone — so the page looks deliberate either way, and adding
 * the image later is a file drop with no CSS change.
 */
.home main {
  background-image:
    linear-gradient(180deg, rgba(15, 19, 26, 0.72), rgba(15, 19, 26, 0.92)),
    url("backdrop.png");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

.hero {
  min-height: 56vh;
  display: grid;
  place-items: center;
}

.hero-logo {
  width: min(24rem, 62vw);
  height: auto;
  /* The logo is a bright mark on a dark ground; a soft glow seats it there. */
  filter: drop-shadow(0 0 60px rgba(230, 170, 80, 0.22));
}

/* ---------- embedded game ---------- */

/**
 * The game canvas is 960x540 and Phaser scales it to FIT, so the frame is
 * sized by aspect-ratio rather than a viewport height: it matches the canvas
 * exactly instead of growing letterbox bars above and below it. max-height
 * keeps the whole board on screen in a short window.
 */
.game {
  display: block;
  /* Width is capped by the height the viewport can spare, so the frame stays
     exactly 16:9 at every size — shrinking it never leaves Phaser pillarboxing
     the canvas inside a frame that is wider than the game. */
  width: min(100%, calc(76vh * 16 / 9));
  aspect-ratio: 16 / 9;
  margin: 2rem auto 0;
  border: 1px solid var(--rule);
  background: #14182b;
}

.under-game {
  margin: 0.9rem 0 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.under-game a { color: var(--accent); }
