/* Frontier — shares Owl + Kestrel's v3 look: cream ground, deep red, Source Serif 4 + JetBrains Mono. */
:root {
  --ground: #f3ecdc;
  --card: #fbf7ee;
  --ink: #1a1612;
  --ink-2: #4a4239;
  --muted: #7a7063;
  --rule: #e2d8c4;
  --grid: #ebe3d3;
  --accent: #982617;
  --accent-hover: #842012;
  /* chart series: validated for colorblind separation on --card */
  --closed: #982617;
  --open: #2f5f9e;
  --unknown: #9a9386;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 4px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--ground); color: var(--ink); }
body { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.55; background: var(--ground); }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.bar { border-bottom: 1px solid var(--rule); background: var(--ground); position: sticky; top: 0; z-index: 20; }
.bar-inner { max-width: 1240px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.brand b { font-weight: 600; font-size: 21px; }
.brand span { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.bar nav { display: flex; gap: 18px; font-family: var(--mono); font-size: 13px; }
.bar nav a { text-decoration: none; color: var(--ink-2); }
.bar nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 48px 0 20px; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
h1 { font-weight: 500; font-size: clamp(38px, 6vw, 62px); line-height: 1.04; margin: 10px 0 14px; letter-spacing: -0.01em; max-width: 900px; }
.lede { font-size: clamp(19px, 2.2vw, 22px); color: var(--ink-2); max-width: 760px; margin: 0; }
.scope-notice { max-width: 760px; margin: 20px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--card); color: var(--ink-2); font-size: 17px; line-height: 1.5; }
.wip-badge { display: inline-block; padding: 2px 7px; margin-right: .5em; border: 1px solid currentColor; border-radius: 999px; color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; white-space: nowrap; }

/* chart card */
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.landscape { margin: 28px 0 56px; padding: 18px 20px 16px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-family: var(--mono); font-size: 13px; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--ground); }
.seg button { font: inherit; border: 0; background: transparent; color: var(--ink-2); padding: 7px 12px; cursor: pointer; min-height: 34px; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
.toggles { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.toggle { font: inherit; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: 6px 11px; cursor: pointer; color: var(--ink); min-height: 34px; }
.toggle[aria-pressed="false"] { color: var(--muted); background: transparent; }
.toggle[aria-pressed="false"] i { opacity: .25; }
.toggle i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.search { margin-left: auto; position: relative; }
.search input { font: inherit; border: 1px solid var(--rule); background: var(--ground); border-radius: 999px; padding: 7px 12px; width: 220px; min-height: 34px; color: var(--ink); }

.stage { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.plot { position: relative; min-width: 0; }
.plot svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.plot text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.plot .lab { fill: var(--ink); font-size: 11.5px; }
.plot .lab-strong { fill: var(--ink); font-size: 12px; font-weight: 700; }
.dot { cursor: pointer; transition: opacity .15s; }

.scrub { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; font-family: var(--mono); font-size: 13px; margin-top: 6px; }
.scrub button { font: inherit; border: 1px solid var(--ink); background: var(--ink); color: var(--card); border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 34px; min-width: 84px; }
.scrub input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
.scrub output { font-variant-numeric: tabular-nums; min-width: 104px; text-align: right; }

.readout { font-size: 19px; line-height: 1.45; margin: 12px 0 4px; min-height: 2.9em; }
.readout b { font-weight: 600; }
.swatch-line { display: inline-block; width: 18px; height: 2px; vertical-align: middle; margin-right: 4px; }

.panel { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; border-left: 1px solid var(--rule); padding-left: 18px; min-height: 360px; }
.panel h3 { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.2; margin: 0 0 4px; }
.panel .org { color: var(--muted); margin-bottom: 12px; }
.panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.panel .badge { display: inline-block; margin: 0 0 10px; padding: 3px 8px; border-radius: 999px; background: var(--ground); border: 1px solid var(--rule); }
.panel .spark { margin: 10px 0 12px; }
.panel .spark text { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.panel .hint { color: var(--muted); font-family: var(--serif); font-size: 16px; }
.panel .src { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); color: var(--muted); }
.panel .close { float: right; font: inherit; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }

.caption { font-family: var(--mono); font-size: 12px; line-height: 1.55; color: var(--muted); border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 10px; }
.caption a { color: var(--ink-2); }
details.table { font-family: var(--mono); font-size: 12.5px; margin-top: 10px; }
details.table summary { cursor: pointer; color: var(--ink-2); }
details.table table { border-collapse: collapse; width: 100%; margin-top: 8px; }
details.table th, details.table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--rule); }
details.table td.n { text-align: right; font-variant-numeric: tabular-nums; }
details.table button.pick { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.tip { position: fixed; z-index: 60; pointer-events: none; max-width: 280px; background: var(--ink); color: var(--card); font-family: var(--mono); font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 4px; opacity: 0; transition: opacity .1s; }
.tip.on { opacity: 1; }
.tip b { font-family: var(--serif); font-size: 15px; font-weight: 600; }

.section { padding: 8px 0 56px; }
.section h2 { font-weight: 500; font-size: clamp(28px, 3.6vw, 38px); margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.post { display: block; text-decoration: none; padding: 20px; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.post:hover, .post:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 14px 34px rgba(26, 22, 18, .10); }
.post .kicker { margin-bottom: 8px; }
.post h3 { font-size: 24px; font-weight: 600; line-height: 1.2; margin: 0 0 8px; }
.post p { margin: 0; color: var(--ink-2); font-size: 17px; }
.post.soon { opacity: .75; }
.post.soon:hover { transform: none; box-shadow: none; border-color: var(--rule); }

footer { border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
footer .wrap { padding: 22px 24px 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
footer a { color: var(--ink-2); }

@media (max-width: 920px) {
  .stage { grid-template-columns: 1fr; }
  .panel { border-left: 0; border-top: 1px solid var(--rule); padding: 14px 0 0; min-height: 0; }
}
@media (max-width: 620px) {
  body { font-size: 17px; }
  .bar-inner, .wrap { padding-left: 16px; padding-right: 16px; }
  .bar nav { gap: 12px; font-size: 12px; }
  .bar nav .wide-only { display: none; }
  .landscape { padding: 14px 12px 12px; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
  .scrub { grid-template-columns: auto 1fr; }
  .scrub output { grid-column: 1 / -1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .post, .dot, .tip { transition: none; } }
