/* ===== Tokens ===== */
:root {
  color-scheme: dark;
  --bg: #0c0c12;
  --bg-2: #12121b;
  --surface: #171722;
  --surface-2: #1e1e2c;
  --line: #2a2a3b;
  --text: #ecebf3;
  --muted: #9a99ad;
  --accent: #ffd23f;      /* Kosmir / Color Bullets yellow */
  --accent-ink: #1a1500;
  --cyan: #2ee6e6;
  --pink: #ff4f8b;
  --radius: 14px;
  --maxw: 1160px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px max(16px, calc((100vw - var(--maxw)) / 2));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--mono); font-weight: 600; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 18px; height: 18px; background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%); /* a little triangle ship */
  transition: transform .3s;
}
.brand:hover .brand-mark { transform: rotate(-90deg); }
.nav nav { display: flex; align-items: center; gap: 4px; }
.nav nav a { color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 15px; }
.nav nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav nav .nav-cta { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.nav nav .nav-cta:hover { background: #ffe07a; color: var(--accent-ink); }
@media (max-width: 720px) {
  .nav nav a:not(.nav-cta):not([href="#play"]) { display: none; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 16px;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffe07a; }
.btn-ghost { color: var(--text); border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--muted); }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  padding: 72px max(16px, calc((100vw - var(--maxw)) / 2));
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 500px at 85% 20%, rgba(46,230,230,.10), transparent 60%),
    radial-gradient(700px 420px at 10% 90%, rgba(255,210,63,.09), transparent 60%),
    var(--bg);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-inner {
  position: relative; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: center;
  pointer-events: none; /* let clicks fall through to the shapes... */
}
.hero-inner a, .hero-inner button, .player-card { pointer-events: auto; } /* ...except real controls */
@media (max-width: 960px) { .hero-inner { grid-template-columns: 1fr; } }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--cyan); letter-spacing: .04em; text-transform: uppercase; margin: 0 0 20px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); font-weight: 700; }
.hl { color: var(--accent); position: relative; }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 620px; margin: 24px 0 32px; }
.lede strong { color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 32px; margin: 48px 0 0; justify-content: start; }
.stats div { border-left: 2px solid var(--line); padding-left: 14px; }
.stats dt { font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats dd { margin: 4px 0 0; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, auto); gap: 20px 28px; } }

/* ===== Sections ===== */
.section { padding: 96px max(16px, calc((100vw - var(--maxw)) / 2)); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 36px; }
.kicker { font-family: var(--mono); color: var(--cyan); font-size: 14px; margin: 0 0 10px; }
.section h2 { font-size: clamp(30px, 4.5vw, 46px); }
.sub { color: var(--muted); margin: 12px 0 0; max-width: 640px; }
@media (max-width: 640px) { .section { padding-top: 64px; padding-bottom: 64px; } }

/* ===== Play grid (featured browser games) ===== */
.play-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.play-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; text-align: left; color: inherit; font: inherit; padding: 0;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.play-card:hover, .play-card:focus-visible { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 40px -16px rgba(255,210,63,.35); }
.play-card .thumb { position: relative; aspect-ratio: 315 / 250; background: var(--bg-2); overflow: hidden; }
.play-card .thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; transition: transform .4s; }
.play-card:hover .thumb img { transform: scale(1.05); }
.play-badge {
  position: absolute; inset: auto 12px 12px auto;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  transition: transform .2s;
}
.play-card:hover .play-badge { transform: scale(1.12); }
.play-card .meta { padding: 16px 18px 18px; }
.play-card h3 { font-size: 21px; }
.play-card p { color: var(--muted); font-size: 15px; margin: 6px 0 0; }

/* ===== Filters + game grid ===== */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  font: 500 14px var(--font); color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.is-active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.game {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.game:hover { border-color: #444460; transform: translateY(-2px); }
.game[hidden] { display: none; }
.game .thumb { aspect-ratio: 315 / 250; background: var(--bg-2); overflow: hidden; }
.game .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  width: 100%; height: 100%; display: grid; place-items: center; padding: 16px; text-align: center;
  font: 700 22px var(--mono); color: var(--bg);
}
.game .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game h3 { font-size: 18px; }
.game .desc { color: var(--muted); font-size: 14px; margin: 0; flex: 1; }
.game .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.pill.browser { background: rgba(255,210,63,.14); color: var(--accent); }
.pill.jam { background: rgba(46,230,230,.12); color: var(--cyan); }
.game .actions { display: flex; gap: 8px; margin-top: 4px; }
.game .actions a, .game .actions button {
  flex: 1; text-align: center; font: 600 14px var(--font); padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
}
.game .actions a:hover { text-decoration: none; border-color: var(--muted); }
.game .actions .play { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ===== Timeline ===== */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-when { font-family: var(--mono); font-size: 14px; color: var(--accent); padding-top: 4px; }
.tl-body h3 { font-size: 22px; }
.tl-body .at { color: var(--muted); font-weight: 500; }
.tl-where { font-family: var(--mono); font-size: 13px; color: var(--cyan); margin: 6px 0 8px; }
.tl-body p:last-child { color: var(--muted); margin: 0; }
.tl-body strong { color: var(--text); }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; gap: 6px; } }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.about-text p { margin: 0 0 14px; color: var(--muted); font-size: 18px; }
.about-text p:last-child { margin: 0; }
.about-text strong, .about-text em { color: var(--text); }
.card-title { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.card-title:not(:first-child) { margin-top: 24px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li { font-size: 15px; }
.list span { display: block; font: 12px var(--mono); color: var(--muted); }

/* ===== Contact + footer ===== */
.contact { text-align: center; }
.contact .sub { margin-left: auto; margin-right: auto; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 28px max(16px, calc((100vw - var(--maxw)) / 2));
  border-top: 1px solid var(--line); color: var(--muted); font: 13px var(--mono);
}
.footer a { color: var(--muted); }

/* ===== Player modal ===== */
.player {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); color: var(--text); overflow: hidden;
}
.player::backdrop { background: rgba(5,5,10,.82); backdrop-filter: blur(4px); }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); }
.player-bar h2 { font-size: 18px; }
.player-actions { display: flex; gap: 6px; }
.icon-btn {
  font: 500 13px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; white-space: nowrap;
}
.icon-btn:hover { border-color: var(--muted); text-decoration: none; }
@media (max-width: 520px) { .icon-btn span { display: none; } }
.player-stage { position: relative; background: #000; aspect-ratio: 16 / 9; max-height: calc(100vh - 160px); margin: 0 auto; }
.player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-stage:fullscreen { max-height: none; aspect-ratio: auto; }
.player-info { margin: 0; padding: 12px 20px 16px; color: var(--muted); font-size: 14px; }
.player-info b { color: var(--text); font-family: var(--mono); font-weight: 600; }
