/* CostBand — a data instrument.
   Numbers lead and carry their provenance; prose supports. */

:root {
  /* Warm neutrals: paper, not screen-grey */
  --bg:         #FAFAF8;
  --bg-alt:     #F2F2EE;
  --surface:    #FFFFFF;
  --surface-2:  #F5F5F1;
  --ink:        #16181C;
  --ink-2:      #3A4149;
  --muted:      #6E7681;
  --faint:      #99A1AB;
  --line:       #E6E6E0;
  --line-2:     #D4D4CC;

  --accent:     #B26A05;
  --accent-2:   #DD9012;
  --accent-bg:  #FDF5E6;
  --accent-line:#E8C88A;

  --up:         #A63F22;
  --down:       #2C6A4B;
  --up-bg:      #FBF0EC;
  --down-bg:    #ECF5F0;

  --band-a:     #9AA6B2;
  --band-b:     #3A4149;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;

  --sh-1: 0 1px 2px rgba(22,24,28,.04), 0 1px 3px rgba(22,24,28,.03);
  --sh-2: 0 1px 2px rgba(22,24,28,.05), 0 6px 20px -6px rgba(22,24,28,.10);
  --sh-3: 0 2px 4px rgba(22,24,28,.05), 0 14px 40px -10px rgba(22,24,28,.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #0D1014;
    --bg-alt:     #11151A;
    --surface:    #161B21;
    --surface-2:  #1D242C;
    --ink:        #EEF1F4;
    --ink-2:      #C3CBD3;
    --muted:      #8B95A1;
    --faint:      #6B7480;
    --line:       #232B34;
    --line-2:     #303A45;

    --accent:     #E9A93B;
    --accent-2:   #FFC663;
    --accent-bg:  #221A0A;
    --accent-line:#5A4415;

    --up:         #E8886A;
    --down:       #5CB98D;
    --up-bg:      #241511;
    --down-bg:    #10231B;

    --band-a:     #55606C;
    --band-b:     #A9B5C1;

    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -6px rgba(0,0,0,.5);
    --sh-3: 0 2px 4px rgba(0,0,0,.4), 0 14px 40px -10px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
p a, li a, .prose a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
p a:hover, li a:hover, .prose a:hover { text-decoration-color: var(--accent); color: var(--accent); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 740px; margin: 0 auto; padding: 0 24px; }

/* ══ masthead ══ */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner { display: flex; align-items: center; gap: 32px; height: 62px; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 17.5px; font-weight: 640; letter-spacing: -.025em; }
.logo-mark { flex: none; display: block; }
.logo:hover { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 7px 12px; border-radius: var(--r-sm);
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-bg); }

/* Narrow screens: the mark alone carries the brand so all three nav items fit. */
@media (max-width: 580px) {
  .masthead-inner { gap: 14px; height: 56px; }
  .logo-word { display: none; }
  .nav a { padding: 6px 10px; font-size: 13.5px; }
  .wrap, .wrap-narrow { padding: 0 18px; }
}

/* ══ type ══ */
h1 {
  font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08;
  letter-spacing: -.032em; font-weight: 660; margin: 0 0 14px;
}
h2 {
  font-size: clamp(19px, 2.2vw, 23px); line-height: 1.25;
  letter-spacing: -.02em; font-weight: 640; margin: 0 0 16px;
}
h3 { font-size: 16px; line-height: 1.4; font-weight: 620; letter-spacing: -.01em; margin: 0 0 6px; }

.lede { font-size: 17.5px; line-height: 1.6; color: var(--ink-2); margin: 0; max-width: 60ch; }
.prose p { max-width: 68ch; }
.prose ul { max-width: 68ch; padding-left: 20px; }
.prose li { margin-bottom: 6px; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}

/* section heading with a hairline that fills the row */
.section-head {
  display: flex; align-items: baseline; gap: 16px;
  margin: 56px 0 20px;
}
.section-head h2 { margin: 0; white-space: nowrap; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-head .note { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ══ breadcrumbs ══ */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); padding: 20px 0 0;
}
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); }
.crumbs [aria-current] { color: var(--ink-2); }

