/* ============================================================
   site.css
   Shared chrome for the interior pages (blog, faq).
   The homepage keeps its own inline styles untouched. The color
   tokens and worlds below are copied verbatim from index.html so
   the two surfaces stay identical. Style everything through the
   tokens, never with a literal color, matching the house rule.
   ============================================================ */

/* ============ reset ============ */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }

/* ============ tokens ============ */
:root {
  --serif: "Hoefler Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --pad-y: clamp(88px, 11vw, 172px);
  --gutter: clamp(20px, 5vw, 64px);
  --measure: 40rem;

  /* default world: night */
  --ground: #0B1410;
  --ink:    #EDE7DA;
  --muted:  #93A796;
  --accent: #D4A24C;
  --rule:   rgba(237,231,218,0.16);
  --plate:  rgba(237,231,218,0.04);
}

/* ============ the worlds ============
   Each band declares its own palette. Children inherit. */
.w-night { --ground:#0B1410; --ink:#EDE7DA; --muted:#93A796; --accent:#D4A24C;
           --rule:rgba(237,231,218,0.16); --plate:rgba(237,231,218,0.04); }
.w-ivy   { --ground:#14351F; --ink:#F2EFE2; --muted:#A8BCA8; --accent:#FF6B54;
           --rule:rgba(242,239,226,0.18); --plate:rgba(242,239,226,0.05); }
.w-orbit { --ground:#0A1030; --ink:#E8ECFF; --muted:#8E97C4; --accent:#FF7A2F;
           --rule:rgba(232,236,255,0.16); --plate:rgba(232,236,255,0.05); }
.w-cave  { --ground:#17191C; --ink:#E9E4DA; --muted:#9A968E; --accent:#FFB020;
           --rule:rgba(233,228,218,0.16); --plate:rgba(233,228,218,0.05); }
.w-paper { --ground:#F2EDE0; --ink:#12241A; --muted:#5A6B5F; --accent:#8A5D12;
           --rule:rgba(18,36,26,0.18); --plate:rgba(18,36,26,0.05); }

/* ============ base ============ */
html { scroll-behavior: smooth; }
body {
  position: relative;
  background: #0B1410;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* printed-material grain over the flat color fields */
.grain {
  position: absolute; inset: 0; z-index: 40; pointer-events: none;
  opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* ============ layout + type ============ */
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
.col  { max-width: var(--measure); }
.col p + p { margin-top: 1.15em; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1.6em;
}
.display {
  font-family: var(--serif); font-weight: 400; line-height: 1.04;
  letter-spacing: -0.024em; text-wrap: balance;
}
h1.display { font-size: clamp(36px, 6vw, 68px); }
h2.display { font-size: clamp(31px, 4.8vw, 56px); }
p.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); line-height: 1.68; }

/* ============ nav ============ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  background: rgba(11,20,16,0.93);
  border-bottom: 1px solid transparent; transition: border-color .4s ease;
}
.nav.stuck { border-bottom-color: rgba(237,231,218,0.14); }
.mark {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--serif); font-size: 17px; text-decoration: none;
  color: #EDE7DA; white-space: nowrap;
}
.mark .logo { height: 32px; width: auto; display: block; flex: 0 0 auto; }
@media (max-width: 1080px) { .mark .wm-text { display: none; } }
body.nav-compact .mark .wm-text { display: inline; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.nav-compact .mark { min-width: 0; }
.mark .wm-text { color: #D4A24C; }
.mark .wm-text span { color: rgba(212,162,76,0.55); }

.nav-links { display: flex; gap: clamp(16px, 3vw, 36px); align-items: center; }
.nav-links a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #93A796; text-decoration: none; transition: color .25s ease;
  flex: 0 0 auto; white-space: nowrap; position: relative;
}
.nav-links a:hover, .nav-links a:focus-visible { color: #EDE7DA; }
.nav-links a.active { color: #EDE7DA; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px;
  height: 1px; background: #D4A24C;
}
.nav-cta { color: #D4A24C !important; }
.nav-cta::after { display: none !important; }

.nav-toggle {
  display: none; position: relative; z-index: 60;
  width: 40px; height: 34px; padding: 8px 6px; margin-right: -6px;
  background: none; border: 0; cursor: pointer;
  flex-direction: column; justify-content: space-between; align-items: stretch;
}
.nav-toggle span {
  display: block; height: 1.5px; background: #EDE7DA; border-radius: 2px;
  transform-origin: center; transition: transform .3s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.25px) rotate(-45deg); }

.nav-scrim {
  position: fixed; inset: 0; z-index: 45; display: none;
  background: rgba(5,10,8,0.62); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.nav-scrim.open { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

body.nav-compact .nav-scrim { display: block; }
body.nav-compact .nav-toggle { display: flex; }
body.nav-compact .nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(11,20,16,0.94); }
body.nav-compact .nav-links {
  position: fixed; inset: 0 0 0 auto; width: min(80vw, 320px);
  flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
  padding: 92px 26px calc(32px + env(safe-area-inset-bottom));
  background: rgba(11,20,16,0.97); backdrop-filter: blur(20px);
  border-left: 1px solid rgba(237,231,218,0.14);
  box-shadow: -30px 0 60px rgba(0,0,0,0.45);
  overflow-y: auto; visibility: hidden;
  transform: translateX(100%);
  transition: transform .38s cubic-bezier(.22,.61,.36,1), visibility 0s linear .38s;
}
body.nav-compact .nav-links.open { transform: none; visibility: visible; transition-delay: 0s; }
body.nav-compact .nav-links a { font-size: 13px; letter-spacing: 0.2em; padding: 15px 0; }
body.nav-compact .nav-links a + a { border-top: 1px solid rgba(237,231,218,0.09); }
body.nav-compact .nav-links a.active::after { left: 0; right: auto; width: 20px; bottom: 9px; }
body.nav-compact .nav-links .nav-cta {
  margin-top: 26px; padding: 15px 16px; text-align: center;
  background: #D4A24C; color: #12180F !important; border-top: 0;
}

/* ============ buttons ============ */
.btn {
  display: inline-block;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: #0B1410; background: var(--accent); padding: 15px 26px; text-decoration: none;
  max-width: 100%; text-align: center;
  transition: transform .25s ease, filter .25s ease, background-color 1.1s ease;
}
@media (max-width: 560px) { .btn { font-size: 10px; letter-spacing: 0.14em; padding: 14px 18px; } }
.btn:hover, .btn:focus-visible { transform: translateY(-2px); filter: brightness(1.1); }
.btn .arw { display: inline-block; margin-left: 12px; transition: transform .25s ease; }
.btn:hover .arw { transform: translateX(4px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule);
  padding-bottom: 6px; transition: border-color .25s ease, color .25s ease;
}
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--accent); color: var(--accent); }

