:root {
  --ground: #0E0D1A;
  --band: #131126;
  --surface: #17152C;
  --border: #24213D;
  --border-dashed: #34305A;
  --chip-muted: #221F3A;
  --text: #F4EFFF;
  --text-2: #E4DFF5;
  --text-3: #C9C3E6;
  --muted: #A9A3C7;
  --amber: #FFB84D;
  --amber-tint: rgba(255, 184, 77, 0.14);
  --hatch-dark: #3A3020;
  --red: #D7263D;
  --red-text: #FF8A96;
  --red-tint: rgba(215, 38, 61, 0.16);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-optical-sizing: auto;
}

a { color: var(--text); }
a:hover { color: var(--amber); }
img { display: block; }
h1, h2, h3, p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.mono { font-family: var(--mono); }
.dot { color: var(--amber); }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.small { font-size: 12px; }

/* Header and footer */

.site-header { border-bottom: 1px solid var(--border); }
.nav { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; margin-left: auto; font-size: 15px; font-weight: 600; }
.nav-links a { text-decoration: none; color: var(--text-3); padding: 12px 0; }
.nav-links a:hover { color: var(--amber); }
.nav-links .btn-group { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 10px; background: var(--text); color: var(--ground); }
.nav-links .btn-group:hover { color: var(--ground); background: var(--amber); }

.site-footer { border-top: 1px solid var(--border); }
.footer { padding-top: 32px; padding-bottom: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }
.footer-note { display: flex; align-items: center; gap: 12px; }
.footer-note img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-links a { color: var(--text-3); padding: 12px 0; }

/* Hero */

.hero { padding-top: 72px; padding-bottom: 56px; display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero-text { flex: 999 1 520px; min-width: 0; }
.hero .eyebrow { margin-bottom: 20px; }
h1 { font-size: clamp(44px, 6vw, 80px); line-height: 0.98; font-weight: 800; letter-spacing: -0.035em; }
.lede { margin-top: 28px; max-width: 580px; font-size: 19px; line-height: 1.55; color: var(--text-3); }

.stats {
  margin-top: 36px;
  max-width: 600px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.stats > div { background: var(--ground); padding: 16px 18px; }
.stat { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.stat.amber { color: var(--amber); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

.hero-tile { flex: 1 1 320px; display: flex; justify-content: center; }
.tile {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  border-radius: 40px;
  overflow: hidden;
  container-type: inline-size;
  box-shadow: 0 0 0 1px var(--border);
}
.tile > div {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--tile-size);
  letter-spacing: -0.04em;
}

/* Progress strip */

.band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--band); }
.strip { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.strip-text { flex: 1 1 220px; }
.strip-count { font-size: 20px; font-weight: 800; margin-top: 6px; }
.strip-icons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; flex: 999 1 560px; }
.strip-icons li { width: 44px; height: 44px; padding: 3px; border-radius: 11px; border: 2px solid var(--border); opacity: 0.55; }
.strip-icons li.on { border-color: var(--amber); opacity: 1; }
.strip-icons img { width: 100%; height: 100%; border-radius: 8px; }

/* Sections */

.section { padding-top: 72px; padding-bottom: 40px; }
#directory { padding-top: 88px; }
.section-last { padding-bottom: 96px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
h2 { font-size: 48px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.intro { margin-top: 18px; max-width: 680px; font-size: 17px; line-height: 1.55; color: var(--text-3); }
.note { margin-top: 28px; font-size: 14px; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border-dashed);
  background: transparent;
  color: var(--text-3);
  font: 600 14px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.filter:hover { border-color: var(--text-3); }
.filter[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--ground); }

.tabs { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-3);
  font: 600 14px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--text); color: var(--ground); }

/* Cards */

