/* Arcade Annex — shared styles */

:root {
  --bg: #070b10;
  --bg-2: #0c131a;
  --panel: #0f1821;
  --panel-2: #14212c;
  --line: #1e2f3d;
  --text: #dce8f2;
  --muted: #8aa3b5;
  --acid: #7df9a6;
  --cyan: #5ad7ff;
  --pink: #ff6b9d;
  --amber: #ffc857;
  --font-body: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --radius: 14px;
  --maxw: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 10% -12%, rgba(125, 249, 166, 0.09), transparent 60%),
    radial-gradient(900px 480px at 96% 0%, rgba(90, 215, 255, 0.07), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--acid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #b6ffcd;
}

::selection {
  background: var(--acid);
  color: #04140a;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--acid);
  color: #04140a;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 16, 0.84);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--acid);
}

.brand-text {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-text small {
  display: block;
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.site-nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0;
}

.site-nav a:hover {
  color: var(--text);
}

.site-nav a.is-active {
  color: var(--acid);
}

.site-nav a.is-active::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}

.nav-toggle {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

/* ---------- Type helpers ---------- */

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acid);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

.kicker {
  color: var(--cyan);
  display: block;
  margin-bottom: 0.45rem;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 4.9rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h1 .stroke {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--acid);
}

h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.4rem);
}

h3 {
  font-size: 1.08rem;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.muted {
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 2.5rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(90, 215, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(90, 215, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 20%, #000 20%, transparent 100%);
}

.hero > .wrap {
  position: relative;
}

.hero h1 {
  margin: 1rem 0 1.2rem;
  max-width: 18ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1.8rem 0 2.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--muted);
  color: var(--text);
}

.btn-primary {
  background: var(--acid);
  border-color: var(--acid);
  color: #04140a;
  font-weight: 600;
}

.btn-primary:hover {
  background: #b6ffcd;
  border-color: #b6ffcd;
  color: #04140a;
}

.btn-ghost {
  background: transparent;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  background: var(--bg-2);
  padding: 1rem 1.2rem;
}

.stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 600;
  color: var(--acid);
  line-height: 1.2;
}

.stat span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Sections ---------- */

.section {
  padding: 3.4rem 0;
}

.section-tight {
  padding: 2.4rem 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.6rem;
}

.section-head p {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.94rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  position: relative;
  padding: 1.4rem;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: rgba(125, 249, 166, 0.45);
  transform: translateY(-3px);
}

.card .num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.card h3 {
  margin: 0.55rem 0 0.45rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.card-link {
  color: inherit;
  text-decoration: none;
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: none;
}

.card-link:focus-visible::after {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.card .more {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--acid);
}

/* ---------- Notes list ---------- */

.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.notes li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.notes time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.15rem;
}

.notes h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.notes p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Page head ---------- */

.page-head {
  padding: clamp(2.6rem, 6vw, 4.5rem) 0 1rem;
}

.page-head h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  margin: 0.8rem 0 0.9rem;
}

.page-head .lede {
  margin: 0;
}

/* ---------- Filters ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 1.8rem 0 1.4rem;
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--muted);
}

.chip.is-active {
  background: var(--acid);
  border-color: var(--acid);
  color: #04140a;
  font-weight: 600;
}

.filter-field {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-field select,
.filter-field input {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}

.filter-field input {
  min-width: 11rem;
}

.filter-field select:focus,
.filter-field input:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.filter-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Game catalog ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1rem;
}

.game-card {
  padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, outline-color 0.15s ease;
}

.game-card:hover {
  border-color: rgba(90, 215, 255, 0.45);
}

.game-card[hidden] {
  display: none;
}

.game-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-card .meta .tag {
  color: var(--cyan);
}

.game-card h3 {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.game-card.is-picked {
  border-color: var(--amber);
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  animation: pick 0.4s ease;
}

@keyframes pick {
  from {
    transform: scale(0.98);
  }
  to {
    transform: scale(1);
  }
}

.empty-state {
  padding: 2.6rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

/* ---------- Timeline ---------- */

.era-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.8rem 0 2rem;
}

.era {
  display: none;
}

.era.is-visible {
  display: block;
  animation: fade 0.25s ease;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.era-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.era-head h2 {
  margin: 0;
}

.era-head .range {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--acid);
  letter-spacing: 0.08em;
}

.era-head p {
  flex-basis: 100%;
  margin: 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 0.94rem;
}

.milestones {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.milestone {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.2rem;
  padding: 1.15rem 1.3rem;
  background: var(--bg-2);
}

.milestone .year {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--acid);
  line-height: 1.3;
}

.milestone h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.milestone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Essays ---------- */

.essay {
  padding-left: 1.4rem;
  border-left: 2px solid var(--line);
  margin-bottom: 2.6rem;
  max-width: 78ch;
}

.essay:last-child {
  margin-bottom: 0;
}

.essay h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  margin-bottom: 0.7rem;
}

.essay p {
  color: #b9c9d6;
  margin: 0 0 0.9rem;
}

.essay p:last-child {
  margin-bottom: 0;
}

.essay strong {
  color: var(--text);
}

.figure {
  margin: 1.8rem 0 0;
  padding: 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.figure svg {
  display: block;
  width: min(100%, 300px);
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}

.figure figcaption {
  margin-top: 0.9rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  margin: 1.6rem 0;
  padding: 1rem 1.2rem;
  background: rgba(90, 215, 255, 0.06);
  border: 1px solid rgba(90, 215, 255, 0.25);
  border-radius: var(--radius);
}

.callout .mark {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 1.2rem;
  line-height: 1;
}

.callout p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.callout strong {
  color: var(--text);
}

/* ---------- Glossary ---------- */

.term-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1.4rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.term {
  padding: 0.95rem 1.15rem;
  background: var(--bg-2);
}

.term[hidden] {
  display: none;
}

.term dt {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--acid);
  letter-spacing: 0.02em;
}

.term dd {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.55;
}

/* ---------- Prose / About ---------- */

.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  margin: 2.4rem 0 0.8rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p {
  color: #b9c9d6;
  margin: 0 0 0.95rem;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: #b9c9d6;
}

.prose li {
  margin-bottom: 0.45rem;
}

.changelog {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  max-width: 72ch;
}

.changelog li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

.changelog time {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
}

.changelog b {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 3.5rem;
  padding: 2.4rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.6rem;
}

.footer-brand {
  max-width: 34ch;
}

.footer-brand .brand-text {
  color: var(--text);
  margin-bottom: 0.6rem;
}

.footer-brand p {
  margin: 0;
  font-size: 0.82rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  align-content: start;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--acid);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: rgba(7, 11, 16, 0.98);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(30, 47, 61, 0.6);
  }

  .site-nav a.is-active::before {
    display: none;
  }

  .site-nav a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .term-list {
    grid-template-columns: 1fr;
  }

  .notes li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .milestone {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .filter-count {
    margin-left: 0;
    width: 100%;
  }

  .filter-field input {
    min-width: 0;
    width: 100%;
  }

  .filter-field {
    width: 100%;
  }

  .filter-field input,
  .filter-field select {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .wrap {
    width: min(100% - 1.6rem, var(--maxw));
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .changelog li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
