/* internet-archive-mcp website. The look follows the owner's faymaps site: ivory paper,
   white panels with warm hairlines and soft rounded corners, navy ink, an orange accent
   (also the one colour for data in charts), sage for secondary marks, Newsreader for
   display and Public Sans for text, a 1.2 UI scale, pill controls and a 3px focus ring.
   Old material (scans, archived web pages) sits in plates of its own. No inline styles
   anywhere: the content security policy forbids them. */
:root {
  --paper: #faf5ec;
  --panel: #fffdf8;
  --cream: #f4efe6;
  --sage-light: #eef0e7;
  --orange-light: #f8e8de;
  --navy-light: #e8edf2;
  --ink: #0d2240;
  --ink-2: #33415a;        /* secondary text */
  --muted: #626a68;        /* labels, 5.4:1 on paper */
  --line: #d8d0c2;
  --soft: #ebe4d8;
  --navy: #0d2240;
  --navy-hover: #07182e;
  --sage: #7b836a;
  --sage-text: #4f5b45;
  --orange: #d3734a;       /* the one data colour */
  --orange-text: #954527;  /* orange for text, 6:1 on paper */
  --focus: #245c8a;
  --grey-bar: #c9c0b1;     /* "the rest" in charts */
  --on-navy: #faf5ec;
  --on-navy-muted: #c9cdd3;
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Public Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ui-scale: 1.2;
  --space-1: calc(4px * var(--ui-scale));
  --space-2: calc(8px * var(--ui-scale));
  --space-3: calc(12px * var(--ui-scale));
  --space-4: calc(16px * var(--ui-scale));
  --space-5: calc(24px * var(--ui-scale));
  --space-6: calc(32px * var(--ui-scale));
  --space-7: calc(48px * var(--ui-scale));
  --space-8: calc(64px * var(--ui-scale));
  --radius-panel: calc(18px * var(--ui-scale));
  --radius-control: calc(12px * var(--ui-scale));
  --radius-row: calc(10px * var(--ui-scale));
  --radius-pill: 999px;
  --motion: 200ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --elevation-1: 0 1px 2px rgba(13,34,64,.07), 0 4px 14px rgba(13,34,64,.09);
  --elevation-2: 0 2px 4px rgba(13,34,64,.08), 0 10px 28px rgba(13,34,64,.12);
  --elevation-3: 0 4px 8px rgba(13,34,64,.10), 0 18px 44px rgba(13,34,64,.16);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: 84px; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 0.18em; text-decoration-color: color-mix(in srgb, var(--orange) 70%, transparent); }
a:hover { color: var(--orange-text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; margin: 0; color: var(--navy); }
p { margin: 0; }
code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.small { font-size: .82rem; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--navy); color: var(--paper); padding: .65rem 1rem; border-radius: var(--radius-control); }
.skip-link:focus { left: .75rem; top: .75rem; }
.site-main { flex: 1 0 auto; }

/* ——— Header ——— */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header-inner { width: min(1180px, 100% - 40px); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 62px; }
.brand-link { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--navy); min-height: 44px; flex-shrink: 0; }
.brand-link:hover { color: var(--navy); }
.mark { width: 30px; height: 30px; flex: none; display: block; }
.brand-name { font-weight: 700; letter-spacing: -0.02em; }
.brand-tag { font-size: .72rem; font-weight: 600; color: var(--sage-text); background: var(--sage-light); border: 1px solid #d6dacb; padding: 1px 8px; border-radius: var(--radius-pill); }
.primary-nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link { font-weight: 600; font-size: .86rem; color: var(--muted); text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius-control); min-height: 40px; display: inline-flex; align-items: center; transition: background-color var(--motion) var(--ease), color var(--motion) var(--ease); }
.nav-link:hover { color: var(--navy); background: var(--cream); }
.nav-link[aria-current="page"] { color: var(--navy); background: transparent; box-shadow: inset 0 -2px 0 var(--orange); border-radius: 0; }

