:root {
  --ink: #253029;
  --muted: #69746b;
  --forest: #395744;
  --forest-deep: #263f31;
  --sage: #e6ede1;
  --sage-strong: #86977c;
  --cream: #f7f3ea;
  --paper: #fffdf9;
  --gold: #be9d61;
  --line: rgba(45, 70, 54, 0.15);
  --danger-soft: #f7e8e0;
  --shadow: 0 22px 64px rgba(43, 61, 48, 0.13);
  --radius-lg: 30px;
  --radius-md: 19px;
  --gug-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(190, 157, 97, 0.13), transparent 28%),
    radial-gradient(circle at 100% 18%, rgba(134, 151, 124, 0.18), transparent 30%),
    var(--cream);
  font-family: var(--gug-font);
  line-height: 1.58;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(57, 87, 68, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 87, 68, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 14px;
  z-index: 200;
  padding: 9px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--forest-deep);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px max(22px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
  mix-blend-mode: multiply;
}

.brand span {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-family: var(--gug-font);
  font-size: 1.04rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.72rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-badge {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--forest);
  background: var(--sage);
  font-size: 0.72rem;
  font-weight: 780;
}

.journey-status {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 10px max(22px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.93);
  backdrop-filter: blur(14px);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(57, 87, 68, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--forest));
  transition: width 300ms ease;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

#profile-app {
  min-height: calc(100vh - 230px);
  padding: clamp(22px, 3vw, 36px) 0 24px;
  outline: none;
}

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

h1,
h2 {
  font-family: var(--gug-font);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.1rem, 4.4vw, 4rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 15px;
  color: var(--forest);
  font-size: 0.75rem;
  font-weight: 820;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead,
.question-heading > p,
.result-heading > p {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(0.94rem, 1.3vw, 1.08rem);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 760;
}

.button-primary {
  color: #fff;
  background: var(--forest-deep);
  box-shadow: 0 10px 24px rgba(38, 63, 49, 0.17);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #183022;
}

.button-secondary {
  color: var(--forest-deep);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.button-quiet,
.text-button {
  color: var(--forest);
  border-color: transparent;
  background: transparent;
}

.button-disabled {
  width: 100%;
  color: var(--muted);
  border-color: var(--line);
  background: #f0f1ec;
  cursor: not-allowed;
}

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

.intro-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 30px;
  align-items: center;
}

.intro-heading {
  max-width: 760px;
  font-size: clamp(2rem, 3.2vw, 3.1rem);
  line-height: 1.12;
}

.intro-panel > div:first-child {
  max-width: 800px;
}

.intro-actions,
.question-actions,
.result-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.intro-facts {
  display: grid;
  gap: 9px;
}

.intro-facts article {
  display: flex;
  min-height: 72px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
}

.intro-facts strong {
  min-width: 62px;
  color: var(--forest);
  font-family: var(--gug-font);
  font-size: 2rem;
  font-weight: 500;
}

.intro-facts span {
  color: var(--muted);
  font-size: 0.9rem;
}

.privacy-note,
.test-warning {
  grid-column: 1 / -1;
  padding: 13px 16px;
  border: 1px solid rgba(190, 157, 97, 0.3);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 235, 0.8);
}

.privacy-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.question-shell.narrow,
.result-shell {
  width: min(940px, 100%);
  margin: 0 auto;
}

.question-heading {
  margin-bottom: 22px;
}

.question-heading h1 {
  max-width: 880px;
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  line-height: 1.14;
}

.topic-group + .topic-group {
  margin-top: 38px;
}

.topic-group h2 {
  margin-bottom: 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
}

.topic-card,
.priority-card {
  position: relative;
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 125px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  cursor: pointer;
}

.topic-card:hover,
.topic-card:focus-visible,
.priority-card:hover,
.priority-card:focus-visible {
  border-color: rgba(57, 87, 68, 0.42);
  background: #fff;
}

.topic-card.selected,
.priority-card.selected {
  border-color: var(--forest);
  background: var(--sage);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.topic-card strong {
  margin-top: auto;
}

.topic-card small,
.priority-card small {
  color: var(--muted);
}

.topic-check {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest);
  font-weight: 800;
}

