:root {
  --paper: #f3f5f4;
  --surface: #ffffff;
  --ink: #17212c;
  --ink-2: #4c5866;
  --ink-3: #7a8592;
  --rule: #d3d9db;
  --accent: #0f6660;
  --accent-tint: #e3efed;
  --rec: #8a5d06;
  --rec-tint: #f5ead2;
  --danger: #a3261d;
  --trace-fill: #17212c;
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: 'kern', 'liga';
}

a { color: var(--accent); text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Seismic trace: one wavelet per answered question */
.trace-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 56px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

.trace { display: block; width: 100%; height: 100%; }
.trace-count {
  position: absolute;
  right: 12px;
  bottom: 4px;
  margin: 0;
  padding: 0 6px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 960px) { .trace-count { display: none; } }
.trace .baseline { stroke: var(--rule); stroke-width: 1; }
.trace .ticks line { stroke: var(--ink-3); stroke-width: 1; }
.trace .wave-fill { fill: var(--trace-fill); }
.trace .bar-fill { fill: var(--accent); transition: width 200ms; }
.trace .wave-line { fill: none; stroke: var(--trace-fill); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.trace .ghost { opacity: .7; }
.trace .ghost path { fill: none; stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trace .wavelet { transform-box: view-box; transform-origin: 0 30px; }
.trace .wavelet.enter { animation: rise 420ms cubic-bezier(.2,.7,.2,1); }

@keyframes rise {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 960px) {
  .layout { grid-template-columns: 240px minmax(0, 700px); gap: 64px; padding: 0 32px; }
}

/* Section index */
.toc { display: none; }

@media (min-width: 960px) {
  .toc {
    display: block;
    position: sticky;
    top: 88px;
    align-self: start;
    padding-top: 72px;
    font-size: 14px;
  }
}

.toc-count { margin: 0 0 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li { margin: 0; }
.toc a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
}
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); border-left-color: var(--accent); }
.toc .n { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.toc .n.full { color: var(--accent); }

/* Intro */
.intro { padding: 56px 0 40px; border-bottom: 1px solid var(--rule); }
@media (min-width: 960px) { .intro { padding-top: 72px; } }

.intro-client { margin: 0 0 20px; color: var(--ink-2); font-weight: 500; }

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 14ch;
}

.intro-project {
  margin: 16px 0 0;
  font-size: 20px;
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 36ch;
}

.intro-body { margin-top: 28px; max-width: 62ch; }
.intro-body p { margin: 0 0 12px; }
.intro-meta { margin: 20px 0 0; color: var(--ink-3); font-size: 15px; }

/* Sections and questions */
.section { padding: 48px 0 8px; }

.section > h2 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.legal {
  margin: 20px 0 8px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  border-radius: 2px;
  font-size: 15.5px;
}
.legal h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.legal ul { margin: 0; padding-left: 18px; }
.legal li { margin: 0 0 8px; }
.legal li::marker { color: var(--ink-3); }
.legal .src { margin: 12px 0 0; font-size: 14px; color: var(--ink-3); }

.q {
  margin: 0;
  padding: 28px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
.q:last-child { border-bottom: 0; }

/* Follow-up: hangs off the question above it */
.q-follow {
  margin-left: 2.4em;
  padding: 20px 0 20px 20px;
  border-left: 2px solid var(--accent);
  border-bottom: 1px solid var(--rule);
}
.q-follow .q-title { font-size: 17px; grid-template-columns: 2.8em 1fr; }
.q-follow .q-body { margin-left: 2.8em; }
@media (max-width: 520px) {
  .q-follow { margin-left: 0; padding-left: 14px; }
  .q-follow .q-body { margin-left: 0; }
}

.q legend { float: left; width: 100%; padding: 0; }
.q legend + * { clear: both; }

.q-title {
  display: grid;
  grid-template-columns: 2.4em 1fr;
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
}
.q-num { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }

.q-body { margin-left: 2.4em; }
@media (max-width: 520px) { .q-title { grid-template-columns: 2em 1fr; } .q-body { margin-left: 0; } }

.q-why { margin: 6px 0 0; color: var(--ink-2); font-size: 15.5px; max-width: 60ch; }
.q-hint { margin: 14px 0 0; color: var(--ink-3); font-size: 14px; }

.options { display: grid; gap: 8px; margin-top: 12px; }

.opt {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms;
}
.opt:hover { border-color: var(--ink-3); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.opt input {
  appearance: none;
  margin: 3px 0 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink-3);
  background: var(--surface);
  display: grid;
  place-content: center;
}
.opt input[type="radio"] { border-radius: 50%; }
.opt input[type="checkbox"] { border-radius: 3px; }
.opt input:checked { border-color: var(--accent); background: var(--accent); }
.opt input[type="radio"]:checked::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--surface);
}
.opt input[type="checkbox"]:checked::before {
  content: '';
  width: 9px; height: 5px;
  border: 2px solid var(--surface);
  border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg);
}
.opt input:focus-visible { outline: none; }

.opt-label { display: block; }
.opt-note { display: block; margin-top: 4px; font-size: 14.5px; color: var(--ink-2); }

.opt.rec { border-left: 3px solid var(--rec); padding-left: 12px; }
.opt.rec:has(input:checked) { border-left-color: var(--rec); }
.rec-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 8px;
  border-radius: 3px;
  background: var(--rec-tint);
  color: var(--rec);
  font-size: 13px;
  font-weight: 500;
}

.comment { margin-top: 12px; }
.comment textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  resize: vertical;
}
.comment textarea::placeholder { color: var(--ink-3); }
.comment textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }

.discuss {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.discuss input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* Respondent + submit */
.respondent { margin-top: 32px; padding: 40px 0 16px; border-top: 2px solid var(--ink); }
.respondent h2 { margin: 0 0 20px; font-size: 26px; font-weight: 600; letter-spacing: -0.015em; }

.fields { display: grid; gap: 16px; }
@media (min-width: 640px) { .fields { grid-template-columns: 1fr 1fr; } .fields .field:first-child { grid-column: 1 / -1; } }

.field span { display: block; margin-bottom: 6px; font-size: 15px; color: var(--ink-2); }
.field input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 1px var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }

.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }

button {
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
button:hover { border-color: var(--ink-3); }
button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
button.primary:hover { background: var(--accent); border-color: var(--accent); }
button:disabled { opacity: .6; cursor: progress; }

.submit-status { margin: 0; font-size: 15px; color: var(--ink-2); }
.submit-status.error { color: var(--danger); }

.done { margin-top: 32px; padding: 40px 0 16px; border-top: 2px solid var(--accent); }
.done:focus { outline: none; }
.done h2 { margin: 0 0 12px; font-size: 26px; font-weight: 600; }
.done p { margin: 0; max-width: 62ch; }
.done-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.foot { padding: 48px 0 64px; color: var(--ink-3); font-size: 14px; }
.foot p { margin: 0 0 4px; }

@media (prefers-reduced-motion: reduce) {
  .trace .wavelet.enter { animation: none; }
  .opt { transition: none; }
}

@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .trace-bar, .toc, .submit-row, .done-actions, .discuss:not(:has(input:checked)), .hp { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .done { display: none !important; }
  .q { break-inside: avoid; }
  .opt { border-color: #bbb; background: #fff; }
  .opt:not(:has(input:checked)) { color: #777; }
  .comment textarea { border-color: #bbb; min-height: 0; resize: none; }
  .comment textarea:placeholder-shown { display: none; }
}

/* Home: one short card, no brief list */
.home { max-width: 700px; margin: 0 auto; padding: 0 16px; }
.home .intro { border-bottom: 0; padding-top: 96px; }
