:root {
  --navy-950: #071421;
  --navy-900: #0b1f33;
  --navy-800: #12324d;
  --navy-700: #1b4865;
  --green-500: #16a66a;
  --green-400: #35d58a;
  --lime-300: #baf36a;
  --paper: #f4f7f2;
  --paper-strong: #ffffff;
  --ink: #102334;
  --ink-soft: #506272;
  --line: #d8e3e0;
  --link: #087b55;
  --warning: #f5b942;
  --measure: min(1180px, calc(100% - 3rem));
  --font-display: 'Zilla Slab', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shadow: 0 1.25rem 3rem rgba(7, 20, 33, .12);
  --radius: 1.25rem;
  color-scheme: light;
}

html[data-theme="dark"], html.dark {
  --paper: #091722;
  --paper-strong: #102638;
  --ink: #edf8f1;
  --ink-soft: #a7bdc5;
  --line: #294354;
  --link: #58e1a0;
  --shadow: 0 1.25rem 3rem rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: .65rem .9rem;
  background: var(--lime-300);
  color: var(--navy-950);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: relative;
  z-index: 10;
  background: var(--navy-950);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.header-inner {
  width: var(--measure);
  min-height: 5.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark {
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-items: center;
  background: var(--green-500);
  clip-path: polygon(50% 0, 91% 14%, 91% 57%, 78% 80%, 50% 100%, 22% 80%, 9% 57%, 9% 14%);
}
.brand-mark svg { width: 1.6rem; height: 1.6rem; }
.brand-name {
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
}
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav a {
  color: #c8d8da;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--lime-300); }
.header-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-left: .35rem;
}
[data-theme-toggle], .menu-toggle {
  border: 1px solid rgba(255,255,255,.24);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  min-width: 2.55rem;
  min-height: 2.55rem;
  display: grid;
  place-items: center;
}
[data-theme-toggle] { font-size: 1rem; }
.menu-toggle { display: none; }

.eyebrow {
  margin: 0 0 .8rem;
  color: var(--green-500);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.display-title, h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: .98;
}
h1 { font-size: clamp(3.2rem, 7vw, 6.6rem); }
h2 { font-size: clamp(2.2rem, 4vw, 4rem); }
h3 { font-size: clamp(1.45rem, 2.3vw, 2rem); }
p { margin: 0; }
.lede { color: var(--ink-soft); font-size: 1.12rem; line-height: 1.65; }

.site-main { min-height: 60vh; }
.page-wrap { width: var(--measure); margin: 0 auto; }
.rail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11.5rem;
  gap: clamp(1.6rem, 4vw, 4rem);
  align-items: start;
  padding: 4.5rem 0 6rem;
}
.rail-layout:has([data-side-links][hidden]) { grid-template-columns: minmax(0, 1fr); }
[data-side-links][hidden] { display: none; }
.side-links {
  position: sticky;
  top: 1.5rem;
  padding: 1rem 0 1rem 1.1rem;
  border-left: 2px solid var(--green-500);
}
.side-links h2 {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}
.side-links ol { margin: .8rem 0 0; padding-left: 1rem; }
.side-links li { margin: .55rem 0; }
.side-links a { color: var(--ink-soft); font-size: .82rem; text-decoration: none; }
.side-links a:hover { color: var(--link); }

.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: .65rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--green-500);
  color: #fff;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, background .2s ease;
}
.button:hover { background: #0d8755; transform: translateY(-2px); }
.button.secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button.secondary:hover { border-color: var(--green-500); background: transparent; }
.button.light { background: var(--lime-300); color: var(--navy-950); }

.hero {
  position: relative;
  isolation: isolate;
  min-height: 37rem;
  display: grid;
  align-items: end;
  padding: clamp(2rem, 6vw, 5.4rem) 0;
  overflow: hidden;
  background: var(--navy-900);
  color: #fff;
}
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .58;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(7,20,33,.96) 0%, rgba(7,20,33,.8) 43%, rgba(7,20,33,.3) 100%), linear-gradient(0deg, rgba(7,20,33,.86), transparent 55%);
}
.hero-inner { width: var(--measure); margin: 0 auto; }
.hero-copy { max-width: 45rem; }
.hero h1 { max-width: 10ch; color: #fff; }
.hero .lede { max-width: 34rem; margin: 1.35rem 0 1.8rem; color: #d6e2e1; font-size: 1.18rem; }
.hero .eyebrow { color: var(--lime-300); }
.hero-statline {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.5rem;
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.24);
  color: #c6d8d6;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.hero-statline strong { color: var(--lime-300); }

.section { padding: 5.5rem 0; }
.section.compact { padding: 3.7rem 0; }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}
.section-heading > div { max-width: 43rem; }
.section-heading .lede { max-width: 31rem; }
.rule { border-top: 1px solid var(--line); }

.signal-band {
  background: var(--green-500);
  color: #fff;
}
.signal-band .page-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.35rem 0;
}
.signal-band p { font-family: var(--font-display); font-size: 1.65rem; line-height: 1; }
.signal-band span { color: var(--lime-300); font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; }

