:root {
  --bg: #fcfaf7;
  --bg-soft: #f5efe8;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #2f3136;
  --muted: #666666;
  --line: #e6ddd2;
  --primary: #c97845;
  --primary-dark: #b46a3b;
  --secondary: #85776b;
  --accent: #e8d7c5;
  --shadow: 0 16px 38px rgba(117, 95, 72, 0.08);
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --sans: "Open Sans", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ui: "Montserrat", "Open Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    linear-gradient(180deg, var(--bg-soft) 0, var(--bg-soft) 86px, var(--bg) 86px, var(--bg) 100%);
}

.page-shell {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.hero {
  padding: 64px 0 54px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.hero-layout {
  display: block;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  column-gap: 42px;
  row-gap: 0;
  align-items: start;
}

.hero-intro {
  grid-column: 1;
  grid-row: 1;
  max-width: 760px;
}

.hero-title-block {
  max-width: 440px;
}

.hero-copy {
  max-width: 680px;
  margin-top: 24px;
}

.eyebrow,
.section-tag {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  font-family: var(--ui);
}

h1,
h2,
h3,
.driver-name {
  font-family: var(--serif);
}

h1 {
  margin: 0;
  max-width: 8.6ch;
  font-size: clamp(4rem, 7vw, 6.2rem);
  line-height: 0.94;
  font-weight: 500;
  letter-spacing: -0.03em;
}

h1 span {
  display: block;
}

.hero-text {
  max-width: none;
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--muted);
}

.hero-text + .hero-text {
  margin-top: 22px;
}

.hero-card {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
  padding: 34px;
  border-radius: var(--radius-lg);
  background: #f9f5ef;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-width: none;
}

.drivers-illustrations {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 38px;
  align-items: stretch;
}

.home-disclaimer {
  margin: 24px 0 0;
  max-width: none;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
  font-style: italic;
  white-space: nowrap;
}

.driver-illustration {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.scale-title {
  margin: 22px 0 0;
  color: var(--text);
}

.scale-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 0;
  margin: 18px 0 0;
  list-style: none;
}

.scale-list li,
.legend span {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
}

.duration-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--text);
}

.primary-button,
.secondary-button {
  appearance: none;
  border-radius: 0;
  padding: 15px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--ui);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.primary-button {
  margin-top: 28px;
  color: #fff;
  border: 1px solid var(--primary);
  background: var(--primary);
  box-shadow: none;
}

.secondary-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: transparent;
}

.primary-button:hover,
.secondary-button:hover,
.option-label:hover {
  transform: translateY(-1px);
}

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

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

.panel {
  margin-top: 44px;
  padding: 38px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: none;
  border: 1px solid var(--line);
}

.hidden {
  display: none;
}

.panel-header,
.results-layout,
.panel-actions,
.progress-label,
.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.panel-header {
  align-items: end;
  margin-bottom: 18px;
}

.panel-actions {
  align-items: center;
  flex-wrap: wrap;
}

.progress-wrap {
  min-width: min(340px, 100%);
}

.progress-label {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--muted);
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #ece5dc;
  overflow: hidden;
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.question-card {
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.question-card.is-unanswered {
  border-color: rgba(201, 120, 69, 0.6);
}

.question-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(117, 95, 72, 0.12);
}

.question-number {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--ui);
}

.question-text {
  margin: 0 0 18px;
  line-height: 1.7;
  min-height: 78px;
  font-size: 1.14rem;
  color: var(--text);
}

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

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

.option-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
  font-family: var(--ui);
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.option-input:checked + .option-label {
  color: #fffaf6;
  border-color: transparent;
  background: #c97845;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-top: 26px;
}

.form-message {
  margin: 0;
  color: var(--primary);
  font-weight: 700;
}

.results-panel {
  scroll-margin-top: 24px;
}

.results-page {
  padding-top: 24px;
}

.standalone-results {
  margin-top: 32px;
}

.results-header {
  align-items: center;
}

.results-summary {
  margin: 0 0 24px;
  max-width: 70ch;
  line-height: 1.7;
  color: var(--muted);
  font-size: 1.04rem;
}

