/* Layout: a museum specimen record. A plate and its tag up top, a narrow record card down the left,
   numbered sections of measured findings on the right. One loud thing: the fees-against-gas ledger chart. */
:root {
  --paper: #eef1f0;      /* cool herbarium sheet */
  --sheet: #f8faf9;      /* raised surfaces: plate mount, record card */
  --ink: #16202a;
  --muted: #5a6670;
  --rule: #c7cfd3;
  --accent: #8c5530;     /* wren rufous */
  --credit: #2e6a4d;
  --debit: #a2392a;
  --chip: #e2e7e6;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e141a; --sheet: #151d25; --ink: #e5eaec; --muted: #93a0a9; --rule: #2a353f;
    --accent: #d39a68; --credit: #6dbd93; --debit: #e47c68; --chip: #1c2630; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e141a; --sheet: #151d25; --ink: #e5eaec; --muted: #93a0a9; --rule: #2a353f;
  --accent: #d39a68; --credit: #6dbd93; --debit: #e47c68; --chip: #1c2630; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding-block: 20px 56px; }

/* masthead */
.mast { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--ink);
  font: 500 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.mast-asof { color: var(--muted); letter-spacing: .06em; text-transform: none; font-size: 12px; }

/* hero: plate + text */
.hero { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start; padding-block: 36px 40px; }
.plate { margin: 0; }
.plate-frame { aspect-ratio: 1; max-width: 100%; background: var(--sheet); border: 1px solid var(--rule); padding: 10px;
  display: grid; place-items: center; box-shadow: 0 1px 0 var(--rule), 6px 6px 0 -1px var(--chip); }
.plate-frame img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.92); }
.plate-mono { font: italic 500 96px/1 var(--display); color: var(--accent); }
.plate figcaption { margin-top: 10px; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.plate figcaption i { font-family: var(--display); font-size: 14px; color: var(--ink); }

h1 { margin: 0 0 12px; font: italic 500 clamp(64px, 11vw, 112px)/.9 var(--display); letter-spacing: -.02em; }
.h1-sub { display: block; margin-top: 10px; font: 500 12px/1.4 var(--mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.lede { margin: 0 0 12px; max-width: 34ch; font: 500 clamp(20px, 2.6vw, 25px)/1.32 var(--display); text-wrap: balance; }
.sub { margin: 0 0 22px; max-width: 60ch; color: var(--muted); }

.ca { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding-block: 12px; margin-bottom: 18px; }
.ca-label { display: block; font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ca-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ca code { font-size: clamp(12.5px, 1.75vw, 16px); word-break: break-all; color: var(--ink); }
.copy { font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: transparent;
  border: 1px solid var(--ink); padding: 7px 12px; cursor: pointer; }
.copy:hover { background: var(--ink); color: var(--paper); }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-flex; gap: 6px; align-items: baseline; padding: 6px 10px; background: var(--chip); text-decoration: none; font-weight: 500; font-size: 14px; }
.links a span { font: 400 12px var(--mono); color: var(--muted); }
.links a:hover { background: var(--ink); color: var(--paper); }
.links a:hover span { color: inherit; }

/* record: card rail + main */
.record { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; border-top: 1px solid var(--ink); padding-top: 28px; }
.label { align-self: start; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); background: var(--sheet); border: 1px solid var(--rule); padding: 14px 16px; }
.label dl { margin: 0; display: grid; gap: 10px; }
.label dt { font: 500 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.label dd { margin: 0; font-size: 14px; line-height: 1.35; }
.label dd.num { font: 500 20px/1.2 var(--display); }

.main { display: grid; gap: 56px; min-width: 0; }
.main section { min-width: 0; }
h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 16px; font: 500 clamp(26px, 3.4vw, 34px)/1.1 var(--display); text-wrap: balance; }
.sec { font: 500 12px/1 var(--mono); letter-spacing: .1em; color: var(--accent); min-width: 2.2em; }
.note { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 68ch; overflow-wrap: anywhere; }
.wrap-code { word-break: break-all; }
.disclosure { margin-top: 14px; padding-left: 12px; border-left: 2px solid var(--accent); color: var(--ink); overflow-wrap: anywhere; }
.prose p { margin: 0 0 12px; max-width: 64ch; }
.prose b { font-weight: 600; }

/* what is Wren: definition + measured facts, each with when it was read */
.about-def { margin: 0 0 16px; max-width: 64ch; font: 500 clamp(18px, 2.1vw, 20px)/1.45 var(--display); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.facts li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.facts li:nth-child(even) { padding-left: 16px; padding-right: 0; border-left: 1px solid var(--rule); }
.fact-k { font-size: 14px; }
.fact-v { font: 500 19px/1.2 var(--display); text-align: right; }
.fact-asof { grid-column: 1 / -1; font: 400 11px/1.35 var(--mono); color: var(--muted); }
.facts .fact-wait { grid-column: 1 / -1; display: block; color: var(--muted); font-size: 14px; }

/* questions */
.faq { border-top: 2px solid var(--ink); }
.qa { padding-block: 14px; border-bottom: 1px solid var(--rule); }
.qa h3 { margin: 0 0 6px; font: 600 17px/1.35 var(--body); max-width: 60ch; }
.qa p { margin: 0; max-width: 68ch; font-size: 15px; overflow-wrap: anywhere; }
.qa p a { white-space: nowrap; }

/* for agents */
.agent-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.agent-files li { background: var(--sheet); border: 1px solid var(--rule); padding: 10px 12px; display: grid; gap: 2px; }
.agent-files a { font: 500 14px var(--mono); }
.agent-files span { font-size: 13px; color: var(--muted); }

/* ledger tally */
.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
.tally > div { padding: 14px 16px 14px 0; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tally > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.t-k { font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.t-v { font: 500 clamp(30px, 4.4vw, 44px)/1 var(--display); font-variant-numeric: tabular-nums lining-nums; }
.t-v.credit { color: var(--credit); } .t-v.debit { color: var(--debit); }
.t-d { font: 400 12px/1.45 var(--mono); color: var(--muted); }

/* chart */
.chart { margin: 22px 0 0; }
.chart-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 12px var(--mono); color: var(--muted); margin-bottom: 8px; }
.chart-key span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.k-credit::before { background: var(--credit); } .k-debit::before { background: var(--debit); }
.k-net::before { height: 2px !important; vertical-align: 3px !important; background: var(--accent); }
.chart-box { overflow-x: auto; }
.chart-box svg { display: block; width: 100%; min-width: 560px; height: auto; }
.chart figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); max-width: 68ch; }
svg .grid { stroke: var(--rule); stroke-width: 1; }
svg .zero { stroke: var(--ink); stroke-width: 1; }
svg .bar-c { fill: var(--credit); } svg .bar-d { fill: var(--debit); }
svg .netline { fill: none; stroke: var(--accent); stroke-width: 2; }
svg .netdot { fill: var(--accent); }
svg text { fill: var(--muted); font: 400 11px var(--mono); }
svg text.end { fill: var(--accent); font-weight: 500; }

/* GeckoTerminal */
.gt { margin-top: 12px; aspect-ratio: 16 / 10; max-width: 100%; background: var(--sheet); border: 1px solid var(--rule); display: grid; place-items: center; text-align: center; padding: 0; }
.gt iframe { width: 100%; height: 100%; border: 0; display: block; }
.gt > a { padding: 20px; font-weight: 500; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
caption { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
th { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
td.r, th.r { text-align: right; padding-right: 0; padding-left: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 600; }
.tables { display: grid; gap: 24px; }

/* launches */
.big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.big b { font: 500 clamp(44px, 7vw, 64px)/1 var(--display); font-variant-numeric: tabular-nums lining-nums; }
.big span { color: var(--muted); }
.coins { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); }
.coins li { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); min-width: 0; display: flex; gap: 10px; align-items: center; }
.coin-pic { width: 40px; height: 40px; flex: none; object-fit: cover; background: var(--chip); border: 1px solid var(--rule); }
.coin-txt { min-width: 0; }
.coins a { font-weight: 600; text-decoration: none; }
.coins a:hover { text-decoration: underline; }
.coins .sym { display: block; font: 400 12px var(--mono); color: var(--muted); overflow-wrap: anywhere; }

/* drips */
.drip-bars { display: flex; align-items: flex-end; gap: 4px; height: 92px; margin-top: 14px; border-bottom: 1px solid var(--ink); }
.drip-bars a { flex: 1 1 0; background: var(--accent); min-width: 6px; opacity: .85; }
.drip-bars a:hover { opacity: 1; }
.drip-axis { display: flex; justify-content: space-between; font: 400 11px var(--mono); color: var(--muted); margin-top: 4px; }

/* receipts */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; background: var(--paper); border: 1px solid var(--ink); border-radius: 50%; }
.timeline time { font: 500 12px var(--mono); color: var(--accent); }
.timeline h3 { margin: 2px 0 4px; font: 600 16px/1.35 var(--body); }
.timeline p { margin: 0 0 4px; max-width: 64ch; font-size: 15px; }
.timeline .tx { font: 400 12px var(--mono); display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* goals */
.goal { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 6px 18px; align-items: baseline; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.goal:first-child { border-top: 2px solid var(--ink); }
.goal-name { font-weight: 600; }
.goal-now { font-variant-numeric: tabular-nums; }
.goal-now small { display: block; color: var(--muted); font-size: 12px; }
.pill { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border: 1px solid currentColor; white-space: nowrap; }
.pill.open { color: var(--debit); } .pill.unmeasured { color: var(--muted); } .pill.done { color: var(--credit); }

/* footer */
.foot { margin-top: 64px; border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 12px; font-size: 14px; }
.nfa { margin: 0; max-width: 72ch; }
.methods summary { cursor: pointer; font-weight: 600; }
.methods ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); max-width: 72ch; display: grid; gap: 6px; }
.colophon { margin: 0; font: 400 12px var(--mono); color: var(--muted); }
.stale { color: var(--debit); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-block: 24px 28px; }
  .plate { max-width: 200px; }
  .record { grid-template-columns: 1fr; gap: 28px; }
  .label { position: static; }
  .label dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .coins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .tally { grid-template-columns: 1fr; }
  .tally > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); }
  .goal { grid-template-columns: 1fr auto; }
  .goal-now { grid-column: 1 / -1; grid-row: 2; }
  .coins { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts li:nth-child(even) { padding-left: 0; border-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .drip-bars a, .links a, .copy { transition: background-color .15s, opacity .15s, color .15s; }
}
