:root {
  --ink: #151716;
  --muted: #5d6462;
  --paper: #f7f4ee;
  --white: #fffdf8;
  --line: #d7d0c3;
  --green: #28584d;
  --blue: #234b66;
  --burgundy: #7a2f38;
  --gold: #b09255;
  --soft: #ece5d7;
  --shadow: 0 18px 55px rgba(21, 23, 22, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(247, 244, 238, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
}

.brand span {
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  color: var(--green);
  font-size: 13px;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topnav a {
  text-decoration: none;
  color: var(--muted);
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.hero {
  min-height: calc(100svh - 72px);
  display: flex;
  align-items: center;
  padding: clamp(34px, 6vw, 86px) clamp(18px, 4vw, 54px);
  background:
    linear-gradient(90deg, rgba(247, 244, 238, 0.95) 0%, rgba(247, 244, 238, 0.9) 38%, rgba(247, 244, 238, 0.58) 68%, rgba(21, 23, 22, 0.14) 100%),
    url("./assets/section-visuals/01-planetary-medicine-hero.webp");
  background-size: cover;
  background-position: center;
}

.hero-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 18px;
  font-size: clamp(45px, 7vw, 98px);
  line-height: 0.9;
  letter-spacing: 0;
  overflow-wrap: normal;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.15;
}

.lead {
  max-width: 720px;
  color: #303532;
  font-size: clamp(18px, 2vw, 24px);
}

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

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

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

.button.secondary {
  background: var(--white);
  color: var(--ink);
}

.system-surface,
.direction-panel,
.brief-form,
.draft-output,
.ops-grid article {
  min-width: 0;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.system-surface {
  padding: 22px;
}

.surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.surface-head span {
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
}

.surface-flow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.surface-flow div {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.surface-flow span {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-weight: 900;
}

.surface-flow p,
.surface-ledger p {
  margin: 0;
}

.surface-ledger {
  padding: 16px;
  border-left: 4px solid var(--burgundy);
  background: #f8eee8;
  border-radius: 6px;
}

.surface-ledger span {
  display: block;
  margin-bottom: 6px;
  color: var(--burgundy);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.section-visual {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  margin: 0 0 clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  box-shadow: var(--shadow);
}

.section-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(21, 23, 22, 0) 46%, rgba(21, 23, 22, 0.2) 100%),
    linear-gradient(90deg, rgba(247, 244, 238, 0.05), rgba(40, 88, 77, 0.09));
}

.section-visual img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.section-visual.compact {
  min-height: 240px;
  margin: 28px 0 0;
}

.status-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink);
}

.status-section .section-visual {
  min-height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.status-section .section-visual img {
  min-height: 100%;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--ink);
  color: var(--white);
}

.status-strip div {
  min-height: 118px;
  padding: 22px clamp(18px, 3vw, 32px);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.status-strip span {
  display: block;
  margin-bottom: 10px;
  color: #d7d0c3;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.status-strip strong {
  font-size: clamp(18px, 2.3vw, 28px);
  line-height: 1.08;
}

.section {
  padding: clamp(52px, 7vw, 96px) clamp(18px, 4vw, 54px);
}

.section-head {
  width: min(840px, 100%);
  margin-bottom: 34px;
}

.section-head p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
}

.direction-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.direction-list {
  display: grid;
  gap: 8px;
}

.direction-tab {
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.direction-tab.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.direction-panel {
  min-height: 410px;
  padding: clamp(22px, 4vw, 42px);
}

.direction-panel h3 {
  max-width: 720px;
  font-size: clamp(28px, 4vw, 48px);
}

.direction-panel > p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
}

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

.facts div {
  min-height: 142px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.facts dt {
  margin-bottom: 8px;
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(320px, 1fr) minmax(300px, 0.8fr);
  gap: 22px;
  align-items: start;
  background: #eee8dc;
}

.split .section-head {
  margin-bottom: 0;
}

.brief-form,
.draft-output {
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 800;
}

label span {
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.check {
  grid-template-columns: 22px 1fr;
  align-items: start;
  font-weight: 600;
}

.check input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.draft-output pre {
  min-height: 250px;
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #171918;
  color: #f5f0e5;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.ops-grid article {
  min-height: 230px;
  padding: 22px;
}

.ops-grid p {
  color: var(--muted);
}

.evidence {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 34px;
  align-items: center;
  background: var(--ink);
  color: var(--white);
}

.evidence p {
  color: #e2ded5;
}

.evidence code {
  color: var(--white);
}

.evidence img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.launch {
  background: var(--white);
}

.launch-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.launch-list li {
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.launch-list strong {
  display: block;
  margin-bottom: 14px;
  color: var(--green);
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 28px clamp(18px, 4vw, 54px);
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: var(--white);
}

.footer p {
  margin: 0;
  max-width: 980px;
  color: #e8e1d5;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
    grid-column: 1 / -1;
    justify-content: start;
    flex-wrap: wrap;
  }

  .topbar.is-open .topnav {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    min-height: auto;
  }

  .hero-grid,
  .status-section,
  .direction-layout,
  .split,
  .evidence {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .facts,
  .ops-grid,
  .launch-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-section .section-visual {
    min-height: 320px;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 64px;
    gap: 14px;
  }

  .brand {
    font-size: 16px;
  }

  h1 {
    font-size: clamp(40px, 16vw, 72px);
    line-height: 0.96;
    overflow-wrap: anywhere;
  }

  .hero-actions,
  .form-actions {
    display: grid;
  }

  .button {
    width: 100%;
  }

  .surface-flow,
  .status-strip,
  .facts,
  .ops-grid,
  .launch-list,
  .footer {
    grid-template-columns: 1fr;
  }

  .section-visual,
  .status-section .section-visual {
    min-height: 220px;
  }

  .section-visual.compact {
    min-height: 190px;
  }

  .status-strip div {
    min-height: auto;
  }
}
