:root {
  --forest: #193a32;
  --cream: #fffdf0;
  --mast-copy: #e1e9dd;
  --mast-title: 400 clamp(3rem, 6.8vw, 6.3rem)/1 var(--serif);
  --mast-inset: clamp(1.6rem, 4vw, 3.5rem);
  --paper: #f8f7f2;
  --ink: #18251f;
  --muted: #526057;
  --rule: #c7ccc2;
  --blue: #203da6;
  --sans: 'Instrument Sans', Arial, Helvetica, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'Courier New', monospace;
  color-scheme: light;
  font: 100%/1.5 var(--sans);
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #3054d5; outline-offset: 3px; }
button, input, select { font: inherit; }
.shell, .reader .masthead { width: min(76rem, calc(100% - clamp(2.5rem, 9vw, 8rem))); margin-inline: auto; }
.masthead, .reader .masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 5rem; padding-block: .8rem; border-bottom: 2px solid var(--ink);
}
.masthead a { color: var(--ink); text-decoration: none; }
.masthead .brand {
  display: inline-flex; align-items: center; gap: .6rem; margin: 0;
  font: 700 clamp(1.15rem, 2vw, 1.55rem)/1 var(--sans); letter-spacing: -.065em;
}
.masthead .brand::before {
  content: '§'; display: grid; place-items: center; width: 1.15em; height: 1.15em; margin: 0;
  font: bold 1.2em/1 var(--serif); color: var(--paper); background: var(--blue);
}
.masthead .nav-items { display: flex; flex-wrap: wrap; gap: clamp(.8rem, 2.5vw, 2.3rem); align-items: baseline; font-size: .92rem; }
.masthead .nav-items a { padding-block: .45rem; }
.masthead .nav-items a:is(:hover,[aria-current]) { text-decoration: underline; text-underline-offset: .4em; }
.masthead .nav-items .contribute-link { color: var(--blue); }
.skip { position: absolute; left: .75rem; top: -5rem; background: white; padding: .6rem; z-index: 300; }
.skip:focus { top: .5rem; }

