/* Ariadne — behaviour-pattern report: layout & chart chrome.
   Colours come only from the vars in tokens.css. No hex in this file. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--exp-bg-base);
  color: var(--exp-text);
  font-family: var(--exp-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- chrome -- */

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 24px;
  background: var(--exp-bg-surface);
  border-bottom: 1px solid var(--exp-line);
}
.topbar .brand { font-weight: 700; letter-spacing: .02em; }
.topbar .brand span { color: var(--exp-accent-text); }
.topbar .sub { color: var(--exp-muted); font-size: 13px; }
.topbar .spacer { flex: 1; }

.btn {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 5px 12px; border-radius: var(--exp-radius);
  border: 1px solid var(--exp-line-strong);
  background: var(--exp-bg-elevated); color: var(--exp-text);
}
.btn:hover { border-color: var(--exp-line-strong); background: var(--exp-bg-surface); }
.btn:focus-visible { outline: 2px solid var(--viz-series-1); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px 96px; }

/* ------------------------------------------------------------------ hero -- */

.hero { padding: 56px 0 32px; border-bottom: 1px solid var(--exp-line-subtle); }
.hero h1 {
  font-size: clamp(28px, 4.4vw, 44px); line-height: 1.12;
  margin: 0 0 16px; letter-spacing: -0.02em; font-weight: 700;
}
.hero .lede { font-size: 17px; color: var(--exp-muted); max-width: 66ch; margin: 0 0 28px; }
.hero .lede strong { color: var(--exp-text); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile {
  background: var(--exp-bg-surface); border: 1px solid var(--exp-line-subtle);
  border-radius: var(--exp-radius-lg); padding: 14px 16px;
}
.tile .label { font-size: 12.5px; color: var(--exp-muted); }
.tile .value { font-size: 27px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.tile .note  { font-size: 12px; color: var(--exp-muted); margin-top: 2px; }

/* --------------------------------------------------------------- section -- */

section { padding: 44px 0 8px; scroll-margin-top: 64px; }
section > h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--exp-muted); font-weight: 650; margin: 0 0 6px;
}
section > h3 {
  font-size: clamp(21px, 2.6vw, 27px); margin: 0 0 12px;
  letter-spacing: -0.015em; font-weight: 650; line-height: 1.22;
}
section > p, .card > p, .callout p { max-width: 74ch; }
section > p { color: var(--exp-text); margin: 0 0 14px; font-size: 15.5px; }
section > p.muted, .muted { color: var(--exp-muted); }

.callout {
  border-left: 3px solid var(--exp-accent);
  background: var(--exp-accent-subtle);
  border-radius: 0 var(--exp-radius) var(--exp-radius) 0;
  padding: 12px 16px; margin: 18px 0; font-size: 14.5px;
}
.callout p { margin: 0; }
.callout.neutral { border-left-color: var(--viz-series-1); background: var(--exp-sev-low-subtle); }

/* ------------------------------------------------------------------ card -- */

.card {
  background: var(--exp-bg-surface);
  border: 1px solid var(--exp-line-subtle);
  border-radius: var(--exp-radius-lg);
  padding: 18px 20px 14px; margin: 18px 0 8px;
}
.card > .card-title { font-size: 15px; font-weight: 640; margin: 0 0 2px; }
.card > .card-sub { font-size: 13px; color: var(--exp-muted); margin: 0 0 14px; max-width: 78ch; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: 13px; }
.legend .item { display: inline-flex; align-items: center; gap: 7px; color: var(--exp-muted); }
.legend .key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.legend .key.sq { width: 11px; height: 11px; border-radius: 3px; }

.plot { width: 100%; overflow-x: auto; }
.plot svg { display: block; max-width: 100%; height: auto; }

/* table-view twin — every chart has one */
details.tv { margin-top: 10px; border-top: 1px solid var(--exp-line-subtle); padding-top: 8px; }
details.tv > summary {
  cursor: pointer; font-size: 12.5px; color: var(--exp-muted);
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
}
details.tv > summary::-webkit-details-marker { display: none; }
details.tv > summary::before { content: "▸"; font-size: 10px; }
details.tv[open] > summary::before { content: "▾"; }
details.tv > summary:focus-visible { outline: 2px solid var(--viz-series-1); outline-offset: 3px; }
.tv-scroll { overflow-x: auto; margin-top: 10px; }

table.data { border-collapse: collapse; font-size: 12.5px; width: 100%; }
table.data th, table.data td {
  text-align: right; padding: 5px 10px; border-bottom: 1px solid var(--exp-line-subtle);
  white-space: nowrap;
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--exp-muted); font-weight: 600; }
table.data td { font-variant-numeric: tabular-nums; }
table.data td.name { font-variant-numeric: normal; }
table.data tbody tr:hover { background: var(--exp-bg-elevated); }

/* prose tables (not chart twins) */
table.prose { border-collapse: collapse; font-size: 14px; width: 100%; margin: 14px 0; }
table.prose th, table.prose td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--exp-line-subtle); vertical-align: top;
}
table.prose th { color: var(--exp-muted); font-weight: 600; font-size: 12.5px; }
table.prose td.num, table.prose th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroller { overflow-x: auto; }

code, .mono { font-family: var(--exp-mono); font-size: .92em; }
code {
  background: var(--exp-bg-elevated); border: 1px solid var(--exp-line-subtle);
  border-radius: 4px; padding: 1px 5px;
}
a { color: var(--exp-accent-text); }

/* --------------------------------------------------------------- tooltip -- */

#tip {
  position: fixed; z-index: 100; pointer-events: none; opacity: 0;
  transition: opacity .08s linear;
  background: var(--exp-bg-surface); color: var(--exp-text);
  border: 1px solid var(--exp-line-strong); border-radius: var(--exp-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .13);
  padding: 8px 11px; font-size: 12.5px; max-width: 280px;
}
#tip.on { opacity: 1; }
#tip .t-head { color: var(--exp-muted); font-size: 11.5px; margin-bottom: 4px; }
#tip .t-row { display: flex; align-items: baseline; gap: 8px; }
#tip .t-key { width: 12px; height: 2.5px; border-radius: 2px; flex: none; align-self: center; }
#tip .t-val { font-weight: 650; font-variant-numeric: tabular-nums; }
#tip .t-lab { color: var(--exp-muted); }

/* chart internals */
.axis text, .tick text { font-size: 11px; fill: var(--exp-muted); }
.tick line, .axis line, .axis path { stroke: var(--viz-grid); stroke-width: 1; }
.lbl { font-size: 11.5px; fill: var(--exp-text); }
.lbl.dim { fill: var(--exp-muted); }
.hit { fill: transparent; cursor: default; }
.mark { transition: opacity .1s linear; }
.mark.lift { opacity: .72; }

footer.foot {
  border-top: 1px solid var(--exp-line-subtle); margin-top: 48px; padding-top: 20px;
  color: var(--exp-muted); font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
