:root {
  --ink: #13211d;
  --ink-soft: #33443d;
  --paper: #f8f2e7;
  --paper-strong: #fffaf0;
  --cedar: #94472f;
  --cedar-dark: #693323;
  --field: #6c7d44;
  --field-dark: #3f5131;
  --wheat: #d5a848;
  --sand: #e8d6b4;
  --line: rgba(19, 33, 29, 0.16);
  --shadow: 0 24px 70px rgba(48, 35, 22, 0.18);
  --red: #ba3a24;
  --yellow: #c89119;
  --green: #407447;
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Avenir Next", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 12% 14%, rgba(213, 168, 72, 0.36), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(108, 125, 68, 0.28), transparent 24rem),
    linear-gradient(135deg, #fbf5eb 0%, #ead8b9 52%, #d7c298 100%);
  min-height: 100vh;
}

body::before {
  background-image:
    linear-gradient(rgba(19, 33, 29, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 33, 29, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.hero,
main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
}

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

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 50%;
  color: var(--paper);
  display: grid;
  height: 42px;
  place-items: center;
  width: 42px;
}

.topbar-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
}

.hero-grid {
  align-items: stretch;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr);
}

.hero-copy,
.assessment-shell,
.report-dialog {
  backdrop-filter: blur(22px);
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 40px;
  position: relative;
  width: 100%;
}

.assessment-shell {
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 42px);
}

.hero-copy::after {
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(19, 33, 29, 0.12) 48% 52%, transparent 52%),
    linear-gradient(45deg, transparent 0 46%, rgba(148, 71, 47, 0.14) 46% 54%, transparent 54%);
  bottom: -70px;
  content: "";
  height: 240px;
  position: absolute;
  right: -80px;
  transform: rotate(-12deg);
  width: 280px;
}