.grid { margin-top: 36px; display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 20px; }
.game-card { display: flex; flex-direction: column; gap: 16px; }
.card-head { display: flex; align-items: flex-start; gap: 14px; }
.card-head img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.card-head > div { min-width: 0; }
.card h3, .future-card h3 { font-size: 17px; font-weight: 700; }
.card h3 a { text-decoration: none; }
.card-title { margin-top: 4px; font-size: 15px; color: var(--text-2); line-height: 1.35; }
.card-platform { margin-top: 4px; font-size: 13px; color: var(--muted); }
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.card-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pct { font-size: 13px; color: var(--text-3); }
.card-link { align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; padding: 12px 0 4px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.chip-progress { background: var(--amber-tint); color: var(--amber); }
.chip-muted { background: var(--chip-muted); color: var(--muted); }
.chip-private { background: var(--red-tint); color: var(--red-text); }
.chip-plain { background: var(--chip-muted); color: var(--text-3); font-weight: 600; }

.bar { height: 8px; border-radius: 999px; background: var(--chip-muted); overflow: hidden; }
.bar > div { height: 100%; background: var(--amber); border-radius: inherit; }
.bar-hatch { background: repeating-linear-gradient(135deg, var(--amber) 0 6px, var(--hatch-dark) 6px 12px); }
.bar-lg { height: 14px; }
.bar-lg.bar-hatch { background: repeating-linear-gradient(135deg, var(--amber) 0 8px, var(--hatch-dark) 8px 16px); }

/* Engine rows */

.rows { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.engine { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.engine > img { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.engine-name { flex: 1 1 220px; min-width: 0; }
.engine-name h3 { font-size: 19px; }
.engine-name p { margin-top: 4px; font-size: 14px; color: var(--muted); }
.engine > .chip { padding: 6px 11px; }

.runs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; flex: 999 1 300px; }
.run {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  background: var(--ground);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px 5px 5px;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}
a.run { min-height: 44px; }
a.run:hover { border-color: var(--amber); }
.run img { width: 26px; height: 26px; border-radius: 6px; }

/* Future work */

.future-grid { margin-top: 32px; gap: 12px; }
.future-card { border: 1px dashed var(--border-dashed); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 14px; }
.future-card > img { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.future-card h3 { font-size: 15px; }
.future-card .card-title { margin-top: 3px; font-size: 14px; line-height: 1.3; }
.future-card .card-platform { margin-top: 3px; font-size: 12px; }
.future-card.engine { border-radius: 18px; padding: 20px; }
.future-card.engine > img { width: 64px; height: 64px; border-radius: 14px; }
.future-card.engine h3 { font-size: 18px; }
.future-card .run { background: transparent; }

/* Game page */

.breadcrumb { padding-top: 28px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.breadcrumb a { color: var(--text-3); padding: 12px 0; }
.breadcrumb .mono { color: var(--text); }

.game-hero { padding-top: 40px; }
.game-hero .eyebrow { margin-bottom: 16px; }
.game-hero h1 { font-size: clamp(42px, 5.5vw, 72px); line-height: 1; }
.chips { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chips .chip { font-size: 13px; padding: 6px 12px; }
.buttons { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 12px; font-size: 15px; }
.btn-primary { background: var(--text); color: var(--ground); font-weight: 700; }
.btn-primary:hover { background: var(--amber); color: var(--ground); }
.btn-secondary { border: 1px solid var(--border-dashed); font-weight: 600; }
.game-tile { flex-basis: 300px; }
.game-tile .tile { max-width: 340px; border-radius: 36px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px; }
.panel h2 { font-size: 26px; letter-spacing: -0.02em; }
.panel > p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: var(--text-3); }

.progress-panel { padding: 32px; display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-end; }
.progress-figure { flex: 1 1 260px; }
.progress-figure h2 { font-size: 13px; letter-spacing: 0.08em; line-height: 1.4; }
.big-pct { margin-top: 12px; font-size: clamp(56px, 7vw, 88px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.progress-detail { flex: 999 1 420px; min-width: 0; }
.progress-caption { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); }
.progress-caption .mono { color: var(--text-3); }

.panels { padding-top: 24px; padding-bottom: 96px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.steps {
  margin: 20px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--ground);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-3);
  overflow-x: auto;
}
.steps code { font-family: inherit; }
.runs-on { margin-top: 18px; display: flex; align-items: center; gap: 16px; }
.runs-on img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.engine-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.caption { margin: 18px 0 12px; font-size: 14px; color: var(--muted); }

@media (max-width: 560px) {
  h2 { font-size: 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .nav-links { margin-left: 0; }
}
