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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-canvas);
  min-height: 100vh;
}

h1 { font-size: var(--text-3xl); font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; }
h2 { font-size: var(--text-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; }
h3 { font-size: var(--text-xl); font-weight: 600; line-height: 1.3; }
h4 { font-size: var(--text-lg); font-weight: 600; line-height: 1.35; }
h5 { font-size: var(--text-md); font-weight: 500; }
h6 { font-size: var(--text-base); font-weight: 500; }

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

a { transition: color var(--t-fast), opacity var(--t-fast); }
a:hover { color: var(--accent-hover); }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  color: var(--accent-hover);
}

pre {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  overflow-x: auto;
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

::selection {
  background: var(--accent-dim);
  color: var(--text-primary);
}

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

.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; }
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-accent    { color: var(--accent) !important; }
.text-danger    { color: var(--color-danger) !important; }
.text-success   { color: var(--color-success) !important; }
.text-warning   { color: var(--color-warning) !important; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.flex        { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.mt-auto { margin-top: auto; }
.hidden { display: none !important; }


@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.theme-toggle[hidden] { display: none !important; }
