:root {
  --olive-950: #23362c;
  --olive-800: #3f5a46;
  --olive-700: #55715a;
  --olive-100: #e8eee2;
  --olive-50: #f4f7f0;
  --sand-50: #fffaf0;
  --sand-100: #f6ecd8;
  --sand-200: #ead9bc;
  --sky-100: #dceff0;
  --sky-500: #6fa9aa;
  --coral: #c97857;
  --ink: #29352d;
  --muted: #68756b;
  --line: rgba(63, 90, 70, .18);
  --white: #fffdf8;
  --shadow: 0 16px 36px rgba(48, 65, 48, .10);
  --font-display: 'Fraunces', serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --shell: min(1180px, calc(100% - 3rem));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sand-50);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .2;
  background-image: radial-gradient(rgba(85, 113, 90, .22) .7px, transparent .7px);
  background-size: 18px 18px;
}
img { max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, .92);
  backdrop-filter: blur(12px);
}
.header-inner {
  width: var(--shell);
  min-height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  color: var(--olive-950);
  text-decoration: none;
}
.brand-mark {
  width: 2.9rem;
  height: 2.9rem;
  flex: 0 0 auto;
}
.brand-name {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
}
.brand-name span { display: block; color: var(--olive-700); font-size: .67em; letter-spacing: .03em; margin-top: .22rem; }
.primary-nav { display: flex; align-items: center; gap: 1.35rem; }
.primary-nav a {
  position: relative;
  padding: .45rem 0;
  color: var(--olive-800);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
}
.primary-nav a::after { position: absolute; right: 0; bottom: .18rem; left: 0; height: 2px; background: var(--coral); content: ""; transform: scaleX(0); transform-origin: right; transition: transform .2s ease; }
.primary-nav a:hover::after, .primary-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.menu-toggle { display: none; border: 1px solid var(--olive-700); border-radius: 999px; padding: .5rem .75rem; color: var(--olive-800); background: transparent; font-weight: 700; }

.page-shell { width: var(--shell); margin: 0 auto; }
.rail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 11rem; gap: clamp(1.5rem, 4vw, 3.75rem); align-items: start; padding: 2.3rem 0 5rem; }
.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: 1.15rem 1rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(232, 238, 226, .7); }
.side-links h2 { margin: 0 0 .7rem; color: var(--olive-800); font-family: var(--font-display); font-size: 1.02rem; }
.side-links ol { display: grid; gap: .65rem; margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .82rem; }
.side-links a { color: var(--olive-800); text-decoration-color: rgba(85, 113, 90, .38); text-underline-offset: .18em; }

.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1rem; color: var(--coral); font-family: var(--font-mono); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { width: 1.8rem; height: 1px; background: currentColor; content: ""; }
h1, h2, h3 { color: var(--olive-950); font-family: var(--font-display); font-weight: 600; letter-spacing: -.045em; line-height: 1.08; }
h1 { max-width: 14ch; margin: 0; font-size: clamp(2.8rem, 7vw, 5.7rem); }
h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.65rem); }
h3 { margin: 0; font-size: 1.35rem; }
p { margin: 0; }
.lede { max-width: 62ch; margin-top: 1.25rem; color: var(--muted); font-size: 1.1rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-heading p { max-width: 38ch; color: var(--muted); font-size: .95rem; }
.text-link { color: var(--olive-800); font-weight: 700; text-decoration-color: var(--coral); text-underline-offset: .22em; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); gap: clamp(2rem, 7vw, 6.5rem); align-items: center; min-height: 540px; padding: clamp(2.5rem, 6vw, 5.5rem) 0; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 { text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .65rem 1.15rem; border: 1px solid var(--olive-800); border-radius: 999px; background: var(--olive-800); color: var(--white); font-weight: 700; text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(63, 90, 70, .18); }
.button.secondary { border-color: var(--line); background: transparent; color: var(--olive-800); }
.hero-art { position: relative; min-height: 430px; }
.hero-art::before { position: absolute; inset: 8% -9% -7% 5%; border-radius: 48% 52% 38% 62% / 45% 38% 62% 55%; background: var(--sky-100); content: ""; transform: rotate(-7deg); }
.hero-art img { position: relative; z-index: 1; display: block; width: 83%; height: 390px; margin: 1rem auto 0; border: 12px solid var(--white); border-radius: 48% 48% 42% 42%; box-shadow: var(--shadow); object-fit: cover; }
.stitch-note { position: absolute; z-index: 2; right: 0; bottom: 5%; max-width: 11rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--sand-100); color: var(--olive-800); font-family: var(--font-display); font-size: 1.03rem; line-height: 1.2; transform: rotate(4deg); }

