/* Design tokens, carried over from the index3.html prototype unchanged.
   Warm and bright by intent: paper, coral, teal and amber. No dark mode. */
:root {
  --bg: #F7F7F4;
  --surface: #FFFFFF;
  --text: #16161A;
  --text-dim: #52525B;
  --text-faint: #A1A1AA;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --accent: #FF4D6D;
  --accent-2: #00B8A9;
  --accent-3: #FF8A3D;
  --accent-soft: #FFF0F3;
  --accent-2-soft: #E6FAF7;
  --accent-3-soft: #FFF1E6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 20px -5px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.04);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w: 288px;
  --radius: 20px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  /* `clip`, not `hidden` — see the note on .main-content: `hidden` here would
     make the body a scroll container and break sticky positioning. */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* The soft radial wash that gives the prototype its warmth. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 77, 109, 0.04), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0, 184, 169, 0.04), transparent 40%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

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

.mono { font-family: var(--font-mono); }

/* Focus is always visible. Learners navigating by keyboard should never have
   to guess where they are. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Skip link for keyboard users, hidden until focused. */
.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

::selection { background: var(--accent-soft); color: var(--accent); }

/* Every animated lab respects this; see web/js/lib/canvas.js. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