.eyebrow {
  color: var(--cedar-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

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

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

h1,
h2 {
  font-family: "Fraunces", "Georgia", serif;
  letter-spacing: 0;
  line-height: 1.05;
}

h1 {
  font-size: 4.4rem;
  hyphens: none;
  line-height: 1.02;
  max-width: 920px;
  text-wrap: balance;
  word-break: normal;
}

h2 {
  font-size: 3rem;
}

h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

p {
  line-height: 1.62;
}

.hero-text {
  color: var(--ink-soft);
  font-size: 1.12rem;
  max-width: 760px;
}

.hero-lead {
  color: var(--ink);
  font-size: clamp(1.3rem, 2vw, 1.85rem);
  font-weight: 900;
  line-height: 1.28;
}


.hero-note {
  background: rgba(108, 125, 68, 0.14);
  border: 1px solid rgba(63, 81, 49, 0.2);
  border-radius: 999px;
  color: var(--field-dark);
  display: inline-flex;
  font-weight: 900;
  margin: 4px 0 0;
  padding: 8px 12px;
}

.hero-actions,
.form-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 48px;
  padding: 14px 20px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(213, 168, 72, 0.78);
  outline-offset: 3px;
}

.button-primary {
  background: var(--ink);
  box-shadow: 0 16px 34px rgba(19, 33, 29, 0.22);
  color: var(--paper);
}

.button-primary:hover {
  background: #1e322c;
}

.button-secondary {
  background: rgba(255, 250, 240, 0.78);
  border: 1px solid var(--line);
  color: var(--ink);
}


.assessment-heading {
  max-width: 920px;
}

.assessment-progress {
  background: rgba(255, 250, 240, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-top: 18px;
  padding: 14px;
}

.progress-copy {
  align-items: center;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-track {
  background: rgba(19, 33, 29, 0.12);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

#progress-bar {
  background: linear-gradient(90deg, var(--cedar), var(--field));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.assessment-layout {
  align-items: start;
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 30px;
  width: 100%;
}

.assessment-form {
  display: grid;
  gap: 22px;
}

.category-section {
  background: rgba(255, 250, 240, 0.74);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
}

.category-header {
  background:
    linear-gradient(135deg, rgba(19, 33, 29, 0.96), rgba(63, 81, 49, 0.92)),
    var(--ink);
  color: var(--paper);
  padding: 24px;
}

.category-header h3 {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 10px;
}

.category-header p {
  color: rgba(255, 250, 240, 0.76);
  margin-bottom: 0;
}

.question-card {
  border: 0;
  border-top: 1px solid var(--line);
  display: grid;
  margin: 0;
  min-width: 0;
  padding: 18px;
}

.question-card legend {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.35;
  padding: 0;
}

.question-card-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.question-card-kicker,
.question-card-status {
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-card-kicker {
  color: var(--cedar-dark);
}

.question-card-status {
  background: rgba(108, 125, 68, 0.1);
  border: 1px solid rgba(63, 81, 49, 0.2);
  color: var(--field-dark);
  padding: 7px 10px;
}

.question-card.is-complete .question-card-status {
  background: var(--field-dark);
  border-color: var(--field-dark);
  color: var(--paper-strong);
}

.question-card.is-missing {
  border-color: rgba(186, 58, 36, 0.55);
  box-shadow: 0 0 0 3px rgba(186, 58, 36, 0.14), 0 16px 36px rgba(48, 35, 22, 0.12);
}

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

.scale-options label {
  align-content: start;
  align-items: center;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid;
  font-weight: 900;
  gap: 10px;
  justify-items: center;
  min-height: 178px;
  min-width: 0;
  padding: 16px 12px;
  position: relative;
  text-align: center;
  touch-action: manipulation;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

.scale-options label:hover {
  transform: translateY(-1px);
}

.scale-options label:active {
  transform: translateY(0);
}

.scale-options input {
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.scale-options label:has(input:focus-visible) {
  outline: 3px solid rgba(213, 168, 72, 0.78);
  outline-offset: 3px;
}

.scale-options label:has(input:checked) {
  background: linear-gradient(135deg, var(--field-dark), var(--ink));
  border-color: rgba(19, 33, 29, 0.72);
  box-shadow: 0 10px 20px rgba(19, 33, 29, 0.16);
  color: var(--paper-strong);
}

.scale-value {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.55rem;
  line-height: 1;
}

.scale-description {
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.35;
}

.scale-description:empty {
  display: none;
}

.scale-options label:has(input:checked) .scale-description {
  color: rgba(255, 250, 240, 0.82);
}

.score-display {
  align-items: center;
  display: inline-grid;
  gap: 8px;
  grid-template-columns: auto minmax(112px, 180px);
  max-width: 100%;
  vertical-align: middle;
}

.score-number {
  color: var(--ink);
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.28rem;
  font-weight: 900;
  line-height: 1;
}

.score-gradient {
  background: linear-gradient(90deg, var(--red) 0%, var(--yellow) 50%, var(--green) 100%);
  border-radius: 999px;
  display: block;
  height: 12px;
  position: relative;
}

.score-marker {
  background: var(--ink);
  border: 2px solid var(--paper-strong);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(19, 33, 29, 0.2);
  height: 20px;
  left: var(--score-position);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
}

.overall-score-line {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  justify-items: start;
  margin: 12px 0 16px;
}

.score-outcome {
  color: var(--ink);
  display: block;
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(1.85rem, 4vw, 3.3rem);
  letter-spacing: -0.03em;
  line-height: 0.98;
  max-width: 760px;
}


.report-preview ul {
  line-height: 1.5;
  margin: 0;
  padding-left: 20px;
}

.report-preview li + li {
  margin-top: 6px;
}

.form-status {
  color: var(--cedar-dark);
  font-weight: 800;
  margin: 0;
  min-height: 1.6em;
}

.report-dialog {
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  max-height: min(86vh, 860px);
  max-width: 920px;
  overflow: auto;
  padding: 0;
  width: calc(100% - 32px);
}

.report-dialog::backdrop {
  background: rgba(19, 33, 29, 0.56);
}

.dialog-header,
.dialog-actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 22px;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin-bottom: 0;
}

.icon-button {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  color: var(--paper);
  cursor: pointer;
  display: grid;
  font-weight: 900;
  height: 40px;
  place-items: center;
  width: 40px;
}

.report-preview {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.report-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.report-block h3 {
  font-family: "Fraunces", "Georgia", serif;
  font-size: 1.6rem;
  letter-spacing: 0;
}

.overall-guidance {
  background: rgba(213, 168, 72, 0.18);
  border-left: 6px solid var(--yellow);
  border-radius: 16px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
  padding: 16px;
}

.next-step {
  background: rgba(108, 125, 68, 0.14);
  border: 1px solid rgba(63, 81, 49, 0.2);
  border-radius: 16px;
  color: var(--ink);
  font-weight: 900;
  padding: 14px;
}

.pain-summary {
  background: rgba(255, 250, 240, 0.9);
}


@media (max-width: 980px) {
  .hero-grid,
  .assessment-layout {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 680px) {
  .hero,
  main {
    padding: 12px;
  }

  .hero {
    padding-bottom: 0;
  }

  h1 {
    font-size: 2.08rem;
    line-height: 1.08;
    text-wrap: initial;
  }

  .topbar {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
  }

  .topbar-link {
    display: none;
  }

  .hero-copy,
  .assessment-shell {
    border-radius: 18px;
  }

  .hero-copy {
    padding: 22px;
  }

  .hero-text {
    font-size: 1rem;
  }

  .hero-note {
    border-radius: 12px;
    display: flex;
    line-height: 1.35;
  }

  .hero-actions {
    margin-top: 18px;
  }

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

  .hero-actions .button-secondary {
    display: none;
  }

  h2 {
    font-size: 1.85rem;
  }

  .category-header h3 {
    font-size: 1.45rem;
  }

  .assessment-shell {
    margin-top: 14px;
    padding: 18px 12px;
  }

  .category-header {
    padding: 18px;
  }

  .question-card {
    background: rgba(255, 250, 240, 0.78);
    border: 1px solid rgba(19, 33, 29, 0.14);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(48, 35, 22, 0.08);
    padding: 14px;
  }

  .question-list {
    background: rgba(19, 33, 29, 0.035);
    display: grid;
    gap: 14px;
    padding: 12px;
  }

  .question-card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .question-card-status {
    align-self: flex-start;
  }

  .scale-options {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .scale-options label {
    align-items: center;
    grid-template-columns: 42px minmax(0, 1fr);
    justify-items: start;
    min-height: 64px;
    padding: 14px;
    text-align: left;
  }

  .scale-value {
    font-size: 1.28rem;
  }

  .scale-description {
    font-size: 0.88rem;
  }


  .overall-score-line {
    align-items: start;
    gap: 14px;
    grid-template-columns: 1fr;
  }

  .score-outcome {
    font-size: 2rem;
    line-height: 1.04;
  }

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

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