:root {
  --bg: #F4F1EA;
  --bg-2: #EBE7DD;
  --paper: #FBF9F4;
  --ink: #1B1916;
  --ink-2: #4B463E;
  --ink-3: #7A7468;
  --rule: #D9D3C5;
  --rule-soft: #E8E3D6;
  --accent: #C2410C;
  --accent-soft: #F5D7C4;
  --moss: #4F6B3A;
  --moss-soft: #DDE5CE;
  --gold: #B07F2C;
  --gold-soft: #F0E0BE;
  --crimson: #8B2A1F;
  --crimson-soft: #F2D2CB;
  --shadow: 0 1px 0 rgba(27, 25, 22, 0.04), 0 18px 50px -28px rgba(27, 25, 22, 0.28);
  --shadow-soft: 0 1px 0 rgba(27, 25, 22, 0.03), 0 8px 24px -16px rgba(27, 25, 22, 0.18);
}

[data-theme="dark"] {
  --bg: #1A1816;
  --bg-2: #232120;
  --paper: #1F1D1B;
  --ink: #F2EEE4;
  --ink-2: #C5BEAE;
  --ink-3: #8B8372;
  --rule: #3A3630;
  --rule-soft: #2A2723;
  --accent: #E87142;
  --accent-soft: #3A2418;
  --moss: #8BAE6D;
  --moss-soft: #22281B;
  --gold: #D4A75C;
  --gold-soft: #2E2618;
  --crimson: #D85F4E;
  --crimson-soft: #2E1A16;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 18px 50px -28px rgba(0, 0, 0, 0.75);
  --shadow-soft: 0 1px 0 rgba(0, 0, 0, 0.15), 0 8px 24px -16px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 6% 0%, rgba(194, 65, 12, 0.055), transparent 30%),
    radial-gradient(circle at 96% 32%, rgba(79, 107, 58, 0.045), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s, color 0.2s;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 6% 0%, rgba(232, 113, 66, 0.075), transparent 30%),
    radial-gradient(circle at 96% 32%, rgba(139, 174, 109, 0.05), transparent 38%),
    var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: translateY(0);
}

