:root {
  color-scheme: light;
  --ink: #143039;
  --ink-soft: #425b62;
  --muted: #63757a;
  --line: #dbe2df;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --surface-soft: #f2f5f1;
  --teal: #1e7c78;
  --teal-dark: #105e61;
  --indigo: #405c8a;
  --amber: #a06c18;
  --rose: #8c4354;
  --focus: #0b6ebd;
  --shadow: 0 16px 38px rgba(20, 48, 57, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.58;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(30, 124, 120, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(64, 92, 138, 0.06), transparent 45%);
  z-index: -1;
}

a {
  color: var(--teal-dark);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #0b4d50;
}

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

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

p {
  color: var(--ink-soft);
}

ul {
  padding-left: 1.2rem;
}

li + li {
  margin-top: 0.45rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 20;
  padding: 0.55rem 0.8rem;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
  border-radius: 6px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(219, 226, 223, 0.75);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18rem;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1rem, 1.5vw, 1.24rem);
  font-weight: 760;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  color: var(--teal-dark);
}

.brand-dot {
  margin-left: 0.28rem;
  padding-left: 0.44rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-weight: 640;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem 1rem;
  font-size: 0.94rem;
}

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 650;
}

.nav a:hover {
  color: var(--teal-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.66fr);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: end;
  min-height: 680px;
  padding: clamp(4.5rem, 9vw, 8rem) clamp(1rem, 4vw, 4rem) clamp(3rem, 7vw, 5rem);
  background:
    linear-gradient(135deg, rgba(20, 48, 57, 0.08), transparent 45%),
    linear-gradient(180deg, #ffffff 0%, #f4f3ec 100%);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 780px;
}

.eyebrow,
.kicker {
  margin-bottom: 0.85rem;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1.35rem;
  font-size: clamp(3.2rem, 7.8vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 710px;
  margin-bottom: 1.8rem;
  color: #2f4e58;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  line-height: 1.52;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1rem;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 760;
  text-decoration: none;
}

.button.primary {
  background: var(--teal-dark);
  color: #fff;
}

.button.primary:hover {
  background: #0b4d50;
  color: #fff;
}

.button.secondary {
  border-color: #b9c8c5;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
}

.button.secondary:hover {
  border-color: var(--teal-dark);
  color: var(--teal-dark);
}

.safety-card {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 5px solid var(--amber);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.safety-card h2 {
  margin-bottom: 0.6rem;
  font-size: 1.1rem;
}

.safety-card p {
  margin-bottom: 0.72rem;
  font-size: 0.96rem;
}

.safety-card p:last-child {
  margin-bottom: 0;
}

.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 4vw, 4rem);
}

.intro-grid,
.split-section,
.clinician-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: start;
}

.section-heading {
  max-width: 760px;
  margin-bottom: clamp(1.6rem, 4vw, 2.6rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.08rem;
  line-height: 1.25;
}

.intro-copy {
  display: grid;
  gap: 0.85rem;
  max-width: 780px;
}

.intro-copy p {
  margin: 0;
  font-size: 1.06rem;
}

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding-top: 0;
  padding-bottom: 0;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-band article {
  min-height: 270px;
  padding: clamp(1.2rem, 2.4vw, 2rem);
  background: #f8f8f2;
}

.stat-band strong {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--teal-dark);
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  line-height: 1;
}

.stat-band span {
  display: block;
  margin-bottom: 1rem;
  color: var(--ink-soft);
}

.stat-band a {
  font-size: 0.9rem;
  font-weight: 760;
}

.spectrum-section {
  background: var(--surface);
}