/* ——— Footer ——— */
.site-footer { background: var(--navy); color: var(--on-navy); margin-top: var(--space-8); }
.site-footer-inner { width: min(1180px, 100% - 40px); margin-inline: auto; padding: var(--space-7) 0 var(--space-8); display: grid; gap: var(--space-4); justify-items: center; text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; color: #fff; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; font-size: .95rem; }
.footer-support { font-size: .86rem; color: var(--on-navy-muted); max-width: 72ch; }
.site-footer a { color: var(--paper); text-decoration-color: rgba(250,245,236,.45); }
.site-footer a:hover { color: #fff; text-decoration-color: var(--orange); }
.site-footer :focus-visible { outline-color: #9cc3e6; }

/* ——— Buttons, pills, tags ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius-pill); font: inherit; font-size: .92rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background-color var(--motion) var(--ease), border-color var(--motion) var(--ease), color var(--motion) var(--ease), transform var(--motion) var(--ease); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-hover); color: #fff; }
.btn-secondary { background: var(--panel); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy-light); color: var(--navy); }
.btn-sm { min-height: 36px; padding: .3rem .85rem; font-size: .82rem; }
.btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.pill { font-family: var(--font-mono); font-size: .72rem; padding: 2px 10px; border-radius: var(--radius-pill); white-space: nowrap; border: 1px solid; display: inline-flex; gap: 6px; align-items: center; }
.pill.read { color: #2f5d40; border-color: #9cc2a6; background: #eef5ef; }
.pill.write { color: var(--orange-text); border-color: #e2b49c; background: var(--orange-light); }
.pill.delete { color: #9a2c22; border-color: #e0a59e; background: #fbeceb; }
.pill.soon { color: var(--sage-text); border-color: #c9cfbb; background: var(--sage-light); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .72rem; font-weight: 600; color: var(--sage-text); background: var(--sage-light); border-radius: var(--radius-pill); padding: 1px 9px; }

/* ——— Heroes ——— */
.hero { padding: var(--space-7) 0 var(--space-6); display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--space-7); align-items: center; }
.hero-plain { grid-template-columns: 1fr; padding-bottom: var(--space-5); }
.hero-plain .lede { max-width: 62ch; }
.kicker { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.kicker b { color: var(--orange-text); font-weight: 500; }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.04; margin: var(--space-3) 0 var(--space-4); }
.hero h1 em { color: var(--orange-text); font-style: italic; font-weight: 500; }
.lede { color: var(--ink-2); font-size: 1.18rem; line-height: 1.5; max-width: 40ch; }
.hero-plate { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 14px 14px 10px; box-shadow: var(--elevation-3); transform: rotate(1deg); max-width: 440px; justify-self: center; margin: 0; }
.hero-plate img { border-radius: 6px; }
.hero-plate figcaption { color: var(--muted); font-family: var(--font-mono); font-size: .72rem; margin-top: 10px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.install-note { margin-top: var(--space-4); font-size: .9rem; color: var(--muted); max-width: 60ch; }
.install-note .k { font-weight: 600; margin-right: 8px; color: var(--ink); }

/* ——— Sections ——— */
.sec { padding: 0 0 var(--space-7); }
.sec-head { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-5); align-items: baseline; border-top: 1px solid var(--line); padding-top: var(--space-4); margin-bottom: var(--space-5); }
.sec-head .t { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sage-text); }
.sec-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.1; }
.sec-head .svc { display: block; font-size: .84rem; color: var(--muted); margin-top: 6px; }
.body { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-5); }
.body::before { content: ""; }
.body > .content { display: grid; gap: var(--space-5); min-width: 0; }
.prose { max-width: 66ch; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose + .prose { margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); align-items: start; }
.stack { display: grid; gap: var(--space-4); align-content: start; }
.stack.wide { gap: var(--space-6); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--space-4) var(--space-5); box-shadow: var(--elevation-1); }
.more-link { margin-top: var(--space-4); font-weight: 600; }

/* ——— "made with": the tools a story's section came from, as on the faymaps site ——— */
.made-with { font-family: var(--font-mono); font-size: .76rem; line-height: 1.5; color: var(--muted); letter-spacing: .02em; margin-bottom: 6px; overflow-wrap: anywhere; }
.made-with a { color: inherit; text-decoration: none; }
.made-with code.tool { font-size: 1em; }
.made-with a:hover code, .made-with a:hover { text-decoration: underline; text-decoration-color: var(--orange); }

