:root {
  --bg: #0e0e12;
  --surface: #17171e;
  --card: #1e1e28;
  --border: rgba(255,255,255,0.06);
  --text: #e8e6e1;
  --muted: #908e88;
  --accent-purple: #7f77dd;
  --accent-teal: #1d9e75;
  --accent-amber: #ef9f27;
  --heading: 'DM Serif Display', Georgia, serif;
  --body: 'DM Sans', system-ui, sans-serif;
  --radius: 16px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 800px; margin: 0 auto; padding: 3rem 1.5rem 6rem; }
.hero { text-align: center; padding: 4rem 0 3rem; }
.hero h1 {
  font-family: var(--heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto; font-size: 15px; }
section { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border); }
section h2 { font-family: var(--heading); font-size: 1.6rem; font-weight: 400; margin-bottom: 0.5rem; }
.section-number { display: inline-block; font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.5rem; }
section .desc { color: var(--muted); font-size: 15px; margin-bottom: 1.5rem; max-width: 600px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 1rem; }
.panel canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.panel canvas:active { cursor: grabbing; }
.canvas-wrap { width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--card); }
.panel svg { width: 100%; height: auto; display: block; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 1rem; }
.controls button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  font-family: var(--body);
  font-size: 13px;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.controls button:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.controls button.active { background: rgba(127,119,221,0.15); border-color: var(--accent-purple); color: #cfcbf6; }
.info-line { text-align: center; font-size: 14px; color: var(--muted); margin-top: 0.75rem; min-height: 2.8em; line-height: 1.5; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent-amber); border: none; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent-amber); border: none; }
.learn-note {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(127,119,221,0.06);
  border-left: 3px solid var(--accent-purple);
  border-radius: 0 12px 12px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.learn-note strong { color: var(--text); font-weight: 500; }
.learn-note code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.05);
  padding: 1px 5px;
  border-radius: 4px;
}
@media (max-width: 520px) {
  .page { padding: 2rem 1rem 4rem; }
  section { margin-top: 3rem; padding-top: 2rem; }
}
