/* ============================================================
   BASE.CSS — Design System Tokens & Global Resets
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Light Mode (default) ──────────────────────────────────── */
:root,
[data-theme="light"] {
  --color-bg:           #f0f4f9;
  --color-surface:      #ffffff;
  --color-surface-2:    #f8fafc;
  --color-border:       #e2e8f0;
  --color-text:         #1a202c;
  --color-text-muted:   #64748b;
  --color-accent:       #1a73e8;
  --color-accent-hover: #1557b0;
  --color-accent-light: #e8f0fe;
  --color-success:      #10b981;
  --color-warning:      #f59e0b;
  --color-danger:       #ef4444;

  --shadow-card:   0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-hover:  0 4px 12px rgba(0,0,0,.12), 0 8px 32px rgba(0,0,0,.08);
  --shadow-modal:  0 20px 60px rgba(0,0,0,.18);

  --radius-card:  14px;
  --radius-btn:   8px;
  --radius-input: 8px;

  --transition: 0.2s ease;
}

/* ── Dark Mode ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg:           #0f1117;
  --color-surface:      #1a1a2e;
  --color-surface-2:    #16213e;
  --color-border:       #2d3748;
  --color-text:         #e2e8f0;
  --color-text-muted:   #94a3b8;
  --color-accent:       #4d94fc;
  --color-accent-hover: #6ba8fd;
  --color-accent-light: rgba(77,148,252,.12);
  --color-success:      #34d399;
  --color-warning:      #fbbf24;
  --color-danger:       #f87171;

  --shadow-card:  0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.4), 0 8px 32px rgba(0,0,0,.3);
  --shadow-modal: 0 20px 60px rgba(0,0,0,.5);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent-hover); }

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

ul { list-style: none; }

/* ── Typography Scale ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--color-text-muted); }

/* ── Focus Outline ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Utility classes ───────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0; white-space: nowrap;
}

.mono { font-family: 'DM Mono', monospace; }

/* ── Scrollbar (webkit) ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