/* ══ surfaces ══ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px; box-shadow: var(--sh-1);
}
.card-flush { padding: 0; overflow: hidden; }
.card-quiet { background: var(--bg-alt); box-shadow: none; }

/* ══ hero ══ */
.hero { padding: 68px 0 8px; }
.hero .lede { margin-top: 4px; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.statstrip {
  display: grid; gap: 1px; margin: 44px 0 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
}
.stat { background: var(--surface); padding: 18px 20px; }
.stat-num {
  font-family: var(--mono); font-size: 23px; font-weight: 600;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ══ the price band ══ */
.band-card { box-shadow: var(--sh-2); margin: 26px 0; padding: 26px; }

.calc { display: grid; gap: 30px; grid-template-columns: 1fr; }

/* Narrow screens read the price first - it is the answer they came for.
   Wide screens put the controls beside it where both stay in view. */
.calc-result { order: 1; }
.calc-controls { order: 2; padding-top: 24px; border-top: 1px solid var(--line); }

@media (min-width: 860px) {
  .calc { grid-template-columns: 320px 1fr; }
  .calc-controls { order: 1; padding-top: 0; border-top: 0; }
  .calc-result { order: 2; }
}

.band-figure {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(32px, 5.2vw, 50px); letter-spacing: -.045em;
  line-height: 1.02; font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.band-figure .cur { color: var(--faint); font-size: .55em; vertical-align: .22em; margin-right: 3px; letter-spacing: 0; }
.band-sub { font-size: 13.5px; color: var(--muted); margin-top: 7px; }

.band {
  position: relative; height: 46px; margin: 30px 0 10px;
  border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px solid var(--line); overflow: hidden;
}
.band-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--band-a) 0%, var(--band-b) 100%);
  opacity: .3;
}
.band-ticks { position: absolute; inset: 0; display: flex; }
.band-ticks span { flex: 1; border-right: 1px solid var(--surface); opacity: .35; }
.band-ticks span:last-child { border-right: 0; }

.band-marker {
  position: absolute; top: -1px; bottom: -1px; width: 3px;
  background: var(--accent); border-radius: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--surface) 85%, transparent);
  transition: left .3s cubic-bezier(.22,.7,.28,1);
}
.band-marker::after {
  content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--accent);
}
.band-ends {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.band-ends b { color: var(--ink-2); font-weight: 600; }

/* ══ badges & pills ══ */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  padding: 6px 11px; border-radius: 100px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface-2);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.badge-high { background: var(--down-bg); border-color: color-mix(in srgb, var(--down) 30%, transparent); color: var(--down); }
.badge-high .badge-dot { background: var(--down); }
.badge-medium { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent); }
.badge-medium .badge-dot { background: var(--accent); }
.badge-none .badge-dot { background: var(--faint); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 550; letter-spacing: .01em;
  padding: 3px 9px; border-radius: 100px; border: 1px solid var(--line-2);
  color: var(--muted); background: var(--surface-2);
}
.pill-live { color: var(--down); background: var(--down-bg); border-color: color-mix(in srgb, var(--down) 28%, transparent); }
.pill-partial { color: var(--accent); background: var(--accent-bg); border-color: var(--accent-line); }

/* ══ provenance ══ */
.provenance { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.prov-line {
  display: flex; gap: 8px; font-size: 12.5px; line-height: 1.6;
  color: var(--muted); margin-bottom: 5px;
}
.prov-line::before { content: "↳"; color: var(--faint); flex: none; }
.prov-line a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.prov-line a:hover { color: var(--accent); }

/* ══ form controls ══ */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.5; }

select, input[type="number"], input[type="text"] {
  width: 100%; padding: 10px 12px; font-size: 14.5px; font-family: inherit;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color .12s, box-shadow .12s;
}
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
select:focus, input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 100px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  transition: border-color .12s, background .12s, color .12s;
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 620;
}

