/* Vibe Games — design tokens & base layer. Arcade Pop direction. */

@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Clash Display";
  src: url("../fonts/ClashDisplay-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Satoshi";
  src: url("../fonts/Satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Base canvas — deep indigo, never neutral gray */
  --bg: oklch(16% 0.03 265);
  --bg-deep: oklch(12% 0.028 265);
  --surface: oklch(21% 0.035 265);
  --surface-up: oklch(25% 0.038 265);
  --surface-line: oklch(32% 0.03 265);

  --ink: oklch(97% 0.01 265);
  --ink-dim: oklch(78% 0.02 265);
  --ink-faint: oklch(58% 0.02 265);

  /* Two accents only — mint carries most weight, coral is a rare hit */
  --mint: oklch(82% 0.16 168);
  --mint-dim: oklch(60% 0.12 168);
  --mint-ink: oklch(18% 0.03 168);
  --coral: oklch(72% 0.18 25);
  --coral-dim: oklch(55% 0.14 25);

  --ok: oklch(78% 0.15 155);
  --warn: oklch(80% 0.15 80);
  --danger: oklch(66% 0.19 25);

  --font-display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --font-body: "Satoshi", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;
  --space-11: 6rem;
  --space-12: 8rem;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 140ms;
  --dur-base: 260ms;
  --dur-slow: 480ms;

  --shadow-card: 0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 18px 40px -20px oklch(8% 0.03 265 / 0.7);
  --shadow-pop: 0 24px 60px -24px oklch(8% 0.03 265 / 0.85);
  --shadow-glow-mint: 0 0 0 1px oklch(82% 0.16 168 / 0.35), 0 12px 32px -8px oklch(82% 0.16 168 / 0.35);

  --container: 1200px;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  position: relative;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Faint grain over everything — warmth without a stock-photo gradient */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  color: inherit;
}

ul, ol {
  padding-left: 1.2em;
}

p {
  text-wrap: pretty;
  max-width: 68ch;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 1.3rem + 4.2vw, 4.75rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.3rem); }

.lede {
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  color: var(--ink-dim);
  max-width: 56ch;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  background: var(--mint);
  color: var(--mint-ink);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-4);
}

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

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Icon component — sprite reference, sized via font-size-like utility */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-6);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--mint);
  color: var(--mint-ink);
  box-shadow: var(--shadow-glow-mint);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: oklch(from var(--mint) calc(l + 0.04) c h);
}

.btn-ghost {
  background: oklch(100% 0 0 / 0.04);
  border-color: var(--surface-line);
  color: var(--ink);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  border-color: var(--mint-dim);
  background: oklch(100% 0 0 / 0.07);
}

.btn-sm {
  min-height: 44px;
  padding: 0 var(--space-4);
  font-size: 0.88rem;
}

.btn-coral {
  background: var(--coral);
  color: oklch(15% 0.02 25);
}

.card {
  background: linear-gradient(155deg, var(--surface) 0%, var(--bg-deep) 100%);
  border: 1px solid var(--surface-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--r-pill);
  background: oklch(100% 0 0 / 0.06);
  border: 1px solid var(--surface-line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-dim);
}
.badge.badge-mint { color: var(--mint-ink); background: var(--mint); border-color: transparent; }

hr {
  border: none;
  border-top: 1px solid var(--surface-line);
  margin: var(--space-8) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--surface-line);
}
th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--surface-line);
}
.table-scroll table {
  min-width: 480px;
}

/* Scroll-driven reveal — native, no JS listeners */
.reveal {
  animation: vg-fade-up linear both;
  animation-timeline: view();
  animation-range: entry 0% cover 30%;
}
@keyframes vg-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@supports not (animation-timeline: view()) {
  .reveal { animation: none; opacity: 1; transform: none; }
}

@media (min-width: 480px) {
  .container { width: min(100% - 3rem, var(--container)); }
}
@media (min-width: 1024px) {
  .container { width: min(100% - 5rem, var(--container)); }
}
