/* =============================================================================
   Change Property Manager — paper/ink design system (chrome + base)
   NGC Network master template, themed for CPM (data-theme="cpm", blue accent).
   This file styles the shared chrome (utility bar, nav, mega-menu, mobile
   drawer, footer) plus the base layout, typography, buttons, and the bespoke
   page component library (hero, sections, cards, callouts, tables, FAQ, CTA).
   Programmatic content pages additionally load /css/programmatic.css.
   ============================================================================= */

:root {
  /* Neutrals */
  --paper:    #F7F5F0;
  --paper-2:  #F1EDE4;
  --paper-3:  #E8E2D2;
  --paper-4:  #D9D1BC;
  --ink:      #15171C;
  --ink-2:    #2A2D35;
  --ink-3:    #555A66;
  --ink-4:    #8A8F9B;
  --line:     #DAD3C2;
  --line-2:   #C8BFA8;
  --line-3:   #AEA38A;

  /* Brand accent (CPM blue) */
  --brand:        #0057A8;
  --brand-dark:   #003E78;
  --brand-soft:   #DCE7F4;
  --brand-glow:   rgba(0,87,168,0.18);
  --brand-text:   #FFFFFF;

  /* Semantic */
  --ok:    #2F7A3A;
  --warn:  #B86A11;
  --bad:   #B73A2A;

  /* Type */
  --font-display: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --maxw:        1180px;
  --maxw-narrow: 760px;
  --gutter:      clamp(18px, 4vw, 48px);
  --radius:      12px;
  --radius-lg:   20px;
  --radius-sm:   7px;
}

[data-theme="cpm"] {
  --brand:      #0057A8;
  --brand-dark: #003E78;
  --brand-soft: #DCE7F4;
  --brand-glow: rgba(0,87,168,0.18);
}

/* ---------------------------------------------------------------------------
   Legacy token bridge. The bespoke content pages (homepage, tool/hub pages)
   were authored against the previous palette variables (--pri, --accent, etc.).
   Mapping them onto the paper/ink tokens re-themes every one of those pages to
   the new design system without touching their inline style blocks.
   --------------------------------------------------------------------------- */
:root {
  --pri:     var(--brand);          /* primary blue */
  --accent:  #E0A23C;               /* warm gold — reads on dark hero panels */
  --light:   var(--paper-2);        /* tinted section background */
  --gray:    var(--ink-3);          /* secondary text */
  --gray-d:  var(--ink-2);          /* stronger secondary text */
  --border:  var(--line);           /* hairlines */
  --green:   var(--ok);
  --red:     var(--bad);
  --amber:   var(--warn);
  --font:    var(--font-body);
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ============ Layout ============ */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding-inline: var(--gutter); }
.row { display: flex; gap: 16px; align-items: center; }
.spacer { flex: 1; }
@media (max-width: 820px) { .hide-md { display: none !important; } }
@media (max-width: 560px) { .hide-sm { display: none !important; } }

/* ============ Typography helpers ============ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.lede { font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-3); }
.brand-text { color: var(--brand); }

/* ============ Skip link (a11y) ============ */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 200; background: var(--brand); color: #fff; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; text-decoration: none; transition: top 140ms ease; }
.skip-link:focus { top: 8px; outline: 2px solid #fff; outline-offset: 2px; }

/* ============ Utility bar ============ */
.util {
  background: var(--ink); color: var(--paper);
  font-size: 13px;
  padding: 9px var(--gutter);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--font-mono); letter-spacing: 0.01em;
  text-align: center;
}
.util a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.util .dot { width: 6px; height: 6px; border-radius: 50%; background: #6BD37A; box-shadow: 0 0 0 4px rgba(107,211,122,0.15); flex-shrink: 0; }
.util b { color: #fff; font-weight: 600; }
.util .sep { opacity: 0.4; }
@media (max-width: 560px) { .util .util-hide-sm { display: none; } }

/* ============ Top navigation ============ */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background-color 200ms ease;
}
.nav.is-stuck { border-color: var(--line); }
.nav-inner { display: flex; align-items: center; gap: 24px; padding: 13px 0; }
.brand-link { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.012em; flex-shrink: 0; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--brand); color: var(--brand-text); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.06em; flex-shrink: 0; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name b { font-weight: 600; }
.brand-name small { font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--ink-3); text-transform: uppercase; }

