:root {
  --bg: #0c1117;
  --bg-elevated: rgba(20, 28, 37, 0.84);
  --bg-card: rgba(17, 23, 31, 0.94);
  --bg-card-hover: rgba(26, 35, 47, 0.98);
  --border: rgba(206, 217, 229, 0.12);
  --border-strong: rgba(206, 217, 229, 0.22);
  --text: #edf2f7;
  --muted: #a4b2c1;
  --soft: #c7d1dc;
  --accent: #d8b782;
  --accent-soft: rgba(216, 183, 130, 0.16);
  --danger: #e6a0a0;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(216, 183, 130, 0.13), transparent 28%),
    radial-gradient(circle at bottom right, rgba(106, 141, 164, 0.14), transparent 24%),
    linear-gradient(180deg, #081018 0%, #0d141d 46%, #0c1117 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
}

.ambient-left {
  top: -10rem;
  left: -8rem;
  background: rgba(216, 183, 130, 0.18);
}

.ambient-right {
  right: -10rem;
  bottom: -8rem;
  background: rgba(85, 126, 151, 0.18);
}

.app {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.panel {
  background: linear-gradient(180deg, rgba(22, 29, 39, 0.9) 0%, rgba(12, 17, 23, 0.96) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero,
.question-layout,
.gate-layout,
.result-layout {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-items: center;
}

.hero-card,
.question-card,
.gate-card,
.result-card {
  padding: clamp(1.5rem, 2vw, 2rem);
}

.hero-card {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
}

.eyebrow,
.section-label,
.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--soft);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}

.section-label strong,
.result-chip strong {
  color: var(--text);
}

h1,
h2,
h3 {
  margin: 0;
}

.title {
  font-family: "Newsreader", serif;
  font-weight: 600;
  font-size: clamp(2.7rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  max-width: 12ch;
}

.subtitle {
  max-width: 62ch;
  color: var(--soft);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.support-list {
  display: grid;
  gap: 0.8rem;
  color: var(--muted);
}

.support-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.support-item::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent) 0%, #e5cfab 100%);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.hero-aside {
  display: grid;
  gap: 1rem;
  align-content: end;
}

.metric-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.metric-card strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text);
  font-size: 1rem;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.6rem;
}

.button,
.ghost-button,
.answer-card,
.back-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    box-shadow 180ms ease;
}

.button {
  min-height: 3.5rem;
  padding: 0.95rem 1.3rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #e7c89a 0%, #cda468 100%);
  color: #11161d;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(205, 164, 104, 0.22);
}

.button:hover,
.ghost-button:hover,
.answer-card:hover,
.back-button:hover {
  transform: translateY(-1px);
}

.ghost-button,
.back-button {
  min-height: 3.3rem;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text);
}

.question-card,
.gate-card,
.result-card {
  display: grid;
  gap: 1.6rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.progress-wrap {
  flex: 1;
  display: grid;
  gap: 0.6rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.progress-bar {
  width: 100%;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #f0dfbe 100%);
  transition: width 280ms ease;
}

.question-title {
  max-width: 16ch;
  font-family: "Newsreader", serif;
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.answer-card {
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-align: left;
  min-height: 8rem;
  display: grid;
  gap: 0.6rem;
  align-content: start;
}

.answer-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.answer-label {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.answer-text {
  font-size: 1.02rem;
  line-height: 1.55;
}

.gate-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
}

.gate-copy p,
.gate-intro {
  margin: 0;
  color: var(--soft);
  line-height: 1.7;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--soft);
  font-size: 0.95rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(8, 13, 18, 0.88);
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(216, 183, 130, 0.65);
  box-shadow: 0 0 0 4px rgba(216, 183, 130, 0.14);
}

.consent {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.consent input {
  margin-top: 0.2rem;
}

.consent p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.error-text,
.success-text {
  margin: 0;
  font-size: 0.95rem;
}

.error-text {
  color: var(--danger);
}

.success-text {
  color: #b8d9c0;
}

.result-header {
  display: grid;
  gap: 0.9rem;
}

.result-title {
  max-width: 16ch;
  font-family: "Newsreader", serif;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.result-section {
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.result-section h3 {
  margin-bottom: 0.7rem;
  font-size: 1rem;
}

.result-section p,
.result-section li {
  color: var(--soft);
  line-height: 1.7;
}

.result-section ul {
  margin: 0;
  padding-left: 1.1rem;
}

.result-intro,
.result-blend,
.result-severity,
.cta-support {
  margin: 0;
  color: var(--soft);
  line-height: 1.75;
  max-width: 72ch;
}

.fade-enter {
  animation: fadeSlide 320ms ease;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .hero-card,
  .gate-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .question-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .question-layout,
  .gate-layout,
  .result-layout {
    min-height: auto;
  }

  .button-row {
    flex-direction: column;
  }

  .button,
  .ghost-button,
  .back-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(calc(100% - 1rem), var(--max-width));
    padding: 0.5rem 0 1.2rem;
  }

  .hero-card,
  .question-card,
  .gate-card,
  .result-card {
    padding: 1.1rem;
  }

  .title,
  .question-title,
  .result-title {
    max-width: none;
  }

  .topbar {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .progress-meta {
    font-size: 0.84rem;
  }
}