.sticky-actions {
  position: sticky;
  bottom: 14px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 35px;
  padding: 12px 14px 12px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sticky-actions span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.priority-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.priority-card {
  min-height: 86px;
  padding: 13px 15px;
}

.priority-card > span {
  font-family: var(--gug-font);
  font-size: 1.12rem;
  font-weight: 650;
}

.priority-card small {
  font-size: 0.78rem;
  line-height: 1.35;
}

.question-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.answer-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.answer-grid.compact {
  grid-template-columns: repeat(2, 1fr);
}

.answer-card {
  position: relative;
  display: flex;
  min-height: 74px;
  gap: 12px;
  align-items: center;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.answer-card:hover {
  border-color: rgba(57, 87, 68, 0.4);
  background: #fff;
}

.answer-card:has(input:checked) {
  border-color: var(--forest);
  background: var(--sage);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.answer-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.answer-indicator {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(57, 87, 68, 0.35);
  border-radius: 50%;
  background: #fff;
}

.answer-card:has(input:checked) .answer-indicator {
  border: 7px solid var(--forest);
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.compact-screen .eyebrow {
  margin-bottom: 9px;
}

.compact-screen .question-heading > p {
  margin-bottom: 0;
}

.question-meta span,
.result-flags span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
}

.region-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.region-field input,
dialog input,
dialog textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
}

.result-heading {
  margin-bottom: 48px;
}

.result-class {
  display: inline-flex;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--forest-deep);
  background: var(--sage);
  font-weight: 780;
}

.result-section + .result-section {
  margin-top: 70px;
}

.section-head {
  max-width: 720px;
  margin-bottom: 25px;
}

.section-head h2 {
  margin-bottom: 12px;
}

.section-head p {
  color: var(--muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.category-card,
.result-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.category-card > span,
.result-card-head > span {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.category-card h3 {
  margin: 28px 0 7px;
}

.category-card p {
  margin: 0;
  color: var(--muted);
}

.result-grid {
  display: grid;
  gap: 14px;
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.result-card h3 {
  margin: 26px 0 9px;
  font-family: var(--gug-font);
  font-size: 1.65rem;
  font-weight: 500;
}

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

.result-card ul,
.why-panel ul {
  padding-left: 20px;
}

.result-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}

.why-panel,
.safety-panel {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 35px;
  margin-top: 70px;
  padding: clamp(25px, 5vw, 48px);
  border-radius: var(--radius-lg);
}

.why-panel {
  color: #fff;
  background: var(--forest-deep);
}

.why-panel .eyebrow {
  color: #d9bd86;
}

.why-panel h2 {
  margin-bottom: 0;
}

.why-panel ul {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.safety-panel {
  display: block;
  margin-top: 0;
  background: var(--danger-soft);
}

.safety-panel h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.empty-state,
.error-panel {
  padding: 25px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.result-actions {
  margin-top: 30px;
}

.human-companion {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 8px 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
}

.companion-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--forest);
  background: var(--sage);
}

.human-companion p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 0;
  cursor: pointer;
  font-weight: 760;
}

footer {
  display: flex;
  width: min(1180px, calc(100% - 32px));
  gap: 30px;
  justify-content: space-between;
  margin: 0 auto;
  padding: 30px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

footer p {
  max-width: 620px;
  margin: 0;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

dialog {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100vh - 30px);
  overflow: auto;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 25px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 25px 90px rgba(24, 42, 30, 0.3);
}

dialog::backdrop {
  background: rgba(27, 41, 31, 0.54);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.dialog-head h2 {
  margin-bottom: 15px;
  font-size: clamp(2rem, 5vw, 3.1rem);
}

.icon-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-size: 1.4rem;
}

.test-warning {
  margin-bottom: 20px;
  font-size: 0.86rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-wide {
  grid-column: 1 / -1;
}

.consent-box {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--sage);
}

.consent-box legend {
  padding: 0 5px;
  font-weight: 780;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.88rem;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  margin-top: 2px;
}

.form-feedback {
  min-height: 24px;
  color: var(--forest);
  font-weight: 700;
}

.noscript {
  margin: 20px;
  padding: 20px;
  border: 1px solid #a33;
  background: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .intro-panel,
  .why-panel {
    grid-template-columns: 1fr;
  }

  .intro-facts {
    grid-template-columns: repeat(3, 1fr);
  }

  .intro-facts article {
    display: grid;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 68px;
    padding: 8px 12px;
  }

  .brand img {
    width: 44px;
    height: 44px;
  }

  .brand strong {
    font-size: 0.9rem;
  }

  .brand small,
  .preview-badge {
    display: none;
  }

  .header-actions .button {
    min-height: 40px;
    padding: 8px 11px;
    font-size: 0.74rem;
  }

  .journey-status {
    padding-inline: 14px;
  }

  .app-shell,
  footer {
    width: min(100% - 22px, 1180px);
  }

  #profile-app {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }

  .question-heading h1,
  .intro-heading {
    font-size: clamp(1.75rem, 7vw, 2.35rem);
  }

  .intro-facts,
  .topic-grid,
  .priority-list,
  .answer-grid,
  .answer-grid.compact,
  .category-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    min-height: 110px;
  }

  .form-wide {
    grid-column: 1;
  }

  .question-actions,
  .result-actions,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .question-actions .button,
  .result-actions .button,
  .dialog-actions .button {
    width: 100%;
  }

  .sticky-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .human-companion {
    grid-template-columns: auto 1fr;
  }

  .human-companion .text-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  footer {
    flex-direction: column;
  }
}

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

@media (forced-colors: active) {
  .topic-card,
  .priority-card,
  .answer-card,
  .result-card,
  .category-card,
  dialog {
    border: 2px solid CanvasText;
  }
}