.nav-links { display: flex; gap: 2px; margin-inline-start: auto; align-items: center; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--ink-2); font-weight: 500;
  transition: background-color 120ms ease, color 120ms ease;
}
.nav-link[aria-current="page"], .nav-item.group-active > .nav-link { color: var(--brand); }
.nav-link:hover, .nav-item.is-open > .nav-link { background: var(--paper-2); color: var(--ink); }
.nav-caret { font-size: 10px; opacity: 0.5; transition: transform 200ms ease; }
.nav-item.is-open .nav-caret { transform: rotate(180deg); opacity: 1; }

/* Mega / dropdown menu */
.megamenu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px;
  box-shadow: 0 24px 60px -28px rgba(21,23,28,0.30), 0 4px 12px -8px rgba(21,23,28,0.10);
  display: none; z-index: 70; min-width: 300px;
}
.megamenu.is-wide { min-width: 540px; }
.megamenu.is-right { left: auto; right: 0; }
.nav-item.is-open .megamenu { display: block; animation: mmIn 160ms ease both; }
@keyframes mmIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mm-grid { display: grid; grid-template-columns: 1fr; gap: 2px; }
.megamenu.is-wide .mm-grid { grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.mm-col h6 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 8px 0 4px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.mm-link { display: block; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); transition: background-color 120ms ease, color 120ms ease; }
.mm-link b { color: var(--ink); font-weight: 600; display: block; font-size: 13.5px; letter-spacing: -0.005em; line-height: 1.3; }
.mm-link span { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.mm-link:hover { background: var(--paper-2); }
.mm-link:hover b { color: var(--brand); }
.mm-link[aria-current="page"] { background: var(--brand-soft); }
.mm-link[aria-current="page"] b { color: var(--brand-dark); }
.mm-divider { height: 1px; background: var(--line); margin: 6px 8px; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); color: var(--brand-text);
  padding: 9px 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; border: 1px solid var(--brand);
  white-space: nowrap; flex-shrink: 0;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.nav-cta:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.nav-burger {
  display: none; width: 40px; height: 40px; border-radius: 10px;
  background: var(--paper-2); border: 1px solid var(--line);
  place-items: center; color: var(--ink); flex-shrink: 0;
}
.nav-burger:hover { background: var(--paper-3); }
.nav-burger span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.nav-burger span::before, .nav-burger span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.nav-burger span::before { top: -6px; }
.nav-burger span::after { top: 6px; }

@media (max-width: 1080px) {
  .nav-links, .nav-cta.nav-cta-desktop { display: none; }
  .nav-burger { display: grid; margin-inline-start: auto; }
}

/* ============ Mobile drawer ============ */
.m-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--paper); z-index: 90;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.32,.72,.34,1);
  box-shadow: -20px 0 60px -20px rgba(0,0,0,0.25);
  pointer-events: none;
}
.m-drawer.is-open { transform: translateX(0); pointer-events: auto; }
.m-backdrop {
  position: fixed; inset: 0; background: rgba(21,23,28,0.45);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 85; opacity: 0; pointer-events: none; transition: opacity 240ms ease;
}
.m-backdrop.is-open { opacity: 1; pointer-events: auto; }
.m-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.m-close { width: 38px; height: 38px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); font-size: 20px; line-height: 1; }
.m-close:hover { background: var(--paper-3); }
.m-nav { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.m-link, .m-group-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 12px; border-radius: 10px; text-align: left; width: 100%;
  background: transparent; border: 0; color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background-color 120ms ease;
}
.m-link:hover, .m-group-toggle:hover { background: var(--paper-2); }
.m-link[aria-current="page"] { color: var(--brand); }
.m-group-caret { font-size: 12px; color: var(--ink-3); transition: transform 220ms ease; }
.m-group.is-open .m-group-caret { transform: rotate(180deg); color: var(--brand); }
.m-group-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 280ms ease; }
.m-group.is-open .m-group-body { grid-template-rows: 1fr; }
.m-group-body > div { overflow: hidden; }
.m-sub-link { display: block; padding: 10px 12px 10px 20px; color: var(--ink-2); font-size: 14px; border-radius: 8px; }
.m-sub-link:hover { background: var(--paper-2); color: var(--brand); }
.m-sub-heading { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding: 12px 12px 4px 20px; }
.m-cta { margin: 14px 4px 6px; justify-content: center; padding: 15px; font-size: 15px; }
.m-drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px 20px; background: var(--paper-2); flex-shrink: 0; }
.m-drawer-foot h5 { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.m-net-link { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 9px 0; align-items: center; border-top: 1px solid var(--line); }
.m-net-link:first-of-type { border-top: 0; }
.m-net-icon { font-size: 18px; }
.m-net-text b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.m-net-text span { display: block; font-size: 11.5px; color: var(--ink-3); }
.m-net-link:hover b { color: var(--brand); }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px; border-radius: 999px; font-weight: 500; font-size: 15px; border: 1px solid transparent; white-space: nowrap; line-height: 1; transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
.btn-primary { background: var(--brand); color: var(--brand-text); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--line-3); }
.btn-dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-2); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }

/* ============ Sections ============ */
section { padding: clamp(48px, 7vw, 96px) 0; }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 56px); align-items: end; margin-bottom: clamp(28px, 4vw, 48px); }
@media (max-width: 820px) { .section-head { grid-template-columns: 1fr; gap: 12px; } }
.section-head h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 48px); letter-spacing: -0.026em; line-height: 1.05; margin: 10px 0 0; text-wrap: balance; }
.section-head p { color: var(--ink-2); margin: 0; }

/* ============ Hero (template) ============ */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px); position: relative; }
.hero-tag { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 8px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.hero-tag .pill { background: var(--ink); color: var(--paper); padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.hero-title { margin: 20px 0 20px; font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 7vw, 84px); letter-spacing: -0.035em; line-height: 0.99; text-wrap: balance; }
.hero-title em { color: var(--brand); font-style: normal; }
.hero-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: end; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } }
.hero-lede { font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* ============ Stat strip ============ */
.stat-strip { margin-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
.stat-cell { padding: 24px 20px; border-inline-start: 1px solid var(--line); }
.stat-cell:first-child { border-inline-start: none; }
@media (max-width: 720px) { .stat-cell:nth-child(3) { border-inline-start: none; } }
.stat-num { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 4.4vw, 48px); letter-spacing: -0.03em; line-height: 1; }
.stat-num small { font-size: 0.5em; color: var(--ink-3); margin-left: 4px; font-weight: 500; }
.stat-label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 10px; }
.stat-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; max-width: 30ch; }

/* ============ Cards ============ */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }
/* Hairline dividers drawn per-card (inset top+left) so empty trailing cells in a
   partial row stay paper-colored instead of exposing a tan container block. */
.card { background: var(--paper); padding: 28px 24px; display: flex; flex-direction: column; gap: 11px; min-height: 200px; transition: background-color 160ms ease; position: relative; box-shadow: inset 1px 0 0 var(--line), inset 0 1px 0 var(--line); }
.card:hover { background: var(--paper-2); }
.card-num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.12em; }
.card h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.015em; line-height: 1.2; }
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; }
.card-foot { margin-top: auto; padding-top: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; display: flex; justify-content: space-between; }
.card-foot .pill { background: var(--brand-soft); color: var(--brand-dark); padding: 3px 8px; border-radius: 999px; font-size: 10.5px; }
.card-link::after { content: ""; position: absolute; inset: 0; }

