/* The palette, and nothing else. Both colour schemes are first-class: dark mode swaps the
   variables rather than restating the design, and the charts inherit them too — which is the
   main reason they are SVG and not the embedded PNGs this page used to carry.

   Kept in its own file because two pages are built from it: the report and the valuation
   form. They used to be two stylesheets with two palettes, so following the report's own
   "Try the valuation form" link landed the reader on a visually different site with no dark
   mode at all.

   The token names are shared with the other projects in this portfolio on purpose — one
   visual system, not five. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f6f8fa;
  --border: #e3e7ee;
  --text: #1c2430;
  --muted: #5b6472;
  --accent: #2563eb;
  --accent-soft: #93c5fd;
  /* Darker than the obvious #059669, which measures 3.5:1 on --surface — below AA for text
     this size, and it is the label on the one state a reader has to be able to trust. */
  --positive: #047857;
  --warn: #b45309;
  /* Distinct from --warn on purpose: the form has two different bad states, and colouring
     them alike would say a refused input and a heuristic answer are the same kind of event.
     One is the user's to fix, the other is the deployment's. */
  --danger: #b42318;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1319;
    --surface: #161c25;
    --border: #263041;
    --text: #e6eaf2;
    --muted: #98a3b6;
    --accent: #6ea8fe;
    --accent-soft: #2c4a7c;
    --positive: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
  }
}
/* Everything both published pages share: page frame, typography, cards, footer. The report
   adds charts and tables on top of this; the form adds inputs. Neither restates it. */

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  max-width: 62rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--accent); }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 0.35rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 1rem; margin: 1.5rem 0 0.25rem; }
p { margin: 0.5rem 0; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.note { color: var(--muted); font-size: 0.9rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.25rem 0;
}

.card.caution { border-left: 3px solid var(--warn); }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.5rem 0; }
.actions a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
}

code { font-size: 0.9em; }

footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

@media print {
  body { max-width: none; }
  details { display: none; }
}
/* The charts, shared by both published pages: the report draws them in Python and the
   valuation form draws its what-if curve in JavaScript, and they must look like one
   system rather than two. Class names are the contract between charts.py and curve.js. */

/* Charts scroll inside their own box; the page itself never scrolls sideways. The min-width
   is what makes that true: with `max-width: 100%` alone an SVG with a viewBox simply scales
   down, so `overflow-x` never fires and a 720 px chart renders at 44 % on a phone — taking
   11 px labels to under 5 px. Below this width the box scrolls instead of shrinking. */
.chart-wrap { overflow-x: auto; }
.chart { min-width: 34rem; max-width: 100%; height: auto; display: block; }
.chart text { font-size: 11px; fill: var(--text); }
.chart .bar-label { fill: var(--text); }
.chart .bar-value, .chart .axis { fill: var(--muted); font-size: 10.5px; }
.chart .bar { fill: var(--accent-soft); }
.chart .bar.served { fill: var(--accent); }
/* The fold-to-fold spread, drawn across the bar end. Deliberately the text colour rather
   than the bar's: it is a statement about the bar, not a part of it. */
.chart .spread { stroke: var(--text); stroke-width: 2; opacity: 0.8; }
.chart .spread-cap { stroke: var(--text); stroke-width: 1.5; opacity: 0.8; }
.chart .series {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .series-dot { fill: var(--accent); }
/* Points that only shape the line, next to the ones that carry a printed value. */
.chart .series-dot.minor { fill: var(--accent); opacity: 0.45; }
.chart .axis-line { stroke: var(--border); stroke-width: 1; }
/* Gridlines are a reading aid, not data: they must stay behind the series in weight as
   well as in paint order. */
.chart .grid { stroke: var(--border); stroke-width: 1; opacity: 0.7; }
/* What only the valuation form needs: the inputs, the banner that says what is answering
   them, and two visually different kinds of answer. Loaded after tokens.css and base.css.

   There used to be a third kind of answer here: an "offline estimate" from a formula in
   app.js, which needed a visibly weaker treatment so it could not be mistaken for a
   valuation. The model itself now runs in the page, so that answer — and the styling that
   hedged it — is gone. What remains is a prediction and a refusal. */

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 1.25rem 0;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.85rem 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

input, select {
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input:disabled, select:disabled, button:disabled { opacity: 0.55; }

button {
  margin-top: 1.1rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* The banner above the form: what will answer it, said before the reader spends a submit
   finding out. Two states now say "a model is answering, and here is which one"; the third is
   the refusal that replaced the old fallback. */
.status { margin: 1.25rem 0; }
.status.live { border-left: 3px solid var(--positive); }
.status.broken { border-left: 3px solid var(--danger); }
.status-label { font-weight: 600; font-size: 0.85rem; }
.status.live .status-label { color: var(--positive); }
.status.broken .status-label { color: var(--danger); }
.status p { margin: 0.35rem 0 0; font-size: 0.92rem; color: var(--muted); }

/* The what-if sliders sit under the field they move, quieter than the field itself: they are
   a way to explore the model's answer, not a second place to enter the car. */
.slider {
  width: 100%;
  padding: 0;
  margin-top: 0.15rem;
  border: none;
  background: none;
  accent-color: var(--accent);
}

.result { margin: 1.25rem 0; }
.result.prediction { border-left: 3px solid var(--accent); }
.result.refused { border-left: 3px solid var(--danger); }
/* Nothing is wrong yet — the form is simply not filled in, and colouring that like a refusal
   would tell the reader off for having started. */
.result.pending { border-left: 3px solid var(--border); }

.result-label { font-weight: 600; font-size: 0.85rem; }
.result.prediction .result-label { color: var(--accent); }
.result.refused .result-label { color: var(--danger); }
.result.pending .result-label { color: var(--muted); }

/* No transition on the figure. It is replaced rather than updated on every keystroke, so a
   transition would never run — and a rule that cannot fire is worse than none: it reads as a
   considered choice about motion while doing nothing. The live update is a text change with no
   movement, which is what `prefers-reduced-motion` would have asked for anyway. */

.price {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 0.2rem 0 0;
}

.result p.note { margin: 0.4rem 0 0; }

.problems { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.92rem; }
.problems li { margin: 0.15rem 0; }
