/* Every colour in this stylesheet is a neutral grey (R = G = B) on purpose:
   the interface must not lend the paintings any blue. */
:root {
  --bg: #1b1b1b;
  --panel: #242424;
  --line: #3a3a3a;
  --muted: #9a9a9a;
  --text: #e9e9e9;
  --strong: #ffffff;
  --card: #808080;
  color-scheme: dark;
  accent-color: #c8c8c8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}
::selection { background: #5a5a5a; color: #fff; }
:focus-visible { outline: 2px solid #f0f0f0; outline-offset: 2px; }
a { color: var(--strong); }
button, select, input { font: inherit; color: inherit; }
button, select {
  background: var(--panel); border: 1px solid #555; border-radius: 6px;
  padding: .45em .8em; cursor: pointer; min-height: 40px;
}
button:hover, select:hover { border-color: #888; }
button[aria-pressed="true"] { background: #e9e9e9; color: #111; border-color: #e9e9e9; }

.intro, main, footer { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.intro { padding-top: 40px; padding-bottom: 8px; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted); margin: 0; font-family: system-ui, sans-serif; }
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; margin: .2em 0 .25em; font-weight: 600; letter-spacing: -.01em; }
.lede { font-size: 1.15rem; max-width: 46em; color: #d4d4d4; margin: 0; }
h2 { font-size: 1.55rem; margin: 0 0 .3em; font-weight: 600; }
.num { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border: 1px solid #777; border-radius: 50%; font-size: .7em; vertical-align: .2em; margin-right: .35em; font-family: system-ui, sans-serif; }
section { padding: 36px 0 12px; border-bottom: 1px solid var(--line); }
.section-head p { max-width: 50em; margin: 0 0 14px; color: #cfcfcf; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; font-family: system-ui, sans-serif; font-size: 14px; }
.tabs button { border-radius: 999px; }
.tabs button[aria-selected="true"] { background: #e9e9e9; color: #111; border-color: #e9e9e9; }
.tabs .tick { margin-left: .35em; }

/* ---- studies ---- */
.study { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 22px; align-items: start; }
.stage-wrap { min-width: 0; }
.stage { position: relative; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; border-radius: 4px; overflow: hidden; background: #000; line-height: 0; }
.stage canvas { display: block; width: 100%; height: auto; }
.stage #card { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage-controls { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-family: system-ui, sans-serif; font-size: 14px; }
.size { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.size input { width: 140px; }
.study-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.ask { font-size: 1.3rem; margin: 0 0 12px; }
.readout { display: flex; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.probe-swatch { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--card); flex: none; }
.probe-label { margin: 0; color: var(--muted); font: 12px/1.3 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; }
.probe-values { margin: 2px 0; font: 600 17px/1.3 ui-monospace, Menlo, Consolas, monospace; }
.probe-verdict { margin: 0; font-size: 14px; color: #d0d0d0; }
.reveal { margin-top: 12px; }
.reveal p { margin: 0 0 10px; }
.plain { display: flex; gap: 12px; align-items: center; background: #ededed; color: #222; border-radius: 6px; padding: 10px; font-size: 13px; }
.plain p { margin: 0; }
.plain-chip { width: 64px; height: 44px; border-radius: 3px; flex: none; }
.progress { color: var(--muted); font: 13px/1.4 system-ui, sans-serif; margin: 12px 0 0; }
details.why { margin: 22px 0 14px; max-width: 52em; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
details.why summary { cursor: pointer; font-weight: 600; }
details.why p { color: #d0d0d0; }

/* ---- mixer ---- */
.mixer { display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.well { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.blob { width: 46px; height: 46px; border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%; box-shadow: inset -4px -5px 8px rgba(0,0,0,.35), inset 3px 3px 5px rgba(255,255,255,.18); }
.well-name { margin: 0; font-weight: 600; line-height: 1.2; }
.well-note { margin: 0; font: 12px/1.3 system-ui, sans-serif; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 40px; padding: 0; font-size: 20px; line-height: 1; }
.stepper output { min-width: 1.6em; text-align: center; font: 600 16px ui-monospace, Menlo, monospace; }
.palette-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-family: system-ui, sans-serif; font-size: 14px; }
.hint { font-size: 14px; color: #d6d6d6; background: var(--panel); border-left: 3px solid #999; padding: 8px 10px; margin: 12px 0 0; }
.ratio { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin-top: 12px; background: #333; }
.ratio span { display: block; height: 100%; }
.brief { margin: 0 0 10px; font-size: 1.05rem; }
.field-wrap { line-height: 0; border-radius: 4px; overflow: hidden; }
#field { width: 100%; height: auto; display: block; image-rendering: auto; }
.field-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; font-family: system-ui, sans-serif; font-size: 14px; }
.goals { list-style: none; padding: 0; margin: 6px 0; }
.goals li { padding: 5px 0 5px 30px; position: relative; color: #bdbdbd; }
.goals li::before { content: ""; position: absolute; left: 0; top: 7px; width: 18px; height: 18px; border: 2px solid #777; border-radius: 50%; }
.goals li.ok { color: var(--strong); }
.goals li.ok::before { background: #e9e9e9; border-color: #e9e9e9; }
.goals li.ok::after { content: ""; position: absolute; left: 6px; top: 10px; width: 5px; height: 9px; border: solid #111; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.done { background: #e9e9e9; color: #111; padding: 10px 12px; border-radius: 6px; margin: 8px 0; }
.readings { display: grid; gap: 10px; }
.reading { display: flex; gap: 12px; align-items: center; }
.chip { width: 46px; height: 46px; border-radius: 4px; flex: none; border: 1px solid #444; }
.chip.ghost { display: grid; place-items: center; color: var(--muted); background: transparent; border-style: dashed; font-size: 20px; }
.r-label { margin: 0; color: var(--muted); font: 12px/1.3 system-ui, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.r-val { margin: 2px 0 0; font-size: 15px; }
.spectrum { margin: 16px 0 0; }
.spectrum svg { width: 100%; height: auto; background: var(--panel); border-radius: 6px; }
.spectrum figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }

.notes ul { max-width: 52em; padding-left: 1.2em; }
.notes li { margin-bottom: .7em; color: #d0d0d0; }
footer { color: var(--muted); font-size: 13px; padding-top: 18px; padding-bottom: 40px; }

@media (max-width: 1000px) {
  .mixer { grid-template-columns: 1fr 1fr; }
  .analysis { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .spectrum { margin: 0; }
}
@media (max-width: 720px) {
  .study { grid-template-columns: 1fr; }
  .mixer { grid-template-columns: 1fr; }
  .canvas-col { order: -1; }
  .analysis { grid-template-columns: 1fr; }
  .intro { padding-top: 24px; }
  section { padding-top: 26px; }
}
@media (prefers-reduced-motion: no-preference) {
  .stage #card { transition: opacity .16s ease; }
}
