/* wouldcop — one stylesheet for every page.
 *
 * Before this, index/about/tracking each carried their own inline <style>, which is
 * exactly how they drifted into three different grounds, three inks and three
 * accents. One file, one token set, no page-local colour.
 *
 * ACCENT IS LODEN #4E6B45, and that is not a preference. It is the first entry in
 * AVATAR_PALETTE (covet src/bsky/avatar.ts) — the colour every magpie avatar in the
 * fleet is generated from — and that list is APPEND-ONLY because combo indices are
 * handle hashes. So loden is the one value in the system with a downstream
 * dependency that cannot be retroactively changed. The site moves to it; it does
 * not move to the site. (Karl, 2026-07-30.)
 */

/* ---- Fonts: self-hosted, no third-party request ----------------------------
 * wouldcop tells visitors it never asks for an email and publishes what it tracks.
 * A font request to a third party on every page view would quietly contradict that.
 * 200 KB, latin subset, OFL — see fonts/LICENSE.md. `swap` so text is readable
 * immediately rather than invisible while a face loads.
 */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-normal-300_700.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-variable.woff2") format("woff2-variations");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-normal-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-normal-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Ground and ink carry over from the existing site — the warm paper is the part
   * of the identity that was already right. */
  --paper: #f1eada;
  --card: #f7f2e8;
  --ink: #1f2421;
  --muted: #5c5a50;
  --line: #e0d8c5;
  --rule: #c9be9f;

  --accent: #4e6b45;        /* loden — see the header */
  --accent-deep: #2e4430;
  --gold: #8a6d1d;          /* the evidence colour: comps cheaper than the listing */
  --gold-weak: rgba(138, 109, 29, 0.34); /* asking-price basis, deliberately fainter */

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-ui: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Every number sets in mono and tabular. A price that shifts width between two
   * posts reads as sloppier than the claim it carries. */
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 34rem;
  --page: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14170f; --card: #1b1f16; --ink: #e8e6dd; --muted: #9aa38f;
    --line: #2f3527; --rule: #3d4534;
    --accent: #8fb083; --accent-deep: #a9c49e; --gold: #c9a544;
    --gold-weak: rgba(201, 165, 68, 0.3);
  }
}
/* An explicit toggle must beat the system preference in BOTH directions — a media
 * query alone cannot be overridden back to light on a dark-set device. */
:root[data-theme="light"] {
  --paper: #f1eada; --card: #f7f2e8; --ink: #1f2421; --muted: #5c5a50;
  --line: #e0d8c5; --rule: #c9be9f;
  --accent: #4e6b45; --accent-deep: #2e4430; --gold: #8a6d1d;
  --gold-weak: rgba(138, 109, 29, 0.34);
}
:root[data-theme="dark"] {
  --paper: #14170f; --card: #1b1f16; --ink: #e8e6dd; --muted: #9aa38f;
  --line: #2f3527; --rule: #3d4534;
  --accent: #8fb083; --accent-deep: #a9c49e; --gold: #c9a544;
  --gold-weak: rgba(201, 165, 68, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.62 var(--font-ui);
  -webkit-text-size-adjust: 100%;
}

main { max-width: var(--page); margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
.measure { max-width: var(--measure); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.15; margin: 3rem 0 0.7rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.4rem; }

p { margin: 0 0 1rem; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lede { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.5; color: var(--muted); }
.kicker {
  font: 500 0.74rem/1 var(--font-ui); text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--muted); margin: 0 0 0.7rem;
}
.muted { color: var(--muted); }
.hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Numbers. Tabular everywhere they stand as figures. */
.num, .price, table td.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.1rem 1.25rem;
}

.btn {
  display: inline-block; font: 500 0.95rem/1 var(--font-ui);
  padding: 0.7rem 1.05rem; border-radius: 8px;
  border: 1px solid var(--accent); color: var(--accent-deep);
  background: transparent; text-decoration: none;
}
.btn:hover { background: color-mix(in oklab, var(--accent) 10%, transparent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--paper); }

/* ---- The comp distribution -------------------------------------------------
 * The product's one true idea, made visible. Bars are the sold-comp distribution;
 * gold bars are comps CHEAPER than the listing; the rule marks where the listing
 * sits. Rendered from real comps by deploy/gen-site.py — there is no synthetic
 * variant, because a drawn distribution with no data behind it is the exact thing
 * this graphic exists to disprove.
 */
.dist { margin: 1rem 0 0.4rem; }
.dist-plot {
  position: relative; height: 96px;
  display: flex; align-items: flex-end; gap: 2px;
}
.dist-bar { flex: 1 1 0; border-radius: 1px 1px 0 0; background: rgba(31, 36, 33, 0.16); }
@media (prefers-color-scheme: dark) { .dist-bar { background: rgba(232, 230, 221, 0.16); } }
:root[data-theme="dark"] .dist-bar { background: rgba(232, 230, 221, 0.16); }
:root[data-theme="light"] .dist-bar { background: rgba(31, 36, 33, 0.16); }
.dist-bar.is-cheaper { background: var(--gold); }
/* Asking-price basis: same shape, visibly weaker ink, because it IS weaker
 * evidence — and it is why no dollar saving may be quoted off it. */
.dist.is-asking .dist-bar.is-cheaper { background: var(--gold-weak); }
.dist-marker {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--accent); border-radius: 1px;
}
.dist-axis {
  display: flex; justify-content: space-between;
  font: 400 0.74rem/1 var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--muted); margin-top: 0.5rem;
}
.dist-caption { font-size: 0.82rem; color: var(--muted); margin: 0.35rem 0 0; }
.dist-legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--muted); margin-top: 0.6rem;
}
.dist-legend i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.3rem; }

/* ---- A post, shown as it actually appears ---------------------------------- */
.post { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; background: var(--card); }
.post-who { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.55rem; }
.post-who img { width: 2.2rem; height: 2.2rem; border-radius: 50%; }
.post-name { font-weight: 600; font-size: 0.94rem; }
.post-handle { color: var(--muted); font-size: 0.86rem; }
.badge {
  font: 500 0.68rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.18rem 0.45rem; color: var(--muted);
}
.post-text { margin: 0 0 0.8rem; font-size: 1rem; line-height: 1.5; }

.grid { display: grid; gap: 1.1rem; }
@media (min-width: 44rem) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
th { font: 500 0.74rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.scroll { overflow-x: auto; }

.nav { display: flex; gap: 1.2rem; align-items: baseline; padding: 1.25rem 0 0; font-size: 0.92rem; }
.nav-brand { font-family: var(--font-display); font-size: 1.15rem; margin-right: auto; }
.foot { margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.86rem; color: var(--muted); }

img { max-width: 100%; height: auto; }

/* ---- The catalog (tracking.html) -------------------------------------------
 * Its own class rather than `.grid`: this is a multi-COLUMN list, not a CSS grid,
 * and overloading the name gave the catalog a single column.
 */
.catalog { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.6rem; }
.catalog li { padding: 0.18rem 0; break-inside: avoid; font-size: 0.96rem; }
@media (max-width: 34rem) { .catalog { columns: 1; } }
.ct { color: var(--muted); font-weight: 400; font-size: 0.8rem; font-family: var(--font-mono); }
h2 .ct { margin-left: 0.4rem; }
