:root {
  color-scheme: light;
  --ink: #14211d;
  --muted: #53645d;
  --paper: #f7f6ef;
  --surface: #ffffff;
  --line: #d7ded6;
  --green: #1f7a57;
  --green-dark: #12523a;
  --blue: #2d6cdf;
  --gold: #b16a00;
  --red: #b83232;
  --teal: #167c80;
  --shadow: 0 18px 50px rgba(22, 35, 30, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(31, 122, 87, 0.08), rgba(247, 246, 239, 0) 460px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: relative;
  top: auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(20, 33, 29, 0.1);
  background: transparent;
}

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

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav a {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.topnav a:hover {
  background: rgba(31, 122, 87, 0.1);
  color: var(--green-dark);
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px) 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.55fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  min-height: calc(86vh - 68px);
  padding: clamp(34px, 6vw, 92px) 0 34px;
}

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

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(3.2rem, 7vw, 6.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}

.hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.12rem;
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 760;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.score-preview,
.assessment-card,
.results-card,
.source-card {
  border: 1px solid rgba(20, 33, 29, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.score-preview {
  padding: clamp(22px, 3vw, 36px);
}

.preview-ring {
  display: grid;
  width: 190px;
  height: 190px;
  margin: 0 auto 24px;
  place-items: center;
  border: 16px solid rgba(31, 122, 87, 0.15);
  border-top-color: var(--green);
  border-right-color: var(--blue);
  border-radius: 999px;
}

.preview-ring span {
  display: block;
  font-size: 3.6rem;
  font-weight: 840;
  line-height: 0.88;
}

.preview-ring small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  text-align: center;
  text-transform: uppercase;
}

.preview-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px 16px;
  align-items: baseline;
}

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

.preview-grid strong {
  font-size: 0.98rem;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 34px;
}

.handoff-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: end;
  margin: 0 0 34px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}

.handoff-band h2 {
  max-width: 18ch;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.handoff-band p {
  margin-bottom: 0;
  color: var(--muted);
}

.handoff-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.handoff-links a {
  display: grid;
  gap: 5px;
  min-height: 98px;
  align-content: center;
  border-left: 3px solid var(--green);
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  text-decoration: none;
}

.handoff-links a:hover {
  background: white;
}

.handoff-links span {
  color: var(--muted);
  font-size: 0.88rem;
}

.workflow div {
  min-height: 112px;
  border: 1px solid rgba(20, 33, 29, 0.11);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.65);
}

.workflow strong {
  display: block;
  margin-bottom: 8px;
}

.workflow span {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.48fr);
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
}

.assessment-card {
  padding: clamp(18px, 3vw, 34px);
}

.results-card {
  position: sticky;
  top: 86px;
  padding: 22px;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 22px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
}

.section-heading.compact {
  margin-bottom: 12px;
}

.question-section {
  border-top: 1px solid var(--line);
  padding: 22px 0 6px;
}

.question-section:first-child {
  border-top: 0;
  padding-top: 0;
}

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

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 720;
  line-height: 1.25;
}

.field small {
  color: var(--muted);
}

select,
input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c7d1ca;
  border-radius: var(--radius);
  background: white;
  padding: 9px 12px;
  color: var(--ink);
}

select:focus,
input[type="text"]:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(45, 108, 223, 0.24);
  outline-offset: 2px;
}

.index-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.main-score {
  display: flex;
  width: 108px;
  height: 108px;
  align-items: center;
  justify-content: center;
  border: 10px solid rgba(31, 122, 87, 0.16);
  border-top-color: var(--green);
  border-radius: 999px;
  font-weight: 850;
}

.main-score span {
  font-size: 2.2rem;
  line-height: 1;
}

.main-score small {
  margin-left: 2px;
  color: var(--muted);
}

#summaryText,
#confidenceText {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.confidence-meter,
.insight-panel {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.meter-row,
.dimension-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.meter-track,
.dimension-track {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #e6ece7;
}

.meter-track div,
.dimension-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.dimension-list {
  display: grid;
  gap: 12px;
  padding: 16px 0 0;
}

.dimension {
  display: grid;
  gap: 5px;
}

.dimension-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.rec-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: #fbfcfa;
}

.rec-card + .rec-card {
  margin-top: 10px;
}

.rec-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(45, 108, 223, 0.1);
  color: #214f9a;
  font-size: 0.74rem;
  font-weight: 840;
  white-space: nowrap;
}

.rec-card p,
.rec-card small {
  color: var(--muted);
}

.rec-card p {
  margin-bottom: 6px;
}

.rec-card small {
  display: block;
}

#missingData {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

#missingData li + li {
  margin-top: 6px;
}

.share-fallback {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.share-fallback label {
  font-weight: 760;
}

.share-fallback textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #c7d1ca;
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfa;
}

.science-section {
  padding-top: 58px;
}

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

.source-card {
  padding: 18px;
  box-shadow: none;
}

.source-card p {
  color: var(--muted);
}

.source-card a {
  color: var(--green-dark);
  font-weight: 760;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: 320px;
  transform: translateY(24px);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--ink);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

  .hero {
    min-height: auto;
  }

  .score-preview,
  .results-card {
    position: static;
  }

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

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

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .topnav a {
    padding-inline: 8px;
  }

  h1 {
    font-size: 3.1rem;
  }

  .workflow,
  .handoff-links,
  .question-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .index-summary {
    grid-template-columns: 1fr;
  }

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

@media print {
  .topbar,
  .hero,
  .workflow,
  .assessment-card,
  .report-actions,
  .toast {
    display: none;
  }

  body {
    background: white;
  }

  main {
    padding: 0;
  }

  .layout {
    display: block;
  }

  .results-card,
  .source-card {
    border: 0;
    box-shadow: none;
  }
}
