:root {
  --ink: #1d211d;
  --ink-soft: #4d554e;
  --paper: #f4f1e8;
  --paper-deep: #e8e3d5;
  --forest: #254d3b;
  --forest-deep: #17362a;
  --brown: #7b4c2e;
  --rust: #b85c35;
  --silver: #aeb6b4;
  --line: rgba(29, 33, 29, 0.16);
  --white: #fffdf7;
  --link: #1f654b;
  --content-measure: min(90vw, 1180px);
  --font-display: 'Merriweather', serif;
  --font-body: 'Open Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-synthesis: none;
}

html[data-theme="dark"], html.dark {
  --ink: #eef0e7;
  --ink-soft: #bdc7bb;
  --paper: #17221c;
  --paper-deep: #213229;
  --forest: #91b99d;
  --forest-deep: #0e1913;
  --brown: #d49b6f;
  --rust: #ef8a5c;
  --silver: #bcc6c4;
  --line: rgba(238, 240, 231, 0.17);
  --white: #f5f4eb;
  --link: #a9d9bb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
img { max-width: 100%; display: block; }
a { color: var(--link); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  position: relative;
  z-index: 5;
}
.header-inner {
  width: var(--content-measure);
  min-height: 5.75rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 3rem;
}
.brand-mark { width: 2.55rem; height: 2.55rem; flex: none; }
.brand-name { font-family: var(--font-display); font-size: clamp(1.28rem, 2vw, 1.6rem); font-weight: 700; letter-spacing: -.035em; }
.brand-tag { display: block; margin-top: .12rem; color: var(--ink-soft); font: 600 .63rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.primary-nav { display: flex; align-items: center; gap: clamp(1rem, 2.3vw, 2rem); }
.primary-nav a { color: var(--ink-soft); text-decoration: none; font-size: .78rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--rust); }
.theme-toggle, .menu-toggle { border: 1px solid var(--line); background: transparent; color: var(--ink); min-width: 2.45rem; height: 2.45rem; display: inline-grid; place-items: center; }
.theme-toggle { font-size: 1rem; }
.menu-toggle { display: none; }

.page-wrap { width: var(--content-measure); margin: 0 auto; }
.rail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: clamp(1.5rem, 4vw, 4.5rem); align-items: start; }
.rail-layout:has([data-side-links][hidden]), .rail-layout:has([data-side-links]:empty) { grid-template-columns: minmax(0, 1fr); }
[data-side-links][hidden], [data-side-links]:empty { display: none; }
.side-links { border-left: 2px solid var(--forest); padding: .3rem 0 .3rem 1rem; margin-top: 2.2rem; }
.side-links h2 { color: var(--forest); font: 700 .68rem/1.2 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 1rem; }
.side-links ol { list-style: none; padding: 0; margin: 0; }
.side-links li + li { margin-top: .65rem; }
.side-links a { color: var(--ink-soft); text-decoration: none; font-size: .8rem; line-height: 1.35; }
.side-links a:hover { color: var(--rust); }

main { min-width: 0; }
.eyebrow { color: var(--rust); font: 700 .7rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.04em; }
h1 { font-size: clamp(2.6rem, 6vw, 5.9rem); line-height: .98; margin-bottom: 1.4rem; }
h2 { font-size: clamp(1.9rem, 3.7vw, 3.4rem); line-height: 1.05; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; line-height: 1.15; margin-bottom: .6rem; }
p { color: var(--ink-soft); line-height: 1.7; }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 38rem; }
.section { padding: clamp(4rem, 9vw, 8rem) 0; }
.section-heading { max-width: 42rem; margin-bottom: 2.4rem; }
.section-heading p { max-width: 35rem; }