/* ══ tables ══ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 500;
  padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num { font-family: var(--mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }

/* ══ trend ══ */
.trend-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.delta {
  font-family: var(--mono); font-size: 13px; font-weight: 620;
  padding: 2px 8px; border-radius: 100px; font-variant-numeric: tabular-nums;
}
.delta-up { color: var(--up); background: var(--up-bg); }
.delta-down { color: var(--down); background: var(--down-bg); }
.spark { display: block; width: 100%; height: 56px; margin: 14px 0 2px; }

/* ══ ad slot ══ */
.adslot {
  margin: 30px 0; padding: 16px; border: 1px dashed var(--line-2);
  border-radius: var(--r); background: var(--bg-alt); text-align: center;
  color: var(--faint); font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase;
}

/* ══ grids & tiles ══ */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid-wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1);
  transition: border-color .14s, box-shadow .14s, transform .14s;
}
.tile:hover { border-color: var(--line-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.tile-name { font-size: 15.5px; font-weight: 620; letter-spacing: -.012em; line-height: 1.3; }
.tile-meta {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-top: auto;
}
.tile-price {
  font-family: var(--mono); font-size: 19px; font-weight: 600;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* ══ notice ══ */
.notice {
  border-left: 3px solid var(--accent); background: var(--accent-bg);
  padding: 15px 18px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 14px; color: var(--ink-2);
}
.notice strong { color: var(--ink); }

.empty {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  padding: 26px; border: 1px dashed var(--line-2); border-radius: var(--r);
  background: var(--bg-alt);
}

/* ══ buttons ══ */
.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--ink); color: var(--bg);
  font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .14s, color .14s;
}
.cta:hover { background: var(--accent); color: #fff; }
.cta-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.cta-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--accent-line); }
.cta[disabled] { opacity: .45; cursor: not-allowed; }
.cta[disabled]:hover { background: var(--ink); color: var(--bg); }

/* ══ footer ══ */
.foot { margin-top: 84px; border-top: 1px solid var(--line); background: var(--surface); }
.foot-cols {
  display: grid; gap: 32px; padding: 44px 0 32px;
  grid-template-columns: 1.6fr 1fr 1fr;
}
@media (max-width: 720px) { .foot-cols { grid-template-columns: 1fr; gap: 26px; } }
.foot h4 {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 12px;
}
.foot-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--accent); }
.foot-blurb { font-size: 14px; color: var(--muted); max-width: 42ch; margin: 0; line-height: 1.65; }
.foot-bar {
  border-top: 1px solid var(--line); padding: 18px 0 28px;
  font-size: 12.5px; color: var(--faint);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ══ utilities ══ */
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 13px; }
.tight { margin-top: 0; }

/* ══ article body ══ */
.article-body { font-size: 17px; line-height: 1.72; color: var(--ink-2); }
.article-body > * + * { margin-top: 20px; }
.article-body h2 {
  font-size: 21px; color: var(--ink); margin: 44px 0 0;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.article-body h3 { font-size: 16.5px; color: var(--ink); margin-top: 30px; }
.article-body strong { color: var(--ink); font-weight: 620; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body li::marker { color: var(--faint); }

/* Every number in an article comes from the dataset, and is marked as such. */
.article-body .figure {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: .94em; font-weight: 600; color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 1px; white-space: nowrap;
}
.article-body a.figure:hover { color: var(--accent); border-bottom-color: var(--accent); }
.article-body .unresolved {
  font-family: var(--mono); font-size: .9em; color: var(--up);
  background: var(--up-bg); padding: 1px 6px; border-radius: 4px;
}

.article-body blockquote {
  margin: 26px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent-line); color: var(--muted);
  font-size: 16px;
}
.article-body .callout {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px 22px; font-size: 15.5px;
}
.article-body .callout p { margin: 0; }
.article-body .callout p + p { margin-top: 12px; }
