/* PayoutCurve — site-specific layer.

   base.css supplies the design tokens (--bg, --panel, --ink, --accent, radii,
   shadows) and the button/pill primitives. app.css supplies the nav, hero and
   stat-band chassis inherited from the sibling sites. Everything below is the
   markup this site adds: sections, tables, the Lorenz plot and the distribution
   visualisations.

   Both themes are styled throughout. The accent is published as CSS variables by
   js/brand.js on load and re-published on every theme change, so nothing here
   hardcodes a brand colour. */

/* --- layout --------------------------------------------------------------- */

.sec-in,
.band-in,
.hero-in,
.foot-in {
  width: min(100% - 44px, var(--maxw));
  margin-inline: auto;
}

.sec { padding: 74px 0; position: relative; }
.sec-alt { background: var(--panel); border-block: 1px solid var(--line); }
.sec h2 {
  font-size: clamp(25px, 3.1vw, 37px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin: 0 0 14px;
}
.sec p { margin: 0 0 14px; }

.lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 74ch;
}
.sec p:not(.lede):not(.note) {
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--ink-2);
  max-width: 74ch;
}
.note {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-3, var(--ink-2));
  max-width: 74ch;
  margin-top: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--accent-line);
}
.muted { color: var(--ink-3, var(--ink-2)); opacity: 0.78; }
.strong { font-weight: 700; color: var(--ink); }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: -0.01em; word-break: break-all; }

/* --- page head + hero ----------------------------------------------------- */

.page-head { padding: 88px 0 8px; }
.page-head h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.032em;
  margin: 6px 0 18px;
}

