:root {
  --ink: #0b1d60;
  --ink-soft: #3a4670;
  --ink-mute: #535c76;
  --accent: #576bff;
  --accent-deep: #2844bb;
  --paper: #f8f7f2;
  --paper-lo: #ecebe3;
  --card: rgba(255, 255, 255, .78);
  --line: rgba(11, 29, 96, .1);
  --line-strong: rgba(11, 29, 96, .2);
  --danger: #c2334d;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  font-family: var(--font); color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

.glow {
  position: fixed; inset: -20vh -10vw auto auto; width: 70vw; height: 80vh; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(87, 107, 255, .22), transparent 70%);
  filter: blur(20px); animation: drift 18s var(--ease) infinite alternate;
}
@keyframes drift { to { transform: translate(-12vw, 18vh) scale(1.15); } }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px clamp(16px, 4vw, 48px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.topbar-tag { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); letter-spacing: .04em; }

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 96px);
  max-width: 1240px; margin: 0 auto; padding: clamp(16px, 4vh, 48px) clamp(16px, 4vw, 48px) 80px;
  align-items: start;
}

/* ---------- Intro ---------- */
.intro { position: sticky; top: 32px; animation: rise .9s var(--ease) both; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; color: var(--accent-deep); }
.intro h1 { font-size: clamp(2.2rem, 4.4vw, 3.9rem); line-height: 1; letter-spacing: -.055em; margin: 16px 0 20px; font-weight: 800; }
.lead { font-size: 1.06rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 28px; max-width: 34em; }