.feature-grid, .value-grid, .forum-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  max-width: 980px;
}
.feature-card, .value-card, .forum-card {
  padding: 1.4rem;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: var(--radius);
}
.feature-card { min-height: 14rem; display: flex; flex-direction: column; justify-content: space-between; }
.card-number { color: var(--green-500); font-family: var(--font-mono); font-size: .72rem; font-weight: 700; }
.feature-card h3 { margin: 1.3rem 0 .7rem; }
.feature-card p, .value-card p, .forum-card p { color: var(--ink-soft); font-size: .94rem; }
.feature-card a { color: var(--link); font-size: .78rem; font-weight: 700; text-decoration: none; }

.news-section { background: var(--navy-900); color: #fff; }
.news-section .section-heading .lede { color: #afc4c8; }
.news-section .eyebrow { color: var(--lime-300); }
.news-grid, .archive-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.15rem;
  align-items: start;
}
.story-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--paper-strong);
  color: var(--ink);
  border-radius: 1rem;
  overflow: hidden;
}
.story-image {
  position: relative;
  display: block;
  aspect-ratio: 1.42 / 1;
  overflow: hidden;
  background: var(--navy-800);
}
.story-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.story-card:hover .story-image img { transform: scale(1.04); }
.story-body { display: flex; flex: 1; flex-direction: column; padding: 1.1rem 1.15rem 1.25rem; }
.story-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .75rem; margin-bottom: .7rem; color: var(--ink-soft); font-family: var(--font-mono); font-size: .63rem; text-transform: uppercase; }
.category-label { color: var(--green-500); font-weight: 700; }
.story-card h3 { font-size: 1.55rem; }
.story-card h3 a { text-decoration: none; }
.story-card h3 a:hover { color: var(--link); }
.story-card p { margin-top: .7rem; color: var(--ink-soft); font-size: .9rem; }
.story-author { display: flex; align-items: center; gap: .55rem; margin-top: 1rem; color: var(--ink-soft); font-size: .76rem; }
.story-author-avatar { width: 2.5rem; height: 2.5rem; object-fit: cover; border-radius: 50%; }
.empty-state { color: var(--ink-soft); padding: 1rem 0; }