/* ============ Callout ============ */
.callout { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.callout-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.callout h4 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.015em; }
.callout p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.callout.is-warn { background: #FBF1E0; border-color: #E8C887; }
.callout.is-warn .callout-eyebrow { color: var(--warn); }
.callout.is-ok { background: #E8F1E6; border-color: #B8D2B0; }
.callout.is-ok .callout-eyebrow { color: var(--ok); }
.callout.is-bad { background: #F6E4DF; border-color: #DCA99D; }
.callout.is-bad .callout-eyebrow { color: var(--bad); }

/* ============ Data table (template) ============ */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th { text-align: left; padding: 13px 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; background: var(--paper-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--paper-2); }
table.data tbody td:first-child { font-weight: 600; color: var(--ink); }

/* ============ FAQ accordion (template) ============ */
.faq-accordion { border-top: 1px solid var(--line); }
.faq-accordion .faq-item { border-bottom: 1px solid var(--line); }
.faq-accordion .faq-q { width: 100%; padding: 20px 0; display: grid; grid-template-columns: 1fr 32px; align-items: center; gap: 16px; text-align: left; }
.faq-accordion .faq-q .t { font-family: var(--font-display); font-weight: 600; font-size: clamp(16px, 1.7vw, 20px); letter-spacing: -0.014em; line-height: 1.25; }
.faq-accordion .faq-q .plus { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; transition: transform 200ms ease, background-color 160ms ease; font-size: 16px; }
.faq-accordion .faq-item.is-open .plus { transform: rotate(45deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }
.faq-accordion .faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms ease; }
.faq-accordion .faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-accordion .faq-a-inner { overflow: hidden; }
.faq-accordion .faq-a-content { padding: 0 0 24px; max-width: 72ch; color: var(--ink-2); font-size: 15px; }

/* ============ Big dark CTA card ============ */
.cta-card { background: var(--ink); color: var(--paper); border-radius: var(--radius-lg); padding: clamp(32px, 5vw, 64px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; position: relative; overflow: hidden; }
.cta-card::before { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, var(--brand-glow), transparent 60%); }
@media (max-width: 900px) { .cta-card { grid-template-columns: 1fr; gap: 24px; } }
.cta-card h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 4vw, 48px); letter-spacing: -0.025em; margin: 0; line-height: 1.05; }
.cta-card p { color: rgba(247,245,240,0.78); margin: 16px 0 24px; max-width: 50ch; }
.cta-card .btn-primary { background: var(--brand); }
.cta-side { display: flex; flex-direction: column; align-self: center; position: relative; z-index: 1; }
.cta-side .row-x { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-top: 1px solid rgba(247,245,240,0.12); align-items: baseline; }
.cta-side .row-x .k { font-family: var(--font-mono); font-size: 11px; color: rgba(247,245,240,0.55); letter-spacing: .12em; text-transform: uppercase; }
.cta-side .row-x .v { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.012em; }

/* ============ Prose ============ */
.prose { font-size: 16.5px; line-height: 1.65; color: var(--ink-2); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.022em; line-height: 1.1; margin: 1.8em 0 0.5em; color: var(--ink); }
.prose h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(20px, 2.4vw, 26px); letter-spacing: -0.016em; margin: 1.5em 0 0.4em; color: var(--ink); }
.prose p { max-width: 68ch; }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-color: var(--brand-soft); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose blockquote { border-inline-start: 3px solid var(--brand); padding: 8px 22px; margin: 1.4em 0; font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 21px; letter-spacing: -0.012em; color: var(--ink); }
.prose code { font-family: var(--font-mono); font-size: 13.5px; background: var(--paper-2); padding: 1px 6px; border-radius: 4px; }
.prose ul, .prose ol { padding-inline-start: 22px; max-width: 66ch; }
.prose li { padding: 4px 0; }
.prose li::marker { color: var(--brand); }

/* ============ Doc / TOC sidebar ============ */
.doc-layout { display: grid; grid-template-columns: 220px 1fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 1080px) { .doc-layout { grid-template-columns: 1fr; } .doc-aside { display: none; } }
.doc-aside { position: sticky; top: 88px; font-size: 13px; }
.doc-aside h6 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; font-weight: 500; }
.doc-aside a:not(.btn) { display: block; padding: 6px 10px; border-inline-start: 2px solid var(--line); color: var(--ink-3); font-size: 13px; transition: color 120ms ease, border-color 120ms ease; }
.doc-aside a:not(.btn):hover, .doc-aside a:not(.btn).is-active { color: var(--brand); border-inline-start-color: var(--brand); }

