:root {
  --ink: #2e2926;
  --muted: #746c66;
  --cream: #f8f3ed;
  --paper: #fffdf9;
  --rose: #bb5f62;
  --rose-dark: #97484d;
  --rose-soft: #f2ddda;
  --sage: #687c6c;
  --line: #ded5cd;
  --shadow: 0 22px 70px rgba(77, 49, 43, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(187, 95, 98, 0.12), transparent 30rem),
    radial-gradient(circle at 92% 82%, rgba(104, 124, 108, 0.12), transparent 32rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
}

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.privacy-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(104, 124, 108, 0.12);
}

.app-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 180px);
  margin: 20px auto 48px;
  display: grid;
  place-items: center;
}

.welcome-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(40px, 8vw, 110px);
  align-items: center;
}

.eyebrow {
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, .question-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  max-width: 680px;
  margin: 20px 0 26px;
  font-size: clamp(58px, 7.3vw, 102px);
  line-height: 0.93;
  letter-spacing: -0.035em;
}

.intro {
  max-width: 570px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.promise-list {
  display: flex;
  gap: 24px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 13px;
}

.promise-list span::before {
  content: "✓";
  color: var(--sage);
  margin-right: 7px;
}

.card {
  position: relative;
  padding: clamp(28px, 5vw, 52px);
  background: rgba(255, 253, 249, 0.88);
  border: 1px solid rgba(222, 213, 205, 0.9);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.name-card::before {
  content: "";
  position: absolute;
  width: 100px;
  height: 100px;
  top: -24px;
  right: -24px;
  border: 1px solid var(--rose-soft);
  border-radius: 50%;
  z-index: -1;
}

.card h2 {
  margin-bottom: 12px;
  font-size: 38px;
}

.card-subtitle {
  margin-bottom: 28px;
  color: var(--muted);
  line-height: 1.55;
}

.field { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 15px 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms;
}

input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(187, 95, 98, 0.1);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms, background 160ms, opacity 160ms;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }

.btn-primary {
  color: white;
  background: var(--rose);
  box-shadow: 0 9px 24px rgba(187, 95, 98, 0.24);
}

.btn-primary:hover { background: var(--rose-dark); }
.btn-wide { width: 100%; margin-top: 10px; }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--line);
}

.form-error { margin: 4px 0 12px; color: var(--rose-dark); font-size: 13px; }

.share-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  text-align: left;
}

.share-link input { min-width: 0; color: var(--muted); font-size: 13px; }
.copy-status { min-height: 20px; margin: 10px 0 2px; color: var(--sage); font-size: 12px; }
.completion-share { width: min(610px, 100%); margin: 28px auto 0; }
.completion-share .card-subtitle { margin-bottom: 12px; text-align: center; }
.room-reminder { margin: 22px 0 0; color: var(--muted); font-size: 13px; }

.waiting-dots { display: flex; justify-content: center; gap: 7px; margin-top: 28px; }
.waiting-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  animation: wait-pulse 1.2s infinite ease-in-out;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.15s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wait-pulse {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-4px); }
}

.quiz-wrap { width: min(840px, 100%); }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 16px;
}

.progress-person { font-weight: 700; }
.progress-count { color: var(--muted); font-size: 13px; }

.progress-track {
  height: 4px;
  margin-bottom: 34px;
  overflow: hidden;
  background: var(--line);
  border-radius: 10px;
}

.progress-fill {
  height: 100%;
  background: var(--rose);
  transition: width 280ms ease;
}

.question-card { min-height: 475px; }

.question-number {
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.question-title {
  max-width: 690px;
  margin: 22px 0 14px;
  font-size: clamp(27px, 3.8vw, 42px);
  line-height: 1.12;
}

.question-note-text,
.question-prompt { display: inline-block; }

.question-note-text { font-weight: 700; }

.question-prompt {
  margin-top: 5px;
  font-size: calc(1em - 2pt);
}

.question-note { color: var(--muted); line-height: 1.6; }

.answer-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 38px;
}

.answer-btn {
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all 150ms;
}

.answer-btn:hover { border-color: var(--rose); transform: translateY(-2px); }
.answer-btn.selected { color: white; background: var(--rose); border-color: var(--rose); }

.quiz-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
}

.text-btn {
  padding: 10px 0;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
}

.handoff-card { width: min(610px, 100%); text-align: center; }

.seal {
  width: 76px;
  height: 76px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  color: var(--rose-dark);
  background: var(--rose-soft);
  border-radius: 50%;
  font-size: 30px;
}

.handoff-card h2 { font-size: clamp(40px, 6vw, 60px); }
.handoff-card .btn { margin-top: 18px; }

.results-wrap { width: min(920px, 100%); padding-top: 20px; }
.results-hero { text-align: center; margin-bottom: 44px; }
.results-hero h1 { max-width: none; margin: 14px auto 20px; font-size: clamp(50px, 7vw, 82px); }
.results-hero p { color: var(--muted); font-size: 17px; }