.timeline { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; margin: 0 0 28px; }
.timeline li {
  position: relative; padding: 12px 10px 10px; border-radius: 14px; background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line); font-weight: 600; font-size: .9rem; letter-spacing: -.01em;
  animation: rise .8s var(--ease) both; animation-delay: calc(.15s + var(--i, 0) * .07s);
}
.timeline li:nth-child(1) { --i: 1; } .timeline li:nth-child(2) { --i: 2; } .timeline li:nth-child(3) { --i: 3; }
.timeline li:nth-child(4) { --i: 4; } .timeline li:nth-child(5) { --i: 5; background: var(--ink); color: #fff; border-color: var(--ink); }
.timeline span { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-mute); margin-bottom: 4px; font-weight: 500; }
.timeline li:nth-child(5) span { color: #c3ccff; }

.criteria { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; color: var(--ink-soft); }
.criteria li { padding-left: 18px; position: relative; line-height: 1.5; }
.criteria li::before { content: ""; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.criteria b { color: var(--ink); }

.attribution-note {
  display: flex; gap: 10px; margin: 0; padding: 14px 16px; border-radius: 16px;
  background: rgba(87, 107, 255, .09); color: var(--accent-deep); font-size: .93rem; line-height: 1.45; font-weight: 500;
}

/* ---------- Card ---------- */
.stage { position: relative; animation: rise 1s var(--ease) .1s both; }
.card {
  position: relative; background: var(--card); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 32px; padding: clamp(24px, 3.4vw, 40px);
  box-shadow: 0 2px 4px rgba(11, 29, 96, .04), 0 40px 80px -36px rgba(11, 29, 96, .35);
  overflow: hidden;
}
.progress { position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--line); }
.progress i { display: block; height: 100%; width: 12.5%; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); border-radius: 0 3px 3px 0; transition: width .7s var(--ease); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }
.saved { opacity: 0; transition: opacity .4s; }
.saved.show { opacity: 1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.steps { position: relative; transition: height .6s var(--ease); overflow: clip; overflow-clip-margin: 10px; }
.step {
  position: absolute; inset: 0 0 auto 0; border: 0; margin: 0; padding: 0; min-width: 0;
  opacity: 0; visibility: hidden; transform: translateY(24px); pointer-events: none;
  transition: opacity .45s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
.step.is-active { position: relative; opacity: 1; visibility: visible; transform: none; pointer-events: auto; transition: opacity .55s var(--ease) .08s, transform .7s var(--ease) .08s, visibility 0s; }
.step.is-leaving-up { transform: translateY(-24px); }
.step legend { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 750; letter-spacing: -.045em; line-height: 1.08; padding: 0; margin-bottom: 8px; }
.hint { margin: 0 0 22px; color: var(--ink-mute); line-height: 1.5; }
.sub { margin: 18px 0 10px; font-weight: 600; font-size: .92rem; }
em { font-style: normal; font-weight: 400; color: var(--ink-mute); font-size: .85em; margin-left: 4px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: block; position: relative; margin-bottom: 14px; }
.field > span { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, .85); border-radius: 14px;
  padding: 13px 15px; font-size: 1rem; outline: none; resize: vertical;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field textarea { line-height: 1.5; min-height: 52px; }
.field.big input { font-size: 1.35rem; font-weight: 650; letter-spacing: -.02em; padding: 15px 16px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 5px rgba(87, 107, 255, .14); }
.field input::placeholder, .field textarea::placeholder { color: #9aa1b8; }
.field .invalid, .field input.invalid, .field textarea.invalid { border-color: var(--danger); animation: shake .4s; }
.count { display: block; min-height: 1em; margin-top: 5px; text-align: right; font-family: var(--mono); font-size: 11px; color: #9aa1b8; }
.count.short { color: var(--accent-deep); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips button {
  border: 1.5px solid var(--line-strong); background: rgba(255, 255, 255, .7); border-radius: 999px;
  padding: 12px 20px; font-weight: 600; cursor: pointer;
  transition: transform .35s var(--ease), background .25s, color .25s, border-color .25s, box-shadow .25s;
}
.chips.small button { padding: 8px 14px; font-size: .9rem; }
.chips button:hover { transform: translateY(-2px); border-color: var(--accent); }
.chips button:active { transform: scale(.96); }
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 10px 24px -12px rgba(11, 29, 96, .7); }
.chips[data-single] button { font-size: 1.05rem; padding: 16px 24px; }
.chips.invalid { animation: shake .4s; }
.step .chips + .field { margin-top: 22px; }

.preview {
  position: relative; border-radius: 22px; padding: 22px; margin-bottom: 20px; color: #fff; overflow: hidden;
  background: radial-gradient(24rem 14rem at 100% 0%, rgba(87, 107, 255, .55), transparent 70%), var(--ink);
  box-shadow: 0 30px 60px -30px rgba(11, 29, 96, .7);
}
.preview-tag { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: #c3ccff; }
.preview h3 { margin: 8px 0 6px; font-size: 1.45rem; letter-spacing: -.035em; line-height: 1.15; }
.preview p { margin: 0 0 18px; color: #c8cee6; line-height: 1.45; }
.preview-by { display: flex; align-items: center; gap: 10px; font-size: .92rem; color: #c8cee6; }
.preview-by b { color: #fff; }
.avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; }

.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line-strong); cursor: pointer; line-height: 1.45; font-size: .93rem; color: var(--ink-soft); transition: border-color .25s, background .25s; }
.consent:has(input:checked) { border-color: var(--accent); background: rgba(87, 107, 255, .07); }
.consent.invalid { border-color: var(--danger); animation: shake .4s; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent-deep); flex: none; }
.consent b { color: var(--ink); }

.error { min-height: 1.4em; margin: 6px 0 0; color: var(--danger); font-size: .9rem; font-weight: 500; }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.kbd { margin-left: auto; font-size: 12px; color: var(--ink-mute); }
kbd { font-family: var(--mono); font-size: 11px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line-strong); background: #fff; }
.primary, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; cursor: pointer;
  font-weight: 650; text-decoration: none; transition: transform .35s var(--ease), box-shadow .3s, background .3s, opacity .3s;
}
.primary { border: 0; padding: 15px 26px; background: var(--ink); color: #fff; box-shadow: 0 14px 30px -14px rgba(11, 29, 96, .8); position: relative; overflow: hidden; }
.primary::after { content: "→"; transition: transform .35s var(--ease); }
.primary:hover { transform: translateY(-2px); background: var(--accent-deep); box-shadow: 0 18px 34px -14px rgba(40, 68, 187, .8); }
.primary:hover::after { transform: translateX(4px); }
.primary.is-submit { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); }
.primary[disabled] { opacity: .6; cursor: progress; transform: none; }
.ghost { border: 0; background: none; padding: 12px 6px; color: var(--ink-mute); }
.ghost:hover { color: var(--ink); }
#backBtn[hidden] { display: inline-flex; visibility: hidden; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Done ---------- */
.done { text-align: center; padding-block: clamp(40px, 6vw, 64px); animation: pop .8s var(--ease) both; }
.done h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.045em; margin: 18px 0 12px; }
.done p { color: var(--ink-soft); line-height: 1.6; max-width: 30em; margin: 0 auto 28px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.check { width: 72px; height: 72px; }
.check circle { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .8s var(--ease) .15s forwards; }
.check path { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s var(--ease) .7s forwards; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(12px); } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 28px; }
  .intro { position: static; }
  .topbar-tag { display: none; }
}
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .timeline { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .timeline li { padding: 9px 6px 8px; font-size: .74rem; border-radius: 10px; }
  .timeline span { font-size: 9px; }
  .card { border-radius: 26px; }
  .kbd { display: none; }
  .chips[data-single] button { padding: 14px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
