/* ================================================================
   theme.css — Corwyn Design System Tokens, Reset & Base Typography
   ================================================================ */

/* ── DARK THEME (default) ── */
:root,
[data-theme="dark"] {
  --bg: #0d0f14;
  --surface: #141720;
  --surface2: #1c2030;
  --border: #2a2f3e;
  --accent: #847dff;
  --accent-bright: #a09aff;
  --accent2: #1aecc0;
  --accent3: #ff7d7d;
  --text: #e0e3ec;
  --muted: #b0b8cc;
  --tag-bg: rgba(132,125,255,0.15);
  --tag-text: #a09aff;
  --tag-bg2: rgba(26,236,192,0.12);
  --tag-text2: #1aecc0;
  --tag-bg3: rgba(255,125,125,0.12);
  --tag-text3: #ff7d7d;
  --card-hover: #222640;
  --shadow: 0 2px 20px rgba(0,0,0,0.4);
  --hero-grad: linear-gradient(135deg, #141720 0%, #1e1438 50%, #0e1828 100%);
  --toggle-bg: #2a2f3e;
  --toggle-fg: #eef0f6;
  --nav-bg: #141720;
  --code-bg: #1c2030;
  --code-header: #252a3a;
  --code-text: #e8edf8;
  --code-border: #333950;
  --code-btn: #333950;
  --code-btn-hover: #404860;
  --code-label: #b0b8cc;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface2: #eef0f8;
  --border: #d8dce8;
  --accent: #5046e5;
  --accent-bright: #5046e5;
  --accent2: #00a88a;
  --accent3: #e04545;
  --text: #1a1d2e;
  --muted: #5a6480;
  --tag-bg: rgba(80,70,229,0.1);
  --tag-text: #5046e5;
  --tag-bg2: rgba(0,168,138,0.1);
  --tag-text2: #00a88a;
  --tag-bg3: rgba(224,69,69,0.1);
  --tag-text3: #e04545;
  --card-hover: #f0f1fa;
  --shadow: 0 2px 20px rgba(80,80,120,0.08);
  --hero-grad: linear-gradient(135deg, #eee8ff 0%, #e6f4f0 50%, #ffe8e8 100%);
  --toggle-bg: #d8dce8;
  --toggle-fg: #1a1d2e;
  --nav-bg: #ffffff;
  --code-bg: #f0f1f8;
  --code-header: #e2e5ef;
  --code-text: #1a1d2e;
  --code-border: #d0d4e0;
  --code-btn: #d8dce8;
  --code-btn-hover: #c8ccd8;
  --code-label: #5a6480;
}

/* ── RESET ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── GLOBAL SCALE (desktop only — preserves mobile viewport) ── */
@media (min-width: 1024px) {
  html {
    zoom: 1.2;
  }
}

/* ── BASE TYPOGRAPHY & BODY ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ── SELECTION ── */
::selection {
  background: rgba(108,99,255,0.3);
  color: var(--text);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* ── BASE LINKS ── */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-bright);
}