.band { padding: 2.5rem 0; }
.band.soft { margin: 1rem calc(50% - 50vw) 0; padding: 4rem max(1.5rem, calc(50vw - 590px)); background: var(--olive-100); }
.band.sky { margin: 1rem calc(50% - 50vw) 0; padding: 4rem max(1.5rem, calc(50vw - 590px)); background: var(--sky-100); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2.25rem; }
.stat { padding: 1.4rem; border-top: 2px solid var(--coral); }
.stat strong { display: block; color: var(--olive-950); font-family: var(--font-display); font-size: 2.1rem; }
.stat span { color: var(--muted); font-size: .88rem; }

.news-grid, .archive-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; align-items: start; }
.story-card { min-width: 0; padding-bottom: .8rem; }
.story-image { display: block; position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: .8rem; background: var(--sand-200); }
.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-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; margin-top: .85rem; color: var(--muted); font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.category-label { color: var(--coral); font-weight: 700; }
.story-card h3 { margin-top: .35rem; font-size: 1.35rem; }
.story-card h3 a { text-decoration: none; }
.story-card h3 a:hover { color: var(--olive-700); }
.story-card p { margin-top: .45rem; color: var(--muted); font-size: .9rem; }
.story-author { display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem; color: var(--muted); font-size: .78rem; }
.story-author-avatar { width: 1.55rem; height: 1.55rem; border-radius: 50%; object-fit: cover; }
.empty-state { grid-column: 1 / -1; padding: 1.25rem; border: 1px dashed var(--line); border-radius: .75rem; color: var(--muted); }
.feature-feed { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 1.25rem; }
.feature-feed .story-card:first-child .story-image { aspect-ratio: 16 / 10; }
.feature-feed .story-card:first-child h3 { font-size: 1.8rem; }

.prompt-grid, .resource-grid, .steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1rem; }
.prompt-card, .resource-card, .step { padding: 1.4rem; border: 1px solid var(--line); border-radius: .9rem; background: rgba(255, 253, 248, .7); }
.prompt-card { min-height: 190px; display: flex; flex-direction: column; justify-content: space-between; }
.card-kicker { color: var(--coral); font-family: var(--font-mono); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.prompt-card h3, .resource-card h3 { margin-top: .8rem; }
.prompt-card p, .resource-card p, .step p { margin-top: .5rem; color: var(--muted); font-size: .9rem; }
.step-number { display: flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--olive-800); color: var(--white); font-family: var(--font-mono); font-size: .8rem; }
.step h3 { margin-top: 1.15rem; }

.callout { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; padding: 2rem; border-radius: 1rem; background: var(--olive-800); color: var(--white); }
.callout h2 { color: var(--white); font-size: clamp(1.75rem, 3vw, 2.7rem); }
.callout p { max-width: 48ch; margin-top: .6rem; color: rgba(255, 253, 248, .78); }
.callout .button { border-color: var(--sand-100); background: var(--sand-100); color: var(--olive-950); white-space: nowrap; }

.page-intro { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.page-intro h1 { max-width: 16ch; font-size: clamp(2.5rem, 6vw, 4.8rem); }
.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: .45rem; color: var(--olive-800); font-size: .78rem; font-weight: 700; }
.archive-search input { width: 100%; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--white); color: var(--ink); }
.filter-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-list a { padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 99px; color: var(--olive-800); font-size: .78rem; text-decoration: none; }
.filter-list a:hover { border-color: var(--olive-700); background: var(--olive-100); }
.archive-results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }

