/* ============================================================
   BASE — Reset & Typography
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-base);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Scrollbar */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--bg-surface-4); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

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

/* Typography Scale */
h1 { font-size: var(--text-2xl); font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: -0.5px; }
h2 { font-size: var(--text-xl);  font-weight: var(--weight-semibold); line-height: var(--leading-tight); letter-spacing: -0.3px; }
h3 { font-size: var(--text-lg);  font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
h4 { font-size: var(--text-md);  font-weight: var(--weight-medium);   line-height: var(--leading-snug); }
h5 { font-size: var(--text-base);font-weight: var(--weight-medium);   line-height: var(--leading-normal); }

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
}

/* Focus visible (keyboard nav only) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) { outline: none; }

/* 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;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Prevent layout shift during page transitions */
img, video { display: block; max-width: 100%; }