/* ——— The question, and the receipts: every call, in a box that scrolls by itself ——— */
.player { display: grid; gap: var(--space-4); }
.receipts { display: grid; gap: var(--space-3); min-width: 0; }
.receipts-box { position: relative; max-height: min(30rem, 72vh); overflow-y: auto; overscroll-behavior: contain; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--elevation-1); }
.receipts-box .replay { border: 0; border-radius: 0; background: transparent; overflow: visible; }
.ask { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px 22px; max-width: 780px; box-shadow: var(--elevation-1); }
.ask .who { justify-self: start; font-size: .72rem; font-weight: 700; color: #fff; background: var(--navy); padding: 2px 10px; border-radius: var(--radius-pill); margin-top: 7px; }
.ask p { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.3; font-weight: 500; }
.ask .q.typing::after { content: ""; display: inline-block; width: .45ch; height: 1em; background: var(--orange); margin-left: 3px; vertical-align: -.12em; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.controls { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.controls .status { font-size: .82rem; color: var(--muted); margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.replay { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; }
.replay > li { font-family: var(--font-mono); font-size: .78rem; line-height: 1.55; border-top: 1px solid var(--soft); }
.replay > li:first-child { border-top: 0; }
.replay > li:target { background: var(--orange-light); box-shadow: inset 3px 0 0 var(--orange); }
details.rc > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.6rem 1fr 1rem; gap: 12px; padding: 11px 18px; }
details.rc > summary::-webkit-details-marker { display: none; }
details.rc > summary::after { content: "+"; color: var(--muted); font-size: .95rem; line-height: 1.4; text-align: right; }
details.rc[open] > summary::after { content: "−"; color: var(--orange-text); }
details.rc > summary:hover { background: var(--cream); }
.rc-more { padding: 0 18px 12px calc(18px + 2.6rem + 12px); display: grid; gap: 8px; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; font-family: var(--font-body); font-size: .82rem; color: var(--muted); }
.rc-group { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rc-group li { border-left: 2px solid var(--soft); padding-left: 10px; }
.replay .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.replay .sig { color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.replay .ret { display: block; color: var(--ink); font-family: var(--font-body); font-size: .88rem; margin-top: 2px; }
.replay .ret::before { content: "→ "; color: var(--orange-text); }
.player.playing .replay li.wait { display: none; }
.player.playing .replay li.run .ret { visibility: hidden; }
.player.playing .replay li.run .n::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border: 2px solid var(--orange); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
.player.playing .replay li.done { animation: arrive .35s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fn { color: var(--orange-text); font-weight: 500; }
.arg { color: var(--muted); }
code.tool { color: var(--orange-text); }

/* tool call chip under a panel */
.call { font-family: var(--font-mono); font-size: .76rem; line-height: 1.5; color: var(--ink-2); background: var(--cream); border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--radius-row); padding: 9px 14px; overflow-wrap: anywhere; }
.call a { color: var(--muted); }
.call .ret { color: var(--muted); }
.calls { display: grid; gap: 8px; }

/* ——— Plates: scans and photographs ——— */
.plate { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 12px; margin: 0; box-shadow: var(--elevation-1); }
.plate img { border-radius: 6px; }
.plate figcaption { font-size: .86rem; line-height: 1.45; margin-top: 10px; color: var(--ink-2); }
.plate figcaption .src { display: block; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
figure { margin: 0; }
a.zoom { display: block; position: relative; cursor: zoom-in; border-radius: 6px; }
a.zoom::after { content: "⤢"; position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; display: grid; place-items: center; background: rgba(255,253,248,.92); color: var(--navy); border: 1px solid var(--line); border-radius: 50%; font-size: .9rem; opacity: 0; transition: opacity var(--motion) var(--ease); }
a.zoom:hover::after, a.zoom:focus-visible::after { opacity: 1; }
dialog.zoom-view { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
dialog.zoom-view::backdrop { background: rgba(13,34,64,.82); }
dialog.zoom-view .zoom-frame { background: var(--panel); border-radius: var(--radius-panel); padding: 12px; display: grid; gap: 8px; max-height: 94vh; }
dialog.zoom-view .zoom-scroll { overflow: auto; max-height: calc(94vh - 80px); max-width: calc(96vw - 24px); border-radius: 6px; }
dialog.zoom-view img { max-width: none; width: auto; cursor: zoom-out; }
dialog.zoom-view img.fit { max-width: calc(96vw - 24px); max-height: calc(94vh - 80px); }
dialog.zoom-view .zoom-bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: .82rem; color: var(--muted); }

/* ——— Big numbers ——— */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3); }
.fig { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 16px 18px; }
.fig .v { font-family: var(--font-display); font-weight: 600; font-size: 2.2rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--navy); }
.fig .v small { font-size: .5em; color: var(--muted); }
.fig .v.accent { color: var(--orange-text); }
.fig .l { font-size: .84rem; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* ——— Quotes from the sources ——— */
.hits { display: grid; gap: var(--space-3); }
.hit { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-panel); padding: 16px 18px; display: grid; gap: 8px; }
.hit .meta { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; overflow-wrap: anywhere; }
.hit .meta b { color: var(--orange-text); font-weight: 500; }
.hit h3 { font-size: 1.2rem; line-height: 1.2; }
.hit .snip { font-size: .94rem; color: var(--ink-2); }
.hit .snip.ocr { font-family: var(--font-mono); font-size: .8rem; }
mark { background: var(--orange-light); color: var(--orange-text); font-weight: 600; border-radius: 3px; padding: 0 2px; }

/* our reading: an inference, not a tool result */
.reading { border: 1px dashed var(--sage); border-radius: var(--radius-row); background: var(--sage-light); padding: 12px 16px; color: var(--ink-2); font-size: .92rem; max-width: 72ch; }
.reading::before { content: "Our reading"; display: block; font-size: .7rem; font-weight: 700; color: var(--sage-text); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 4px; }

/* ——— Charts (inline SVG drawn by the build) ——— */
.chart { display: grid; gap: 10px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 18px 20px; }
.chart h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; }
.chart .sub { font-size: .84rem; color: var(--muted); }
.chart svg { width: 100%; height: auto; overflow: visible; display: block; }
.chart svg text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.chart svg text.hi { fill: var(--ink); }
.chart svg .grid { stroke: var(--soft); stroke-width: 1; }
.s-accent { fill: var(--orange); }
.s-muted { fill: var(--grey-bar); }
.s-third { fill: var(--sage); }
.chart svg .hit { fill: transparent; }
.chart svg .col:hover .hit, .chart svg .col.on .hit { fill: rgba(13,34,64,.05); }
.chart svg .col:hover rect:not(.hit), .chart svg .col.on rect:not(.hit) { filter: brightness(.82); }
.chart svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart svg .line.s-accent { stroke: var(--orange); fill: none; }
.chart svg .line.s-muted { stroke: #9d9484; fill: none; }
.chart svg .line.s-third { stroke: var(--sage); fill: none; }
.chart svg .area { fill: rgba(211,115,74,.12); }
.chart svg .mark { fill: var(--orange); stroke: var(--panel); stroke-width: 2; }
.chart svg .band .xh { stroke: var(--navy); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; }
.chart svg .band .pt { opacity: 0; stroke: var(--panel); stroke-width: 2; }
.chart svg .band .pt.s-muted { fill: #9d9484; }
.chart svg .band:hover .xh, .chart svg .band:hover .pt, .chart svg .band.on .xh, .chart svg .band.on .pt { opacity: 1; }
.chart svg .dot { stroke: var(--panel); stroke-width: 1.5; }
.chart svg .dot:hover { stroke: var(--navy); stroke-width: 2; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .84rem; color: var(--ink-2); list-style: none; margin: 0; padding: 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend .sw.s-accent { background: var(--orange); }
.legend .sw.s-muted { background: var(--grey-bar); }
.legend .sw.s-third { background: var(--sage); }
.chart-wrap { overflow-x: auto; }
details.as-table, .swap-pane { font-size: .86rem; color: var(--muted); }
details.as-table summary, details.more summary { cursor: pointer; width: fit-content; font-weight: 600; color: var(--navy); min-height: 32px; display: inline-flex; align-items: center; }
details.as-table table, .swap-pane table { border-collapse: collapse; margin-top: 8px; font-family: var(--font-mono); font-size: .76rem; }
details.as-table td, details.as-table th, .swap-pane td, .swap-pane th { padding: 3px 14px 3px 0; text-align: left; color: var(--ink-2); font-weight: 400; border-bottom: 1px solid var(--soft); }
details.as-table th, .swap-pane th { color: var(--muted); }
/* a chart's tables in its place (site.js): the stage keeps the chart's size, a long table
   scrolls inside it, and the switch below picks the view */
.swap-stage { position: relative; min-width: 0; }
.swap-stage.tabled > .chart-wrap, .swap-stage.tabled > .swap-main { visibility: hidden; }
.swap-pane { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; background: var(--panel); border-radius: 6px; }
.swap-pane[hidden] { display: none; }
.swap-pane .table-wrap { overflow: visible; }
.swap-pane table { margin-top: 0; }
.swap-pane thead th { position: sticky; top: 0; background: var(--panel); box-shadow: inset 0 -1px 0 var(--line); }
.swap-bar { justify-self: start; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
#tip { position: fixed; pointer-events: none; z-index: 60; background: var(--navy); color: #fff; font-family: var(--font-mono); font-size: .74rem; padding: 6px 10px; border-radius: 8px; opacity: 0; transition: opacity .1s; max-width: min(420px, 90vw); box-shadow: var(--elevation-2); left: 0; top: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px; background: var(--cream); gap: 2px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .82rem; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: .35rem .8rem; border-radius: var(--radius-pill); cursor: pointer; min-height: 34px; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ——— Old web pages, as text ——— */
.oldweb { background: #c0c0c0; color: #000; font-family: "Times New Roman", Times, serif; padding: 18px 20px; border: 2px outset #e0e0e0; border-radius: 4px; }
.oldweb .bar96 { font-family: var(--font-mono); font-size: .7rem; background: #000080; color: #fff; margin: -18px -20px 14px; padding: 4px 10px; overflow-wrap: anywhere; }
.oldweb h3 { font-family: "Times New Roman", Times, serif; font-weight: 700; font-size: 1.3rem; margin-bottom: 8px; color: #000; letter-spacing: 0; }
.oldweb p { font-size: .95rem; line-height: 1.4; }
.oldweb p + p { margin-top: 8px; }
.oldweb table { border-collapse: collapse; margin-top: 12px; font-size: .88rem; width: 100%; }
.oldweb td, .oldweb th { border: 1px solid #808080; padding: 3px 6px; text-align: left; }
.oldweb.y2k { background: #fff; border: 1px solid #999; font-family: Verdana, Arial, sans-serif; }
.oldweb.y2k .bar96 { background: #7b0099; }
.oldweb.y2k h3 { font-family: Verdana, Arial, sans-serif; font-size: 1.05rem; color: #7b0099; }
.oldweb.y2k p { font-size: .85rem; }
.oldweb .alert { color: #c00; font-weight: 700; }

/* ——— Diffs ——— */
.diff { font-family: var(--font-mono); font-size: .8rem; line-height: 1.55; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 12px 0; overflow-x: auto; }
.diff div { padding: 0 16px; white-space: pre-wrap; }
.diff .add { background: var(--orange-light); color: var(--ink); }
.diff .add::before { content: "+ "; color: var(--orange-text); }
.diff .del { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(98,106,104,.6); }
.diff .del::before { content: "− "; }
.diff .gap { color: var(--muted); font-style: italic; }

/* ——— Transcripts ——— */
.srt { border-left: 2px solid var(--line); display: grid; gap: 16px; padding-left: 20px; }
.cue { display: grid; grid-template-columns: 5.2rem 1fr; gap: 14px; align-items: baseline; }
.cue time, .cue .t { font-family: var(--font-mono); font-size: .78rem; color: var(--orange-text); font-variant-numeric: tabular-nums; }
.cue p { font-size: 1.02rem; line-height: 1.55; }
.cue mark, .printed mark { background: none; color: var(--orange-text); font-weight: 600; text-decoration: underline; text-decoration-style: wavy; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.printed { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.5; color: var(--ink); }
.printed p + p { margin-top: 10px; }
audio { width: 100%; max-width: 560px; }

/* ——— Home ——— */
.home-hero { padding-top: var(--space-7); }
.why { padding-bottom: var(--space-7); }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.why-grid p { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--space-4) var(--space-5); color: var(--ink-2); box-shadow: var(--elevation-1); }
.why-grid b { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.onward { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); padding-bottom: var(--space-4); }
.tile { display: grid; gap: 4px; align-content: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: var(--space-4) var(--space-5); text-decoration: none; color: var(--ink); box-shadow: var(--elevation-1); transition: transform var(--motion) var(--ease), box-shadow var(--motion) var(--ease); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--elevation-2); color: var(--ink); }
.tile .n { font-family: var(--font-display); font-weight: 600; font-size: 2.4rem; line-height: 1; color: var(--orange-text); }
.tile b { font-family: var(--font-display); font-size: 1.3rem; color: var(--navy); }
.tile span:last-child { color: var(--muted); font-size: .9rem; }

/* story cards: the whole card is one link (a stretched heading link) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-4); }
.card { position: relative; display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow: hidden; box-shadow: var(--elevation-1); transition: transform var(--motion) var(--ease), box-shadow var(--motion) var(--ease), border-color var(--motion) var(--ease); }
.card:hover, .card:focus-within { transform: translateY(-3px); box-shadow: var(--elevation-2); border-color: #c8bca8; }
.card .pic { background: var(--cream); height: 180px; overflow: hidden; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .pic.dark { background: #111; }
.card .pic.web { background: #c0c0c0; color: #000; font-family: "Times New Roman", Times, serif; padding: 16px; text-align: left; place-items: start; align-content: center; gap: 6px; }
.card .pic.web b { font-size: 1.2rem; }
.card .pic.web span { font-family: var(--font-mono); font-size: .72rem; color: #333; }
.card .txt { padding: 16px 18px 18px; display: grid; gap: 8px; align-content: start; }
.card .t { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--sage-text); }
.card h3 { font-size: 1.45rem; line-height: 1.12; }
.card h3 a { text-decoration: none; color: var(--navy); }
.card h3 a.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card p { font-size: .92rem; color: var(--ink-2); }
.card .tags, .card .tools-line a { position: relative; z-index: 2; }
.card .tools-line { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); line-height: 1.7; }
.cards.gallery { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card.big .pic { height: 210px; }

/* stories: coverage of the read tools */
.cov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }
.cov-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 14px 16px; }
.cov-group h3 { font-family: var(--font-body); font-size: .8rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--sage-text); margin-bottom: 8px; }
.cov { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cov li { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: baseline; padding: 5px 8px; border-radius: 8px; font-size: .8rem; }
.cov li .name { text-decoration: none; }
.cov li code.tool { color: var(--muted); }
.cov li .where { color: var(--muted); text-align: right; font-size: .76rem; }
.cov li.on { background: var(--orange-light); }
.cov li.on code.tool { color: var(--orange-text); font-weight: 500; }
.cov li.on .where a { color: var(--ink); margin-left: 6px; }

/* safety */
.safety { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }
.safety li { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--orange); border-radius: var(--radius-panel); padding: var(--space-4); display: grid; gap: 6px; align-content: start; }
.safety b { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--navy); }
.safety span { color: var(--ink-2); font-size: .94rem; }

/* tool catalog */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.svc-grid a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 14px 16px; text-decoration: none; display: grid; gap: 4px; color: var(--ink); transition: box-shadow var(--motion) var(--ease); }
.svc-grid a:hover { box-shadow: var(--elevation-2); color: var(--ink); }
.svc-grid .n { font-family: var(--font-display); font-weight: 600; font-size: 1.8rem; line-height: 1; color: var(--navy); }
.svc-grid .k { font-family: var(--font-mono); font-size: .82rem; color: var(--orange-text); }
.svc-grid .s { font-size: .84rem; color: var(--muted); }
.tools { display: grid; gap: 10px; }
details.tool { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-row); }
details.tool > summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: minmax(11rem, auto) 1fr auto; gap: 6px 16px; align-items: baseline; color: var(--ink); font-size: .94rem; border-radius: var(--radius-row); }
details.tool > summary::-webkit-details-marker { display: none; }
details.tool > summary code { color: var(--orange-text); font-size: .86rem; font-weight: 500; }
details.tool > summary .d { color: var(--ink-2); }
details.tool[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius-row) var(--radius-row) 0 0; }
details.tool:target { box-shadow: 0 0 0 3px var(--orange-light); }
details.tool .more { padding: 12px 16px 16px; display: grid; gap: 10px; color: var(--ink-2); font-size: .9rem; }
.params { border-collapse: collapse; width: 100%; font-size: .82rem; }
.params th, .params td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--soft); vertical-align: top; color: var(--ink-2); font-weight: 400; }
.params th { color: var(--muted); font-family: var(--font-mono); font-size: .72rem; }
.params td code { color: var(--ink); }
.table-wrap { overflow-x: auto; }

/* get started */
.install { display: grid; gap: 14px; }
.cmd { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 14px 16px; display: grid; gap: 6px; }
.cmd .k { font-size: .76rem; font-weight: 600; color: var(--muted); }
.cmd pre { margin: 0; font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.notice { border-left: 3px solid var(--orange); background: var(--orange-light); border-radius: 0 var(--radius-row) var(--radius-row) 0; padding: 10px 14px; color: var(--ink-2); max-width: 72ch; }
.steps { counter-reset: step; display: grid; gap: var(--space-6); }
.step { display: grid; grid-template-columns: 3rem 1fr; gap: 16px; }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--font-display); font-weight: 600; color: var(--orange-text); font-size: 1.4rem; line-height: 1.3; }
.step h2 { font-size: 1.6rem; margin-bottom: 10px; }
.step .stack { gap: 12px; }
.asks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); }
.asks article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.asks q { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.3; quotes: "\201C" "\201D"; color: var(--navy); }
.asks .uses { font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }
ul.plain { margin: 0; padding-left: 1.1em; color: var(--ink-2); display: grid; gap: 6px; }

