:root {
  --paper: #f4f0e7;
  --ink: #111111;
  --yellow: #ecb614;
  --yellow-hover: #d9a70f;
  --muted: #756f64;
  --line: rgba(17, 17, 17, 0.24);
  --soft-line: rgba(17, 17, 17, 0.11);
  --display: "Unbounded", "Arial Black", sans-serif;
  --ui: "DM Sans", "Avenir Next", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.submit-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.brief-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(390px, 32.5vw) minmax(0, 1fr);
}

.masthead {
  min-height: 100vh;
  padding: 48px 54px 44px;
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.masthead::after {
  content: "";
  position: absolute;
  width: 176px;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  left: -96px;
  top: 55%;
  opacity: 0.32;
}

.brand {
  width: fit-content;
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1;
  text-decoration: none;
}
.brand span { color: var(--yellow); }

.edition-line {
  margin-top: clamp(82px, 14vh, 146px);
  padding-top: 18px;
  border-top: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cover-title {
  margin: 25px 0 0;
  font-family: var(--display);
  font-size: clamp(44px, 4vw, 66px);
  font-weight: 700;
  letter-spacing: -0.062em;
  line-height: 0.98;
}

.cover-copy {
  max-width: 320px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.cover-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.cover-footer > div:last-child { padding-top: 11px; border-top: 1px solid var(--ink); }

.round-mark {
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: var(--display);
  transform: rotate(-8deg);
}

.form-panel {
  min-height: 100vh;
  padding: 46px clamp(32px, 4.6vw, 74px) 48px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.progress-header {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.step-count {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--display);
  line-height: 1;
}
.step-count strong { font-size: 18px; }
.step-count span, .autosave {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.progress-track { height: 1px; background: var(--line); overflow: hidden; }
.progress-track span {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 480ms cubic-bezier(0.22, 1, 0.36, 1);
}

.question {
  width: min(900px, 100%);
  margin: auto 0;
  padding: 54px 0 44px;
}
.question-enter { animation: question-in 560ms cubic-bezier(0.22, 1, 0.36, 1) both; }

.eyebrow {
  margin: 0 0 21px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

.question h1, .completion-card h1 {
  max-width: 880px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(35px, 3.6vw, 58px);
  font-weight: 700;
  letter-spacing: -0.058em;
  line-height: 1.08;
}

.helper {
  max-width: 720px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.answer-area { margin-top: 38px; }

.field-shell {
  display: block;
  min-height: 156px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  position: relative;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.field-shell:focus-within { border-color: var(--yellow); background: rgba(255, 255, 255, 0.2); }
.field-shell textarea, .field-shell input, .extra-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.field-shell textarea {
  min-height: 156px;
  padding: 23px 92px 35px 0;
  resize: vertical;
  font-size: 18px;
  line-height: 1.5;
}
.field-shell.single-line { min-height: auto; }
.field-shell.single-line input { padding: 22px 0; font-size: 19px; }
::placeholder { color: #918b80; opacity: 1; }
.char-count {
  position: absolute;
  right: 0;
  bottom: 15px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}
.choice-card {
  min-height: 76px;
  padding: 16px 18px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  transition: background-color 170ms ease, color 170ms ease;
}
.choice-card:hover, .choice-card.selected { background: var(--ink); color: var(--paper); }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card:focus-within { outline: 3px solid rgba(236, 182, 20, 0.6); outline-offset: -3px; }
.choice-number { color: var(--muted); font-family: var(--display); font-size: 10px; }
.choice-card.selected .choice-number, .choice-card:hover .choice-number { color: var(--yellow); }
.choice-mark {
  color: var(--yellow);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 170ms ease, transform 170ms ease;
}
.choice-card.selected .choice-mark, .choice-card:hover .choice-mark { opacity: 1; transform: translate(0, 0); }

.extra-field {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) 1fr;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.extra-field input { padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.extra-field input:focus { border-color: var(--yellow); }
.error-message { margin: 15px 0 0; color: #a23418; font-size: 13px; }

.actions {
  padding-top: 26px;
  border-top: 1px solid var(--soft-line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.back-button, .primary-button {
  min-height: 54px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 170ms ease, background-color 170ms ease, color 170ms ease;
}
.back-button { background: transparent; }
.back-button:hover:not(:disabled) { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.back-button:disabled { opacity: 0.32; cursor: default; }
.primary-button { min-width: 210px; background: var(--yellow); border-color: var(--yellow); }
.primary-button:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); transform: translateY(-2px); }
.primary-button:disabled { cursor: wait; opacity: 0.68; transform: none; }
.back-button:focus-visible, .primary-button:focus-visible { outline: 3px solid rgba(236, 182, 20, 0.42); outline-offset: 3px; }
.action-right { display: flex; align-items: center; gap: 22px; }
.preview-note {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.completion-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
}
.completion-card {
  width: min(940px, 100%);
  min-height: 610px;
  padding: clamp(34px, 6vw, 86px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.completion-card::after {
  content: "";
  position: absolute;
  right: -92px;
  bottom: -120px;
  width: 320px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--yellow);
}
.completion-kicker {
  margin: auto 0 22px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.completion-card h1 { max-width: 680px; }
.completion-card > p:not(.completion-kicker) {
  max-width: 630px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.completion-actions { margin-top: 42px; display: flex; align-items: center; gap: 24px; position: relative; z-index: 1; }
.completion-actions > a { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }

@keyframes question-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .brief-page { grid-template-columns: minmax(300px, 34vw) 1fr; }
  .masthead { padding: 36px 34px; }
  .autosave, .preview-note { display: none; }
  .progress-header { grid-template-columns: auto 1fr; }
  .question h1 { font-size: clamp(32px, 4.4vw, 46px); }
}

@media (max-width: 780px) {
  .brief-page { display: block; }
  .masthead { min-height: auto; padding: 24px 22px 28px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .edition-line { margin-top: 36px; }
  .cover-title { font-size: 39px; }
  .cover-copy, .cover-footer, .masthead::after { display: none; }
  .form-panel { min-height: calc(100vh - 194px); padding: 26px 22px 30px; }
  .question { padding: 46px 0 42px; }
  .choice-grid { grid-template-columns: 1fr; }
  .extra-field { grid-template-columns: 1fr; gap: 8px; }
  .action-right { flex: 1; }
  .primary-button { flex: 1; min-width: 0; }
}

@media (max-width: 480px) {
  .form-panel { min-height: calc(100vh - 179px); }
  .cover-title { font-size: 34px; }
  .question h1, .completion-card h1 { font-size: 31px; }
  .helper { font-size: 15px; }
  .field-shell textarea { padding-right: 0; }
  .actions { gap: 10px; }
  .back-button, .primary-button { padding: 0 15px; gap: 8px; }
  .completion-actions { align-items: stretch; flex-direction: column; }
}

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