.match-summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 16px;
  color: var(--sage);
  background: rgba(104, 124, 108, 0.1);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.matches { display: grid; gap: 14px; }

.match-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  background: rgba(255, 253, 249, 0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.match-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--rose-dark);
  background: var(--rose-soft);
  border-radius: 50%;
}

.match-card h3 { margin-bottom: 5px; font-size: 16px; }
.match-card p { margin: 0; color: var(--muted); font-size: 13px; }

.match-level {
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty-state { text-align: center; }
.empty-state p { max-width: 580px; margin: 12px auto 0; color: var(--muted); line-height: 1.7; }

.conversation-note {
  margin: 28px 0;
  padding: 24px;
  color: var(--muted);
  background: rgba(104, 124, 108, 0.08);
  border-radius: 18px;
  line-height: 1.65;
}

.conversation-note strong { color: var(--ink); }
.results-actions { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }

footer {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}


.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;
}

select {
  width: 100%;
  padding: 15px 42px 15px 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid rgba(151, 72, 77, 0.42);
  outline-offset: 3px;
}

.category-picker {
  margin: 6px 0 20px;
  padding: 14px 16px;
  text-align: left;
  background: rgba(104, 124, 108, 0.06);
  border-radius: 12px;
}

.category-picker summary { cursor: pointer; font-weight: 700; }
.category-picker > p { margin: 10px 0; color: var(--muted); font-size: 13px; }
.category-options { display: grid; gap: 9px; }
.category-options label,
.consent-toggle { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 400; }
.category-options input,
.consent-toggle input { width: 18px; height: 18px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--rose); }

.quiz-intro {
  margin: 24px 0 6px;
  padding: 20px;
  text-align: left;
  background: rgba(104, 124, 108, 0.07);
  border-radius: 16px;
}
.quiz-intro > p { color: var(--muted); line-height: 1.55; }
.scope-summary { font-size: 13px; }
.answer-guide { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 16px 0; }
.answer-guide span { padding: 9px; background: rgba(255,255,255,.72); border-radius: 9px; font-size: 11px; line-height: 1.35; }
.answer-guide strong { display: block; color: var(--ink); }
.consent-reminder { font-size: 12px; }
.consent-toggle { padding-top: 14px; border-top: 1px solid var(--line); line-height: 1.45; }

.answer-grid { padding: 0; border: 0; }
.answer-btn { position: relative; display: grid; place-items: center; }
.answer-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.answer-btn:focus-within { outline: 3px solid rgba(151, 72, 77, 0.42); outline-offset: 2px; }
.quiz-error { min-height: 20px; margin: 14px 0 0; color: var(--rose-dark); font-size: 13px; }
.connection-status { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.danger-btn { margin-top: 18px; color: var(--rose-dark); text-decoration: underline; }
.danger-action { background: var(--rose-dark); }

.result-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -18px 0 24px; }
.result-filter,
.plan-chip {
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.result-filter[aria-pressed="true"],
.plan-chip[aria-pressed="true"] { color: white; background: var(--sage); border-color: var(--sage); }
.match-card[hidden] { display: none; }
.match-content { min-width: 0; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.result-row + .result-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.result-row-title { font-size: 14px; line-height: 1.45; }
.direction-results { margin-top: 14px; }
.difference-level { color: var(--sage); }
.result-plans { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }

@media (max-width: 760px) {
  .site-header { width: min(100% - 28px, 1120px); padding-top: 18px; }
  .privacy-pill { font-size: 0; }
  .app-shell { width: min(100% - 28px, 1120px); margin-top: 8px; }
  .welcome-grid { grid-template-columns: 1fr; gap: 42px; }
  h1 { font-size: clamp(52px, 17vw, 80px); }
  .promise-list { flex-direction: column; gap: 9px; }
  .card { border-radius: 22px; }
  .answer-grid { grid-template-columns: 1fr; gap: 8px; }
  .answer-btn { min-height: 48px; }
  .answer-guide { grid-template-columns: 1fr 1fr; }
  .result-row { grid-template-columns: 1fr; gap: 8px; }
  .result-plans { display: grid; grid-template-columns: 1fr; }
  .plan-chip { width: 100%; }
  .question-card { min-height: auto; }
  .match-card { grid-template-columns: 42px 1fr; }
  .match-icon { width: 42px; height: 42px; }
  .match-level { grid-column: 2; }
  .results-actions { flex-direction: column; }
  .share-link { grid-template-columns: 1fr; }
}

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

@media print {
  .site-header, footer, .results-actions, .result-filters, .result-plans, .conversation-note, .grain { display: none; }
  body { background: white; }
  .app-shell { width: 100%; margin: 0; display: block; }
  .results-hero { margin-bottom: 24px; }
  .match-card { break-inside: avoid; background: white; }
}