.hero { padding: 96px 0 24px; }
.hero h1 {
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.038em;
  margin: 8px 0 22px;
  max-width: 18ch;
}
.hero-figure {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent-text);
  white-space: nowrap;
}
.hero-sub {
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 66ch;
  margin: 0 0 28px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
/* The dark-mode selector is not redundant. base.css carries
     :root[data-theme='dark'] .btn { background: var(--panel); }
   at specificity (0,3,0), which beats a bare `.btn-primary` at (0,1,0) no matter
   how late this file loads. Without the second selector the primary button in
   dark mode renders near-black ink on a near-black panel — invisible, and it
   looked fine in light mode, so it survived the first visual pass.
   `.btn.btn-primary` is (0,4,0) and wins. The same trap applies to the chassis's
   own `.btn-accent`. */
/* Light and dark need DIFFERENT ink, not the same pair reused.
   Measured with WCAG contrast: the light accent fill (#C026D3) under the dark
   accent ink is only 3.77:1, which fails AA for 14px text. The darker accent
   (--accent-text, #A21CAF) under white is 6.03:1. In dark mode the fill is light
   (#E879F9) and the dark ink gives 7.22:1, so that pair is kept there. */
.btn-primary {
  background: var(--accent-text);
  color: #fff;
  border-color: transparent;
  font-weight: 650;
}
:root[data-theme='dark'] .btn.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover,
:root[data-theme='dark'] .btn.btn-primary:hover {
  filter: brightness(1.08);
}
.hero-ci {
  font-size: 14px;
  color: var(--accent-text);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  margin: 0 0 6px;
}
.hero-ci:empty { display: none; }
.hero-caveat { font-size: 13.5px; color: var(--ink-3, var(--ink-2)); opacity: 0.85; }

/* --- stat band ------------------------------------------------------------ */

.band { padding: 30px 0 6px; }
.band-in {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.band-in .stat {
  background: var(--panel-solid);
  padding: 24px 22px;
  border: 0;
}
.band-in .stat-v {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 750;
  letter-spacing: -0.026em;
  line-height: 1.1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.band-in .stat:first-child .stat-v { color: var(--accent-text); }

/* --- cards ---------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 26px;
}
.card {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-big {
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.026em;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
}
.card h3 { font-size: 14.5px; margin: 0 0 7px; letter-spacing: -0.005em; }
.card p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 0; }

/* --- callouts ------------------------------------------------------------- */

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  background: var(--panel-solid);
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 82ch;
}
.callout strong { color: var(--ink); }
.callout-warn { border-left-color: #C08A00; }
.callout-bad { border-left-color: var(--bad); }

/* --- mean vs median ------------------------------------------------------- */

.compare { margin-top: 26px; display: grid; gap: 14px; }
.cmp-row {
  display: grid;
  grid-template-columns: 92px 1fr 130px;
  grid-template-areas: 'label track val' '. note note';
  align-items: center;
  gap: 6px 16px;
}
.cmp-label { grid-area: label; font-weight: 650; font-size: 15px; }
.cmp-track {
  grid-area: track;
  height: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.cmp-bar { height: 100%; border-radius: 999px; transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
.cmp-bar.is-mean { background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.cmp-bar.is-median { background: var(--bad); }
.cmp-val {
  grid-area: val;
  text-align: right;
  font-weight: 750;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.cmp-note { grid-area: note; font-size: 12.5px; color: var(--ink-3, var(--ink-2)); opacity: 0.8; }

/* --- zero vs earners split ------------------------------------------------ */

.split-viz {
  display: flex;
  margin-top: 26px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  min-height: 108px;
  box-shadow: var(--shadow-sm);
}
.split-seg {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  min-width: 0;
  transition: flex-grow 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.split-seg.is-zero { background: color-mix(in srgb, var(--bad) 16%, var(--panel-solid)); }
.split-seg.is-some { background: var(--accent-soft); }
.split-n { font-size: 27px; font-weight: 750; letter-spacing: -0.024em; font-variant-numeric: tabular-nums; }
.split-l { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }

/* --- venues --------------------------------------------------------------- */

.venues { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 26px; }
.venue {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-top: 3px solid var(--venue, var(--accent));
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.venue-share {
  font-size: 34px;
  font-weight: 780;
  letter-spacing: -0.028em;
  color: var(--venue, var(--accent-text));
  font-variant-numeric: tabular-nums;
}
.venue h3 { margin: 4px 0 2px; font-size: 16px; }
.venue-sol { font-size: 12.5px; color: var(--ink-3, var(--ink-2)); opacity: 0.85; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.venue p { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 0; }

/* --- tables --------------------------------------------------------------- */

.table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel-solid);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.tbl th, .tbl td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 650;
  color: var(--ink-3, var(--ink-2));
  opacity: 0.9;
  white-space: nowrap;
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 1;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--accent-soft); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.is-self td { background: var(--accent-soft); }
.tbl tr.is-missing td { opacity: 0.62; }
.tbl-sortable th[data-sort] { cursor: pointer; user-select: none; }
.tbl-sortable th[data-sort]:hover { color: var(--accent-text); }
.tbl-sortable th.is-sorted { color: var(--accent-text); }
.tbl-sortable th.is-sorted::after { content: ' ↓'; }

.grad-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}

.pill-exact { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.pill-floor { color: #8A5A00; border-color: rgba(138, 90, 0, 0.3); background: rgba(192, 138, 0, 0.09); }
.pill-unknown { color: var(--bad); border-color: rgba(194, 51, 74, 0.3); background: rgba(194, 51, 74, 0.07); }
[data-theme='dark'] .pill-floor { color: #F0C060; border-color: rgba(240, 192, 96, 0.32); }

/* --- controls ------------------------------------------------------------- */

.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 8px; }
#search {
  flex: 1 1 260px;
  min-width: 0;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
#search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip.is-on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }

/* --- lorenz --------------------------------------------------------------- */

.lorenz-wrap {
  display: grid;
  grid-template-columns: minmax(300px, 460px) 1fr;
  gap: 34px;
  align-items: center;
}
#lorenz {
  width: 100%;
  height: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 6px;
}
#lorenz .grid { stroke: var(--line); stroke-width: 1; }
#lorenz .equality { stroke: var(--ink-3, var(--ink-2)); stroke-width: 1.6; stroke-dasharray: 5 5; opacity: 0.55; }
#lorenz .lorenz-line { fill: none; stroke: var(--accent); stroke-width: 2.8; stroke-linejoin: round; stroke-linecap: round; }
#lorenz .lorenz-fill { fill: var(--accent-soft); opacity: 0.55; }
#lorenz .tick { font-size: 10.5px; fill: var(--ink-3, var(--ink-2)); opacity: 0.8; font-family: var(--sans); }
#lorenz .axis { font-size: 11.5px; fill: var(--ink-2); font-family: var(--sans); font-weight: 550; }

.lorenz-side { display: grid; gap: 20px; }
.lstat-v {
  font-size: 34px;
  font-weight: 780;
  letter-spacing: -0.03em;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.lstat-k { font-size: 14px; font-weight: 650; margin-top: 2px; }
.lstat-n { font-size: 12.5px; color: var(--ink-3, var(--ink-2)); opacity: 0.85; margin: 4px 0 0; line-height: 1.5; }

/* --- deciles -------------------------------------------------------------- */

.deciles {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-top: 26px;
  align-items: end;
}
.dec { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.dec-track { width: 100%; height: 170px; display: flex; align-items: flex-end; }
.dec-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  border-radius: 6px 6px 3px 3px;
  min-height: 2px;
  transition: height 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.dec-k { font-size: 10.5px; color: var(--ink-3, var(--ink-2)); text-align: center; line-height: 1.25; }
.dec-v { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --- blind spots ---------------------------------------------------------- */

.blind { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; max-width: 80ch; }
.blind li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel-solid);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.blind strong { color: var(--ink); display: block; margin-bottom: 3px; }

/* --- freshness pill ------------------------------------------------------- */

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-solid);
  white-space: nowrap;
}
.freshness-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3, var(--ink-2)); flex: none; }
.freshness[data-state='live'] { color: var(--accent-text); border-color: var(--accent-line); }
.freshness[data-state='live'] .freshness-dot { background: var(--accent); animation: pulse 2.1s ease-in-out infinite; }
.freshness[data-state='warn'] .freshness-dot { background: #C08A00; }
.freshness[data-state='bad'] { color: var(--bad); border-color: rgba(194, 51, 74, 0.3); }
.freshness[data-state='bad'] .freshness-dot { background: var(--bad); }

/* --- footer --------------------------------------------------------------- */

.foot { margin-top: 84px; border-top: 1px solid var(--line); padding: 44px 0 56px; background: var(--panel); }
.foot-in { display: grid; gap: 22px; }
.foot-brand { display: flex; align-items: center; gap: 13px; }
.foot-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.foot-name { font-weight: 750; letter-spacing: -0.018em; font-size: 16px; }
.foot-tag { font-size: 13px; color: var(--ink-2); }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--accent-text); }
.foot-note { font-size: 12.5px; color: var(--ink-3, var(--ink-2)); opacity: 0.8; line-height: 1.6; max-width: 78ch; margin: 0; }
.foot-note a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  z-index: 100;
}
.skip:focus { left: 12px; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 940px) {
  .lorenz-wrap { grid-template-columns: 1fr; gap: 24px; }
  .band-in { grid-template-columns: repeat(2, 1fr); }
  .deciles { grid-template-columns: repeat(5, 1fr); row-gap: 16px; }
}

@media (max-width: 620px) {
  .sec-in, .band-in, .hero-in, .foot-in { width: min(100% - 30px, var(--maxw)); }
  .sec { padding: 52px 0; }
  .hero { padding: 70px 0 18px; }
  .band-in { grid-template-columns: 1fr; }
  .cmp-row { grid-template-columns: 74px 1fr 96px; }
  .cmp-val { font-size: 16px; }
  .split-viz { flex-direction: column; }
  .deciles { grid-template-columns: repeat(5, 1fr); }
  .dec-track { height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .cmp-bar, .dec-bar, .split-seg { transition: none; }
  .freshness[data-state='live'] .freshness-dot { animation: none; }
}
