/* Layout: a lab notebook of semi-log plots. Summary comparison up top, then one card per trend in a two-column grid. */
:root {
  --bg: #f4f6f4;
  --surface: #fcfcfb;
  --ink: #121614;
  --ink-2: #4a524e;
  --muted: #747d78;
  --grid: #e4e8e5;
  --rule: #d2d8d4;
  --series: #2a78d6;
  --series-soft: rgba(42,120,214,.10);
  --kurz: #eb6834;
  --mkt: #4a3aa7;
  --mkt-soft: rgba(74,58,167,.10);
  --display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101312; --surface: #181c1a; --ink: #e2e6e3; --ink-2: #bfc7c3; --muted: #8b948f;
    --grid: #252b28; --rule: #333a36; --series: #3987e5; --series-soft: rgba(57,135,229,.16); --kurz: #e0662f; --mkt: #9085e9; --mkt-soft: rgba(144,133,233,.16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101312; --surface: #181c1a; --ink: #e2e6e3; --ink-2: #bfc7c3; --muted: #8b948f;
  --grid: #252b28; --rule: #333a36; --series: #3987e5; --series-soft: rgba(57,135,229,.16); --kurz: #e0662f; --mkt: #9085e9; --mkt-soft: rgba(144,133,233,.16);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
img { max-width: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 20px; padding-block: 40px 64px; display: grid; gap: 36px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.05; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 21px; font-weight: 600; line-height: 1.2; }
p { margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
header { display: grid; gap: 14px; max-width: 780px; }
header .lede { color: var(--ink-2); font-size: 16.5px; max-width: 66ch; }
header .lede a { color: var(--series); }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 0; overflow: hidden; background: var(--surface); }
.seg button { font: 500 13px var(--body); color: var(--ink-2); background: transparent; border: 0; padding: 7px 14px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button:focus-visible { outline: 2px solid var(--series); outline-offset: -2px; }
.seg i.sw { display: inline-block; width: 9px; height: 9px; border-radius: 0; background: var(--series); margin-right: 7px; vertical-align: 0; }
.seg i.sw.m { background: var(--mkt); }
.card.market { --series: var(--mkt); --series-soft: var(--mkt-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: -16px; }
.chips button { font: 500 13px var(--body); color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule); border-radius: 0; padding: 6px 13px; cursor: pointer; }
.chips button span { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 6px; }
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips button[aria-pressed="true"] span { color: var(--bg); opacity: .7; }
.chips button:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
.controls .hint { font-size: 13px; color: var(--muted); max-width: 60ch; }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 0; padding: 22px; display: grid; gap: 14px; min-width: 0; }
.compare-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; align-items: baseline; }
.compare-head p { color: var(--ink-2); font-size: 14px; max-width: 60ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 20px; }
.card { display: grid; gap: 14px; align-content: start; }
.card-top { display: grid; gap: 6px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-block: 4px; }
.stat { display: grid; gap: 0; }
.stat b { font-family: var(--display); font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); }
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 0; padding: 7px 10px; font-size: 12px; line-height: 1.35; max-width: 230px; transform: translate(-50%, calc(-100% - 12px)); white-space: normal; z-index: 2; }
.tip strong { font-family: var(--mono); font-weight: 500; font-size: 13px; display: block; }
.tip .yr { opacity: .7; font-family: var(--mono); font-size: 11px; }
.lens { border-top: 1px solid var(--grid); padding-top: 12px; display: grid; gap: 10px; }
.lens h4 { margin: 0 0 3px; font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lens p, .lens li { font-size: 14px; color: var(--ink-2); }
.lens ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.kz { color: var(--ink); }
.kz::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--kurz); transform: rotate(45deg); margin-right: 8px; vertical-align: 1px; }
.src { font-size: 12px; color: var(--muted); }
details { font-size: 13px; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
details summary:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
.tbl { overflow-x: auto; margin-top: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--grid); font-size: 12.5px; }
th { color: var(--muted); font-weight: 500; }
td.num { font-family: var(--mono); text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--series); vertical-align: 4px; margin-right: 6px; }
.legend i.fit { border-top: 2px dashed var(--muted); }
.legend i.sw { width: 9px; height: 9px; border: 0; border-radius: 0; background: var(--series); vertical-align: 0; }
.legend i.sw.m { background: var(--mkt); }
.legend i.ext { border-top: 2px dotted var(--muted); }
.legend i.k { width: 8px; height: 8px; border: 0; background: var(--kurz); transform: rotate(45deg); vertical-align: 0; }
footer { color: var(--muted); font-size: 12.5px; display: grid; gap: 6px; max-width: 80ch; }
@media (max-width: 520px) { .panel { padding: 16px; } .stat b { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- site additions ---------- */

a { color: var(--series); text-underline-offset: 2px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px 48px; align-items: end; max-width: none; }
.hero-text { display: grid; gap: 14px; min-width: 0; }
.hero .lede { font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; color: var(--muted); }
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; min-width: 0; }
.insights a { display: block; text-decoration: none; color: var(--ink-2); font-size: 14px; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); transition: border-color .15s; }
.insights a:hover, .insights a:focus-visible { border-color: var(--series); outline: none; }
.insights b { color: var(--ink); font-weight: 600; display: block; font-family: var(--display); font-size: 15.5px; margin-bottom: 2px; }
.toolbar { position: sticky; top: 0; z-index: 5; display: grid; gap: 10px; padding-block: 12px; margin-inline: -20px; padding-inline: 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); margin-block: -12px; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.theme { margin-left: auto; font: 500 12.5px var(--body); color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule); border-radius: 0; padding: 7px 12px; cursor: pointer; }
.theme:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
.chips { margin-bottom: 0; }
.compare-head { display: grid; grid-template-columns: 1fr; gap: 6px; }
.compare-head p { max-width: 75ch; }
.crow { cursor: pointer; outline: none; }
.crow-bg { fill: transparent; }
.crow:hover .crow-bg, .crow:focus-visible .crow-bg { fill: var(--series-soft); }
.chart text.crow-label { fill: var(--ink); font-family: var(--body); font-size: 13px; }
.chart text.endlabel { fill: var(--ink); font-weight: 500; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.group-head { grid-column: 1 / -1; font-size: 15px; font-family: var(--mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--rule); margin-top: 8px; }
.group-head:first-child { margin-top: 0; }
.card h3 .anchor { font-family: var(--mono); font-size: 15px; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .15s; }
.card:hover h3 .anchor, .card h3 .anchor:focus-visible { opacity: 1; }
.card.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--series); } 100% { box-shadow: 0 0 0 3px transparent; } }
.linear-note { margin: -16px 0 0; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--rule); border-radius: 0; padding: 10px 14px; }
footer h2 { font-size: 17px; color: var(--ink); }
footer { border-top: 1px solid var(--rule); padding-top: 20px; font-size: 13.5px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -20px; padding-inline: 20px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { white-space: nowrap; flex: none; }
  .seg button { padding: 7px 10px; }
  .card h3 .anchor { opacity: 1; }
}

