/* Site-wide tokens and base. Load before any page stylesheet.

   Theme: dark glass, with a light counterpart. A near-black ground with a
   faint warm tint in it, surfaces that sit just above it behind a hairline,
   and soft corners throughout. Depth comes from blur and a low shadow rather
   than from heavy outlines, so nothing on the page shouts.

   Palette is one place only — change it here and every page follows. The light
   values live in the [data-theme="light"] block at the bottom; every token the
   two themes share keeps its name, so no rule below needs to know which is on. */

:root {
  /* surfaces */
  --page: #121114;
  --header: rgba(18, 17, 20, 0.45);
  --raised: #1a1920;
  --raised-2: #201e28;
  --tab: #26232f;
  --well: #0d0c10;

  /* lines — hairlines. Anything heavier would read as a drawn border, which
     is not this theme. */
  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-mid: rgba(255, 255, 255, 0.14);
  --line-hard: rgba(255, 255, 255, 0.20);

  /* text — the ladder is stepped so every step clears 4.5:1 on the lightest
     surface it can land on (--tab), not just on the page. Ratios on --tab:
     ink 14.0, strong 11.8, body 8.4, lede 6.4, soft 5.7, muted 5.1, faint 4.5. */
  --ink: #f5f3f7;
  --strong: #e4e0ea;
  --body: #c2bdcb;
  --lede: #aaa4b4;
  --soft: #a09aa9;
  --muted: #96919f;
  --faint: #8e8899;

  /* accent — the one warm colour on the page. --accent is the fill; --accent-on
     is what sits on top of it, and it is dark because the fill is light. */
  --accent: #d4a843;
  --accent-on: #1a1408;
  --accent-deep: #b98d2e;
  --accent-soft: #e8c877;
  --accent-pale: #f0dda6;
  --accent-ink: #f5e6bb;
  --accent-wash: rgba(212, 168, 67, 0.20);
  --accent-hover: rgba(212, 168, 67, 0.35);
  --accent-tint: rgba(212, 168, 67, 0.12);
  --accent-line: rgba(212, 168, 67, 0.40);

  /* semantic */
  --ok: #4ade80;
  --ok-wash: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --warn-wash: rgba(251, 191, 36, 0.12);
  --err: #f87171;
  --err-wash: rgba(248, 113, 113, 0.12);
  --live: #ff4646;

  /* platform brand marks */
  --twitch: #a970ff;
  --kick: #6ee32c;
  --tiktok: #d6339b;
  --youtube: #ff4d6a;
  --x: #e7e9ea;
  --patreon: #ff9a55;
  --kofi: #ff7a77;
  --discord: #495bff;
  --github: #e6edf3;

  /* type */
  --sans: 'Archivo', system-ui, -apple-system, sans-serif;
  --display: 'Archivo Black', 'Archivo', system-ui, sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* geometry — soft by default, pill for controls */
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* kit: hairline weight, the glass blur, and the soft shadows */
  --bw: 1px;
  --bw-heavy: 1px;
  --slab-gap: 16px;
  --blur: blur(12px) saturate(1.4);
  --blur-heavy: blur(24px) saturate(1.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.40);
  --lift: 0 10px 28px rgba(0, 0, 0, 0.38);
  --ring: 0 0 0 1px var(--accent-line);

  /* motion — eased, never snappy */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --glide: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.15s;
  --t: 0.22s;
  --t-slow: 0.34s;
}

/* ── light ──────────────────────────────────────────── */
/* Same names, lighter values. Warm paper rather than white, so the accent
   still reads as the same colour it is on the dark ground. */
html[data-theme="light"] {
  --page: #f4f1ea;
  --header: rgba(244, 241, 234, 0.55);
  --raised: #ffffff;
  --raised-2: #faf8f3;
  --tab: #ece7db;
  --well: #e9e3d5;

  --line: rgba(24, 20, 12, 0.14);
  --line-soft: rgba(24, 20, 12, 0.08);
  --line-mid: rgba(24, 20, 12, 0.20);
  --line-hard: rgba(24, 20, 12, 0.28);

  --ink: #16150f;
  --strong: #2a2820;
  --body: #3f3c33;
  --lede: #545049;
  --soft: #5c584d;
  --muted: #645f54;
  --faint: #6c665a;

  --accent: #d4a843;
  --accent-on: #1a1408;
  --accent-deep: #b98d2e;
  --accent-soft: #7e6420;
  --accent-pale: #6f5616;
  --accent-ink: #5c4712;
  --accent-wash: rgba(212, 168, 67, 0.26);
  --accent-hover: rgba(212, 168, 67, 0.42);
  --accent-tint: rgba(212, 168, 67, 0.16);
  --accent-line: rgba(180, 140, 40, 0.46);

  --ok: #1a8241;
  --warn: #a16207;
  --err: #c0392b;

  --shadow-sm: 0 1px 2px rgba(60, 48, 20, 0.10);
  --shadow: 0 2px 12px rgba(60, 48, 20, 0.12);
  --shadow-lg: 0 16px 48px rgba(60, 48, 20, 0.16);
  --lift: 0 10px 28px rgba(60, 48, 20, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent-pale); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-on); }

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

/* Thin scrollbars so they do not cut a bright line into the page. */
* { scrollbar-width: thin; scrollbar-color: var(--tab) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--tab); border-radius: var(--r-pill); }
*::-webkit-scrollbar-thumb:hover { background: var(--raised-2); }

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