:root {
  --ink: #111;
  --paper: #fff;
  --muted: #747474;
  --soft: #444;
  --line: #cfcfcf;
  --subtle: #f4f4f2;
  --danger: #7a1e1e;
  --success: #1c5e32;
  --max: 1080px;
  --gutter: clamp(1.25rem, 4vw, 3.25rem);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.65; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.skip-link { position: fixed; z-index: 2000; top: .75rem; left: .75rem; padding: .75rem 1rem; background: #fff; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; z-index: 1000; top: 0; background: #fff; color: #111; }
.site-header::after { content: ""; position: absolute; right: 0; bottom: -5px; left: 0; height: 10px; background: #111; clip-path: polygon(0 34%,8% 27%,17% 42%,28% 30%,40% 42%,52% 29%,64% 42%,77% 29%,89% 41%,100% 34%,100% 67%,89% 60%,77% 71%,64% 61%,52% 71%,40% 61%,28% 72%,16% 60%,0 68%); }
.header-inner { width: min(1180px, calc(100% - 2 * var(--gutter))); min-height: 82px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: 1rem; text-decoration: none; }
.brand img { display: block; width: 42px; height: 52px; object-fit: contain; }
.brand-copy { display: grid; line-height: 1; }
.brand-name { font-size: 1rem; font-weight: 700; letter-spacing: -.04em; }
.brand-name span { color: #929292; font-weight: 400; }
.brand-sub { margin-top: .45rem; font-size: .65rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.header-context { font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

.hub-shell, .form-shell { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.hero { padding: clamp(5rem, 10vw, 9rem) 0 clamp(3rem, 7vw, 6rem); }
.compact-hero { max-width: 850px; }
.eyebrow, .card-kicker { margin: 0 0 .75rem; font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 13ch; margin-bottom: 1.75rem; font-size: clamp(3.25rem, 6vw, 6.25rem); line-height: .94; letter-spacing: -.055em; }
h2 { max-width: 19ch; margin-bottom: 1.25rem; font-size: clamp(2.15rem, 3.6vw, 3.75rem); line-height: 1; letter-spacing: -.045em; }
h3 { margin-bottom: .85rem; font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.08; letter-spacing: -.03em; }
.lede { max-width: 42rem; margin-bottom: 2rem; color: var(--soft); font-size: clamp(1.15rem, 1.5vw, 1.42rem); }
.discovery-grid { padding: 0 0 7rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
.section-heading { grid-column: 1 / -1; margin-bottom: 1.5rem; }
.discovery-card { min-height: 270px; padding: clamp(1.5rem, 3vw, 2.5rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; border: 1px solid; }
.muted-card { color: #666; }

.button, .text-button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .95rem 1.3rem; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .075em; text-decoration: none; text-transform: uppercase; transition-property: background-color, color, scale; transition-duration: .16s; }
.button:hover, .button:focus-visible { background: #fff; color: var(--ink); }
.button:active, .text-button:active { scale: .96; }
.button.secondary { background: #fff; color: var(--ink); }
.button.secondary:hover, .button.secondary:focus-visible { background: var(--ink); color: #fff; }
.button.small { min-height: 38px; padding: .65rem .85rem; font-size: .7rem; }
.button.disabled, .button:disabled { border-color: #aaa; background: #eee; color: #777; pointer-events: none; }
.text-button { min-height: auto; margin-left: .75rem; padding: .4rem 0; border: 0; border-bottom: 1px solid; background: transparent; color: var(--ink); }
.text-button:hover, .text-button:focus-visible { border-bottom-color: transparent; }
.site-footer { padding: 3rem var(--gutter); background: #111; color: #d4d4d4; font-size: .85rem; }

.form-shell { padding-bottom: 5rem; }
.form-intro { max-width: 850px; padding: clamp(5rem, 9vw, 8rem) 0 2.5rem; }
.form-intro h1 { font-size: clamp(3rem, 5.6vw, 5.5rem); }
.meta-strip { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1.5rem 0; }
.meta-pill { padding: .55rem .75rem; border: 1px solid; font-size: .78rem; font-weight: 700; letter-spacing: .035em; }
.notice { margin: 1.5rem 0; padding: 1.25rem 1.4rem; border: 1px solid; border-left: 5px solid; background: #fff; }
.notice p:last-child { margin-bottom: 0; }
.progress-wrap { position: sticky; z-index: 900; top: 87px; margin-bottom: 2rem; padding: .85rem 0 .7rem; background: #fff; border-bottom: 1px solid; }
.progress-row { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.progress-track { height: 5px; overflow: hidden; background: #e4e4e4; }
.progress-bar { width: 0; height: 100%; background: #111; transition: width .2s ease; }
.form-section { margin: 0 0 1.5rem; padding: clamp(1.5rem, 4vw, 3.25rem); border: 1px solid; }
.form-section > .section-copy { max-width: 760px; margin-bottom: 2rem; }
.respondent-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.respondent-section .section-copy { grid-column: 1 / -1; }
.field { min-width: 0; margin: 0 0 1.75rem; }
.field:last-child { margin-bottom: 0; }
fieldset.field { padding: 0; border: 0; }
.field label, .field legend { display: block; margin-bottom: .5rem; font-weight: 700; }
.help { margin: -.1rem 0 .65rem; color: var(--muted); font-size: .9rem; }
.question-number { display: inline-grid; width: 1.85rem; height: 1.85rem; margin-right: .65rem; place-items: center; background: #111; color: #fff; font-size: .72rem; line-height: 1; vertical-align: middle; }
input[type="text"], input[type="email"], textarea, select { width: 100%; padding: .8rem .85rem; border: 1px solid #999; background: #fff; color: var(--ink); outline: none; }
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(17, 17, 17, .2); outline-offset: 3px; border-color: #111; }
.textarea-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .55rem; }
.dictation-state { color: var(--muted); font-size: .8rem; }
.dictate-stop { background: var(--ink); color: #fff; }

.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.choice-list label { display: flex; align-items: flex-start; gap: .65rem; min-height: 54px; padding: .75rem; border: 1px solid #bbb; background: #fff; font-size: .9rem; line-height: 1.35; transition-property: background-color, color, border-color; transition-duration: .14s; }
.choice-list label:has(input:checked) { border-color: #111; background: #111; color: #fff; }
.choice-list input, .situation-choice input { flex: 0 0 auto; margin-top: .22rem; accent-color: #111; }
.choice-list.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.selection-count { margin: -.1rem 0 1rem; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.situation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.situation-choice { display: flex; align-items: flex-start; gap: .8rem; padding: 1rem; border: 1px solid #bbb; background: #fff; transition-property: background-color, color, border-color; transition-duration: .14s; }
.situation-choice:has(input:checked) { border-color: #111; background: #111; color: #fff; }
.situation-choice-copy { display: grid; gap: .35rem; line-height: 1.4; }
.situation-choice-copy strong { font-size: 1rem; line-height: 1.25; }
.situation-choice-copy > span { font-size: .86rem; opacity: .78; }

.pattern-card { margin: 1.25rem 0; padding: clamp(1.25rem, 3vw, 2.25rem); border: 1px solid; background: #fafaf8; }
.pattern-card h3 { max-width: 28ch; }
.pattern-situation { max-width: 760px; margin-bottom: 2rem; color: var(--soft); }
.pattern-questions > .field { padding-top: 1.5rem; border-top: 1px solid; }
.pattern-questions > .field:first-child { padding-top: 0; border-top: 0; }
.privacy-confirmation { margin: 2rem 0; padding: 1.25rem; border: 1px solid; }
.privacy-confirmation label { display: flex; align-items: flex-start; gap: .75rem; font-weight: 700; }
.privacy-confirmation input { margin-top: .38rem; }
.form-actions { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 5rem; }
.backup-warning { max-width: 32rem; margin: .75rem 0 0; color: var(--muted); font-size: .82rem; }
.status { min-height: 1.5em; margin-top: .55rem; color: var(--muted); font-size: .9rem; }
.status.error { color: var(--danger); }
.status.success { color: var(--success); }
.warning-list { padding-left: 1.25rem; }
.dialog { width: min(620px, calc(100% - 2rem)); padding: 2rem; border: 1px solid; border-radius: 0; box-shadow: 0 18px 60px rgba(0, 0, 0, .2); }
.dialog::backdrop { background: rgba(17, 17, 17, .55); }
.dialog-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1.5rem; }
.runtime-banner { margin: 0 0 1.25rem; padding: 1rem; border: 1px solid #b49522; background: #fff6d8; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .header-inner { min-height: 72px; }
  .brand img { width: 36px; height: 44px; }
  .header-context { font-size: .68rem; }
  .discovery-grid, .respondent-section, .choice-list, .choice-list.compact, .situation-list { grid-template-columns: 1fr; }
  .site-header { position: relative; }
  .progress-wrap { top: 0; }
  .progress-row { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .form-intro { padding-top: 4.5rem; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions > button { width: 100%; }
  .text-button { margin: .75rem 0 0; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
}

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