/* ===========================================================================
   Security Helps — base, components and site chrome
   ===========================================================================
   Every colour comes from a token in tokens.css. There are no hard-coded
   hex values below this line except inside the print block at the end.
   =========================================================================== */

/* ---------- Base ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-6));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  font-optical-sizing: auto;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-4);
  color: var(--ink);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}
h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -.01em; }
p  { margin: 0 0 var(--sp-4); }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

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

ul, ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-6); }
li { margin-bottom: var(--sp-2); }

strong, b { color: var(--ink); font-weight: 600; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-8) 0; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
#main:focus { outline: none; }

::selection { background: var(--accent-tint); color: var(--accent-tint-ink); }

/* ---------- Utilities ----------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap-narrow { max-width: var(--container-narrow); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--sp-4); color: var(--on-accent); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--accent); flex: none;
}

.lede { font-size: var(--fs-lg); line-height: var(--lh-relaxed); color: var(--text); }
/* --font-mono was defined in tokens.css and never applied to anything: .mono
   only set tabular numerals, so a rule asking for monospace silently fell back
   to the body font. The blog's post metadata is the first thing to depend on
   it. */
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }

.link-more {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 600; text-decoration: none;
}
.link-more:hover { gap: var(--sp-3); }
.link-more::after { content: "\2192"; transition: none; }

/* ---------- Sections ------------------------------------------------------ */

.section { padding-block: var(--section-y); }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { max-width: var(--measure); margin-bottom: var(--sp-12); }
.section-head p { color: var(--text); }

/* ---------- Buttons ------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-3) var(--sp-6);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: none;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn-primary:active { background: var(--accent-active); transform: none; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost { border-color: var(--panel-line); color: var(--panel-ink); }
.btn-ghost:hover { background: var(--panel-surface); color: var(--panel-ink); }

.btn-sm { min-height: 36px; padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); }
.btn-lg { min-height: 52px; padding: var(--sp-4) var(--sp-8); font-size: var(--fs-lg); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ---------- Header -------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  width: 100%;
  max-width: var(--container);
  min-height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.brand-mark { width: 32px; height: 32px; border-radius: var(--r-sm); }
.brand-name { display: block; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.brand-tag {
  display: block;
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: var(--sp-1); }
.nav-link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { color: var(--accent); font-weight: 600; }

.nav-cta { margin-left: var(--sp-2); flex: none; }

.nav-toggle, .theme-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  flex: none;
}
.nav-toggle:hover, .theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.nav-toggle-bars::before { content: ""; transform: translateY(-6px); }
.nav-toggle-bars::after  { content: ""; transform: translateY(4px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { transform: rotate(-45deg) translateY(-2px); }

.theme-toggle svg { width: 18px; height: 18px; }
:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
}

/* The theme toggle belongs in the header at every width — without this it would
   only appear below 1024px, which is the opposite of the point. The hamburger
   stays inside the navigation breakpoint. */
.js-enabled .theme-toggle { display: inline-flex; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-drawer) - 1);
  background: rgba(14, 28, 51, .45);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-backdrop[hidden] { display: none; }

/* ---------- Status bar ---------------------------------------------------- */

.status-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.status-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-6);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--sp-2) var(--gutter);
}
.status-inner span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.status-inner strong { color: var(--ink); font-weight: 600; }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .dot { animation: pulse 2.4s var(--ease) infinite; }
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Hero ---------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-20) var(--sp-24);
  background: var(--bg);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% 40% 40% -10%;
  background: radial-gradient(closest-side, var(--accent-tint), transparent);
  opacity: .75;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: var(--sp-16);
  align-items: center;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.hero-sub { font-size: var(--fs-lg); line-height: var(--lh-relaxed); max-width: 46ch; }
