:root {
  color-scheme: dark;
  --bg: #070709;
  --surface: #111116;
  --surface-strong: #181820;
  --surface-hover: #20202a;
  --ink: #f4f2f8;
  --muted: #aaa6b3;
  --subtle: #8e8998;
  --accent: #9b7cff;
  --accent-light: #d7cfff;
  --accent-ink: #120d20;
  --line: rgba(244, 242, 248, 0.14);
  --danger: #ff9b94;
  --success: #91d8b7;
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-family: Manrope, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100svh; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, p, dl, dd { margin: 0; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.brief-header {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: 120px minmax(180px, 540px) 120px;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(16px, 4vw, 56px);
  background: rgba(7, 7, 9, .94);
  backdrop-filter: blur(18px);
}
.wordmark { width: max-content; color: var(--ink); font-size: 18px; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.wordmark span { margin-left: 2px; color: var(--accent); }
.progress-wrap { display: grid; grid-template-columns: auto minmax(80px, 1fr); align-items: center; gap: 12px; }
.progress-label { min-width: 86px; color: var(--muted); font-size: 13px; text-align: right; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent-light); transition: width .45s var(--ease); }
.save-status { justify-self: end; padding: 9px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 5px; }
.save-status:hover { color: var(--ink); }

.brief-shell { width: min(100% - 32px, 1120px); min-height: calc(100svh - 156px); margin-inline: auto; display: grid; align-items: center; padding: clamp(48px, 8vw, 112px) 0; }
.question-stage { width: 100%; }
.question-view { animation: question-in .48s var(--ease) both; }
@keyframes question-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: no-preference) {
  .question-view .choice { animation: choice-in .46s var(--ease) both; }
  .question-view .choice:nth-child(2) { animation-delay: 35ms; }
  .question-view .choice:nth-child(3) { animation-delay: 70ms; }
  .question-view .choice:nth-child(4) { animation-delay: 105ms; }
  .question-view .choice:nth-child(5) { animation-delay: 140ms; }
  .question-view .choice:nth-child(6) { animation-delay: 175ms; }
  .question-view .choice:nth-child(7) { animation-delay: 210ms; }
  .question-view .choice:nth-child(8) { animation-delay: 245ms; }
  .question-view .choice:nth-child(9) { animation-delay: 280ms; }
  .question-view .choice:nth-child(10) { animation-delay: 315ms; }
}
@keyframes choice-in { from { opacity: 0; transform: translateY(14px); } }

.question-copy { max-width: 820px; }
.step-context { margin-bottom: 18px; color: var(--accent-light); font-size: 15px; font-weight: 600; }
.question-title { max-width: 900px; font-size: clamp(36px, 6vw, 76px); line-height: .98; letter-spacing: -.055em; font-weight: 600; text-wrap: balance; }
.question-hint { max-width: 700px; margin-top: 24px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }

.choice-grid { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-grid.services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { position: relative; display: block; min-width: 0; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-body {
  position: relative;
  min-height: 104px;
  display: block;
  padding: 18px 56px 18px 18px;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--surface);
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.choice-body:hover { background: var(--surface-hover); transform: translateY(-2px); }
.choice input:focus-visible + .choice-body { outline: 3px solid var(--accent-light); outline-offset: 3px; }
.choice input:checked + .choice-body { border-color: var(--accent); background: #181522; }
.choice-name { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.025em; }
.choice-desc { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.choice-mark { position: absolute; top: 18px; right: 18px; width: 22px; height: 22px; border: 2px solid var(--subtle); border-radius: 50%; transition: border-color .2s, background-color .2s; }
.multi .choice-mark { border-radius: 5px; }
.choice input:checked + .choice-body .choice-mark { border-color: var(--accent-light); background: var(--accent-light); }

.field-wrap { max-width: 820px; margin-top: 48px; }
.text-field, .text-area, .select-field {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--accent-light);
  transition: border-color .2s;
}
.text-field, .select-field { min-height: 64px; padding: 10px 0; font-size: clamp(22px, 3vw, 34px); }
.text-area { min-height: 190px; padding: 14px 0; resize: vertical; font-size: clamp(20px, 2.5vw, 30px); line-height: 1.4; }
.text-field:focus, .text-area:focus, .select-field:focus { border-color: var(--accent-light); outline: 0; }
.text-field::placeholder, .text-area::placeholder { color: var(--subtle); opacity: 1; }
.select-field { color-scheme: dark; }
.file-field { width: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--muted); }
.field-note { margin-top: 12px; color: var(--subtle); font-size: 13px; }

.contact-grid { max-width: 820px; margin-top: 48px; display: grid; gap: 24px; }
.contact-grid .text-field { font-size: 22px; }
.contact-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-method { position: relative; display: block; }
.contact-method input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.contact-method span { min-height: 44px; display: grid; place-items: center; padding: 8px 16px; border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font-weight: 600; transition: transform .2s var(--ease), background-color .2s, color .2s; }
.contact-method span:hover { transform: translateY(-2px); background: var(--surface-hover); color: var(--ink); }
.contact-method input:checked + span { background: var(--accent-light); color: var(--accent-ink); }
.contact-method input:focus-visible + span { outline: 3px solid var(--accent-light); outline-offset: 3px; }

.question-actions { position: sticky; z-index: 8; bottom: 0; margin-top: 48px; padding: 12px 0; display: flex; align-items: center; gap: 12px; background: var(--bg); }
.action {
  min-height: 52px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .2s var(--ease), background-color .2s, color .2s;
}
.action:hover { transform: translateY(-2px); }
.action:active { transform: scale(.98); }
.action-primary { background: var(--accent-light); color: var(--accent-ink); }
.action-primary:hover { background: var(--ink); }
.action-secondary { background: var(--surface-strong); color: var(--ink); }
.action-link { padding-inline: 8px; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 5px; }
.action[disabled] { opacity: .55; cursor: wait; transform: none; }
.error { min-height: 24px; margin-top: 16px; color: var(--danger); font-size: 14px; }

.review-head { display: grid; grid-template-columns: 1fr minmax(260px, .55fr); gap: 48px; align-items: end; }
.review-head p { color: var(--muted); font-size: 18px; }
.review-list { margin-top: 56px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.review-item { min-width: 0; padding: 22px; border-radius: 18px; background: var(--surface); }
.review-item dt { color: var(--subtle); font-size: 13px; }
.review-item dd { margin-top: 9px; overflow-wrap: anywhere; font-size: 17px; white-space: pre-wrap; }
.review-item.is-wide { grid-column: 1 / -1; }
.consent { max-width: 760px; margin-top: 28px; display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; color: var(--muted); font-size: 14px; }
.consent input { width: 20px; height: 20px; accent-color: var(--accent); }
.consent a { color: var(--ink); text-underline-offset: 4px; }

.success-view { max-width: 900px; }
.success-mark { width: max-content; min-height: 44px; display: grid; place-items: center; padding: 8px 16px; border-radius: 999px; background: var(--success); color: #092016; font-size: 15px; font-weight: 700; }
.success-view h1 { margin-top: 32px; font-size: clamp(48px, 8vw, 96px); line-height: .92; letter-spacing: -.06em; font-weight: 600; }
.success-view > p { max-width: 640px; margin-top: 28px; color: var(--muted); font-size: 19px; }
.success-summary { margin-top: 40px; padding: 24px; border-radius: 18px; background: var(--surface); }
.success-summary strong { display: block; margin-bottom: 8px; }
.success-summary p { white-space: pre-wrap; }
.success-links { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

.notice { padding: 32px; border-radius: 18px; background: var(--surface); }
.notice h1 { font-size: 36px; }
.notice p { margin-top: 16px; color: var(--muted); }
.notice a { color: var(--accent-light); }

.brief-footer { width: min(100% - 32px, 1120px); margin-inline: auto; min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 13px; }
.brief-footer div { display: flex; gap: 18px; }
.brief-footer a { text-underline-offset: 4px; }
.brief-footer a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .brief-header { grid-template-columns: auto 1fr; min-height: 72px; }
  .progress-wrap { grid-template-columns: 1fr; gap: 6px; }
  .progress-label { min-width: 0; text-align: left; }
  .save-status { display: none; }
  .choice-grid.services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-head { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 560px) {
  .brief-shell { min-height: calc(100svh - 140px); padding: 40px 0 56px; }
  .question-title { font-size: 40px; line-height: 1.02; }
  .question-hint { margin-top: 18px; }
  .choice-grid, .choice-grid.services { margin-top: 32px; grid-template-columns: 1fr; }
  .choice-body { min-height: 92px; padding: 18px 52px 18px 18px; }
  .field-wrap, .contact-grid { margin-top: 36px; }
  .contact-grid { gap: 16px; }
  .contact-methods { display: grid; grid-template-columns: repeat(2, 1fr); }
  .contact-method:last-child { grid-column: 1 / -1; }
  .question-actions { margin-top: 36px; flex-wrap: wrap; }
  .action-primary { flex: 1; }
  .review-list { margin-top: 36px; grid-template-columns: 1fr; }
  .review-item.is-wide { grid-column: auto; }
  .brief-footer { min-height: 112px; align-items: flex-start; flex-direction: column; justify-content: center; }
}

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

@media (prefers-reduced-transparency: reduce) {
  .brief-header { background: var(--bg); backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --muted: #d4d0db; --subtle: #c3becb; --line: rgba(255, 255, 255, .38); }
}