.spectrum-map {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
  padding: clamp(1.1rem, 2.6vw, 1.8rem);
}
.spectrum-title {
  margin: 0 0 1rem;
  font-size: clamp(1.12rem, 2.1vw, 1.45rem);
  font-weight: 760;
  color: var(--ink);
  line-height: 1.25;
}
.spectrum-band {
  position: relative;
  height: 84px;
  border-radius: 999px;
  background: linear-gradient(90deg, #32546b, #57708a 30%, #3f8f91 56%, #aa7a33 80%, #7f3948);
  box-shadow: 0 12px 28px rgba(18, 49, 58, 0.16);
  overflow: hidden;
}
.spectrum-band svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.spectrum-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.2rem;
  margin-top: 1.15rem;
}
.spectrum-stages .stage { border-top: 3px solid var(--line); padding-top: 0.7rem; }
.spectrum-stages .stage:nth-child(1) { border-color: #32546b; }
.spectrum-stages .stage:nth-child(2) { border-color: #57708a; }
.spectrum-stages .stage:nth-child(3) { border-color: #3f8f91; }
.spectrum-stages .stage:nth-child(4) { border-color: #aa7a33; }
.spectrum-stages h3 { margin: 0 0 0.35rem; font-size: 0.98rem; font-weight: 720; color: var(--ink); line-height: 1.25; }
.spectrum-stages p { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.spectrum-note {
  margin-top: 1.2rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.spectrum-note strong { display: block; margin-bottom: 0.2rem; color: var(--ink); font-size: 1rem; }
.spectrum-note .body { color: var(--ink-soft); font-size: 0.92rem; }
@media (max-width: 720px) { .spectrum-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 430px) { .spectrum-stages { grid-template-columns: 1fr; } }

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

.card-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.audience-card,
.clinician-grid article,
.temperament-list article {
  min-height: 100%;
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  border-top: 4px solid transparent;
}

.card:nth-child(3n + 1) {
  border-top-color: var(--teal);
}

.card:nth-child(3n + 2) {
  border-top-color: var(--indigo);
}

.card:nth-child(3n + 3) {
  border-top-color: var(--amber);
}

.card p,
.audience-card p,
.clinician-grid p,
.temperament-list p {
  margin-bottom: 0;
}

.assessment-section {
  background: linear-gradient(180deg, #ffffff 0%, #f3f7f4 100%);
}

.assessment-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(360px, 1.28fr);
  gap: clamp(1.4rem, 4vw, 4rem);
  align-items: start;
}

.assessment-note,
.assessment-tool,
.assessment-result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(20, 48, 57, 0.07);
}

.assessment-note {
  margin-top: 1.3rem;
  padding: 1.1rem;
  border-left: 5px solid var(--indigo);
}

.assessment-note h3,
.assessment-instructions h3,
.result-next h4 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.assessment-note p,
.assessment-instructions p,
.result-next p,
.copy-status {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.assessment-tool {
  display: grid;
  gap: 0.8rem;
  padding: clamp(1rem, 2.2vw, 1.4rem);
}

.assessment-instructions {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.assessment-question {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

/* A styled <legend> mishandles multi-line content (it gets a shrink-to-fit box,
   so long questions wrap per-word and overflow). display:contents removes the
   legend's own box and lets its number + text flow normally inside the fieldset. */
.assessment-question legend { display: contents; }

/* Badge: the leading number span only — inline so the question text flows and
   wraps beside it. */
.assessment-question > legend > span:first-child {
  display: inline-grid;
  place-items: center;
  vertical-align: -0.45em;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.55rem;
  border-radius: 999px;
  background: rgba(30, 124, 120, 0.1);
  color: var(--teal-dark);
  font-size: 0.86rem;
}
.assessment-question > legend > .en,
.assessment-question > legend > .no {
  font-weight: 720;
  line-height: 1.5;
  color: var(--ink);
}
.assessment-question .answer-row { margin-top: 0.85rem; }

.answer-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

/* Modern segmented-button options: the native radio is visually hidden but stays
   keyboard-accessible; the whole label is a tappable pill that fills when chosen. */
.answer-row label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 54px;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}
.answer-row label:hover { border-color: rgba(30, 124, 120, 0.5); }
.answer-row label:active { transform: scale(0.985); }
.answer-row label:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 6px 16px rgba(30, 124, 120, 0.22);
}
.answer-row label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.answer-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.urgent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.8rem 0.9rem;
  border: 1.5px solid rgba(160, 108, 24, 0.5);
  border-radius: 11px;
  background: #fffaf0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  cursor: pointer;
}
.urgent-check:has(input:checked) {
  border-color: var(--amber);
  background: #fdf1d8;
  color: var(--ink);
}
.urgent-check input {
  flex: 0 0 auto;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.12rem;
  accent-color: var(--amber);
}

.question-missing {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(140, 67, 84, 0.12);
}

.form-message,
.copy-status {
  min-height: 1.45rem;
  color: var(--rose);
  font-weight: 680;
}

.assessment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.assessment-result {
  max-width: 920px;
  margin: clamp(1.3rem, 4vw, 2.4rem) auto 0;
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.result-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.result-heading .kicker,
.result-heading h3 {
  grid-column: 1;
  margin-bottom: 0;
}

.result-heading h3 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.score-pill {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 780;
}

.result-next {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 8px;
  background: var(--surface-soft);
}

.result-next ul {
  margin-top: 0.6rem;
}

.result-low {
  border-top: 5px solid var(--teal);
}

.result-moderate {
  border-top: 5px solid var(--amber);
}

.result-high {
  border-top: 5px solid var(--rose);
}

.result-urgent {
  border-top: 5px solid #b42318;
}

.split-section {
  background: #eef4f2;
}

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

.temperament-list article:first-child {
  grid-column: 1 / -1;
  border-left: 5px solid var(--teal);
}

.temperament-list article:nth-child(2) {
  border-left: 5px solid var(--amber);
}

.temperament-list article:nth-child(3) {
  border-left: 5px solid var(--indigo);
}

.temperament-list article:nth-child(4) {
  border-left: 5px solid var(--rose);
}

.temperament-list article:nth-child(5) {
  border-left: 5px solid #5f7f6d;
}

.prepare-section {
  background: var(--surface);
}

.timeline-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.45rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.week-grid span {
  aspect-ratio: 1;
  border-radius: 5px;
}

.week-grid .low {
  background: #536f88;
}

.week-grid .mid {
  background: #6aa09b;
}

.week-grid .high {
  background: #b57925;
}

.check-list {
  margin-bottom: 0;
}

.check-list li::marker {
  color: var(--teal-dark);
}

.audience-section {
  background: #f7f4ea;
}

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

.audience-card {
  background: rgba(255, 255, 255, 0.74);
}

.clinician-section {
  background: var(--ink);
  color: #fff;
}

.clinician-section .kicker {
  color: #75c7c0;
}

.clinician-section p,
.clinician-section h2,
.clinician-section h3 {
  color: #fff;
}

.clinician-section > div > p:not(.kicker),
.clinician-grid p {
  color: #dbe9e6;
}

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

.clinician-grid article {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
}

.sources-section {
  background: var(--surface);
}

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

.source-columns > div {
  padding: 1.2rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-columns ul {
  margin-bottom: 0;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  background: #edf0ea;
  border-top: 1px solid var(--line);
}

.footer p {
  margin: 0;
  font-size: 0.95rem;
}

@media (max-width: 1020px) {
  .hero,
  .intro-grid,
  .split-section,
  .clinician-section,
  .timeline-card,
  .assessment-layout,
  .footer {
    grid-template-columns: 1fr;
  }

  .stat-band,
  .audience-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid.three,
  .source-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero {
    min-height: auto;
    align-items: start;
  }

  .safety-card {
    max-width: 680px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
    width: 100%;
  }

  .hero {
    padding-top: 3rem;
  }

  h1 {
    max-width: 11ch;
    font-size: clamp(2.8rem, 16vw, 4.5rem);
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .stat-band,
  .card-grid.three,
  .answer-row,
  .temperament-list,
  .audience-grid,
  .clinician-grid,
  .source-columns {
    grid-template-columns: 1fr;
  }

  .stat-band article {
    min-height: auto;
  }

  .week-grid {
    gap: 0.32rem;
    padding: 0.75rem;
  }

  .result-heading {
    grid-template-columns: 1fr;
  }

  .score-pill {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }
}

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