/* Refine the Vibe — single-page stylesheet
   Tokens first; every spacing value comes from the 4/8 scale. */
:root {
  --ink-900: #0f1724;
  --ink-800: #1b2638;
  --ink-700: #2a3850;
  --ink-500: #55657f;
  --ink-300: #a9b4c6;
  --paper: #fbfaf7;
  --paper-tint: #f2efe8;
  --line: #e2ddd2;
  --text: #1a2230;
  --text-muted: #4a5568;
  --amber-500: #f2b33d;
  --amber-600: #d99a1f;
  --amber-800: #8a5a00;
  --green-400: #34d399;
  --green-700: #0f7a55;

  /* Semantic colours. Light values below; dark values in [data-theme="dark"]. */
  --bg: var(--paper);
  --bg-tint: var(--paper-tint);
  --surface: #fff;
  --heading: var(--ink-900);
  --heading-2: var(--ink-800);
  --link: var(--green-700);
  --accent-text: var(--amber-800);
  --success: var(--green-700);
  --danger: #b42318;
  --stakes: #9b2c2c;
  --icon: var(--ink-900);
  --pillar-top: var(--ink-900);
  --badge-bg: var(--ink-900);
  --divider: var(--paper-tint);
  --field-bg: #fff;
  --field-border: var(--ink-500);
  --meter-border: transparent;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232a3850' stroke-width='2'/%3E%3C/svg%3E");
  color-scheme: light;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(15, 23, 36, .06), 0 2px 6px rgba(15, 23, 36, .05);
  --shadow-2: 0 6px 24px rgba(15, 23, 36, .10);

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Verdana, Geneva, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --nav-h: 64px;
}

/* Dark is the default theme (data-theme="dark" is set in the HTML). Navbar, CTA band and
   footer are dark in both themes; the hero and the content sections change. */
:root[data-theme="dark"] {
  --bg: #0b111b;
  --bg-tint: #101927;
  --surface: #152033;
  --line: #263349;
  --text: #dbe2ee;
  --text-muted: #a9b4c6;
  --heading: #f3f6fa;
  --heading-2: #e4e9f1;
  --link: var(--green-400);
  --accent-text: var(--amber-500);
  --success: var(--green-400);
  --danger: #ff8a80;
  --stakes: #ff9b93;
  --icon: #e4e9f1;
  --pillar-top: var(--amber-500);
  --badge-bg: #0a101a;
  --divider: #1d293d;
  --field-bg: #0f1724;
  --field-border: #6b7a93;
  --meter-border: var(--line);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
  --shadow-2: 0 6px 24px rgba(0, 0, 0, .45);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23dbe2ee' stroke-width='2'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--s-4)); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--heading); }
:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--heading); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); letter-spacing: -.01em; max-width: 24ch; }
p { margin: 0 0 var(--s-4); }
em { font-style: italic; }

.skip-link {
  position: absolute; left: var(--s-4); top: -60px; z-index: 100;
  background: var(--amber-500); color: var(--ink-900); padding: var(--s-2) var(--s-4);
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--s-2); }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--s-5); }
.wrap--narrow { max-width: 820px; }

.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-text); margin: 0 0 var(--s-3); font-weight: 600;
}
.eyebrow--light { color: var(--amber-500); }