.hero-cta { margin-top: var(--sp-6); }
.hero-note {
  margin-top: var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.hero-note a { color: var(--ink); font-weight: 600; text-decoration: none; }
.hero-note a:hover { color: var(--accent); }

.hero-card {
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.hero-card h2 {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-4);
}
.practice-list { list-style: none; margin: 0; padding: 0; }
.practice-list li { margin: 0; border-top: 1px solid var(--line); }
.practice-list li:first-child { border-top: 0; }
.practice-list a {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.practice-list a:hover { color: var(--accent); }
.practice-list small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Page header (inner pages) ------------------------------------- */

.page-header {
  position: relative;
  overflow: hidden;
  padding-block: var(--sp-16) var(--sp-12);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.page-header::before {
  content: "";
  position: absolute;
  inset: -30% 55% 30% -10%;
  background: radial-gradient(closest-side, var(--accent-tint), transparent);
  opacity: .7;
  pointer-events: none;
}
.page-header-inner {
  position: relative;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.page-header p { max-width: var(--measure); font-size: var(--fs-lg); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  color: var(--muted);
  font-size: var(--fs-xs);
  list-style: none;
  padding: 0;
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--sp-2); color: var(--line-strong); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Practice cards ------------------------------------------------ */

.practice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}
.practice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.practice-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
  color: var(--ink);
}
.practice-card h3 { margin: 0; font-size: var(--fs-lg); }
.practice-card p { margin: 0; color: var(--text); font-size: var(--fs-sm); }
.practice-card--wide { grid-column: 1 / -1; }
.card-link { margin-top: auto; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; }

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-tint);
  color: var(--accent-tint-ink);
  flex: none;
}
.icon-tile svg { width: 20px; height: 20px; }

/* ---------- Feature grid -------------------------------------------------- */

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--grid-gap) var(--sp-8); }
.feature { padding-top: var(--sp-4); border-top: 2px solid var(--line); }
.feature h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.feature p { font-size: var(--fs-sm); }
.feature:hover { border-top-color: var(--accent); }