.photo-band {
  position: relative;
  min-height: 27rem;
  display: flex;
  align-items: end;
  padding: 2rem 0;
  overflow: hidden;
  color: #fff;
  background: var(--navy-900);
}
.photo-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.photo-band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7,20,33,.9), rgba(7,20,33,.06)); }
.photo-band-content { position: relative; z-index: 1; width: var(--measure); margin: 0 auto; }
.photo-band-content p { max-width: 31rem; color: #d8e8e3; }
.photo-band-content h2 { max-width: 14ch; margin: .5rem 0 1rem; }

.split-intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(18rem, .95fr); gap: clamp(2rem, 7vw, 7rem); align-items: center; }
.split-intro > div:first-child { max-width: 42rem; }
.split-intro .lede { margin-top: 1.4rem; }
.stat-stack { border-top: 1px solid var(--line); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.stat-row strong { color: var(--green-500); font-family: var(--font-display); font-size: 2rem; }
.stat-row span { color: var(--ink-soft); font-size: .9rem; text-align: right; }

.guide-hero, .page-hero { padding-bottom: 1rem; }
.page-hero h1 { max-width: 12ch; }
.page-hero .lede { max-width: 40rem; margin-top: 1.3rem; }
.guide-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(17rem, .9fr); gap: 2rem; align-items: start; }
.guide-panel {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: var(--shadow);
}
.guide-panel h3 { margin-bottom: 1rem; }
.tip-list { display: grid; gap: .9rem; margin: 0; padding: 0; list-style: none; }
.tip-list li { display: grid; grid-template-columns: 2.3rem 1fr; gap: .8rem; align-items: start; }
.tip-list b { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--lime-300); color: var(--navy-950); font-family: var(--font-mono); font-size: .7rem; }
.tip-list strong { display: block; margin-bottom: .15rem; }
.tip-list span { color: var(--ink-soft); font-size: .9rem; }
.calculator { background: var(--navy-950); color: #fff; }
.calculator h3 { color: #fff; }
.calculator label { display: block; margin-top: 1rem; color: #bed1d1; font-size: .78rem; font-weight: 600; }
.calculator input { width: 100%; margin-top: .35rem; padding: .7rem .75rem; border: 1px solid #395267; border-radius: .5rem; background: #10283d; color: #fff; }
.calculator input:focus { outline: 2px solid var(--green-400); outline-offset: 2px; }
.calc-result { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid #395267; color: var(--lime-300); font-family: var(--font-mono); font-size: .8rem; }
.calc-result strong { display: block; margin-top: .25rem; color: #fff; font-family: var(--font-display); font-size: 2rem; }

.forum-grid { grid-template-columns: repeat(2, minmax(min(100%, 18rem), 1fr)); max-width: none; }
.forum-card { min-height: 13rem; }
.forum-card h3 { margin: .65rem 0; }
.forum-card a { display: inline-block; margin-top: 1rem; color: var(--link); font-size: .8rem; font-weight: 700; text-decoration: none; }
.community-note { padding: 1.6rem; border-left: 4px solid var(--green-500); background: var(--paper-strong); }
.community-note p { max-width: 46rem; color: var(--ink-soft); }

.archive-intro { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding-bottom: 2.4rem; border-bottom: 1px solid var(--line); }
.archive-intro .lede { max-width: 33rem; }
.archive-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; margin: 2rem 0; }
.archive-search label { display: block; margin-bottom: .4rem; color: var(--ink-soft); font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; }
.archive-search input { width: 100%; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--paper-strong); color: var(--ink); }
.filter-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-list a { display: inline-block; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-size: .74rem; text-decoration: none; }
.filter-list a:hover { border-color: var(--green-500); color: var(--link); }

.article-layout { padding-top: 3rem; }
.byline { display: flex; align-items: center; gap: .8rem; margin: 0 auto 2rem; max-width: 52rem; }
.byline img { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; }
.byline p { color: var(--ink-soft); font-size: .8rem; }
.article-reader { max-width: 54rem; margin: 0 auto; }
.article-header { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.article-header h1 { max-width: 18ch; font-size: clamp(2.8rem, 6vw, 5.6rem); }
.article-deck { max-width: 44rem; margin-top: 1.1rem; color: var(--ink-soft); font-size: 1.2rem; }
.article-cover { width: 100%; max-height: 34rem; margin: 2rem 0; object-fit: cover; border-radius: var(--radius); }
.prose { max-width: 44rem; }
.prose p, .prose li { color: var(--ink); font-family: var(--font-body); font-size: 1.08rem; line-height: 1.82; }
.prose p { margin: 1.35rem 0; }
.prose h2, .prose h3 { margin: 2.5rem 0 .9rem; }
.prose a { color: var(--link); text-decoration-thickness: .1em; text-underline-offset: .16em; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose .article-inline { width: 100%; margin: 2rem 0; border-radius: .75rem; }

.not-found { min-height: 55vh; display: grid; place-items: center; text-align: center; }
.not-found-inner { max-width: 38rem; }
.not-found h1 { font-size: clamp(4rem, 10vw, 9rem); color: var(--green-500); }
.not-found h2 { margin-top: 1rem; font-size: clamp(2rem, 4vw, 3.5rem); }
.not-found p { margin: 1rem auto 1.8rem; color: var(--ink-soft); }

.site-footer { background: var(--navy-950); color: #c8d8da; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; padding: 2.3rem 0; }
.footer-brand { color: #fff; font-family: var(--font-display); font-size: 1.25rem; }
.footer-inner p { max-width: 30rem; font-size: .8rem; }
.footer-meta { color: #769096; font-family: var(--font-mono); font-size: .65rem; text-align: right; text-transform: uppercase; }

@media (max-width: 800px) {
  :root { --measure: min(100% - 2rem, 42rem); }
  .header-inner { min-height: 4.6rem; gap: 1rem; }
  .brand-name { font-size: 1.35rem; }
  .site-nav {
    position: absolute;
    inset: 100% 0 auto;
    display: none;
    padding: 1rem max(1rem, calc((100% - 42rem) / 2));
    background: var(--navy-950);
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .site-nav.is-open { display: grid; gap: .8rem; }
  .menu-toggle { display: grid; }
  .header-actions { margin-left: auto; }
  .rail-layout { grid-template-columns: minmax(0, 1fr); padding-top: 3rem; }
  .side-links { position: static; }
  .hero { min-height: 33rem; }
  .hero h1 { max-width: 12ch; }
  .section { padding: 4rem 0; }
  .section-heading, .archive-intro, .signal-band .page-wrap { display: block; }
  .section-heading .lede { margin-top: 1rem; }
  .signal-band span { display: block; margin-top: .5rem; }
  .feature-grid, .value-grid, .forum-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: auto; }
  .split-intro, .guide-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .archive-tools { grid-template-columns: 1fr; }
  .footer-inner { display: block; }
  .footer-meta { margin-top: 1rem; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
