/* ═══════════════════════════════════════════════════
   GLOBALS — Reset + Base Styles
   ═══════════════════════════════════════════════════ */

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

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

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button, input, select, textarea {
  font-family: var(--font);
  font-size: 1rem;
}

button { cursor: pointer; border: none; background: none; }

ul, ol { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb {
  background: rgba(124, 111, 247, 0.30);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Selection ── */
::selection {
  background: var(--accent-glow-strong);
  color: var(--text-primary);
}

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

/* ── Typography ── */
h1 { font-size: clamp(1.5rem, 3vw, 2rem);   font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem;  font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }

p  { color: var(--text-secondary); line-height: 1.7; }

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

.text-muted    { color: var(--text-muted); }
.text-accent   { color: var(--accent); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-center   { text-align: center; }

.hidden { display: none !important; }
.flex   { display: flex; }
.grid   { display: grid; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }

/* ── Loading overlay ── */
#page-loader {
  position: fixed; inset: 0;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity var(--t-slow);
}
#page-loader.fade-out { opacity: 0; pointer-events: none; }

.loader-ring {
  width: 40px; height: 40px;
  border: 3px solid var(--accent-glow-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  gap: 1rem;
  text-align: center;
}
.empty-state svg { opacity: 0.4; }
.empty-state h3 { color: var(--text-secondary); font-size: 1rem; }
.empty-state p  { font-size: 0.875rem; max-width: 280px; }
