:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #ebe7dc;
  --text: #20231f;
  --muted: #666b61;
  --line: #d6d0c2;
  --green: #1f6b4a;
  --green-dark: #174c37;
  --blue: #265f8f;
  --yellow: #e0b23b;
  --danger: #a94735;
  --shadow: 0 18px 45px rgba(38, 45, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 30px;
  background: rgba(255, 255, 252, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--green);
  border-radius: 8px;
  color: white;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.brand-text {
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 15px;
}

.brand-text small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

nav {
  align-items: center;
  display: flex;
  gap: 8px;
  font-size: 14px;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-cta {
  margin-left: 4px;
  background: var(--green);
  color: white;
}

.nav-cta:hover {
  background: var(--green-dark);
  color: white;
}

.hero {
  display: grid;
  min-height: calc(88vh - 64px);
  padding: 64px 24px;
  background:
    linear-gradient(90deg, rgba(16, 27, 22, 0.72), rgba(16, 27, 22, 0.44)),
    url("https://images.unsplash.com/photo-1504917595217-d4dc5ebe6122?auto=format&fit=crop&w=1800&q=80") center/cover;
  color: white;
}

.hero-inner {
  align-self: center;
  width: min(980px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  max-width: 880px;
  font-size: clamp(42px, 8vw, 88px);
}

h2 {
  font-size: clamp(28px, 4vw, 44px);
}

h3 {
  font-size: 22px;
}

.lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: white;
}

.button.primary:hover {
  background: var(--green-dark);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.42);
  color: white;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.diagnosis,
.results,
.types {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.intro-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.intro {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 52px;
  align-items: center;
}

.intro-copy {
  max-width: 650px;
}

.intro p,
.section-heading p {
  color: var(--muted);
}

.intro-copy p {
  max-width: 590px;
  margin: 20px 0 0;
  font-size: 17px;
}

.summary-panel {
  padding: 30px;
  background: #f7f7f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.summary-panel ul {
  margin-bottom: 0;
  padding-left: 22px;
}

.summary-panel li + li {
  margin-top: 10px;
}

.diagnosis-band {
  background: #efede6;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 28px;
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.step-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 28px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

#question-counter {
  color: var(--green);
}

.top-progress {
  width: calc(100% - 56px);
  margin: 0 28px 16px;
}

.question {
  display: none;
  grid-template-columns: 1fr;
  gap: 38px;
  min-height: 260px;
  margin: 0;
  padding: 34px 28px 28px;
  border: 0;
}

.question.active {
  display: grid;
}

.question-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  font-weight: 800;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.35;
}

.question-number {
  color: var(--green);
  font-size: 14px;
  text-transform: uppercase;
}

.choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 18px 10px 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.choice span::before {
  content: "";
  position: absolute;
  top: 12px;
  width: 14px;
  height: 14px;
  border: 2px solid #a8aa9e;
  border-radius: 999px;
}

.choice input:checked + span {
  background: #dcebe3;
  border-color: var(--green);
  color: var(--green-dark);
  transform: translateY(-2px);
}

.choice input:checked + span::before {
  background: var(--green);
  border-color: var(--green);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.button.ghost {
  background: var(--surface-2);
  color: var(--text);
}

.progress-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.hidden {
  display: none;
}

.top-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.main-result {
  grid-column: 1 / -1;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.main-result-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
}

.main-result-head h3 {
  font-size: clamp(26px, 4vw, 40px);
}

.main-result-head p:not(.eyebrow),
.result-summary,
.next-action p {
  color: var(--muted);
}

.main-score {
  min-width: 150px;
  padding: 20px;
  background: #e8f0ea;
  border: 1px solid #c9dccc;
  border-radius: 8px;
  color: var(--green-dark);
  text-align: center;
}

.main-score strong {
  display: block;
  font-size: 48px;
  line-height: 1;
}

.main-score span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 900;
}

.result-summary {
  max-width: 850px;
  margin: 22px 0 0;
  font-size: 17px;
}

.result-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.result-detail {
  padding: 18px;
  background: #f7f7f3;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-detail h4,
.next-action h4 {
  margin: 0;
  font-size: 15px;
}

.result-detail ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.result-detail li + li {
  margin-top: 8px;
}

.next-action {
  margin-top: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.result-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.result-action.primary-action {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.result-card,
.axis-wrap,
.all-types {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.result-card {
  padding: 24px;
}

.rank {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.score {
  margin: 14px 0 8px;
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

.band {
  display: inline-flex;
  padding: 4px 8px;
  background: #e8f0ea;
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
}

.result-card p {
  color: var(--muted);
}

.mini-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.fake-cta {
  display: block;
  margin-top: 18px;
  padding: 12px;
  background: var(--green);
  border-radius: 6px;
  color: white;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.axis-wrap,
.feedback-panel,
.all-types {
  margin-top: 22px;
  padding: 24px;
}

.feedback-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.rating-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.rating-buttons button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.rating-buttons button.selected,
.rating-buttons button:hover {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.feedback-message {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.axis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.axis-pill {
  padding: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  font-weight: 800;
}

.axis-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.type-row {
  display: grid;
  grid-template-columns: 190px 1fr 62px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.type-row:first-child {
  border-top: 0;
}

.bar {
  height: 12px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.type-grid span {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 800;
}

.site-footer {
  padding: 28px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.article-main {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.article-prose {
  padding: 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article-prose h1 {
  max-width: none;
  font-size: clamp(34px, 6vw, 56px);
}

.article-prose h2 {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: clamp(24px, 4vw, 34px);
}

.article-prose h3 {
  margin-top: 28px;
}

.article-prose p,
.article-prose li {
  color: var(--muted);
  font-size: 17px;
}

.article-prose a {
  color: var(--green);
  font-weight: 900;
}

@media (max-width: 800px) {
  .site-header {
    padding: 0 14px;
  }

  nav {
    gap: 4px;
    font-size: 12px;
  }

  nav a {
    min-height: 34px;
    padding: 0 7px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-text small {
    display: none;
  }

  .brand-text strong {
    font-size: 13px;
  }

  .nav-cta {
    display: none;
  }

  .hero {
    min-height: 620px;
    padding: 44px 20px 52px;
  }

  .intro,
  .top-results,
  .result-detail-grid,
  .main-result-head {
    grid-template-columns: 1fr;
  }

  .main-result {
    padding: 22px;
  }

  .article-prose {
    padding: 26px 20px;
  }

  .main-score {
    width: 100%;
  }

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

  .form-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #progress-text {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }

  .form-footer .button {
    grid-row: 2;
  }

  .question {
    min-height: auto;
    padding: 28px 18px 34px;
  }

  .choice span {
    min-height: 58px;
    justify-content: flex-start;
    padding: 12px 14px 12px 44px;
    text-align: left;
  }

  .choice span::before {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .axis-grid,
  .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .type-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}
