:root {
  --bg: #0a1109;
  --bg-2: #0c150e;
  --panel: #101c14;
  --panel-2: #16261b;
  --panel-3: #1c3123;
  --ink: #f1eede;
  --ink-dim: #a3b3a5;
  --ink-faint: #849688;
  --line: rgba(241, 238, 222, 0.09);
  --line-2: rgba(241, 238, 222, 0.16);
  --leather: #cd5d3c;
  --leather-deep: #b04a2c;
  --leather-ink: #180a05;
  --seam: #ecdcbf;
  --pitch: #6fae7a;
  --radius: 14px;
  --gut: clamp(16px, 4vw, 24px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, #16281b 0%, var(--bg-2) 34%, var(--bg) 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.floods {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 46vh;
  max-height: 420px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 22% -10%, rgba(255, 236, 190, 0.11), transparent 60%),
    radial-gradient(120% 90% at 82% -14%, rgba(255, 236, 190, 0.08), transparent 60%);
}

.wrap {
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 var(--gut) 64px;
}

.board {
  padding: clamp(28px, 8vw, 44px) 0 20px;
}

.board-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ball {
  display: inline-block;
  width: 46px;
  height: 46px;
  flex: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cdefs%3E%3CradialGradient id='g' cx='36%25' cy='30%25' r='75%25'%3E%3Cstop offset='0' stop-color='%23e07a54'/%3E%3Cstop offset='0.6' stop-color='%23c65a3a'/%3E%3Cstop offset='1' stop-color='%239b3f22'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='20' cy='20' r='18' fill='url(%23g)' stroke='%237a2f1a' stroke-width='1'/%3E%3Cpath d='M20 2.4 C12.6 11 12.6 29 20 37.6' stroke='%23ecdcbf' stroke-width='1.5' fill='none'/%3E%3Cg stroke='%23ecdcbf' stroke-width='1' stroke-linecap='round'%3E%3Cpath d='M16.7 7.5 L14.3 6.7'/%3E%3Cpath d='M15.2 12 L12.6 11.6'/%3E%3Cpath d='M14.6 17 L11.9 16.9'/%3E%3Cpath d='M14.6 23 L11.9 23.1'/%3E%3Cpath d='M15.2 28 L12.6 28.4'/%3E%3Cpath d='M16.7 32.5 L14.3 33.3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.ball-sm { width: 20px; height: 20px; }
.ball-xs { width: 15px; height: 15px; vertical-align: -2px; }

.brand { flex: 1; min-width: 0; }

.wordmark {
  font-family: var(--mono);
  font-size: clamp(34px, 11vw, 50px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--ink);
}

.tag {
  margin-top: 8px;
  color: var(--ink-dim);
  font-size: clamp(14px, 3.6vw, 16px);
  max-width: 30ch;
}

.readout {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.readout-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.readout-sep {
  flex: 1;
  height: 1px;
  min-width: 12px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}

.langs { display: flex; gap: 6px; }

.lang {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink-dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}

.lang:hover { color: var(--ink); border-color: var(--line-2); }

.lang.on {
  color: var(--leather-ink);
  background: var(--leather);
  border-color: var(--leather);
  font-weight: 600;
}

.progress {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 4px calc(var(--gut) * -1) 8px;
  padding: 12px var(--gut);
  background: linear-gradient(180deg, rgba(10, 17, 9, 0.94), rgba(10, 17, 9, 0.82));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.progress-inner {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.progress-count b { color: var(--ink); }

.progress-word {
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
  border: 1px solid var(--line);
}

.fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--leather-deep), var(--leather));
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.intro {
  color: var(--ink-dim);
  font-size: 15px;
  margin: 8px 0 30px;
  max-width: 48ch;
}

.section { margin: 0 0 12px; }

.section + .section { margin-top: 30px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 22px 0 6px;
}

.section-idx {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--leather);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.section-title {
  font-size: clamp(19px, 5.2vw, 23px);
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-tick {
  flex: none;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: var(--leather);
  align-self: center;
}

.q {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.q-label {
  display: block;
  font-size: 16px;
  font-weight: 550;
  color: var(--ink);
  margin-bottom: 13px;
  text-wrap: balance;
}

.q-opt-note {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 13px;
}

.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 11px 15px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: left;
}

.chip:hover { border-color: var(--pitch); }

.chip.on {
  background: var(--leather);
  border-color: var(--leather);
  color: var(--leather-ink);
  font-weight: 600;
}

.other-wrap { margin-top: 10px; }

.scale { display: flex; gap: 8px; }

.seg {
  flex: 1;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-dim);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  min-height: 50px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.seg:hover { border-color: var(--pitch); }

.seg.on {
  background: var(--leather);
  border-color: var(--leather);
  color: var(--leather-ink);
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

.field {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  border-radius: 11px;
  padding: 13px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea.field { min-height: 92px; resize: vertical; line-height: 1.5; }

.field::placeholder { color: var(--ink-faint); }

.field:focus { outline: none; border-color: var(--leather); box-shadow: 0 0 0 3px rgba(205, 93, 60, 0.22); }

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

.chip:focus-visible, .seg:focus-visible, .lang:focus-visible { outline-offset: 3px; }

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

.submit-wrap { margin-top: 34px; }

.submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 650;
  color: var(--leather-ink);
  background: var(--leather);
  border: none;
  border-radius: 13px;
  padding: 16px 20px;
  min-height: 56px;
  cursor: pointer;
  transition: background 0.16s;
}

.submit:hover { background: #d96b49; }
.submit:active { background: var(--leather-deep); }
.submit[disabled] { opacity: 0.72; cursor: default; }

.submit.loading .ball-sm { animation: spin 0.7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.err {
  color: #ffb9a3;
  background: rgba(176, 74, 44, 0.16);
  border: 1px solid rgba(205, 93, 60, 0.4);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 12px;
}

.fineprint {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.done {
  text-align: center;
  padding: 40px 8px 20px;
}

.done-six {
  font-family: var(--mono);
  font-size: 84px;
  font-weight: 700;
  line-height: 1;
  color: var(--leather);
  letter-spacing: 0.02em;
}

.done-title {
  margin-top: 14px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.done-body {
  margin-top: 10px;
  color: var(--ink-dim);
  font-size: 15.5px;
  max-width: 34ch;
  margin-left: auto;
  margin-right: auto;
}

.foot {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .fill { transition: none; }
  .submit.loading .ball-sm { animation: none; }
}