/* ── Navbar ─────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 23, 36, .94);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav__inner {
  max-width: 1160px; margin: 0 auto; padding: 0 var(--s-5);
  height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; color: #fff; min-height: 44px; min-width: 0; }
.nav .brand { margin-right: auto; }
.brand:hover { color: #fff; }
.brand__mark { width: 36px; height: 36px; flex: none; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }

.nav__menu { display: flex; align-items: center; gap: var(--s-1); }
.nav__menu a {
  color: #dbe2ee; text-decoration: none; font-size: .95rem; font-weight: 500;
  padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); min-height: 44px;
  display: inline-flex; align-items: center; white-space: nowrap;
}
.nav__menu a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav__menu .nav__cta { background: var(--amber-500); color: var(--ink-900); font-weight: 700; margin-left: var(--s-2); }
.nav__menu .nav__cta:hover { background: #ffc85a; color: var(--ink-900); }

.nav__toggle {
  display: none; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .18);
  background: transparent; border-radius: var(--radius-sm); cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav__bars, .nav__bars::before, .nav__bars::after {
  display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; }
.nav__bars::before { top: -6px; }
.nav__bars::after { top: 6px; }
.nav__toggle[aria-expanded="true"] .nav__bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__bars::before { transform: translateY(6px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Six links, the CTA and the switch need about 1,050 px on one line, so the hamburger
   takes over below 1081 px (keep in step with desktopQuery in app.js). */
@media (max-width: 1080px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-900); border-bottom: 1px solid rgba(255, 255, 255, .1);
    padding: var(--s-2) var(--s-4) var(--s-4); box-shadow: var(--shadow-2);
    display: none;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu a { padding: var(--s-3) var(--s-4); font-size: 1rem; }
  .nav__menu .nav__cta { margin: var(--s-2) 0 0; justify-content: center; }
}

/* Theme switch: iOS-style pill, top right of the navbar. On = dark mode.
   Shown only once theme.js has run (.js), because it does nothing without JavaScript. */
.theme-switch {
  display: none; flex: none; align-items: center; justify-content: center;
  width: 52px; height: 44px; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer;
  border-radius: 999px; -webkit-tap-highlight-color: transparent;
}
.js .theme-switch { display: inline-flex; }
.theme-switch__track {
  position: relative; display: block; width: 50px; height: 30px; border-radius: 999px;
  background: rgba(255, 255, 255, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
  transition: background .25s ease;
}
.theme-switch[aria-checked="true"] .theme-switch__track { background: var(--green-400); box-shadow: none; }
.theme-switch__knob {
  position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s cubic-bezier(.3, .7, .4, 1);
}
.theme-switch[aria-checked="true"] .theme-switch__knob { transform: translateX(20px); }
.theme-switch__icon { width: 16px; height: 16px; fill: none; stroke: var(--ink-700); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-switch__icon--moon { display: none; fill: var(--ink-700); stroke: none; }
.theme-switch[aria-checked="true"] .theme-switch__icon--moon { display: block; }
.theme-switch[aria-checked="true"] .theme-switch__icon--sun { display: none; }
.theme-switch:hover .theme-switch__track { filter: brightness(1.08); }
.theme-switch:focus-visible { outline: 3px solid var(--amber-500); outline-offset: 0; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  color: #fff; padding: clamp(72px, 12vw, 148px) 0 clamp(64px, 9vw, 112px);
  background: var(--ink-900);
}
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; z-index: -2; }
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(100deg, rgba(15, 23, 36, .96) 0%, rgba(15, 23, 36, .90) 45%, rgba(15, 23, 36, .70) 100%),
    linear-gradient(0deg, rgba(15, 23, 36, .55), rgba(15, 23, 36, 0) 40%);
}
.hero__content { max-width: 1160px; }
.hero h1 {
  font-family: Verdana, Geneva, sans-serif;
  font-size: clamp(2.05rem, 1.2rem + 3.9vw, 4rem);
  line-height: 1.12; letter-spacing: -.025em; font-weight: 700;
  color: #fff; max-width: 15ch; margin-bottom: var(--s-5);
}
.hero__lede { font-size: clamp(1.05rem, .98rem + .4vw, 1.25rem); color: #d6deea; max-width: 56ch; margin-bottom: var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero__tags { list-style: none; padding: 0; margin: var(--s-7) 0 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.hero__tags li {
  font-family: var(--font-mono); font-size: .78rem; color: #c9d3e2;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: var(--s-1) var(--s-3);
  background: rgba(15, 23, 36, .5);
}

/* Light theme: the hero turns light too, with a warm paper overlay over the photo and dark
   text. The overlay is near-opaque where the text sits (left), so AA holds over the code. */
:root[data-theme="light"] .hero { color: var(--ink-900); background: var(--paper-tint); border-bottom: 1px solid var(--line); }
:root[data-theme="light"] .hero__overlay {
  background:
    linear-gradient(100deg, rgba(242, 239, 232, .97) 0%, rgba(242, 239, 232, .93) 45%, rgba(242, 239, 232, .78) 100%),
    linear-gradient(0deg, rgba(242, 239, 232, .6), rgba(242, 239, 232, 0) 40%);
}
:root[data-theme="light"] .hero h1 { color: var(--ink-900); }
:root[data-theme="light"] .hero__lede { color: var(--ink-700); }
/* Darker than --amber-800: the small mono eyebrow sits over the photo (5.5:1 measured). */
:root[data-theme="light"] .hero .eyebrow--light { color: #6b4500; }
:root[data-theme="light"] .hero .btn--ghost { border-color: var(--ink-700); color: var(--ink-900); }
:root[data-theme="light"] .hero .btn--ghost:hover { background: rgba(15, 23, 36, .06); color: var(--ink-900); }
:root[data-theme="light"] .hero__tags li { color: var(--ink-700); border-color: rgba(15, 23, 36, .22); background: rgba(255, 255, 255, .7); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: var(--s-3) var(--s-5); border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--amber-500); color: var(--ink-900); }
.btn--primary:hover { background: #ffc85a; color: var(--ink-900); }
.btn--ghost { border-color: rgba(255, 255, 255, .55); color: #fff; background: transparent; }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn--quiet { background: transparent; color: var(--text-muted); border-color: var(--line); }
.btn--quiet:hover { color: var(--heading); border-color: var(--ink-300); }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section--tint { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { margin-bottom: var(--s-5); }
.section__intro { color: var(--text-muted); font-size: 1.08rem; max-width: 62ch; margin-bottom: var(--s-7); }

/* Why now */
.why__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--s-8); align-items: start; margin-top: var(--s-6); }
.prose p { max-width: 62ch; color: var(--text); }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-5);
  box-shadow: var(--shadow-1); display: grid; gap: var(--s-2);
  border-left: 4px solid var(--amber-500);
}
.stat__num { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; color: var(--heading); line-height: 1; letter-spacing: -.02em; }
.stat__label { color: var(--text); }
.stat__src { font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); }

/* Pillars */
.group-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3);
  font-size: 1.15rem; margin: 0 0 var(--s-5); color: var(--heading-2);
}
.group-title + .pillars { margin-bottom: var(--s-8); }
.pillars:last-child { margin-bottom: 0; }
.group-title__tag {
  font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em;
  background: var(--badge-bg); color: var(--amber-500); padding: var(--s-1) var(--s-3); border-radius: 999px;
}
.group-title__tag--alt { background: var(--green-700); color: #fff; }

.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
.pillar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-6); box-shadow: var(--shadow-1); display: flex; flex-direction: column;
  border-top: 4px solid var(--pillar-top);
}
.pillar--alt { border-top-color: var(--success); }
.pillar__head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); }
.pillar__num { font-family: var(--font-mono); font-size: .85rem; color: var(--accent-text); font-weight: 700; }
.pillar__icon { width: 26px; height: 26px; fill: none; stroke: var(--icon); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pillar--alt .pillar__icon { stroke: var(--success); }
.pillar h4 { font-size: 1.25rem; }
.pillar__risk { color: var(--text-muted); }
.pillar__checks { list-style: none; padding: 0; margin: 0 0 var(--s-5); display: grid; gap: var(--s-2); }
.pillar__checks li { position: relative; padding-left: 28px; }
.pillar__checks li::before {
  content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--success); border-bottom: 2.5px solid var(--success);
  transform: rotate(-45deg); transform-origin: left top; translate: 0 2px;
}
.pillar__stakes {
  margin: auto 0 0; padding-top: var(--s-4); border-top: 1px dashed var(--line);
  font-size: .95rem; color: var(--text-muted);
}
.pillar__stakes strong { color: var(--stakes); }

/* Checklist */
.meter {
  position: sticky; top: calc(var(--nav-h) + var(--s-2)); z-index: 5;
  background: var(--ink-900); color: #fff; border-radius: var(--radius);
  padding: var(--s-4) var(--s-5); margin-bottom: var(--s-6); box-shadow: var(--shadow-2);
  border: 1px solid var(--meter-border);
}
.meter__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-3); }
.meter__verdict { font-weight: 700; font-size: 1.05rem; color: var(--amber-500); }
.meter__verdict.is-ready { color: var(--green-400); }
.meter__count { font-family: var(--font-mono); font-size: .9rem; color: #c9d3e2; }
.meter__track { height: 10px; background: var(--ink-700); border-radius: 999px; overflow: hidden; }
.meter__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber-500), var(--green-400)); border-radius: 999px; transition: width .3s ease; }

.checklist { display: grid; gap: var(--s-4); }
.checklist fieldset {
  margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: var(--s-4) var(--s-5) var(--s-3); min-width: 0;
}
.checklist legend {
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--heading); padding: 0 var(--s-2); margin-left: calc(var(--s-2) * -1);
}
.checklist label {
  display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) 0; cursor: pointer;
  border-top: 1px solid var(--divider);
}
.checklist label:first-of-type { border-top: 0; }
.checklist input[type="checkbox"] {
  flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--success); cursor: pointer;
}
.checklist label:has(input:checked) { color: var(--text-muted); }
.checklist__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* Process */
.steps { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4); counter-reset: none; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s-5); box-shadow: var(--shadow-1); }
.step__n {
  display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--badge-bg); color: var(--amber-500); font-family: var(--font-mono); font-weight: 700; margin-bottom: var(--s-3);
}
.step h3 { font-size: 1.15rem; margin-bottom: var(--s-2); }
.step p { color: var(--text-muted); font-size: .95rem; margin: 0; }

/* Documentation pack */
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); margin-top: var(--s-6); }
.doc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s-6); box-shadow: var(--shadow-1); border-top: 4px solid var(--pillar-top);
}
.doc__head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.doc__num { font-family: var(--font-mono); font-size: .85rem; color: var(--accent-text); font-weight: 700; }
.doc__icon { width: 26px; height: 26px; fill: none; stroke: var(--icon); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.doc h3 { font-size: 1.15rem; margin: 0; }
.doc__for { color: var(--text-muted); font-size: .95rem; margin-bottom: var(--s-4); }
.doc__for strong { color: var(--heading-2); }
.doc .pillar__checks { margin: 0; }
.buyer {
  margin-top: var(--s-7); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s-6);
  align-items: center; background: var(--bg-tint); border: 1px solid var(--line); border-left: 4px solid var(--amber-500);
  border-radius: var(--radius); padding: var(--s-6);
}
.buyer h3 { font-size: 1.35rem; margin-bottom: var(--s-3); }
.buyer__text > p { color: var(--text-muted); }
.buyer .pillar__checks { margin: 0; }
.buyer__action { display: flex; flex-direction: column; gap: var(--s-3); }
.buyer__action p { margin: 0; color: var(--text-muted); }

/* CTA band */
.cta { background: var(--ink-900); color: #fff; padding: clamp(64px, 9vw, 104px) 0; }
.cta__inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta h2 { color: #fff; margin: 0 auto var(--s-4); }
.cta p { color: #d6deea; max-width: 58ch; font-size: 1.1rem; margin-bottom: var(--s-6); }
.cta .hero__actions { justify-content: center; }

/* Footer */
.footer { background: #0a101a; color: var(--ink-300); padding: var(--s-7) 0; font-size: .95rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-6); flex-wrap: wrap; }
.footer__text { text-align: right; }
.footer__text p { margin: 0 0 var(--s-2); }
.footer a { color: #e4e9f1; }
.footer a:hover { color: var(--amber-500); }
.footer__small { font-size: .82rem; color: #8a96aa; max-width: 52ch; margin-left: auto !important; }
.brand--footer .brand__name { color: #fff; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buyer { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .why__grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .pillars { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap, .nav__inner { padding: 0 var(--s-4); }
  .pillar, .doc, .buyer { padding: var(--s-5); }
  .buyer__action .btn { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  .hero__actions .btn, .checklist__actions .btn { width: 100%; }
  .hero__tags { margin-top: var(--s-6); }
  .footer__inner { flex-direction: column; }
  .footer__text { text-align: left; }
  .footer__small { margin-left: 0 !important; }
  .checklist fieldset { padding: var(--s-3) var(--s-4) var(--s-2); }
  .meter { padding: var(--s-3) var(--s-4); }
}
@media (max-width: 360px) {
  .nav__inner { gap: var(--s-2); }
  .brand { gap: var(--s-2); }
  .brand__name { font-size: .9rem; }
  .brand__mark { width: 30px; height: 30px; }
}

/* 404 page */
.notfound__title { font-family: var(--font-display); font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); line-height: 1.12; margin-bottom: var(--s-5); max-width: 20ch; }
.footer__text--left { text-align: left; }
/* Keep the 404 footer pinned to the bottom on tall screens */
.page-notfound { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page-notfound main { flex: 1 0 auto; }

/* ── Contact ────────────────────────────────────────────── */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-8); align-items: start; }
.contact__intro .section__intro { margin-bottom: var(--s-6); }
.contact__info { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.contact__info li { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: baseline; overflow-wrap: anywhere; }
.contact__label { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); min-width: 5ch; }

.contact-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: var(--s-6); display: grid; gap: var(--s-4);
}
.contact-form h3 { font-size: 1.25rem; }
.contact-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.field { display: grid; gap: var(--s-1); min-width: 0; }
.field label { font-weight: 600; font-size: .95rem; }
.req { color: var(--accent-text); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--field-bg);
  border: 1px solid var(--field-border); border-radius: var(--radius-sm);
  padding: var(--s-3); min-height: 48px;
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.field select { appearance: none; -webkit-appearance: none; padding-right: var(--s-7);
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right var(--s-4) center; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--heading); }
.field [aria-invalid="true"], .check input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.field__error { margin: 0; min-height: 0; color: var(--danger); font-size: .88rem; font-weight: 600; }
.field__error:empty { display: none; }

.check { display: flex; gap: var(--s-3); align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check[hidden] { display: none; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--success); }

.hp { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp input { width: 1px; height: 1px; padding: 0; border: 0; }
.contact-form__submit { justify-self: start; min-width: 200px; }
.contact-form__submit[disabled] { opacity: .65; cursor: progress; }
.contact-form__status { margin: 0; font-weight: 600; }
.contact-form__status:empty { display: none; }
.contact-form__status.is-ok { color: var(--success); }
.contact-form__status.is-error { color: var(--danger); }
.contact-form__note { margin: 0; font-size: .85rem; color: var(--text-muted); }

@media (max-width: 960px) {
  .contact { grid-template-columns: 1fr; gap: var(--s-6); }
}
@media (max-width: 520px) {
  .contact-form { padding: var(--s-5) var(--s-4); }
  .contact-form__row { grid-template-columns: 1fr; }
  .contact-form__submit { width: 100%; justify-self: stretch; }
}

/* In dark mode the always-dark bands sit on a dark page, so give them an edge. */
:root[data-theme="dark"] .cta,
:root[data-theme="dark"] .footer { border-top: 1px solid var(--line); }
:root[data-theme="dark"] .cta { border-bottom: 1px solid var(--line); }
