/* HTML CSS JS Compiler – base tokens & reset */
:root {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #1a2332;
  --text: #e8eef7;
  --muted: #94a3b8;
  --border: #243044;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --focus: #38bdf8;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --font: "Segoe UI", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "SF Mono", "Consolas", ui-monospace, monospace;
  --header-h: 56px;
  --max: 1280px;
  --transition: 150ms ease;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0f172a;
  --muted: #64748b;
  --border: #d7e0ea;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-soft: rgba(2, 132, 199, 0.1);
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 1000;
  background: var(--accent);
  color: #041018;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
}

h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

p strong,
li strong {
  color: var(--text);
}

ul,
ol {
  color: var(--muted);
}

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

kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

pre code {
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.55;
}

.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;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 1.25rem, 1440px);
  margin-inline: auto;
}