/* ============ Tags / badges ============ */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-2); }
.tag.is-brand { background: var(--brand-soft); border-color: color-mix(in oklab, var(--brand) 30%, transparent); color: var(--brand-dark); }
.tag.is-ok { background: #E2F0DC; border-color: #B8D2B0; color: var(--ok); }
.tag.is-warn { background: #F7E5C3; border-color: #E0B770; color: var(--warn); }
.tag.is-bad { background: #F4D9D3; border-color: #D9A096; color: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 4px; background: var(--brand); color: var(--brand-text); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ============ Document generator (template .docgen) ============ */
.docgen { display: grid; grid-template-columns: 400px 1fr; gap: 0; background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 960px) { .docgen { grid-template-columns: 1fr; } }
.docgen-form { background: var(--paper-2); padding: 28px 26px; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 960px) { .docgen-form { border-inline-end: 0; border-bottom: 1px solid var(--line); } }
.docgen-form h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -0.014em; }
.docgen-form .form-eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.docgen-form .form-note { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); text-align: center; margin: 0; letter-spacing: 0.04em; line-height: 1.5; }
.docgen-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.docgen-fieldset + .docgen-fieldset { padding-top: 16px; border-top: 1px solid var(--line); }
.docgen-fieldset legend { padding: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.docgen-field { display: flex; flex-direction: column; gap: 6px; }
.docgen-field label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.docgen-field label .req { color: var(--bad); }
.docgen-field input, .docgen-field select, .docgen-field textarea { width: 100%; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-body); font-size: 14px; color: var(--ink); transition: border-color 120ms ease, box-shadow 120ms ease; }
.docgen-field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.docgen-field input:focus, .docgen-field select:focus, .docgen-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.docgen-field input.invalid, .docgen-field textarea.invalid { border-color: var(--bad); background: #FBEDE9; }
.docgen-field .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.docgen-form .btn { width: 100%; justify-content: center; margin-top: 4px; }
.docgen-form .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dg-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.docgen-preview { background: var(--paper-3); padding: 36px; position: relative; min-height: 540px; display: flex; align-items: flex-start; justify-content: center; }
.docgen-preview::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 18px, rgba(21,23,28,0.025) 18px 19px); pointer-events: none; }
@media (max-width: 960px) { .docgen-preview { padding: 24px 18px; } }
.docletter { position: relative; z-index: 1; width: 100%; max-width: 540px; background: #FEFCF7; border: 1px solid var(--line-2); border-radius: 4px; padding: 48px 56px; font-family: 'Newsreader', Georgia, serif; font-size: 14px; line-height: 1.55; color: var(--ink); box-shadow: 0 12px 40px -20px rgba(21,23,28,0.25), 0 2px 6px -2px rgba(21,23,28,0.10); }
@media (max-width: 560px) { .docletter { padding: 30px 26px; } }
.docletter .letterhead { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.docletter .letterhead .mono { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; }
.docletter .letterhead .sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.docletter .letterhead .mark { width: 32px; height: 32px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; border-radius: 6px; flex-shrink: 0; }
.docletter p { margin: 0 0 12px; }
.docletter strong { font-weight: 600; }
.docletter .field-val { background: linear-gradient(0deg, var(--brand-soft), var(--brand-soft)) no-repeat 0 100% / 100% 6px; padding: 0 2px; font-weight: 500; }
.docletter .placeholder-pill { background: var(--paper-3); color: var(--ink-3); padding: 0 5px; border-radius: 3px; font-style: italic; font-size: 0.9em; }
.docletter .lp-from { text-align: right; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.03em; line-height: 1.7; margin-bottom: 22px; }
.docletter .lp-via { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 18px; }
.docletter .lp-to { margin-bottom: 16px; }
.docletter .lp-re { font-weight: 600; margin: 0 0 16px; }
.docletter .lp-re .field-val { font-weight: 600; }
.docletter .signature { margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line); }
.docletter .signature .sig-line { display: block; height: 1px; background: var(--line-2); width: 200px; margin: 0 0 10px; }
.docletter .signature .sig-cap { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase; line-height: 1.8; }

/* ============ Footer ============ */
.foot { background: var(--ink); color: var(--paper); padding: 56px 0 28px; }
.foot-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
@media (max-width: 900px) { .foot-top { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 600px) { .foot-top { grid-template-columns: 1fr; } }
.foot-brand .brand-link { color: var(--paper); }
.foot-brand .brand-mark { background: var(--paper); color: var(--ink); }
.foot-brand p { color: rgba(247,245,240,0.65); font-size: 14px; max-width: 42ch; margin: 12px 0 16px; }
.foot-brand .btn { padding: 10px 16px; font-size: 13px; }
.foot h5 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(247,245,240,0.5); margin: 0 0 12px; font-weight: 500; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot ul li { padding: 4px 0; }
.foot ul a { color: rgba(247,245,240,0.85); font-size: 14px; transition: color 120ms ease; }
.foot ul a:hover { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.foot-network { margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(247,245,240,0.12); }
.foot-network h5 { display: flex; align-items: center; gap: 8px; }
.foot-network h5::after { content: ""; flex: 1; height: 1px; background: rgba(247,245,240,0.08); }
.network-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .network-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .network-grid { grid-template-columns: 1fr; } }
.net-card { background: rgba(247,245,240,0.04); border: 1px solid rgba(247,245,240,0.10); border-radius: 12px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 7px; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.net-card:hover { background: rgba(247,245,240,0.08); border-color: rgba(247,245,240,0.20); transform: translateY(-2px); }
.net-card.is-current { background: var(--brand); border-color: var(--brand); }
.net-card.is-current:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.net-icon { font-size: 20px; }
.net-card b { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; letter-spacing: -0.012em; color: var(--paper); }
.net-card span { font-size: 12.5px; color: rgba(247,245,240,0.6); line-height: 1.4; }
.net-card.is-current span { color: rgba(255,255,255,0.85); }
.net-card.is-current b { color: #fff; }
.foot-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(247,245,240,0.10); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 11.5px; color: rgba(247,245,240,0.5); letter-spacing: .06em; }
.foot-bottom .legal-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-bottom .legal-links a:hover { color: #fff; }
.foot-disclaimer { margin-top: 20px; padding-top: 18px; border-top: 1px dashed rgba(247,245,240,0.10); font-size: 12px; color: rgba(247,245,240,0.45); max-width: 82ch; line-height: 1.6; }

/* ============ Animations ============ */
.fade-in { animation: fadeIn 600ms ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

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

/* ============================================================================
   Imagery system + UI polish (added v2 — paper grain, illustration figures,
   card hover, section accents). Self-hosted SVG only; CSP allows 'self' + data:.
   ============================================================================ */

/* ---- Site-wide paper grain. A monochrome fractal-noise tile painted behind
   all content gives the flat paper palette a tactile, printed feel. Fixed so it
   doesn't scroll, very low opacity so it reads as texture, never noise. ------ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ---- Illustration figure (hero + in-content) ---------------------------- */
.hero-aside { display: flex; flex-direction: column; gap: 18px; }
.hero-grid.has-figure { align-items: start; }
@media (max-width: 920px) { .hero-grid.has-figure { gap: 28px; } }

.hero-figure,
.media-figure {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(21,23,28,0.05), 0 22px 48px -28px rgba(21,23,28,0.30);
}
.hero-figure img, .hero-figure svg,
.media-figure img, .media-figure svg {
  display: block;
  width: 100%;
  height: auto;
}
.hero-figure::after,
.media-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 70px -22px rgba(21,23,28,0.16);
}
/* Floating mono badge, mirrors the master-template .hero-image-badge */
.fig-badge {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(247,245,240,0.92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-2);
}
.fig-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

/* In-content figure: caption + width variants for article/hub bodies */
.media-figure { margin: 28px 0; }
.media-figure figcaption {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.04em; color: var(--ink-3);
}
.media-figure.fig-center { max-width: 520px; margin-inline: auto; }

/* ---- Card hover polish. Cards live in an overflow:hidden 1px grid, so a
   lift/shadow would clip — use a growing top accent rule + brand-tinted index
   number instead. Contained, crisp, works in every card-grid. --------------- */
.card { transition: background-color 160ms ease; }
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  height: 3px; width: 0;
  background: var(--brand);
  transition: width 240ms cubic-bezier(.22,.61,.36,1);
  z-index: 1;
}
.card:hover::before { width: 100%; }
.card:hover .card-num { color: var(--brand); }
.card-num, .card:hover .card-num { transition: color 160ms ease; }

/* ---- Section eyebrow ornament — a short brand tick before the eyebrow text
   gives section heads a designed, deliberate look. ------------------------- */
.eyebrow { position: relative; }

/* ---- Standalone decorative rule between sections (opt-in) ---------------- */
.rule-ornament { display: flex; align-items: center; gap: 16px; color: var(--line-2); }
.rule-ornament::before, .rule-ornament::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rule-ornament .mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--ink-4); white-space: nowrap; }