/* ============ interior page shell ============ */
.band { position: relative; background: var(--ground); color: var(--ink); }
.page-head {
  padding-top: calc(var(--pad-y) + 40px);
  padding-bottom: var(--pad-y);
}
.page-body { padding-block: clamp(56px, 8vw, 104px); }

/* breadcrumb + back link */
.crumb {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2em; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.crumb a { color: var(--muted); text-decoration: none; transition: color .25s ease; }
.crumb a:hover, .crumb a:focus-visible { color: var(--accent); }
.crumb .sep { opacity: 0.5; }

/* ============ long-form prose ============ */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 {
  font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -0.02em;
  font-size: clamp(24px, 3vw, 34px); margin-top: 1.8em;
}
.prose h3 {
  font-family: var(--serif); font-weight: 400; line-height: 1.2;
  font-size: clamp(20px, 2.3vw, 26px); margin-top: 1.6em;
}
.prose p { line-height: 1.78; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
  margin-inline: 0; padding: 0.2em 0 0.2em 1.3em; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.4; color: var(--ink);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.4em; }
.prose .footnote {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--muted);
  border-top: 1px solid var(--rule); padding-top: 1.4em; margin-top: 2.6em; line-height: 1.6;
}

/* article meta line under the title */
.post-meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin-top: 1.8em; display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
}
.post-meta .dot { opacity: 0.5; }

/* ============ blog index ============ */
.post-list { max-width: 52rem; display: grid; gap: 0; }
.post-card {
  display: block; text-decoration: none; color: inherit;
  padding-block: clamp(28px, 4vw, 40px); border-top: 1px solid var(--rule);
}
.post-card:last-child { border-bottom: 1px solid var(--rule); }
.post-card .kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 0.9em;
}
.post-card .kicker .tag { color: var(--accent); }
.post-card h2 {
  font-family: var(--serif); font-weight: 400; line-height: 1.12; letter-spacing: -0.02em;
  font-size: clamp(23px, 3vw, 33px); transition: color .25s ease;
}
.post-card p { color: var(--muted); margin-top: 0.7em; line-height: 1.7; max-width: 44rem; }
.post-card .more {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 1.1em;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.post-card .more .arw { transition: transform .25s ease; }
.post-card:hover h2, .post-card:focus-visible h2 { color: var(--accent); }
.post-card:hover .more .arw { transform: translateX(4px); }

/* ============ faq ============ */
.faq { max-width: 52rem; }
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item > summary {
  list-style: none; cursor: pointer; padding-block: clamp(20px, 3vw, 28px);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
  font-family: var(--serif); font-size: clamp(19px, 2.2vw, 24px); line-height: 1.3; color: var(--ink);
  transition: color .25s ease;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { color: var(--accent); }
.faq-item .plus {
  flex: 0 0 auto; width: 20px; height: 20px; margin-top: 6px; position: relative;
}
.faq-item .plus::before, .faq-item .plus::after {
  content: ""; position: absolute; background: var(--accent); transition: transform .3s ease, opacity .3s ease;
}
.faq-item .plus::before { top: 9px; left: 0; width: 20px; height: 2px; }
.faq-item .plus::after  { left: 9px; top: 0; width: 2px; height: 20px; }
.faq-item[open] .plus::after { transform: rotate(90deg); opacity: 0; }
.faq-answer { padding-bottom: clamp(22px, 3vw, 30px); }
.faq-answer > * + * { margin-top: 1em; }
.faq-answer p { color: var(--muted); line-height: 1.78; max-width: 44rem; }
.faq-answer a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* soft open animation, honored only when motion is allowed */
@media (prefers-reduced-motion: no-preference) {
  .faq-item[open] .faq-answer { animation: faqIn .35s ease; }
  @keyframes faqIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}

/* closing call to action on interior pages */
.tail { margin-top: clamp(48px, 7vw, 84px); padding-top: clamp(40px, 6vw, 64px); border-top: 1px solid var(--rule); max-width: 52rem; }
.tail h2 { font-family: var(--serif); font-weight: 400; line-height: 1.1; letter-spacing: -0.02em; font-size: clamp(26px, 3.4vw, 40px); }
.tail p { color: var(--muted); margin-top: 0.8em; margin-bottom: 1.8em; max-width: 40rem; }

/* ============ footer ============ */
.foot {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-block: 40px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ============ accessibility ============ */
a:focus-visible, .btn:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #0B1410; padding: 10px 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
}
.skip:focus { left: var(--gutter); top: 10px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-links, .nav-scrim, .nav-toggle span, .faq-item .plus::before, .faq-item .plus::after { transition: none; }
}
.foot-links { display: flex; gap: clamp(16px, 3vw, 28px); flex-wrap: wrap; }