.lead { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 7vw, 6.5rem); align-items: center; padding: clamp(2rem, 4.8vw, 4.5rem) 0; }
.page-header h1, .reader main h1 { color: var(--ink); font: 600 clamp(3.1rem, 6.8vw, 6.4rem)/.98 var(--sans); letter-spacing: -.058em; margin: 0; }
.lead { margin-top: 1.25rem; padding: var(--mast-inset); background: var(--forest); color: var(--cream); }
.lead h1 { margin: 0; font: var(--mast-title); letter-spacing: -.055em; }
.lead-copy > p { max-width: 32rem; color: var(--mast-copy); font-size: clamp(1rem, 1.48vw, 1.26rem); line-height: 1.5; margin: 1.5rem 0 1.9rem; }
.catalog-search { display: flex; align-items: stretch; background: white; border: 1px solid var(--ink); max-width: 29rem; }
.catalog-search input { flex: 1; min-width: 0; color: var(--ink); background: transparent; padding: .85rem 1rem; border: 0; }
.catalog-search button { border: 0; padding: .8rem 1.1rem; background: var(--blue); color: white; cursor: pointer; }
.catalog-search button:hover { background: #142c83; }
.plate { display: grid; margin: 0; padding: 1.15rem clamp(1rem, 2vw, 2rem) .9rem; background: #e8ebdf; }
.plate img { display: block; width: 100%; height: clamp(13rem, 22vw, 20.5rem); object-fit: contain; mix-blend-mode: multiply; }
.plate figcaption { border-top: 1px solid #a4b2a5; margin-top: .55rem; padding-top: .65rem; }
.plate a { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem .8rem; color: #284536; text-decoration: none; }
.plate a:hover { text-decoration: underline; }
.plate figcaption span { font: italic 1rem var(--serif); }
.plate small { font: .72rem var(--mono); }
.topics { display: flex; flex-wrap: wrap; gap: .5rem clamp(1rem, 2.8vw, 2.8rem); align-items: center; border-block: 1px solid var(--rule); padding: 1rem 0; }
.topics strong { font-size: .85rem; }
.topics a, .section-link, .latest-articles > a { font-size: .92rem; }
.reading-room { display: grid; grid-template-columns: 1.32fr 1fr; gap: clamp(2rem, 7vw, 6.5rem); padding-block: clamp(2rem, 4.5vw, 4.2rem); }
.reading-room h2, .contribute h2 { font: 500 clamp(1.6rem, 2.5vw, 2.3rem)/1.08 var(--serif); letter-spacing: -.04em; margin: 0 0 1.25rem; }
.reading-room ul { margin: 0 0 1.15rem; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.reading-room li { border-bottom: 1px solid var(--rule); padding: 1.05rem 0; }
.reading-room li a { display: inline-block; font-weight: 500; text-decoration-thickness: 1px; text-decoration-color: #a4adcd; color: var(--blue); }
.reading-room li a:hover { color: var(--blue); text-decoration: underline; }
.reading-room li p, .contribute p { color: var(--muted); margin: .4rem 0 0; }
.latest-articles li a { max-width: 24ch; font: 500 clamp(1.8rem, 3.1vw, 3.1rem)/1.08 var(--serif); letter-spacing: -.04em; }
.latest-articles li small { display: block; color: var(--muted); margin-bottom: .4rem; font-size: .82rem; }
.latest-articles li { padding-block: 1.5rem; }
.projects li a { font: 500 1.4rem/1.2 var(--serif); }
.projects li p { font-size: .94rem; }
.contribute { border-top: 2px solid var(--ink); padding-block: 2rem 3rem; }
.contribute h2 { margin: 0; }
.contribute p { max-width: 42rem; margin-bottom: .8rem; }
.colophon { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .75rem; border-top: 1px solid var(--rule); padding-block: 1.2rem 2rem; font-size: .85rem; }
.colophon div { display: flex; flex-wrap: wrap; gap: 1rem; }
.colophon span { font-weight: bold; }
.colophon a { color: var(--muted); }

/* The directory keeps its existing filter controls and small-screen drawer. */
.catalog {
  --bg: var(--paper); --bg-warm: #eaece7; --surface: var(--paper); --text: var(--ink);
  --text-secondary: var(--muted); --text-tertiary: #57635d; --border: var(--rule); --border-light: #d8dbd3;
  --coral: var(--blue); --coral-hover: #152b7a; --coral-soft: #e7ecfb; --coral-border: #a4b5e2; --radius: 3px;
}
.catalog .page-header { padding: clamp(2rem, 5vw, 4rem) 0 1.5rem; }
.page-header h1, .reader main h1 { font-size: clamp(2.8rem, 5.5vw, 5rem); }
.page-header p { margin: .9rem 0 0; color: var(--muted); }
.catalog .layout { width: min(76rem, calc(100% - clamp(2.5rem, 9vw, 8rem))); margin: auto; padding: 1.3rem 0 4rem; border-top: 2px solid var(--ink); }
.catalog .main { min-width: 0; }
.catalog .filter-label { white-space: normal; line-height: 1.3; }
.catalog .filter-list { padding: 0; margin: 0; }
.catalog .grid { grid-template-columns: minmax(0,1fr); gap: 0; border-top: 1px solid var(--ink); }
.catalog .tile { padding: 1.25rem 0; gap: .35rem; min-height: 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
.catalog .tile:hover { box-shadow: none; transform: none; }
.catalog .tile:hover .tile-title { color: var(--blue); text-decoration: underline; }
.catalog .tile-title { font: 650 1.4rem/1.2 var(--sans); letter-spacing: -.045em; }
.catalog .tile-category { color: var(--blue); text-transform: none; font-size: .81rem; letter-spacing: 0; }
.catalog .tile-desc { display: block; color: var(--muted); font-size: .96rem; line-height: 1.5; max-width: 80ch; }
.catalog .tile-foot { margin: .25rem 0 0; padding: 0; border: 0; }
.catalog .license-badge { max-width: 45%; white-space: normal; }
.catalog .site-footer { font-size: .9rem; }

/* Generated articles retain their public content repository styles for code and tables. */
.reader main { width: min(45rem, calc(100% - 2.5rem)); padding-block: clamp(2.5rem, 6vw, 5rem); }
.reader main h1 { margin: .25em 0; line-height: 1.03; }
.reader h2, .reader h3 { font-family: var(--sans); font-weight: 650; letter-spacing: -.035em; }
.reader main a, .reader footer a { color: var(--blue); }
.reader article > p:not(.summary):not(.byline), .reader article li { font: 1.13rem/1.7 var(--serif); }
.reader article code { font-size: .9em; }
.reader .results { border-top: 2px solid var(--ink); }
.reader .results li { border: 0; border-bottom: 1px solid var(--rule); }
.reader .summary, .reader .byline { color: var(--muted); }
.reader footer { width: min(45rem, calc(100% - 2.5rem)); font-size: .9rem; }
.benchmarks main:has(.results) { width: min(57rem, calc(100% - 2.5rem)); }
.benchmarks .results h2 { font: 550 clamp(1.4rem, 2.6vw, 2.05rem)/1.15 var(--serif); }
.benchmarks .results h2 a { color: var(--ink); text-decoration: none; }
.benchmarks .results h2 a:hover { color: var(--blue); text-decoration: underline; }
@media (min-width: 741px) {
  .benchmarks .results li:not([hidden]) { display: grid; grid-template-columns: 13rem 1fr; gap: .25rem 2rem; }
  .benchmarks .results .byline { grid-row: span 2; }
  .benchmarks .results li > p:last-child { grid-column: 2; }
}
@media (max-width: 740px) {
  .lead, .reading-room { grid-template-columns: minmax(0,1fr); gap: 1.8rem; }
  .lead { padding: 1.35rem; }
  .lead-copy > p { margin-block: 1rem 1.35rem; }
  .plate img { height: clamp(10rem, 36vw, 15rem); }
  .topics { font-size: .9rem; gap: .5rem 1.15rem; }
  .topics strong { width: 100%; }
}
@media (max-width: 540px) {
  .masthead, .reader .masthead { min-height: 0; flex-wrap: wrap; gap: .65rem; padding-block: .9rem .6rem; }
  .masthead .nav-items { width: 100%; gap: .15rem clamp(.45rem, 1.8vw, .8rem); font-size: .9rem; }
  .catalog .toolbar { flex-wrap: wrap; }
  .catalog .search { flex: 1 1 100%; order: -1; }
}
@media (max-width: 900px) {
  .catalog .sidebar:not(.open) { visibility: hidden; }
}


/* Benchmark directory rows keep the upstream project and the editorial note separately reachable. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.directory-benchmark { border-bottom: 1px solid var(--rule); padding-bottom: 1rem; }
.catalog .directory-benchmark .tile { border-bottom: 0; padding-bottom: .5rem; }
.benchmark-notes { font-size: .92rem; }
.catalog .page-header h1, .reader article h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; }
@media (max-width: 540px) {
  .catalog-search input, .catalog-search button { padding: .65rem; }
  .plate img { height: 9rem; }
}