.wrap {
  width: min(1180px, calc(100% - 80px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  transition: border-color 0.2s, background 0.2s;
}

.nav.scrolled,
.nav.open {
  border-bottom-color: var(--rule-soft);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
}

.nav-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  color: var(--ink);
}

.brand-name {
  font-family: "Fraunces", Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand-name em {
  color: var(--accent);
  font-family: inherit;
  font-style: italic;
  font-weight: 300;
}

.journal-sign {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 2px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.journal-sign::before {
  width: 1px;
  height: 18px;
  background: var(--rule);
  content: "";
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 20px;
}

.nav-link {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.theme-toggle,
.nav-toggle {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.theme-toggle:hover,
.nav-toggle:hover {
  border-color: var(--ink-3);
  background: var(--bg-2);
  color: var(--ink);
}

.theme-toggle svg,
.nav-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-toggle .sun,
.nav-toggle,
.nav-toggle .close {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon,
.nav.open .nav-toggle .menu {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun,
.nav.open .nav-toggle .close {
  display: block;
}

.eyebrow,
.track-label,
.meta-line {
  font-family: "Geist Mono", monospace;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 24px;
  height: 1px;
  background: currentColor;
  content: "";
}

.journal-hero {
  padding: 88px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 72px;
  align-items: center;
}

.journal-title,
.page-title,
.article-title,
.section-title,
.card-title,
.footer-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.journal-title em,
.page-title em,
.article-title em,
.section-title em,
.footer-title em {
  color: var(--accent);
  font-style: italic;
  font-weight: 300;
}

.journal-title {
  max-width: 710px;
  margin: 20px 0 24px;
  font-size: clamp(54px, 7vw, 88px);
}

.journal-deck {
  max-width: 610px;
  color: var(--ink-2);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(20px, 2.3vw, 27px);
  font-weight: 300;
  line-height: 1.45;
}

.journal-deck em {
  color: var(--ink);
  font-style: italic;
}

.issue-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.issue-note .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--moss);
  box-shadow: 0 0 0 5px var(--moss-soft);
}

.rule-illustration {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 22px;
  background:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  box-shadow: var(--shadow);
}

.rule-illustration::before {
  position: absolute;
  inset: -20% 20% 20% -30%;
  border-radius: 999px;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  content: "";
  opacity: 0.7;
}

.mailbox-card,
.rule-card,
.outside-card {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  box-shadow: var(--shadow-soft);
}

.mailbox-card {
  top: 62px;
  left: 42px;
  width: 180px;
  padding: 18px;
  border-radius: 14px;
}

.rule-card {
  top: 164px;
  left: 102px;
  width: 248px;
  padding: 20px;
  border-radius: 16px;
}

.outside-card {
  right: 34px;
  bottom: 48px;
  width: 155px;
  padding: 16px;
  border-radius: 14px;
}

.mini-label {
  margin-bottom: 10px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.mini-line {
  height: 7px;
  margin-top: 7px;
  border-radius: 8px;
  background: var(--rule);
}

.mini-line.short {
  width: 62%;
}

.rule-if,
.rule-then {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  color: var(--ink-2);
  font-size: 12px;
}

.rule-if {
  border-bottom: 1px solid var(--rule-soft);
}

.rule-token {
  min-width: 38px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  text-align: center;
  text-transform: uppercase;
}

.rule-then .rule-token {
  background: var(--crimson-soft);
  color: var(--crimson);
}

.route-line {
  position: absolute;
  z-index: 1;
  right: 84px;
  bottom: 120px;
  width: 145px;
  border-top: 1px dashed var(--accent);
  transform: rotate(27deg);
  transform-origin: right;
}

.route-line::after {
  position: absolute;
  top: -4px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.section {
  padding: 72px 0 88px;
}

.section-rule {
  border-top: 1px solid var(--rule);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.section-title {
  margin-top: 14px;
  font-size: clamp(34px, 4.2vw, 52px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}

.text-link:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.featured-story {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.featured-copy {
  display: flex;
  min-height: 380px;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(32px, 5vw, 62px);
}

.track-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--moss);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.track-label::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.track-label.build {
  color: var(--gold);
}

.featured-copy .card-title {
  max-width: 620px;
  margin: 22px 0 18px;
  font-size: clamp(34px, 4.6vw, 56px);
}

.card-excerpt {
  max-width: 590px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}

.story-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding-top: 34px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}

.story-link span {
  transition: transform 0.15s;
}

.story-link:hover span {
  transform: translateX(4px);
}

.featured-visual {
  display: grid;
  min-height: 380px;
  place-items: center;
  overflow: hidden;
  border-left: 1px solid var(--rule);
  background:
    radial-gradient(circle at 50% 42%, var(--accent-soft), transparent 42%),
    var(--bg-2);
}

.featured-visual svg {
  width: 78%;
  color: var(--ink);
}

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.track-card {
  min-height: 240px;
  padding: 30px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.track-card:hover {
  border-color: var(--ink-3);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.track-card h3 {
  margin: 22px 0 12px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.track-card p {
  max-width: 470px;
  color: var(--ink-2);
  line-height: 1.65;
}

.track-count {
  display: block;
  margin-top: 24px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.listing-hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--rule);
}

.page-title {
  max-width: 790px;
  margin: 18px 0 18px;
  font-size: clamp(46px, 6vw, 72px);
}

.page-deck {
  max-width: 680px;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.65;
}

.filter-bar {
  display: flex;
  gap: 8px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.filter-link {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink-2);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-link:hover {
  background: var(--bg-2);
}

.filter-link[aria-current="page"] {
  border-color: var(--rule);
  background: var(--paper);
  color: var(--ink);
}

.story-list {
  padding: 30px 0 96px;
}

.story-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 120px;
  gap: 30px;
  align-items: start;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
}

.story-row:first-child {
  border-top: 1px solid var(--rule);
}

.story-row h2 {
  max-width: 720px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.story-row h2 a:hover {
  color: var(--accent);
}

.story-row p {
  max-width: 670px;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
}

.meta-line {
  color: var(--ink-3);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.65;
  text-transform: uppercase;
}

.read-time {
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  text-align: right;
  text-transform: uppercase;
}

.empty-state {
  margin: 22px 0 96px;
  padding: clamp(38px, 7vw, 82px);
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--paper);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 13px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 400;
}

.empty-state p {
  max-width: 530px;
  margin: 0 auto;
  color: var(--ink-2);
  line-height: 1.65;
}

.article-header {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--rule);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 48px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.article-title {
  max-width: 980px;
  margin: 22px 0 26px;
  font-size: clamp(45px, 6.5vw, 79px);
}

.article-deck {
  max-width: 780px;
  color: var(--ink-2);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(20px, 2.4vw, 27px);
  font-weight: 300;
  line-height: 1.48;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: 36px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.article-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 740px) 1fr;
  gap: 56px;
  align-items: start;
  padding: 64px 0 104px;
}

.article-toc {
  position: sticky;
  top: 104px;
}

.toc-label {
  display: block;
  margin-bottom: 14px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.article-toc ol {
  border-left: 1px solid var(--rule);
  list-style: none;
}

.article-toc a {
  display: block;
  padding: 7px 0 7px 16px;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.4;
  transition: color 0.15s;
}

.article-toc a:hover,
.article-toc a.active {
  color: var(--accent);
}

.prose {
  min-width: 0;
  color: var(--ink-2);
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  font-weight: 350;
  line-height: 1.78;
}

.prose > * + * {
  margin-top: 1.45em;
}

.prose h2,
.prose h3 {
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.prose h2 {
  margin-top: 2.25em;
  padding-top: 0.15em;
  font-size: clamp(31px, 4vw, 43px);
}

.prose h3 {
  margin-top: 1.8em;
  font-size: 26px;
}

.prose a {
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  transition: border-color 0.15s, color 0.15s;
}

.prose a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li {
  padding-left: 0.35em;
}

.prose li + li {
  margin-top: 0.65em;
}

.prose code {
  padding: 0.12em 0.36em;
  border: 1px solid var(--rule-soft);
  border-radius: 5px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: 0.78em;
}

.article-diagram {
  margin: 2em 0;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.diagram-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.diagram-node {
  padding: 16px 12px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  text-align: center;
}

.diagram-node.danger {
  border-color: color-mix(in srgb, var(--crimson) 48%, var(--rule));
  background: var(--crimson-soft);
}

.diagram-arrow {
  color: var(--accent);
  font-family: "Geist Mono", monospace;
  font-size: 14px;
}

.diagram-note {
  margin-top: 16px;
  color: var(--ink-3);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.callout {
  margin: 2em 0;
  padding: 22px 24px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-family: "Geist", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.callout strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.response-list {
  margin: 2em 0;
  padding: 0;
  counter-reset: response;
  list-style: none;
}

.response-list li {
  position: relative;
  min-height: 56px;
  padding-left: 72px;
  counter-increment: response;
}

.response-list li::before {
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--paper);
  color: var(--accent);
  content: counter(response, decimal-leading-zero);
  font-family: "Geist Mono", monospace;
  font-size: 10px;
}

.response-list li + li {
  margin-top: 1.15em;
}

.source-list {
  margin-top: 3em;
  padding-top: 1.7em;
  border-top: 1px solid var(--rule);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.source-list h2 {
  margin-top: 0;
  font-size: 30px;
}

.source-list li + li {
  margin-top: 0.8em;
}

.article-aside {
  padding-top: 6px;
}

.aside-card {
  max-width: 210px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.6;
}

.aside-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-cta {
  padding: 64px 0;
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
}

.article-cta-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 50px;
  align-items: center;
}

.article-cta h2 {
  max-width: 730px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(31px, 4vw, 46px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.14;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover {
  opacity: 0.86;
  transform: translateY(-1px);
}

.footer {
  padding: 54px 0 28px;
  border-top: 1px solid var(--rule);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  gap: 60px;
}

.footer-intro {
  max-width: 380px;
}

.footer-title {
  margin-top: 18px;
  font-size: 25px;
  line-height: 1.28;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-col h2 {
  margin-bottom: 12px;
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-col a {
  display: block;
  padding: 4px 0;
  color: var(--ink-2);
  font-size: 13px;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid var(--rule-soft);
  color: var(--ink-3);
  font-family: "Geist Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .article-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 44px;
  }

  .article-aside {
    display: none;
  }

  .hero-grid {
    gap: 44px;
  }
}

@media (max-width: 860px) {
  .wrap {
    width: min(100% - 48px, 720px);
  }

  .nav-inner {
    min-height: 64px;
  }

  .journal-sign {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    right: 0;
    left: 0;
    display: none;
    margin: 0;
    padding: 14px 24px 20px;
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
  }

  .nav.open .nav-links {
    display: grid;
  }

  .nav-link {
    padding: 12px;
    font-size: 15px;
  }

  .hero-grid,
  .featured-story {
    grid-template-columns: 1fr;
  }

  .journal-hero {
    padding: 64px 0 56px;
  }

  .rule-illustration {
    min-height: 360px;
  }

  .featured-visual {
    min-height: 300px;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .tracks-grid {
    grid-template-columns: 1fr;
  }

  .story-row {
    grid-template-columns: 130px 1fr;
  }

  .read-time {
    display: none;
  }

  .article-layout {
    display: block;
    padding-top: 42px;
  }

  .article-toc {
    position: static;
    margin-bottom: 42px;
    padding: 18px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    background: var(--paper);
  }

  .article-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-left: 0;
  }

  .article-toc a {
    padding: 6px 10px 6px 0;
  }
}

@media (max-width: 620px) {
  .wrap {
    width: calc(100% - 36px);
  }

  .nav-actions {
    gap: 7px;
  }

  .journal-title {
    font-size: clamp(48px, 15vw, 66px);
  }

  .journal-deck {
    font-size: 20px;
  }

  .rule-illustration {
    min-height: 330px;
  }

  .mailbox-card {
    top: 30px;
    left: 24px;
  }

  .rule-card {
    top: 130px;
    left: 54px;
    width: 230px;
  }

  .outside-card {
    right: 20px;
    bottom: 28px;
  }

  .featured-copy {
    min-height: 410px;
    padding: 30px 24px;
  }

  .featured-visual {
    min-height: 240px;
  }

  .section {
    padding: 56px 0 64px;
  }

  .section-head {
    display: block;
  }

  .section-head .text-link {
    margin-top: 18px;
  }

  .filter-bar {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-link {
    flex: none;
  }

  .story-row {
    display: block;
    padding: 28px 0;
  }

  .story-row .meta-line {
    margin-bottom: 14px;
  }

  .article-header {
    padding: 50px 0 42px;
  }

  .breadcrumbs {
    margin-bottom: 32px;
  }

  .article-title {
    font-size: clamp(40px, 13vw, 56px);
  }

  .article-deck {
    font-size: 19px;
  }

  .article-toc ol {
    display: block;
  }

  .prose {
    font-size: 18px;
    line-height: 1.72;
  }

  .diagram-flow {
    grid-template-columns: 1fr;
  }

  .diagram-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .response-list li {
    padding-left: 60px;
  }

  .article-cta-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .article-cta .btn {
    justify-self: start;
  }

  .footer-main,
  .footer-bottom {
    flex-direction: column;
  }

  .footer-links {
    flex-wrap: wrap;
    gap: 34px 48px;
  }

  .footer-bottom {
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .nav,
  .article-toc,
  .article-aside,
  .article-cta,
  .footer {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .article-layout {
    display: block;
    padding: 24px 0;
  }

  .prose {
    max-width: none;
    color: #222;
  }
}

/* ---- Journal listing cards (generated index + track pages) ---- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.post-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.post-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.post-card .card-title {
  margin-top: 14px;
  font-size: 24px;
}
.post-card .card-excerpt {
  margin-top: 10px;
}
.card-date {
  margin-top: auto;
  padding-top: 18px;
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

/* ---- Inline raster infographic (AI-generated) ---- */
.prose .article-figure,
.article-figure {
  margin: 2.2em 0;
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  /* Raster infographics are drawn on cream and do not follow the dark theme,
     so seat them on a light surface with a hairline in both themes. */
  background: #FBF9F4;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-soft);
}
.article-figure figcaption {
  margin-top: 12px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

@media (max-width: 720px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Blog index — Bit Refinery-style layout in Haven's design system
   ============================================================ */
.bhero {
  padding: 72px 0 40px;
  text-align: center;
}
.bhero .eyebrow { justify-content: center; }
.bhero-title {
  margin: 14px auto 0;
  max-width: 14ch;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.bhero-title em { font-style: italic; color: var(--accent); font-weight: 300; }
.bhero-deck {
  margin: 18px auto 0;
  max-width: 54ch;
  font-family: "Geist", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
}
.bhero-deck em { font-style: italic; color: var(--ink); }

/* Filter bar */
.bfilters { padding: 8px 0 4px; }
.bfilters .wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.bsearch { position: relative; width: 100%; max-width: 320px; }
.bsearch svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--ink-3);
  stroke-width: 2; stroke-linecap: round;
}
.bsearch input {
  width: 100%; padding: 11px 16px 11px 40px;
  font-family: "Geist", sans-serif; font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 999px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bsearch input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bsearch input::placeholder { color: var(--ink-3); }
.bpills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bpill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; font-family: "Geist", sans-serif; font-size: 13px; font-weight: 500;
  color: var(--ink-2); background: var(--paper); border: 1px solid var(--rule);
  border-radius: 999px; cursor: pointer; transition: all 0.15s;
}
.bpill:hover { border-color: var(--ink-3); }
.bpill.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
[data-theme="dark"] .bpill.is-active { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.bpill-count { font-size: 11px; opacity: 0.6; font-family: "Geist Mono", monospace; }

/* Card grid */
.bsection { padding: 34px 0 10px; }
.bgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.bcard {
  position: relative;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 18px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.bcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, var(--rule)); box-shadow: var(--shadow); }
.bcard-media {
  position: relative; height: 168px; overflow: hidden;
  background: #FBF9F4; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
}
.bcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.bcard:hover .bcard-media img { transform: scale(1.04); }
.bcard-media--personal_security { background: linear-gradient(135deg, var(--accent-soft), var(--paper) 70%); }
.bcard-media--building_haven { background: linear-gradient(135deg, var(--moss-soft), var(--paper) 70%); }
.bcard-mark {
  font-family: "Geist Mono", monospace; font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
}
.bcard-badge {
  position: absolute; top: 12px; z-index: 2;
  padding: 5px 11px; font-family: "Geist Mono", monospace; font-size: 11px;
  letter-spacing: 0.02em; border-radius: 999px; white-space: nowrap;
}
.bcard-badge--cat { left: 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); }
.bcard-badge--time { right: 12px; background: color-mix(in srgb, var(--ink) 82%, transparent); color: var(--paper); }
.bcard-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.bcard-title {
  font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: 21px;
  line-height: 1.18; letter-spacing: -0.02em; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bcard-excerpt {
  margin-top: 10px; font-family: "Geist", sans-serif; font-size: 14px;
  line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.bcard-stats {
  display: flex; gap: 30px; margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
}
.bstat-v { display: block; font-family: "Geist Mono", monospace; font-size: 13px; font-weight: 500; color: var(--accent); }
.bstat-l { display: block; margin-top: 3px; font-family: "Geist Mono", monospace; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.bcard[hidden] { display: none; }

.bcount { margin-top: 26px; text-align: center; font-family: "Geist Mono", monospace; font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); }
.bempty { margin-top: 30px; text-align: center; font-family: "Geist", sans-serif; font-size: 15px; color: var(--ink-2); }
.btextlink { font: inherit; color: var(--accent); text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; }

/* Recent posts band */
.brecent-band { margin-top: 40px; padding: 48px 0 8px; border-top: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 60%, transparent); }
.brecent-head { font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: 28px; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 22px; }
.brecent-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.brecent {
  display: flex; gap: 14px; padding: 14px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 14px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.brecent:hover { box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.brecent-thumb { flex-shrink: 0; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: #FBF9F4; border: 1px solid var(--rule); }
.brecent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.brecent-body { min-width: 0; }
.brecent-title {
  font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: 16px; line-height: 1.25; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brecent-meta { margin-top: 6px; display: flex; gap: 8px; font-family: "Geist Mono", monospace; font-size: 11px; color: var(--ink-3); }

@media (max-width: 900px) {
  .bgrid, .brecent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .bgrid, .brecent-grid { grid-template-columns: 1fr; }
  .bhero { padding: 52px 0 32px; }
}

/* Blockquotes in article prose read as callouts (the AI and seeded posts use
   > quotes for "the important thing" asides). Mirrors the hand-authored
   .callout treatment. */
.prose blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-family: "Geist", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 0.7em; }
.prose blockquote strong { color: var(--ink); }

/* Article hero image (BR-style banner under the header) */
.article-hero {
  margin: 8px 0 4px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #FBF9F4;
  box-shadow: var(--shadow-soft);
}
.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
}
