:root {
  color-scheme: light;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #f4f6f0;
  color: #111512;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #111512;
  --muted: #667069;
  --line: #d7ddd2;
  --paper: #fbfcf8;
  --accent: #0c6b58;
  --accent-strong: #084d40;
  --risk: #a73424;
  --gold: #d7a33b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(17, 21, 18, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 21, 18, 0.04) 1px, transparent 1px),
    #f4f6f0;
  background-size: 56px 56px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  min-height: clamp(540px, 82dvh, 760px);
  border: 1px solid var(--ink);
  background: var(--paper);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 6vw, 82px);
  border-right: 1px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(12, 107, 88, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(215, 163, 59, 0.18), transparent 38%);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--ink);
  padding: 8px 11px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  background: #eef2e9;
}

h1 {
  max-width: 920px;
  margin: auto 0 22px;
  font-size: clamp(3.2rem, 9vw, 9.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 760px;
  margin: 0;
  color: #354039;
  font-size: clamp(1.02rem, 1.8vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.secondary-button,
.ghost-button,
.copy-button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 0 18px;
  font-weight: 800;
  background: var(--accent);
  color: white;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover,
.copy-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.ghost-button:hover {
  background: #e8ede1;
  transform: translateY(-1px);
}

.score-panel {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 4vw, 46px);
  background: #111512;
  color: white;
}

.score-topline,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-number {
  margin-top: 28px;
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 900;
  line-height: 0.88;
}

.score-number.muted {
  color: rgba(255, 255, 255, 0.35);
}

.score-scale {
  color: rgba(255, 255, 255, 0.66);
  font-weight: 700;
}

.progress-track,
.mini-track {
  overflow: hidden;
  height: 10px;
  margin: 26px 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar,
.mini-bar {
  height: 100%;
  background: var(--gold);
  transition: width 240ms ease;
}

.recommendation {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px 12px;
  color: #f9e2a4;
  font-weight: 900;
}

.score-copy {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.58;
}

.score-guide {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 18px;
  padding: 16px 0;
}

.score-guide strong {
  display: block;
  margin-bottom: 8px;
  color: #f9e2a4;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-guide p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.52;
}

.score-guide ul {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.42;
}

.score-guide li {
  padding-left: 14px;
  border-left: 3px solid rgba(244, 191, 88, 0.7);
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  margin-top: 18px;
}

.assessment-column,
.side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-heading {
  position: sticky;
  top: 0;
  z-index: 4;
  border: 1px solid var(--ink);
  padding: 16px 18px;
  background: var(--ink);
  color: white;
}

.question-row,
.panel,
.metric-card,
.sources-section {
  border: 1px solid var(--ink);
  background: var(--paper);
}

.question-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  padding: 18px;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.question-row.answered {
  background: #f8faf2;
  box-shadow: inset 5px 0 0 var(--accent);
}

.question-meta span,
.segmented-field > span,
.range-field > span,
.metric-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.question-meta p {
  margin: 7px 0 0;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.42;
}

.scale-control {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-self: center;
  border: 1px solid var(--ink);
}

.scale-control button,
.segmented button {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.scale-control button:last-child,
.segmented button:last-child {
  border-right: 0;
}

.scale-control button:hover,
.segmented button:hover {
  background: #e8ede1;
}

.scale-control button.active,
.segmented button.active {
  background: var(--accent);
  color: white;
}

.scale-labels {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.side-column {
  position: sticky;
  top: 12px;
  align-self: start;
}

.panel {
  padding: 20px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1rem;
  text-transform: uppercase;
}

.range-field {
  display: grid;
  gap: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.segmented-field {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  color: #27302a;
  font-weight: 720;
  line-height: 1.38;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.redline-panel {
  border-color: var(--risk);
  box-shadow: inset 5px 0 0 var(--risk);
}

.warning-copy,
.quiet-copy {
  margin: 16px 0 0;
  color: var(--risk);
  font-weight: 750;
  line-height: 1.5;
}

.quiet-copy {
  color: var(--muted);
}

.result-pill {
  width: fit-content;
  border: 1px solid var(--ink);
  padding: 9px 11px;
  background: #e8ede1;
  font-weight: 900;
}

.result-pill[data-band="plan"],
.result-pill[data-band="leave"] {
  background: #fff1c7;
}

.result-pill[data-band="urgent"] {
  background: var(--risk);
  color: white;
}

.action-list {
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.action-list li {
  border-top: 1px solid var(--line);
  padding: 11px 0;
  font-weight: 740;
}

.copy-button {
  width: 100%;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.metric-card {
  min-height: 178px;
  padding: 16px;
}

.metric-card div:first-child {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.metric-card strong {
  font-size: 2.1rem;
  line-height: 0.95;
}

.metric-card p {
  min-height: 60px;
  margin: 16px 0;
  color: #435047;
  font-size: 0.9rem;
  line-height: 1.42;
}

.metric-card .mini-track {
  height: 8px;
  margin: 0;
  border-color: var(--ink);
  background: white;
}

.metric-card .mini-bar {
  background: var(--accent);
}

.sources-section {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
  margin-top: 18px;
  padding: clamp(20px, 4vw, 42px);
}

.sources-section p {
  max-width: 680px;
  color: #354039;
  line-height: 1.6;
}

.disclaimer {
  font-weight: 760;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-list a {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  padding: 14px;
  background: white;
  text-decoration: none;
}

.source-list a:hover {
  border-color: var(--ink);
}

.source-list span {
  color: var(--muted);
  line-height: 1.44;
}

@media (max-width: 1180px) {
  .hero-panel,
  .layout-grid,
  .sources-section {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 520px;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .score-panel {
    min-height: 360px;
  }

  .side-column {
    position: static;
  }

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

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .hero-copy {
    min-height: 500px;
    padding: 22px;
  }

  h1 {
    font-size: clamp(3rem, 17vw, 5.2rem);
  }

  .score-panel {
    padding: 22px;
  }

  .question-row {
    grid-template-columns: 1fr;
  }

  .scale-labels {
    grid-column: 1;
  }

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

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