/* 404 */
.lost { min-height: 50vh; }
.going-home { margin-top: var(--space-4); color: var(--muted); font-size: .92rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-6); padding-top: var(--space-5); }
  .hero-plate { max-width: 360px; }
  .sec-head, .body { grid-template-columns: 1fr; gap: 8px; }
  .body::before { display: none; }
  .grid-2, .grid-3, .why-grid, .onward { grid-template-columns: 1fr; }
  details.tool > summary { grid-template-columns: 1fr auto; }
  details.tool > summary .d { grid-column: 1 / -1; }
  .site-header-inner { flex-wrap: wrap; gap: 0; padding: 4px 0; }
  .primary-nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; justify-content: flex-start; scrollbar-width: none; margin: 0 -6px; }
  .primary-nav::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; padding: .4rem .6rem; }
}
@media (max-width: 560px) {
  :root { --ui-scale: 1.1; }
  .wrap, .site-header-inner, .site-footer-inner { width: min(1180px, 100% - 28px); }
  .ask { grid-template-columns: 1fr; padding: 14px 16px; }
  .ask p { font-size: 1.2rem; }
  details.rc > summary { grid-template-columns: 1fr 1rem; gap: 2px 8px; padding: 10px 14px; }
  details.rc > summary .n { grid-column: 1; }
  details.rc > summary .sig { grid-column: 1; }
  details.rc > summary::after { grid-column: 2; grid-row: 1; }
  .rc-more { padding: 0 14px 12px; }
  .controls .status { flex-basis: 100%; margin-left: 0; }
  .cue { grid-template-columns: 1fr; gap: 2px; }
  .step { grid-template-columns: 1fr; gap: 4px; }
  .chart { padding: 14px; }
  .chart-wrap svg.bars, .chart-wrap svg.lines { min-width: 560px; }
  .cards, .cards.gallery { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
