/* Quantum Ascent — shared widget look.
   Matches website/assets/css/site.css: warm editorial "paper", ink text, one
   forest-green brand accent, amber as the honest second outcome colour. NO
   neon / deep-space glow — that pop-sci cliché is exactly what this course
   avoids. Keep these tokens in sync with site.css. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;1,400&display=swap');

:root {
  --bg: #f8f6f1;
  --bg2: #f1eee6;
  --panel: #ffffff;
  --line: #e2dfd8;
  --text: #1a1a18;
  --muted: #6b6860;

  --accent: #1f7a4d;
  --accent-strong: #17603c;
  --accent-bg: #eaf6ee;
  --amber: #b45309;
  --amber-strong: #7c3a06;
  --amber-bg: #fdf3e7;
  --danger: #b3261e;

  /* Outcome palette used across the widgets. Two grounded, print-friendly
     hues (green = outcome 0 / Heads, amber = outcome 1 / Tails) plus ink for
     the "goal" prediction line. The names are kept from the old theme so the
     widget markup doesn't have to change — only the values are now on-brand. */
  --cyan: #1f7a4d;    /* outcome 0 / Heads — brand green */
  --violet: #b45309;  /* outcome 1 / Tails — amber      */
  --green: #1a1a18;   /* prediction / "goal" marker — ink */
  --red: #b3261e;     /* collapse marker — danger        */

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  padding: 14px;
}

.hint-bar {
  background: var(--accent-bg);
  border: 1px solid #cfe6d8;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--text);
  margin-bottom: 12px;
}
.hint-bar b { color: var(--accent-strong); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(26, 26, 24, 0.04);
}

label { color: var(--muted); display: block; margin: 8px 0 4px; font-weight: 500; }
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }

button {
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 15px;
  margin: 4px 4px 0 0;
  cursor: pointer;
  transition: transform .08s, filter .15s;
}
button:hover { filter: brightness(1.08); }
button:active { transform: scale(.96); }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.violet { background: var(--amber); color: #fff; }

/* Visually hidden but present for screen readers. Every widget carries one of
   these as an aria-live mirror of its canvas/bar state, so a blind or
   keyboard-only learner gets the same reading, at the same moment, as a
   sighted one. The primary teaching artifact of this course must not be
   sight-only; tests/test_widgets.py enforces that every widget has one. */
.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;
}

.readout { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.big { font-size: 18px; font-weight: 700; }

/* A fixed-size canvas (e.g. the Bloch sphere) must never spill past its frame. */
canvas { max-width: 100%; height: auto; }

/* On a phone-width embed, stack the widget's columns instead of squishing them. */
@media (max-width: 560px) {
  .wrap { flex-direction: column; }
}