/* ---------- Pillars ------------------------------------------------------- */

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); }
.pillar { padding: var(--sp-6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pillar-mark {
  display: inline-block;
  margin-bottom: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--accent-tint);
  color: var(--accent-tint-ink);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.pillar h3 { font-size: var(--fs-lg); }
.pillar p { font-size: var(--fs-sm); margin: 0; }

/* ---------- KPI row ------------------------------------------------------- */

.kpi-row { background: var(--surface); border-block: 1px solid var(--line); }
.kpi-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.kpi { padding: var(--sp-8) var(--sp-6) var(--sp-8) 0; border-left: 1px solid var(--line); padding-left: var(--sp-6); }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi b { display: block; color: var(--ink); font-size: var(--fs-2xl); font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Trust row ----------------------------------------------------- */

.trust-row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); list-style: none; margin: 0; padding: 0; }
.trust-row li { margin: 0; }
.trust-row span {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* ---------- Steps --------------------------------------------------------- */

.step-list { display: grid; gap: var(--sp-6); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: var(--sp-4); margin: 0; }
.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent-tint-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.step h3 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.step p { margin: 0; font-size: var(--fs-sm); }

/* ---------- Figure well --------------------------------------------------- */

.figure-well {
  padding: var(--sp-5);
  background: var(--panel-bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.figure-well img { width: 100%; border-radius: var(--r-md); }
.figure-well figcaption { margin-top: var(--sp-3); color: var(--panel-muted); font-size: var(--fs-xs); }

/* Photographs get a light frame instead of the dark panel used by the in-house
   diagrams, and are cropped to a consistent 16:10 so a portrait source and a
   landscape source sit the same way on the page. */
.figure-well--photo {
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.figure-well--photo img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.figure-well--photo figcaption { color: var(--muted); }

/* ---------- Tables -------------------------------------------------------- */

.tbl-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
caption { padding: var(--sp-4); color: var(--muted); font-size: var(--fs-xs); text-align: left; }
th, td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Badges -------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--accent-tint);
  color: var(--accent-tint-ink);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- Callouts ------------------------------------------------------ */

.callout {
  margin: var(--sp-6) 0;
  padding: var(--sp-5) var(--sp-6);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--accent-tint);
  color: var(--text);
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout-title { display: block; color: var(--ink); font-weight: 600; margin-bottom: var(--sp-1); }

/* ---------- FAQ ----------------------------------------------------------- */

.faq { display: grid; gap: var(--sp-3); }
.faq details {
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.faq summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; flex: none; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { margin-bottom: var(--sp-3); }
.faq details > p { font-size: var(--fs-sm); margin: 0; }

/* ---------- Split layout -------------------------------------------------- */

.split { display: grid; grid-template-columns: 1.5fr .9fr; gap: var(--sp-16); align-items: start; }
.aside-card {
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.aside-card h3 { font-size: var(--fs-base); }

/* ---------- Check list ---------------------------------------------------- */

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: grid; grid-template-columns: 18px 1fr; gap: var(--sp-3); margin-bottom: var(--sp-3); font-size: var(--fs-sm); }
.check-list svg { width: 18px; height: 18px; color: var(--ok); margin-top: 3px; }

/* ---------- Link list ----------------------------------------------------- */

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { margin: 0; border-top: 1px solid var(--line); }
.link-list li:first-child { border-top: 0; }
.link-list a { display: block; padding: var(--sp-4) 0; color: var(--ink); font-weight: 600; text-decoration: none; }
.link-list a:hover { color: var(--accent); }
.link-list small { display: block; color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }

/* ---------- CTA panel (the one dark band per page) ------------------------ */

.cta-panel {
  padding-block: var(--sp-16);
  background: var(--panel-bg);
  color: var(--panel-ink);
}
.cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.cta-inner h2 { color: var(--panel-ink); margin-bottom: var(--sp-2); }
.cta-inner p { color: var(--panel-muted); margin: 0; max-width: 52ch; }

/* ---------- Pricing plans ------------------------------------------------- */

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--grid-gap); }
.plan {
  display: flex;
  flex-direction: column;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.plan-featured { border-color: var(--accent); box-shadow: var(--shadow-2); }
.plan-name { font-size: var(--fs-base); margin-bottom: var(--sp-1); }
.plan-flag { margin-bottom: var(--sp-3); }
.price-num { display: block; color: var(--ink); font-size: var(--fs-2xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-for { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.plan-list { list-style: none; margin: 0 0 var(--sp-6); padding: 0; font-size: var(--fs-sm); }
.plan-list li { display: grid; grid-template-columns: 16px 1fr; gap: var(--sp-2); }
.plan-list li::before { content: "\2713"; color: var(--ok); font-weight: 700; }
.plan .btn { margin-top: auto; }

/* ---------- Forms --------------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }
.form-grid .full { grid-column: 1 / -1; }
.field-label, label { display: block; margin-bottom: var(--sp-2); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin-top: var(--sp-2); color: var(--danger); font-size: var(--fs-xs); }
.field-help { margin-top: var(--sp-2); color: var(--muted); font-size: var(--fs-xs); }

.checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.checks label {
  display: flex; align-items: center; gap: var(--sp-3);
  margin: 0; padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  font-weight: 400; font-size: var(--fs-sm);
  cursor: pointer;
}
.checks input { width: 18px; min-height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.honeypot { position: absolute; left: -9999px; }

/* ---------- Quote builder ------------------------------------------------- */

.quote-grid { display: grid; grid-template-columns: 1.6fr .9fr; gap: var(--sp-12); align-items: start; }
.q-section { margin: 0 0 var(--sp-8); padding: 0; border: 0; }
.q-legend { padding: 0; margin-bottom: var(--sp-4); color: var(--muted); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--ls-wide); text-transform: uppercase; }
.plan-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
.plan-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-opt {
  display: block;
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
}
.plan-opt b { display: block; color: var(--ink); }
.plan-opt small { color: var(--muted); font-size: var(--fs-xs); }
.plan-pick input:checked + .plan-opt { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.plan-pick input:focus-visible + .plan-opt { outline: 2px solid var(--focus); outline-offset: 2px; }
.q-field { display: grid; grid-template-columns: 1fr 150px; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-4); }
.q-field input { min-height: 40px; }
.q-hint { color: var(--muted); font-size: var(--fs-xs); }

.sum-card {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-6));
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.sum-title { font-size: var(--fs-base); }
.sum-line { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-2) 0; font-size: var(--fs-sm); border-bottom: 1px solid var(--line); }
.sum-line span:last-child { font-variant-numeric: tabular-nums; }
.sum-total { display: flex; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-3); color: var(--ink); font-size: var(--fs-lg); font-weight: 700; }
.sum-total span:last-child { font-variant-numeric: tabular-nums; }
.sum-sub { color: var(--muted); font-size: var(--fs-xs); margin: var(--sp-2) 0 var(--sp-5); }
.sum-actions { display: grid; gap: var(--sp-2); }
.sum-note { margin-top: var(--sp-4); color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Toast --------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  transform: translate(-50%, 20px);
  max-width: min(92vw, 460px);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-3);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }

/* ---------- Footer -------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: var(--sp-16) var(--sp-8);
  font-size: var(--fs-sm);
}
.foot-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--sp-12);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.foot-brand p { color: var(--muted); max-width: 42ch; }
.foot-brand a { color: var(--text); }
.foot-col h4 {
  margin-bottom: var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: var(--sp-2); }
.foot-col a { color: var(--text); text-decoration: none; }
.foot-col a:hover { color: var(--accent); }

.foot-social { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.foot-social a { display: inline-flex; color: var(--muted); }
.foot-social a:hover { color: var(--accent); }
.foot-social svg { width: 20px; height: 20px; }

.foot-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  max-width: var(--container);
  margin: var(--sp-12) auto 0;
  padding: var(--sp-6) var(--gutter) 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.foot-legal { display: flex; flex-wrap: wrap; gap: var(--sp-5); list-style: none; margin: 0; padding: 0; }
.foot-legal a { color: var(--muted); text-decoration: none; }
.foot-legal a:hover { color: var(--accent); }

/* ===========================================================================
   Responsive
   One breakpoint for the navigation (1024px), then a small ladder for grids.
   =========================================================================== */

/* ---------- Blog ---------------------------------------------------------- */

/* Article body copy. It sits on its own measure rather than the site-wide
   .wrap (1200px): a line of prose that long is unreadable, and the fix is a
   max-width, not a narrower page every other element has to live with. */
.prose { max-width: var(--measure); }
.prose > p, .prose > ul, .prose > ol { color: var(--text); }
.prose h2 { margin-top: var(--sp-12); margin-bottom: var(--sp-4); }
.prose h3 { margin-top: var(--sp-8); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: var(--sp-6); }
.prose li { margin-bottom: var(--sp-2); }
.prose b, .prose strong { color: var(--ink); }
.prose code {
  padding: 2px var(--sp-2);
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .92em;
}

/* A pull quote is a paragraph that happens to be set large, so it stays in the
   flow and keeps its place in the reading order. */
.pull {
  margin: var(--sp-8) 0;
  padding-left: var(--sp-6);
  border-left: 3px solid var(--accent);
  font-size: var(--fs-lg);
  color: var(--ink);
}
.pull-note {
  display: block;
  margin-top: var(--sp-3);
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-style: normal;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

/* --- The index card list -------------------------------------------------- */

.post-grid { display: grid; gap: var(--sp-8); }
.post-card {
  display: grid;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.post-thumb { display: block; background: var(--surface-2); }
.post-thumb img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
}
.post-card-body h2 { font-size: var(--fs-xl); margin: 0; }
.post-card-body h2 a { color: var(--ink); text-decoration: none; }
.post-card-body h2 a:hover { color: var(--accent); }
.post-card-body p { margin: 0; color: var(--text); font-size: var(--fs-sm); }
.post-go {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
}
.post-go:hover { gap: var(--sp-3); }

/* Above the single-column breakpoint the newest post is laid out as a lead
   story: image beside the text rather than above it. */
@media (min-width: 761px) {
  .post-card-wide { grid-template-columns: 1.15fr 1fr; align-items: stretch; }
  .post-card-wide .post-thumb { height: 100%; }
  .post-card-wide .post-thumb img { height: 100%; aspect-ratio: auto; }
  .post-card-wide .post-card-body { padding: var(--sp-10); }
  .post-card-wide .post-card-body h2 { font-size: var(--fs-2xl); }
}
@media (max-width: 760px) {
  .post-card-wide .post-thumb img { aspect-ratio: 16 / 10; }
}

/* --- Metadata, tags, and the foot of an article --------------------------- */

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  background: var(--accent-tint);
  color: var(--accent-tint-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  white-space: nowrap;
}
/* A live threat write-up leads with the alert rather than with a subject area. */
.tag-crit { background: var(--danger-soft); color: var(--danger); }

.article-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}
.article-foot .post-meta { gap: var(--sp-2); }

/* --- Share bar ------------------------------------------------------------
   The behaviour has always been there in site.js; these rules are the styling
   it was written against and never had. The bar renders empty and invisible
   until the script has put buttons in it, so a reader without JavaScript sees
   nothing rather than five dead controls. */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
}
.share-bar:empty { display: none; }
.share-label {
  margin-right: var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-btn svg { width: 18px; height: 18px; fill: currentColor; }
.share-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The blog index header carries the feed link, so a reader can subscribe
   without hunting for it. */
.feed-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.feed-link:hover { color: var(--accent); }
.feed-link svg { width: 16px; height: 16px; fill: currentColor; }

@media (max-width: 1200px) {
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(2, 1fr); }
}

/* --- Navigation collapses to a drawer --- */
@media (max-width: 1024px) {
  .status-bar { display: none; }

  /* Shown only when JavaScript is available to run them. */
  .js-enabled .nav-toggle { display: inline-flex; }
  .js-enabled .theme-toggle { display: inline-flex; }

  .js-enabled .nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    z-index: var(--z-drawer);
    width: min(86vw, 340px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-4) var(--sp-5) calc(var(--sp-8) + env(safe-area-inset-bottom));
    background: var(--surface);
    border-left: 1px solid var(--line);
    box-shadow: var(--shadow-3);
    overflow-y: auto;
    /* nowrap matters: with the default wrap, a long link list on a very short
       viewport wraps into a second column instead of scrolling. */
    flex-wrap: nowrap;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--dur-2) var(--ease), visibility 0s linear var(--dur-2);
  }
  .js-enabled.nav-open .nav { transform: translateX(0); visibility: visible; transition-delay: 0s; }

  /* Without JavaScript the nav is a plain, fully reachable list. It loses to
     the .js-enabled rule above, which is higher specificity, so this only
     affects the no-JS case. */
  .nav { flex-wrap: wrap; }

  .nav-link {
    padding: var(--sp-4) var(--sp-2);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    font-size: var(--fs-base);
  }
  .nav-link:hover { background: none; }
  .nav-cta { margin: var(--sp-4) 0 0; width: 100%; }

  .hero { padding-block: var(--sp-12) var(--sp-16); }
  .hero-inner { grid-template-columns: 1fr; gap: var(--sp-10); }
  .page-header { padding-block: var(--sp-12) var(--sp-10); }
  .split, .quote-grid { grid-template-columns: 1fr; gap: var(--sp-10); }
  .sum-card { position: static; }
  .kpi-inner { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: var(--sp-6) var(--sp-5); }
  .kpi:nth-child(odd) { border-left: 0; padding-left: 0; }
  .foot-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --section-y: 64px; }
  .practice-grid, .feature-grid, .pillars, .plans, .form-grid, .checks, .plan-pick { grid-template-columns: 1fr; }
  .practice-card--wide { grid-column: auto; }
  .q-field { grid-template-columns: 1fr; gap: var(--sp-2); }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .foot-inner { grid-template-columns: 1fr; gap: var(--sp-8); }
  .foot-note { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .brand-tag { display: none; }
  .kpi-inner { grid-template-columns: 1fr; }
  .kpi { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .kpi:first-child { border-top: 0; }
}

/* ---------- Reduced motion ------------------------------------------------ */

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

/* ---------- Print --------------------------------------------------------- */

@media print {
  /* Force the light palette in print regardless of theme or OS setting. */
  :root,
  :root[data-theme="dark"],
  :root:not([data-theme="light"]) {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --ink: #000000;
    --text: #1a1a1a;
    --muted: #444444;
    --line: #cccccc;
    --line-strong: #999999;
    --accent: #000000;
    --accent-tint: #ffffff;
    --accent-tint-ink: #000000;
    --panel-bg: #ffffff;
    --panel-ink: #000000;
    --panel-muted: #333333;
  }
  .site-header, .status-bar, .cta-panel, .toast, .nav-backdrop,
  .nav-toggle, .theme-toggle, .skip-link, .site-footer { display: none !important; }
  *, *::before, *::after { box-shadow: none !important; background-image: none !important; }
  .wrap, .hero-inner, .page-header-inner { max-width: none; }
  a { color: #000000; }
  .section { padding-block: 16px; }
  .faq details { break-inside: avoid; }
  .faq details > p { display: block !important; }
}