.results-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card,
.chart-panel,
.driver-detail-card {
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-label,
.detail-label,
.chart-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-family: var(--ui);
}

.metric-value {
  display: block;
  font-size: 1.2rem;
  line-height: 1.35;
}

.metric-caption {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.charts-stack {
  display: grid;
  gap: 18px;
}

.chart-panel {
  padding: 22px;
}

.chart-panel-single {
  margin-top: 8px;
}

.results-chart-shell {
  max-width: 760px;
  margin: 0 auto;
}

.chart-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.chart-panel-head h3 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.chart-panel-head-simple {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.chart-kicker {
  margin-bottom: 10px;
}

.chart-note {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

.chart-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.drivers-chart {
  min-width: 100%;
}

.drivers-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
}

.chart-grid-line {
  stroke: rgba(31, 42, 45, 0.12);
  stroke-width: 1;
}

.chart-axis {
  stroke: rgba(31, 42, 45, 0.28);
  stroke-width: 1.4;
}

.chart-axis-label {
  fill: rgba(31, 42, 45, 0.68);
  font-size: 12px;
  font-weight: 600;
}

.chart-band {
  fill: rgba(201, 120, 69, 0.12);
}

.chart-band-label {
  fill: rgba(180, 106, 59, 0.92);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--ui);
}

.chart-bar {
  filter: drop-shadow(0 12px 18px rgba(31, 42, 45, 0.14));
}

.chart-bar-gloss {
  fill: rgba(255, 255, 255, 0.16);
}

.chart-value-label {
  fill: var(--text);
  font-size: 16px;
  font-weight: 800;
  font-family: var(--ui);
}

.chart-driver-label {
  fill: rgba(31, 42, 45, 0.9);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
}

.insight-panel {
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.insight-tag {
  margin-bottom: 10px;
}

.insight-visual {
  margin-top: 4px;
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.insight-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 72%;
}

.insight-summary {
  margin: 18px 0 0;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.04rem;
}

.insight-toggle {
  margin-top: 22px;
}

.insight-details {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.insight-block + .insight-block {
  margin-top: 20px;
}

.insight-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  font-family: var(--ui);
}

.insight-quote,
.insight-essential {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--text);
}

.insight-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.insight-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.insight-list li + li {
  margin-top: 6px;
}

.insight-block-essential {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: #fbf4ee;
}

.pdf-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.pdf-button {
  margin-top: 0;
}

.pdf-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.score-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.driver-detail-card {
  padding: 18px;
}

.driver-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.driver-swatch {
  width: 14px;
  height: 44px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.driver-detail-name {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 500;
}

.driver-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-value {
  display: block;
  font-size: 1.05rem;
}

.noscript-message {
  margin: 24px auto;
  width: min(780px, calc(100% - 32px));
  padding: 16px;
  border-radius: var(--radius-md);
  background: #f9f3ed;
  color: var(--primary-dark);
  border: 1px solid var(--line);
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 24px, 1220px);
    padding-top: 0;
  }

  .hero,
  .panel {
    padding: 22px;
  }

  .hero {
    padding-top: 38px;
  }

  .hero-layout {
    display: block;
  }

  .drivers-illustrations {
    order: 2;
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 6px;
  }

  .hero-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-intro {
    order: 1;
    grid-column: auto;
    grid-row: auto;
  }

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

  .hero-card {
    order: 3;
    grid-column: auto;
    grid-row: auto;
    margin-top: 8px;
  }

  .panel-header,
  .results-layout,
  .form-footer,
  .panel-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .question-text {
    min-height: auto;
  }

  .progress-wrap {
    min-width: 0;
  }

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

  .chart-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .chart-note {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .options-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .option-label {
    min-height: 44px;
    font-size: 0.92rem;
  }

  .results-metrics,
  .driver-detail-stats {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 9ch;
    font-size: clamp(3rem, 14vw, 4.3rem);
  }

  .drivers-illustrations {
    grid-template-columns: 1fr;
  }

  .home-disclaimer {
    white-space: normal;
  }

  .insight-panel {
    padding: 22px;
  }

  .insight-quote,
  .insight-essential {
    font-size: 1.28rem;
  }
}