.guide-hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(280px, .8fr); gap: 3rem; align-items: center; padding: 3.5rem 0; }
.guide-hero figure { margin: 0; }
.guide-hero figure img { display: block; width: 100%; height: 360px; border-radius: 1rem 4rem 1rem 4rem; object-fit: cover; }
.guide-hero figcaption { margin-top: .55rem; color: var(--muted); font-size: .78rem; }
.materials { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.materials span { padding: .45rem .7rem; border-radius: 999px; background: var(--sand-100); color: var(--olive-800); font-size: .8rem; font-weight: 700; }
.checklist { display: grid; gap: .75rem; margin: 1.35rem 0 0; padding: 0; list-style: none; }
.checklist li { display: flex; gap: .7rem; align-items: baseline; color: var(--muted); }
.checklist li::before { color: var(--coral); content: "✦"; }
.resource-card a { display: inline-block; margin-top: 1rem; color: var(--olive-800); font-weight: 700; text-decoration-color: var(--coral); text-underline-offset: .2em; }
.reference-table { width: 100%; margin-top: 1.5rem; border-collapse: collapse; font-size: .92rem; }
.reference-table th, .reference-table td { padding: .8rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
.reference-table th { color: var(--olive-800); font-family: var(--font-mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.faq { display: grid; gap: .65rem; }
.faq details { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: .65rem; background: rgba(255, 253, 248, .7); }
.faq summary { color: var(--olive-800); cursor: pointer; font-family: var(--font-display); font-size: 1.1rem; }
.faq details p { max-width: 68ch; margin-top: .65rem; color: var(--muted); }

.article-layout { padding-top: 2.3rem; }
.byline { display: grid; grid-template-columns: 3rem 1fr; column-gap: .8rem; align-items: center; max-width: 48rem; margin: 0 auto 1.5rem; padding: .8rem 1rem; border-radius: .7rem; background: var(--olive-100); }
.byline img { grid-row: span 2; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; }
.byline strong { color: var(--olive-800); }
.byline p { color: var(--muted); font-size: .82rem; }
.article-content { max-width: 56rem; margin: 0 auto; }
.article-header h1 { max-width: 18ch; margin-top: .5rem; font-size: clamp(2.7rem, 6vw, 5.1rem); }
.article-deck { max-width: 62ch; margin-top: 1rem; color: var(--muted); font-size: 1.15rem; }
.article-cover { display: block; width: 100%; max-height: 480px; margin: 2rem 0; border-radius: 1rem; object-fit: cover; }
.prose { max-width: 68ch; margin: 0 auto; }
.prose p, .prose ul, .prose ol { margin: 1.15rem 0; color: #435046; font-size: 1.08rem; line-height: 1.82; }
.prose h2, .prose h3 { margin: 2.6rem 0 .8rem; }
.prose a { color: var(--olive-700); text-decoration-color: var(--coral); text-underline-offset: .18em; }
.prose img.article-inline { display: block; width: 100%; max-height: 500px; margin: 2rem 0; border-radius: .8rem; object-fit: cover; }
#category-title { max-width: 16ch; }

.not-found { display: grid; place-items: center; min-height: 62vh; padding: 3rem 0; text-align: center; }
.not-found h1 { max-width: none; }
.not-found p { max-width: 42ch; margin: 1rem auto 1.5rem; color: var(--muted); }
.not-found .patch { color: var(--coral); font-family: var(--font-mono); font-size: 4rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--olive-950); color: rgba(255, 253, 248, .76); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; padding: 2.2rem 0; }
.footer-brand { color: var(--white); font-family: var(--font-display); font-size: 1.25rem; }
.site-footer p { font-size: .84rem; }

@media (max-width: 760px) {
  :root { --shell: min(100% - 2rem, 620px); }
  .header-inner { min-height: 76px; }
  .menu-toggle { display: block; }
  .primary-nav { position: absolute; z-index: 5; top: 76px; right: 1rem; left: 1rem; display: none; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--sand-50); box-shadow: var(--shadow); }
  .primary-nav.is-open { display: grid; }
  .primary-nav a { padding: .65rem 0; }
  .hero, .guide-hero { grid-template-columns: 1fr; gap: 1.5rem; min-height: 0; padding: 3rem 0; }
  .hero-art { min-height: 300px; }
  .hero-art img { height: 280px; }
  .stitch-note { right: 2%; bottom: 0; }
  .stats { grid-template-columns: 1fr; }
  .feature-feed { grid-template-columns: 1fr; }
  .feature-feed .story-card:first-child .story-image { aspect-ratio: 4 / 3; }
  .section-heading, .callout, .archive-tools { align-items: start; grid-template-columns: 1fr; display: grid; }
  .callout .button { justify-self: start; }
  .archive-tools { display: grid; }
  .guide-hero figure img { height: 280px; }
  .rail-layout { grid-template-columns: 1fr; padding-top: 1rem; }
  .side-links { position: static; order: 2; }
  .footer-inner { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@supports (view-transition-name: root) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
}