.hero { padding: clamp(3rem, 6vw, 5.5rem) 0 4rem; }
.hero-frame { min-height: min(70vh, 690px); display: grid; align-items: end; position: relative; overflow: hidden; background: var(--forest-deep); }
.hero-frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 24, 18, .88) 0%, rgba(12, 24, 18, .5) 48%, rgba(12, 24, 18, .16) 100%); }
.hero-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .86; }
.hero-copy { position: relative; z-index: 1; max-width: 700px; padding: clamp(2rem, 6vw, 5.5rem); color: var(--white); }
.hero-copy h1 { max-width: 10ch; margin-bottom: 1.3rem; }
.hero-copy p { color: rgba(255, 253, 247, .82); max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: .7rem 1.15rem; border: 1px solid var(--rust); background: var(--rust); color: #fffaf1; text-decoration: none; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; transition: transform .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); background: #994628; }
.button.secondary { border-color: rgba(255, 253, 247, .52); background: transparent; color: var(--white); }
.button.secondary:hover { background: rgba(255, 253, 247, .12); }

.pulse-line { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.15rem 0; display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; color: var(--ink-soft); font: 600 .68rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.pulse-line span::before { content: "↗"; color: var(--rust); margin-right: .5rem; }
.value-grid, .category-grid, .review-grid { display: grid; grid-template-columns: repeat(3, minmax(min(100%, 15rem), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.value-card, .category-card, .review-card { background: var(--paper); padding: clamp(1.4rem, 3vw, 2.2rem); }
.value-card .number { color: var(--rust); font: 700 .72rem var(--font-mono); }
.value-card h3 { margin-top: 2.4rem; }
.category-card { min-height: 15rem; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.category-card strong, .category-card p { position: relative; z-index: 1; }
.category-card strong { color: var(--white); font: 700 1.75rem var(--font-display); }
.category-card p { color: rgba(255, 253, 247, .78); margin: .35rem 0 0; font-size: .9rem; }
.category-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(10, 26, 18, .86), rgba(10, 26, 18, .15)); }
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.category-card > *:not(img) { position: relative; }

.finder { background: var(--paper-deep); padding: clamp(1.5rem, 4vw, 3rem); display: grid; grid-template-columns: minmax(0, .9fr) minmax(18rem, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.finder form { display: grid; gap: 1rem; }
.field label { display: block; margin-bottom: .4rem; color: var(--ink); font-weight: 700; font-size: .78rem; }
.field select { width: 100%; min-height: 2.9rem; border: 1px solid var(--line); padding: .6rem .7rem; background: var(--paper); color: var(--ink); }
.finder-result { min-height: 12rem; border-left: 3px solid var(--rust); padding: 1.2rem 1.4rem; background: var(--paper); }
.finder-result h3 { color: var(--forest); }
.finder-result p { margin-bottom: 0; }

.photo-band { min-height: 24rem; position: relative; overflow: hidden; display: grid; align-items: center; background: var(--forest-deep); }
.photo-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.photo-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13, 32, 23, .88), rgba(13, 32, 23, .25)); }
.photo-band-copy { position: relative; z-index: 1; width: var(--content-measure); margin: 0 auto; padding: 3rem 0; color: var(--white); }
.photo-band-copy h2 { max-width: 18ch; }
.photo-band-copy p { color: rgba(255, 253, 247, .8); max-width: 34rem; }

.page-hero { padding: clamp(3.5rem, 8vw, 7rem) 0 3rem; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 12ch; }
.page-hero p { max-width: 40rem; font-size: 1.1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .85fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.note { border-top: 3px solid var(--rust); padding-top: 1rem; }
.note strong { font-family: var(--font-display); font-size: 1.2rem; }
.numbered-list { display: grid; gap: 1rem; counter-reset: field; }
.numbered-item { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: 1.2rem 0; border-top: 1px solid var(--line); counter-increment: field; }
.numbered-item::before { content: counter(field, decimal-leading-zero); color: var(--rust); font: 700 .8rem var(--font-mono); }
.numbered-item h3 { margin: 0; }
.numbered-item p { margin: .4rem 0 0; }

.news-section { background: var(--paper-deep); }
.news-grid, .archive-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); align-items: start; gap: 1.3rem; }
.story-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); }
.story-image { display: block; position: relative; aspect-ratio: 1.45; overflow: hidden; background: var(--forest-deep); }
.story-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.story-card:hover .story-image img { transform: scale(1.04); }
.story-card > :not(.story-image) { margin-left: 1.2rem; margin-right: 1.2rem; }
.story-meta { display: flex; gap: .5rem .75rem; flex-wrap: wrap; align-items: center; color: var(--ink-soft); font: 600 .66rem/1.3 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.story-card .story-meta { margin-top: 1rem; }
.category-label { color: var(--rust); }
.story-card h3 { margin-top: .6rem; }
.story-card h3 a { color: var(--ink); text-decoration: none; }
.story-card h3 a:hover { color: var(--rust); }
.story-card .excerpt { font-size: .9rem; }
.empty-state { color: var(--ink-soft); border: 1px dashed var(--line); padding: 1.3rem; }

.archive-controls { display: grid; gap: 1.3rem; margin: 2rem 0 2.5rem; }
.archive-controls form { display: flex; gap: .7rem; }
.archive-controls input { min-height: 3rem; flex: 1; border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: .7rem .9rem; }
.filter-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.filter-list a { border: 1px solid var(--line); padding: .45rem .7rem; color: var(--ink-soft); text-decoration: none; font: 600 .68rem var(--font-mono); text-transform: uppercase; }
.filter-list a:hover { border-color: var(--rust); color: var(--rust); }

.prose { max-width: 52rem; }
.prose p, .prose li { font-size: 1.08rem; line-height: 1.85; }
.prose p { margin-bottom: 1.35rem; }
.prose a { color: var(--link); text-decoration-thickness: .11em; text-underline-offset: .16em; }
.prose h2 { margin-top: 3rem; }
.prose h3 { margin-top: 2rem; }
.article-header { max-width: 52rem; padding: 3rem 0 1.5rem; }
.article-header h1 { font-size: clamp(2.5rem, 5vw, 5rem); }
.article-deck { font-size: 1.2rem; }
.article-cover { aspect-ratio: 2 / 1; margin: 1rem 0 2rem; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.byline { display: flex; align-items: center; gap: .85rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 0; margin: 1rem 0 2rem; }
.byline img { width: 2.8rem; height: 2.8rem; border-radius: 50%; object-fit: cover; }
.byline strong { display: block; }
.byline p { margin: .15rem 0 0; font-size: .85rem; }

.site-footer { margin-top: 5rem; border-top: 1px solid var(--line); padding: 2rem 0 3rem; }
.footer-inner { width: var(--content-measure); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; font-size: .82rem; }
.footer-mark { color: var(--forest); font: 700 .72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.not-found { padding: 7rem 0; }
.not-found h1 { max-width: 8ch; }

@media (max-width: 850px) {
  .header-inner { min-height: 5.2rem; }
  .menu-toggle { display: inline-grid; }
  .primary-nav { display: none; position: absolute; left: 5vw; right: 5vw; top: 5.2rem; padding: 1.2rem; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 1rem 2rem rgba(0,0,0,.12); flex-direction: column; align-items: stretch; }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: .65rem 0; }
  .rail-layout, .rail-layout:has([data-side-links][hidden]), .rail-layout:has([data-side-links]:empty) { grid-template-columns: minmax(0, 1fr); }
  .side-links { margin-top: 0; }
  .value-grid, .category-grid, .review-grid, .finder, .split { grid-template-columns: 1fr; }
  .finder { gap: 1.5rem; }
}
@media (max-width: 540px) {
  .header-inner, .page-wrap, .footer-inner, .photo-band-copy { width: min(91vw, 1180px); }
  .brand-tag { display: none; }
  .hero-frame { min-height: 33rem; }
  .hero-copy { padding: 1.5rem; }
  .hero-copy h1 { font-size: 2.75rem; }
  .archive-controls form { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
