/* Rogue Polygon studio site. Same look as the games (kit/kit.css in Rogue-Polygons):
   white lines on black, chamfered frames, color only where it means something:
   blue is the player, gold is the ball and rewards. Single dark theme on purpose.
   Layout concept: a live court as the hero, then the games as framed cards. */

@font-face {
  font-family: 'Chakra Petch';
  font-weight: 500;
  font-display: swap;
  src: url('fonts/chakra-petch-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Chakra Petch';
  font-weight: 700;
  font-display: swap;
  src: url('fonts/chakra-petch-700.woff2') format('woff2');
}

:root {
  --bg: #050505;
  --grid: #2c2c2c;
  --frame: #8f8f8f;
  --text: #f2f2f2;
  --dim: #8c8c8c;
  --player: #4d9bff;
  --gold: #ffd23d;
  --card: #0b0b0b;
  --font: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --cut: 14px;
  color-scheme: dark;
}

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

.page {
  display: grid;
  gap: clamp(40px, 7vw, 72px);
  max-width: 1120px;
  margin: 0 auto;
  padding-block: clamp(20px, 4vw, 40px) 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Hero */
.hero { display: grid; gap: 14px; width: min(100%, calc(68vh * 16 / 9)); margin-inline: auto; }
.hero__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }

.mark { display: flex; align-items: center; gap: clamp(10px, 2vw, 18px); margin: 0; font-weight: 700; text-transform: uppercase; }
.mark__emblem { width: clamp(48px, 9vw, 76px); height: auto; aspect-ratio: 1; flex: none; }
.mark__words { display: grid; line-height: 0.9; }
.mark__words span:first-child { font-size: clamp(2.6rem, 9vw, 4.6rem); letter-spacing: 0.03em; }
.mark__words span:last-child { font-size: clamp(1.05rem, 3.6vw, 1.85rem); letter-spacing: 0.33em; color: var(--dim); }

.tag { margin: 0; color: var(--dim); font-size: clamp(0.95rem, 2.4vw, 1.1rem); letter-spacing: 0.04em; }
/* The Play button sits in the header so it is on the first screen on phones too. */
.hero__side { display: grid; justify-items: end; gap: 12px; }

.court { width: 100%; aspect-ratio: 16 / 9; max-width: 100%; margin-top: 4px; }
.court canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.court canvas:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
/* Under the court: the rally's polygon on the left, how to play on the right. */
.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: -4px; }
.bar p { margin: 0; }
.bar__hud { display: flex; align-items: baseline; gap: 10px; min-width: 0; text-transform: uppercase; }
.bar__hud b { color: var(--player); font-size: clamp(1.5rem, 4vw, 2rem); font-variant-numeric: tabular-nums; line-height: 1; min-width: 1.3em; }
.bar__hud span { color: var(--dim); font-size: 0.78rem; letter-spacing: 0.18em; }
.bar__hint { font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); transition: opacity 0.6s; }
.bar__hint.is-gone { opacity: 0; }

.perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; margin: 10px 0 0; color: var(--dim); font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; }
.perks span + span::before { content: '·'; padding-inline: 0.9em; color: var(--grid); }

/* Games */
.games { display: grid; gap: 16px; }
.eyebrow { margin: 0; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.games__grid { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.games__grid .game:first-child { grid-row: span 2; }

/* A chamfered frame: the card is filled with the line color and a slightly smaller
   chamfered panel sits inside it, so the cut corners get their diagonal lines too. */
.game {
  --c: var(--cut);
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  background: var(--frame);
}
.game, .game::before {
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c),
    100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%,
    0 calc(100% - var(--c)), 0 var(--c));
}
.game::before { --c: calc(var(--cut) - 1px); content: ''; position: absolute; inset: 2px; z-index: -1; background: var(--card); }
.game__art { display: block; width: 100%; height: auto; max-width: 100%; }
.game__body { display: grid; gap: 12px; justify-items: start; padding: 0 4px 4px; }

.game--soon { background: var(--grid); }
.game--soon::before { background: var(--bg); }
.game--soon .game__art { opacity: 0.45; }
.game--soon .game__body { grid-auto-flow: column; justify-content: space-between; align-items: baseline; width: 100%; box-sizing: border-box; }

.title { display: grid; margin: 0; font-weight: 700; text-transform: uppercase; line-height: 0.95; }
.title span:first-child { color: var(--player); font-size: clamp(1.9rem, 5vw, 2.6rem); letter-spacing: 0.03em; }
.title span:last-child { font-size: clamp(1rem, 2.6vw, 1.35rem); letter-spacing: 0.28em; }
.title--small { font-size: 1.15rem; letter-spacing: 0.12em; color: var(--dim); }
.soon { margin: 0; font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }

.stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; color: var(--dim); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stats b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.btn {
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  min-width: 11rem;
  padding: 12px 24px;
  box-sizing: border-box;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bg);
  background: var(--text);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: background 0.15s;
}
.btn:hover { background: var(--gold); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Line art inside the game cards: the same strokes the games draw. */
.ln-frame { fill: none; stroke: var(--frame); stroke-width: 1.2; }
.ln-mid { stroke: var(--grid); stroke-width: 1.6; stroke-dasharray: 5 7; }
.ln-face { fill: none; stroke: var(--text); stroke-width: 1.2; opacity: 0.42; }
.ln-enemy { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-linejoin: round; }
/* Unannounced games: a polygon and a question mark, no name or genre until the pitch is approved. */
.ln-mystery { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 6 6; stroke-linejoin: round; }
.art-q { font-family: var(--font); font-weight: 700; font-size: 34px; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.fill-you { fill: var(--player); }
.fill-gold { fill: var(--gold); }

.foot { display: flex; align-items: center; gap: 10px; padding-top: 18px; border-top: 1px solid var(--grid); color: var(--dim); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.foot__mark { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.6; }

/* Phones: a tall court like the games' portrait layout, the player at the bottom. */
@media (max-width: 640px) {
  .hero { width: min(100%, calc(60vh * 3 / 4)); }
  .hero__side { justify-items: start; }
  .court { aspect-ratio: 3 / 4; }
  .perks { font-size: 0.72rem; letter-spacing: 0.12em; }
  .perks span + span::before { padding-inline: 0.6em; }
  .games__grid { grid-template-columns: 1fr 1fr; }
  .games__grid .game:first-child { grid-column: 1 / -1; grid-row: auto; }
  .game--soon { padding: 10px; gap: 10px; }
  .title--small { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