.seg .short { display: none; }
.more { justify-self: start; font: 500 13px var(--body); color: var(--series); background: transparent; border: 1px solid var(--rule); border-radius: 0; padding: 7px 14px; cursor: pointer; }
.more:hover { border-color: var(--series); }
.more:focus-visible { outline: 2px solid var(--series); outline-offset: 2px; }
@media (max-width: 620px) {
  .seg .full, .theme .full { display: none; }
  .seg .short { display: inline; }
  .toolbar { gap: 8px; padding-block: 10px; }
  .toolbar-row { flex-wrap: nowrap; gap: 8px; }
  .theme { padding: 7px 10px; }
  .chips button { padding: 5px 11px; font-size: 12.5px; }
}
.seg button { white-space: nowrap; }
.card, #compare-panel, #about { scroll-margin-top: 140px; }
@media (max-width: 620px) { .card, #compare-panel, #about { scroll-margin-top: 120px; } }

.eyebrow-link { text-decoration: none; color: var(--muted); }
.eyebrow-link:hover, .eyebrow-link:focus-visible { color: var(--series); text-decoration: underline; text-underline-offset: 3px; }
.insights { counter-reset: insight; }
.insights a { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start; }
.insights a::before { counter-increment: insight; content: counter(insight, decimal-leading-zero); grid-row: 1 / span 2; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--series); padding-top: 2px; }
.insights a b { grid-column: 2; }

/* ---------- neutral UI: color is reserved for the charts ---------- */
:root { --sel: #e3e7e4; --sel-ink: #121614; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sel: #2b312e; --sel-ink: #e2e6e3; } }
:root[data-theme="dark"] { --sel: #2b312e; --sel-ink: #e2e6e3; }
a, header .lede a { color: var(--ink-2); text-decoration-color: var(--rule); }
a:hover { color: var(--ink); text-decoration-color: var(--muted); }
.meta a { color: var(--muted); }
.meta a:hover { color: var(--ink); }
.eyebrow-link:hover, .eyebrow-link:focus-visible { color: var(--ink); }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] { background: var(--sel); color: var(--sel-ink); }
.chips button[aria-pressed="true"] { border-color: var(--rule); }
.chips button[aria-pressed="true"] span { color: var(--muted); opacity: 1; }
.insights a::before { color: var(--muted); }
.insights a:hover, .insights a:focus-visible { border-color: var(--muted); }
.more { color: var(--ink-2); }
.more:hover { border-color: var(--muted); }
.seg button:focus-visible, .chips button:focus-visible, .theme:focus-visible, .more:focus-visible, details summary:focus-visible { outline-color: var(--ink-2); }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--muted); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---------- headlines: uppercase mono ---------- */
:root { --headline: "Roboto Mono", "JetBrains Mono", ui-monospace, Menlo, monospace; }
h1, h2:not(.group-head), h3 { font-family: var(--headline); text-transform: uppercase; }
h1 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; }
h2:not(.group-head) { font-size: 17px; font-weight: 600; letter-spacing: 0; }
footer h2 { font-size: 14px; }
h3 { font-size: 16.5px; font-weight: 600; letter-spacing: 0; line-height: 1.3; }
.card h3 .anchor { font-family: var(--headline); }
