/* Understory: shared styles for content pages (field notes, guides). The homepage keeps its own inline copy. */
:root {
  --bg: #fbfbf8; --bg-2: #f1f2ee; --ink: #111512; --ink-2: #4a524c; --ink-3: #6b736d; --ink-4: #b4bcb5;
  --line: #e3e6e1; --accent: #1f5a3d; --accent-2: #6a4aa8; --hover: #f3f4f0; --tint: #eaf2ec; --stream: #4e8a68;
  --font-display: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e0c; --bg-2: #111512; --ink: #e6ebe7; --ink-2: #9aa49d; --ink-3: #7f8a83; --ink-4: #2c342e;
    --line: #1f2621; --accent: #7fc8a0; --accent-2: #b9a2ea; --hover: #121714; --tint: #13241a; --stream: #7fc8a0; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e0c; --bg-2: #111512; --ink: #e6ebe7; --ink-2: #9aa49d; --ink-3: #7f8a83; --ink-4: #2c342e;
  --line: #1f2621; --accent: #7fc8a0; --accent-2: #b9a2ea; --hover: #121714; --tint: #13241a; --stream: #7fc8a0; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
p { margin: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.meta { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* Header */
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; justify-content: space-between; align-items: center; height: 72px; gap: 16px; }
.mark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 16px; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; }
.logo { flex: none; }
.logo .f { fill: var(--tint); }
.logo .c { stroke: var(--accent); }
.logo .s { stroke: var(--stream); }
header.site nav { display: flex; gap: 32px; }
header.site nav a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
header.site nav a:hover, header.site nav a[aria-current="page"] { color: var(--ink); }

/* Article */
.article { padding-block: 48px 24px; }
.article-head { max-width: 720px; }
.article-head h1 { margin: 14px 0 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(32px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -0.04em; }
.dek { margin-top: 18px; font-size: 20px; line-height: 1.5; color: var(--ink-2); max-width: 36ch; }
.byline { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.prose { max-width: 680px; margin-top: 40px; }
.prose > * + * { margin-top: 18px; }
.prose h2 { margin: 52px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 24px; line-height: 1.25; letter-spacing: -0.03em; }
.prose h2 + * { margin-top: 14px; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li + li { margin-top: 8px; }
.prose blockquote { margin: 0; padding-left: 18px; border-left: 2px solid var(--line); color: var(--ink-2); }
.cites { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.cite { color: var(--ink-3); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cite:hover { color: var(--accent); }
.summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 18px; display: grid; gap: 10px; }
.summary div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; font-size: 15.5px; line-height: 1.55; }
.summary dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-top: 2px; }
.summary dd { margin: 0; }

/* Photos */
.photo { margin: 30px 0 0; }
.photo img { display: block; width: 100%; height: auto; background: var(--bg-2); }
.photo.hero { max-width: 1040px; margin-top: 36px; }
.prose .photo img { max-height: 640px; width: auto; max-width: 100%; }
.photo figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-2); max-width: 680px; }
.photo .credit { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.photo .credit a { color: var(--ink-3); text-underline-offset: 3px; }

/* Range charts */
.chart { margin: 26px 0 0; padding: 18px 0 6px; border-top: 1px solid var(--line); }
.chart figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.chart-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 30px; }
.row .lab { font-size: 13.5px; line-height: 1.3; color: var(--ink-2); }
.row .lab small { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.track { position: relative; height: 22px; background: linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat; }
.bar { position: absolute; top: 5px; height: 12px; border-radius: 2px; background: var(--accent); }
.bar.soft { background: var(--tint); border: 1px solid var(--stream); }
.bar.ours { background: var(--accent-2); }
.dot { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.val { position: absolute; top: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.line-mark { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 1px dashed var(--ink-3); }
.axis { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 14px; margin-top: 4px; }
.axis .ticks { position: relative; height: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.axis .ticks span { position: absolute; transform: translateX(-50%); }
.axis .ticks span:first-child { transform: none; }
.axis .ticks span:last-child { transform: translateX(-100%); }

/* Comparison table */
.table-box { margin-top: 22px; overflow-x: auto; border: 1px solid var(--line); }
table.compare { border-collapse: collapse; width: 100%; min-width: 600px; font-size: 14.5px; line-height: 1.5; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.compare thead th { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; background: var(--bg-2); }
.compare tbody th { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.compare tbody tr:last-child th, .compare tbody tr:last-child td { border-bottom: 0; }
.wide { max-width: 1040px; }

/* Sources */
.sources { max-width: 720px; margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); }
.sources ol { margin: 14px 0 0; padding-left: 22px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.sources li + li { margin-top: 10px; }
.sources a { color: var(--ink-2); text-underline-offset: 3px; overflow-wrap: anywhere; }
.note { margin-top: 28px; max-width: 680px; font-size: 14.5px; color: var(--ink-3); }

/* Notes index */
.post-list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 760px; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 22px 0; text-decoration: none; }
.post-list a:hover h2 { text-decoration: underline; text-underline-offset: 4px; }
.post-list h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.03em; line-height: 1.25; }
.post-list p { margin-top: 8px; color: var(--ink-2); font-size: 15.5px; }

/* Footer */
footer.site { margin-top: 72px; border-top: 1px solid var(--line); }
footer.site .wrap { padding-block: 32px 44px; display: grid; gap: 18px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.links a { font-size: 14px; color: var(--ink-2); text-decoration: none; }
.links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.fine { display: flex; flex-wrap: wrap; gap: 6px 24px; }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  header.site nav { gap: 14px; }
  header.site nav a { font-size: 13px; }
  .article { padding-top: 32px; }
  .dek { font-size: 18px; }
  .row, .axis { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; }
  .row .lab { font-size: 12.5px; }
  .summary div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .post-list a { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
