@view-transition { navigation: auto; }

:root {
  color-scheme: light dark;
  --paper: light-dark(#eef1f5, #0b1e33);
  --surface: light-dark(#f8fafc, #112a45);
  --ink: light-dark(#0f1724, #e6eef7);
  --steel: light-dark(#4f6075, #93a9c0);
  --line: light-dark(#cdd5de, #234262);
  --signal: light-dark(#f2511b, #ff7a4d);
  --grid: light-dark(transparent, rgb(255 255 255 / .045));
  --e-lived: light-dark(#2446c8, #8aa4ff);
  --e-verified: light-dark(#0e7c6b, #3fc2ac);
  --e-assumption: light-dark(#a66a00, #e0a53a);
  --e-example: light-dark(#7a4fb0, #b995ea);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-body: "Newsreader", Charter, "Iowan Old Style", Georgia, serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 76rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0; background-color: var(--paper); color: var(--ink);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  font: 400 1.1875rem/1.6 var(--f-body); font-optical-sizing: auto;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
a { color: inherit; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 650; line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
p, li { text-wrap: pretty; }

/* title block header */
.tb {
  max-width: var(--max); margin: 1.2rem auto 0; width: calc(100% - 2 * var(--gutter));
  display: grid; grid-template-columns: minmax(0, 1.6fr) auto auto auto auto; align-items: stretch;
  border: 1.5px solid var(--ink); background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
}
.tb > * { padding: .85rem 1.1rem; border-right: 1px solid var(--line); display: flex; align-items: center; }
.tb > :last-child { border-right: 0; }
.tb-brand { flex-direction: column; align-items: flex-start; justify-content: center; text-decoration: none; gap: .15rem; }
.wordmark { font: 700 1.35rem/1 var(--f-display); letter-spacing: -0.025em; }
.wordmark::before { content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--signal); margin-right: .45em; }
.tb-brand small { font: 400 .8rem var(--f-mono); color: var(--steel); }
.tb-nav { gap: 1.5rem; font: 500 1rem var(--f-display); }
.tb-nav a { text-decoration: none; padding: .15rem 0; border-bottom: 2px solid transparent; }
.tb-nav a:hover, .tb-nav a[aria-current] { border-bottom-color: var(--signal); }
.tb-meta { margin: 0; gap: 1.4rem; font: 400 .8rem var(--f-mono); }
.tb-meta div { display: grid; gap: .1rem; }
.tb-meta dt { color: var(--steel); }
.tb-meta dd { margin: 0; }
.theme { background: none; border: 0; color: var(--ink); cursor: pointer; justify-content: center; }
.theme:hover { color: var(--signal); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 6vw, 5rem); align-items: center; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); font-weight: 700; max-width: 17ch; }
.lede { font-size: 1.3rem; line-height: 1.5; color: var(--steel); max-width: 38rem; margin: 1.4rem 0 0; }
.hero-actions { display: flex; align-items: center; gap: 1.6rem; flex-wrap: wrap; margin: 2rem 0 0; }
.btn { display: inline-block; background: var(--ink); color: var(--paper); font: 600 1rem var(--f-display); padding: .85rem 1.4rem; border-radius: 999px; text-decoration: none; }
.btn:hover { background: var(--signal); color: light-dark(#fff, #0b1e33); }
.textlink { font: 500 1rem var(--f-display); }

/* plot */
.plot { margin: 0; }
.plot svg { width: 100%; height: auto; display: block; overflow: visible; }
.plot .grid line { stroke: var(--line); stroke-width: 1; }
.plot .axis line { stroke: var(--steel); stroke-width: 1.5; }
.plot .axis text { fill: var(--steel); font: 500 13px var(--f-mono); }
.plot .curve { fill: none; stroke: var(--signal); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.plot .pts circle { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.plot .labels text { fill: var(--ink); font: 500 14px var(--f-display); }
.plot figcaption { font: 400 .875rem var(--f-mono); color: var(--steel); margin-top: .8rem; }
@media (prefers-reduced-motion: no-preference) {
  .plot .curve { animation: draw 1.8s cubic-bezier(.3,.1,.2,1) .2s both; }
  .plot .pts circle, .plot .labels text { animation: fade .5s ease both; }
  .plot .pts circle:nth-child(1), .plot .labels text:nth-child(1) { animation-delay: .7s; }
  .plot .pts circle:nth-child(2), .plot .labels text:nth-child(2) { animation-delay: 1.1s; }
  .plot .pts circle:nth-child(3), .plot .labels text:nth-child(3) { animation-delay: 1.6s; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* garden: notes by maturity */
.garden { border-top: 1px solid var(--line); padding: 3rem 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.8rem; }
.garden h2, .pillars h2, .labels-explain h2 { font-size: 1.05rem; font-weight: 600; color: var(--steel); letter-spacing: 0; }
.garden-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); }
.gcol h3 { font-size: 1.35rem; display: flex; align-items: center; gap: .6rem; }
.gd { display: inline-block; border-radius: 50%; background: var(--signal); }
.gcol[data-stage="seedling"] .gd { width: .45rem; height: .45rem; }
.gcol[data-stage="growing"] .gd { width: .7rem; height: .7rem; }
.gcol[data-stage="evergreen"] .gd { width: .95rem; height: .95rem; }
.gd-d { margin: .3rem 0 1.2rem; color: var(--steel); font-size: 1rem; }
.gcol ul { list-style: none; margin: 0; padding: 0; }
.gcol li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.g-title { display: block; font: 600 1.2rem/1.3 var(--f-display); letter-spacing: -0.01em; text-decoration: none; margin-bottom: .55rem; }
.g-title:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; }
.g-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; font: 400 .85rem var(--f-mono); color: var(--steel); }
.gd-empty { margin: 0; padding: 1.1rem 0; border-top: 1px dashed var(--line); color: var(--steel); font-size: 1rem; }

/* pillars: one wide, two narrow, deliberately unequal */
.pillars { border-top: 1px solid var(--line); padding: 3rem 0; }
.pillars h2 { margin-bottom: 1.6rem; }
.pillar-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); }
.pillar h3 { font-size: 1.6rem; margin-bottom: .6rem; }
.pillar p { margin: 0; max-width: 28rem; }
.pillar.big h3 { font-size: 2rem; }

/* register (ledger) */
.ledger { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 2.6rem 7.5rem minmax(0, 1fr) 7rem 11.5rem; gap: 1rem 1.2rem;
  align-items: baseline; padding: 1.3rem 0; border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row[hidden] { display: none; }
.row time, .row-type, .row-no { font: 400 .9rem var(--f-mono); color: var(--steel); }
.row-no { color: var(--signal); }
.row-title { font: 600 1.35rem/1.25 var(--f-display); letter-spacing: -0.01em; text-decoration: none; }
.row-title:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 3px; text-underline-offset: .2em; }
.row-dek { margin: .4rem 0 0; color: var(--steel); font-size: 1.05rem; line-height: 1.45; max-width: 44rem; }

/* tags */
.tag { display: inline-flex; align-items: center; gap: .5rem; font: 500 .9rem var(--f-display); white-space: nowrap; color: var(--ink); }
.tag i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); flex: none; }
.tag[data-e="lived"] { --c: var(--e-lived); }
.tag[data-e="verified"] { --c: var(--e-verified); }
.tag[data-e="assumption"] { --c: var(--e-assumption); }
.tag[data-e="example"] { --c: var(--e-example); }
.tag[data-e="example"] i { background: none; border: 2px solid var(--c); }
.lang { font: 500 .8rem var(--f-mono); border: 1px solid var(--steel); color: var(--steel); border-radius: 4px; padding: .05rem .35rem; justify-self: start; }
.chip { font: 400 .85rem var(--f-mono); color: var(--steel); }
.chip::before { content: "#"; }
.sep { width: 1px; height: .9em; background: var(--line); }

/* explain strip */
.labels-explain { border-top: 1px solid var(--line); padding: 3rem 0 4rem; }
.labels-explain h2 { margin-bottom: 1.6rem; }
.labels-explain dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 2rem; margin: 0; }
dt { margin-bottom: .4rem; }
dd { margin: 0; color: var(--steel); font-size: 1.05rem; line-height: 1.45; }

/* page heads & filters */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
.filters { display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem; margin: 1rem 0 .5rem; }
.filters fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; }
.filters legend { float: left; font: 500 .85rem var(--f-mono); color: var(--steel); margin-right: .8rem; padding: 0; }
.filters label { position: relative; font: 500 .9rem var(--f-display); cursor: pointer; }
.filters input { position: absolute; opacity: 0; inset: 0; }
.filters label span { display: block; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; }
.filters input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters input:focus-visible + span { outline: 3px solid var(--signal); outline-offset: 2px; }
.count, .empty { font: 400 .9rem var(--f-mono); color: var(--steel); margin: 1rem 0 1.2rem; }

/* article */
.post { padding-bottom: 5rem; }
.post-head { padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; max-width: 52rem; }
.post-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
.crumbs { font: 500 .95rem var(--f-display); margin: 0 0 1.4rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center; margin-top: 1.6rem; font: 400 .9rem var(--f-mono); color: var(--steel); }
.evidence-note { font-size: 1rem; color: var(--steel); margin: 1rem 0 0; border-left: 3px solid var(--line); padding-left: 1rem; max-width: 36rem; }
.post-grid { display: grid; grid-template-columns: minmax(0, 40rem); gap: 2rem; }
.post-grid.has-toc { grid-template-columns: minmax(0, 40rem) 14rem; gap: 4.5rem; align-items: start; }
.toc { font: 500 .95rem var(--f-display); position: sticky; top: 1.5rem; border-left: 2px solid var(--line); padding-left: 1.1rem; }
.toc p { margin: 0 0 .6rem; color: var(--steel); font-weight: 400; }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.toc a { text-decoration: none; color: var(--steel); }
.toc a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--signal); }
.prose { max-width: 40rem; }
.prose > * + * { margin-top: 1.2rem; }
.prose h2 { font-size: 1.7rem; margin-top: 2.8rem; }
.prose h3 { font-size: 1.3rem; margin-top: 2rem; }
.prose p, .prose li { hyphens: auto; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .4rem; }
.prose li::marker { color: var(--signal); }
.prose blockquote { margin-left: 0; padding: .2rem 0 .2rem 1.2rem; border-left: 4px solid var(--signal); font-size: 1.3rem; line-height: 1.45; font-style: italic; }
.prose blockquote p { margin: 0; }
.prose code { font: 400 .88em var(--f-mono); background: var(--surface); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--surface); padding: 1rem 1.2rem; overflow-x: auto; border-radius: 6px; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.table-wrap { overflow-x: auto; max-width: min(100%, 52rem); }
.prose table { border-collapse: collapse; width: 100%; font-size: .98rem; }
.prose th, .prose td { text-align: left; padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose thead th { font: 500 .85rem var(--f-mono); color: var(--steel); }
.prose tbody th { font-weight: 600; }
.tags-line { margin-top: 3rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.def { display: grid; gap: 1.2rem; margin: 0; }

/* figures */
.fig { margin: 2.2rem 0; }
.fig-svg { overflow-x: auto; }
.fig svg { display: block; width: 100%; min-width: 34rem; height: auto; }
.fig text { fill: var(--ink); font: 500 14px var(--f-display); }
.fig text.m { fill: var(--steel); font-weight: 400; }
.fig text.h { font-weight: 700; }
.fig .box { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.fig .box.hot { stroke: var(--signal); stroke-width: 3.5; }
.fig .bar-soft { fill: var(--line); }
.fig .bar-sig { fill: var(--signal); }
.fig .dash { stroke: var(--steel); stroke-width: 1.5; stroke-dasharray: 5 4; }
.fig .arrow { stroke: var(--steel); stroke-width: 2; fill: none; }
.fig .arrowhead { fill: var(--steel); }
.fig figcaption { font: 400 .875rem var(--f-mono); color: var(--steel); margin-top: .7rem; }

/* footer */
.foot { position: relative; max-width: var(--max); margin: 0 auto; width: 100%; padding: 2.5rem var(--gutter) 3rem; font-size: 1rem; }
.foot::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); border-top: 1px solid var(--line); }
.foot p { margin: 0 0 .6rem; max-width: 40rem; }
.foot-links { display: flex; gap: 1.5rem; font: 500 .95rem var(--f-display); }
.fine { color: var(--steel); font-size: .9rem; }

@media (max-width: 62rem) {
  .row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no date date" "main main main" "type ev ev"; gap: .4rem 1rem; }
  .row-no { grid-area: no; }
  .row time { grid-area: date; }
  .row-main { grid-area: main; }
  .row-type { grid-area: type; }
  .row .tag { grid-area: ev; justify-self: end; }
  .post-grid.has-toc { grid-template-columns: minmax(0, 40rem); }
  .toc { position: static; order: -1; }
  .tb { grid-template-columns: 1fr auto auto; }
  .tb-nav { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--line); border-right: 0; }
  .tb-meta { display: none; }
}
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .pillar-grid, .garden-cols { grid-template-columns: 1fr; }
  body { font-size: 1.125rem; }
}

/* language switch */
.lang-switch { gap: .5rem; font: 500 .85rem var(--f-mono); }
.lang-switch a, .lang-switch span { padding: .1rem .35rem; border-radius: 4px; text-decoration: none; border: 1px solid transparent; }
.lang-switch a { color: var(--steel); border-color: var(--line); }
.lang-switch a:hover { color: var(--ink); border-color: var(--signal); }
.lang-switch .lang-on { color: var(--ink); border-color: var(--ink); }
.lang-switch .lang-off { color: var(--steel); opacity: .4; text-decoration: line-through; cursor: help; }
.chooser { max-width: 40rem; margin: 18vh auto 0; width: calc(100% - 2 * var(--gutter)); }
.chooser h1 { font: 700 2.4rem var(--f-display); margin: 0 0 1rem; }
.chooser .hero-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }
