@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/Manrope-Variable.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #163a5a;
  --navy-dark: #0d2940;
  --ink: #101216;
  --muted: #58616a;
  --porcelain: #f8f8f4;
  --paper: #fffefa;
  --source-blue: #e9f0f7;
  --line: #d9dee2;
  --green: #1f7a52;
  --amber: #a6692a;
  --rust: #a34838;
  --shadow: 9px 9px 0 rgba(22, 58, 90, 0.09);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--porcelain); }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(22, 58, 90, 0.035) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--porcelain);
  font-family: "Manrope", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0 auto 0 max(18px, calc((100vw - 1180px) / 2 - 18px));
  width: 1px;
  background: rgba(22, 58, 90, 0.16);
  content: "";
  pointer-events: none;
}

button, input, select { font: inherit; }
button { touch-action: manipulation; }
a { color: inherit; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(31, 122, 82, 0.35);
  outline-offset: 3px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0 56px;
}

.brandbar,
.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-logo { width: 34px; height: 34px; flex: 0 0 auto; }

.brand-mark {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.welcome-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(300px, 0.52fr);
  gap: clamp(44px, 8vw, 108px);
  align-items: center;
  padding: clamp(64px, 10vh, 118px) 0 30px;
}

.welcome-copy {
  position: relative;
  max-width: 720px;
}

.section-index {
  margin: 0 0 42px;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 20px;
  color: var(--navy);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 840px;
  margin-bottom: 22px;
  font-size: clamp(40px, 6.2vw, 78px);
  font-weight: 770;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.question-main h1 {
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1.04;
}

.gate-panel h1,
.contact-summary h1,
.done-panel h1 {
  font-size: clamp(34px, 4.15vw, 54px);
  line-height: 1.04;
}

.lead {
  max-width: 680px;
  margin-bottom: 34px;
  color: #30383f;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.55;
}

.lead.small { font-size: 18px; }

.promise-list {
  display: grid;
  gap: 0;
  max-width: 650px;
  margin: 0 0 38px;
  border-top: 1px solid var(--line);
}

.promise-list p {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.5;
}

.promise-list span { color: var(--navy); font-family: "IBM Plex Mono", monospace; font-size: 11px; }

.primary-button,
.secondary-button {
  min-height: 52px;
  border: 1px solid var(--navy);
  padding: 13px 20px;
  cursor: pointer;
  font-weight: 720;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.primary-button { color: white; background: var(--navy); }
.primary-button:hover:not(:disabled) { background: var(--navy-dark); transform: translateY(-1px); }
.primary-button.compact { min-width: 152px; }
.secondary-button { color: var(--navy); background: transparent; }
.secondary-button:hover:not(:disabled) { background: var(--source-blue); }
button:disabled { cursor: not-allowed; opacity: 0.42; }

.microcopy,
.question-help,
.selection-hint,
.legal-draft {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.microcopy { margin: 16px 0 0; }

.trust-note {
  position: relative;
  align-self: stretch;
  padding: 34px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  background: var(--paper);
}

.trust-note::after {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 34%;
  height: 5px;
  background: var(--navy);
  content: "";
}

.trust-note h2 { margin: 30px 0 14px; font-size: 28px; letter-spacing: -0.035em; }
.trust-note > p:not(.status-line) { color: var(--muted); font-size: 15px; line-height: 1.7; }
.status-line { display: flex; align-items: center; gap: 9px; color: var(--green); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(31, 122, 82, 0.12); }

.trust-note dl { margin: 28px 0 0; }
.trust-note dl div { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.trust-note dt { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 10px; letter-spacing: 0.07em; text-transform: uppercase; }
.trust-note dd { margin: 0; font-size: 13px; line-height: 1.5; }

.progress-copy { width: min(360px, 44vw); }
.progress-copy .mono { display: block; margin-bottom: 9px; text-align: right; }
.progress-copy small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: right; }
.progress-track { height: 3px; overflow: hidden; background: #dfe4e7; }
.progress-track span { display: block; height: 100%; background: var(--navy); transition: width 220ms ease; }

.question-layout {
  display: grid;
  grid-template-columns: minmax(0, 770px) minmax(240px, 1fr);
  gap: clamp(40px, 8vw, 110px);
  padding: clamp(46px, 8vh, 82px) 0 20px;
}

.question-main { min-width: 0; }
.question-help { max-width: 680px; margin: -8px 0 8px; font-size: 15px; }
.question-context { margin: 0 0 16px; color: var(--navy); font-size: 14px; }
.question-context summary { display: list-item; min-height: 44px; padding-block: 11px; cursor: pointer; font-weight: 700; }
.question-context p { margin: 0 0 8px; max-width: 60ch; color: var(--muted); }

.options { display: grid; gap: 10px; margin-top: 30px; }

.option-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 13px;
  align-items: center;
  min-height: 62px;
  width: 100%;
  border: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.82);
  cursor: pointer;
  text-align: left;
  transition: border 140ms ease, background 140ms ease, transform 140ms ease;
}

.option-button:hover { border-color: rgba(22, 58, 90, 0.55); background: var(--paper); }
.option-button.selected { border-color: var(--navy); background: var(--source-blue); box-shadow: inset 4px 0 0 var(--navy); }
.option-index { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.option-label { font-size: 16px; font-weight: 610; line-height: 1.5; }
.option-check { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--line); color: var(--navy); font-size: 14px; }
.option-button.selected .option-check { border-color: var(--navy); color: white; background: var(--navy); }
.selection-hint { margin: 15px 0 0; }

.question-actions,
.gate-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.side-rail {
  position: sticky;
  top: 28px;
  align-self: start;
  margin-top: 48px;
  padding-left: 25px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.side-rail > .mono { color: var(--navy); }
.text-button { border: 0; padding: 0; color: var(--navy); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }

.form-error { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--rust); color: #6f2e24; background: #f7ebe8; font-size: 15px; line-height: 1.6; }

.gate-panel,
.done-panel {
  max-width: 820px;
  margin: clamp(52px, 9vh, 96px) auto 0;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.gate-facts { display: grid; gap: 0; margin: 30px 0 0; border-top: 1px solid var(--line); }
.gate-facts p { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.55; }
.gate-actions { justify-content: flex-start; flex-wrap: wrap; }
.legal-draft { margin: 16px 0 0; color: var(--amber); }
.priority-list { margin-top: 30px; border-top: 1px solid var(--line); }
.priority-list > div { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
.priority-list .mono { color: var(--navy); font-weight: 700; }
.priority-list p { margin: 0; font-size: 16px; font-weight: 700; }
.priority-list small { color: var(--muted); font-size: 13px; text-align: right; }

.contact-grid { align-items: start; padding-top: 64px; }
.contact-summary { position: sticky; top: 24px; }
.summary-card { margin-top: 32px; padding: 26px; border: 1px solid var(--line); border-left: 4px solid var(--navy); background: var(--source-blue); }
.summary-card ol { margin: 18px 0 0; padding-left: 20px; }
.summary-card li { margin: 10px 0; padding-left: 7px; font-size: 14px; line-height: 1.55; }
.scope-warning { margin-top: 20px; color: var(--green); font-size: 13px; line-height: 1.55; }

.contact-form { padding: 32px; border: 1px solid var(--line); border-top: 4px solid var(--navy); background: var(--paper); box-shadow: var(--shadow); }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label, .consent-list legend { font-size: 15px; font-weight: 720; }
.field .optional { color: var(--muted); font-weight: 500; }
.field-help { margin: -2px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.field input, .field select { min-height: 52px; width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 12px 14px; color: var(--ink); background: white; }
.field input:focus, .field select:focus { border-color: var(--navy); }
.contact-channel { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 0 0 20px; border: 0; padding: 0; }
.contact-channel legend { width: 100%; margin-bottom: 2px; font-size: 15px; font-weight: 720; }
.contact-channel label { display: inline-flex; min-height: 42px; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 9px 13px; background: white; font-size: 14px; font-weight: 650; }
.contact-channel input { accent-color: var(--navy); }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.consent-list { display: grid; gap: 0; margin: 30px 0 0; border: 0; padding: 0; }
.consent-list legend { margin-bottom: 10px; }
.consent-row { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line); cursor: pointer; }
.consent-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.consent-row span { color: var(--muted); font-size: 14px; line-height: 1.65; }
.consent-row strong { color: var(--ink); }

.financial-details {
  min-width: 0;
  margin: 24px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.financial-details legend { padding: 0 10px 0 0; color: var(--navy); font-size: 17px; font-weight: 720; }
.financial-details .consent-row { margin-top: 4px; border-top: 0; }
.financial-fields:not([hidden]) { display: grid; gap: 13px; margin-bottom: 15px; }
.financial-fields .field { margin: 0; }
.financial-fields input[aria-invalid="true"] { border-color: var(--amber); }
.financial-fields .form-error { margin: 0; }

.draft-control {
  margin-top: 24px;
  padding: 20px 0;
  border-block: 1px solid var(--line);
  color: var(--muted);
}
.draft-control.compact { margin-top: 26px; padding: 16px 0; }
.draft-control p { margin: 0 0 11px; font-size: 14px; line-height: 1.65; }
.draft-control .mono { color: var(--navy); font-size: 10px; letter-spacing: 0.09em; }
.draft-control .draft-status { display: flex; align-items: center; gap: 9px; color: var(--green); }
.draft-control .microcopy { margin: 8px 0; }
.draft-permission-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; margin: 14px 0; cursor: pointer; }
.draft-permission-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--navy); }
.draft-permission-row span { color: var(--ink); font-size: 14px; line-height: 1.6; }
.draft-control .secondary-button { min-height: 44px; padding: 10px 16px; font-size: 12px; }

.done-shell { display: grid; place-items: center; }
.done-panel { margin: 0; }
.done-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 34px 0; border-block: 1px solid var(--line); }
.done-grid div { padding: 24px 15px; border-right: 1px solid var(--line); }
.done-grid div:last-child { border-right: 0; }
.done-grid .mono { display: block; color: var(--navy); font-size: 23px; }
.done-grid p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.completion-next { margin: 32px 0; padding-block: 24px; border-block: 1px solid var(--line); }
.completion-next h2 { margin: 0 0 16px; font-size: clamp(24px, 4vw, 32px); line-height: 1.25; }
.completion-next p { font-size: 16px; line-height: 1.65; }
.completion-reference {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 24px; margin: 18px 0 6px; padding: 14px 16px;
  border-left: 3px solid var(--navy); background: #e9f0f7;
}
.completion-reference .microcopy, .completion-reference strong { display: block; }
.completion-reference strong { margin-top: 3px; color: var(--navy); font-size: 1rem; overflow-wrap: anywhere; }
.completion-reference .secondary-button { min-height: 44px; }
.completion-next .primary-button { display: inline-flex; align-items: center; gap: 14px; margin-top: 8px; text-decoration: none; }
.completion-preparation { margin-top: 24px; }
.completion-preparation summary { padding-block: 12px; cursor: pointer; font-weight: 700; font-size: 16px; }
.done-panel a:focus-visible, .completion-preparation summary:focus-visible { outline: 3px solid var(--navy); outline-offset: 4px; }

.error-panel { max-width: 700px; margin: 80px auto; padding: 40px; border-top: 4px solid var(--rust); background: var(--paper); }

@media (max-width: 840px) {
  body::before { display: none; }
  .shell { width: min(100% - 28px, 700px); padding-top: 18px; }
  .welcome-grid, .contact-grid, .question-layout { grid-template-columns: 1fr; gap: 34px; }
  .welcome-grid { padding-top: 54px; }
  .trust-note { align-self: auto; }
  .side-rail { display: none; }
  .contact-summary { position: static; }
  .contact-grid { padding-top: 42px; }
  h1 { font-size: clamp(38px, 11vw, 62px); }
  .question-main h1, .gate-panel h1, .contact-summary h1, .done-panel h1 { font-size: clamp(32px, 9.5vw, 52px); }
}

@media (max-width: 520px) {
  .brandbar, .question-header { align-items: flex-start; }
  .progress-copy { width: 45%; }
  .progress-copy .mono { font-size: 9px; }
  .question-layout { padding-top: 38px; }
  .option-button { grid-template-columns: 31px minmax(0, 1fr) 26px; min-height: 58px; padding: 11px 12px; }
  .option-label { font-size: 15px; }
  .question-actions, .gate-actions { align-items: stretch; flex-direction: column-reverse; }
  .priority-summary .gate-actions { flex-direction: column; }
  .question-actions button, .gate-actions button { width: 100%; }
  .contact-form, .gate-panel, .done-panel { padding: 24px 18px; }
  .priority-list > div { grid-template-columns: 40px 1fr; gap: 10px; }
  .priority-list small { grid-column: 2; text-align: left; }
  .draft-control .secondary-button { width: 100%; }
  .done-grid { grid-template-columns: 1fr; }
  .done-grid div { border-right: 0; border-bottom: 1px solid var(--line); }
  .done-grid div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
