/* Scientific Humans. One stylesheet, no scripts, no external requests (fonts, analytics, CDNs).
   Colours follow the Additive Check app's tokens (src/ui/theme.ts) so the apps and the site read as one family.
   Text/background pairs are at least 4.5:1 in both themes. */

:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-alt: #eef2ea;
  --text: #132019;
  --muted: #5b685f;
  --border: #e2e8df;
  --border-strong: #c9d4c6;
  --primary: #0d6b46;
  --primary-dark: #094d33;
  --on-primary: #ffffff;
  --chip: #e4f1e9;
  --chip-border: #b9d9c7;
  --warning-bg: #fdf3e3;
  --warning-border: #f0d4a6;
  --warning-text: #7a3b06;
  --radius: 14px;
  --radius-sm: 8px;
  --measure: 68ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1511;
    --surface: #16201a;
    --surface-alt: #1c2822;
    --text: #e8efe9;
    --muted: #9db0a3;
    --border: #25332b;
    --border-strong: #35473c;
    --primary: #4cc38a;
    --primary-dark: #7fdbaa;
    --on-primary: #06140d;
    --chip: #1a2d23;
    --chip-border: #2d4a3a;
    --warning-bg: #2a2012;
    --warning-border: #5a4420;
    --warning-text: #f0c98a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.6rem;
  background: var(--primary);
  color: var(--on-primary);
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex: none;
}

.mark svg {
  width: 62%;
  height: 62%;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

/* Layout */

main {
  flex: 1;
}

.section {
  padding: 3rem 0;
}

.hero {
  padding: 4.5rem 0 3rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  font-weight: 800;
  max-width: 20ch;
}

h2 {
  font-size: clamp(1.4rem, 3.4vw, 1.8rem);
  font-weight: 750;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.75rem;
}

h2.flush {
  margin-top: 0;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

.lede {
  font-size: clamp(1.1rem, 2.4vw, 1.3rem);
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 1.5rem;
}

.prose {
  max-width: var(--measure);
}

.prose li {
  margin-bottom: 0.4rem;
}

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

/* Buttons and chips */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--primary);
}

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

.button.secondary {
  background: transparent;
  color: var(--primary);
}

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

.chip {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--chip-border);
  color: var(--primary-dark);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* App cards */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card h3 {
  margin: 0;
}

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

.card .card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.card .mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.8rem;
}

.card-link {
  margin-top: auto;
  font-weight: 700;
}

.card-link a {
  text-decoration: none;
}

.card-link a:hover {
  text-decoration: underline;
}

.card.placeholder {
  background: transparent;
  border-style: dashed;
  border-color: var(--border-strong);
  justify-content: center;
}

/* Feature grid */

.features {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
}

.features li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 0;
}

.features strong {
  display: block;
  margin-bottom: 0.2rem;
}

.features span {
  color: var(--muted);
  font-size: 0.975rem;
}

/* Steps */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  max-width: var(--measure);
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.9rem;
  align-items: start;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--chip-border);
  color: var(--primary-dark);
  font-weight: 700;
}

/* Notice and tables */

.notice {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  max-width: var(--measure);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice strong {
  color: inherit;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 36rem;
  font-size: 0.975rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-alt);
}

/* Page head for sub pages */

.page-head {
  padding: 3rem 0 0.5rem;
}

.page-head h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  max-width: none;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.925rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

/* Phones: each table row becomes a small block, so nothing scrolls sideways. */
@media (max-width: 40rem) {
  .table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  thead {
    position: absolute;
    left: -999rem;
  }

  tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    margin-bottom: 0.9rem;
  }

  td {
    border: 0;
    padding: 0.25rem 1rem;
  }

  td:first-child {
    font-weight: 700;
    font-size: 1.05rem;
  }

  td:nth-child(2)::before,
  td:nth-child(3)::before {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
  }

  td:nth-child(2)::before {
    content: "What it is";
  }

  td:nth-child(3)::before {
    content: "Why we need it";
  }
}

@media (max-width: 36rem) {
  .hero {
    padding: 3rem 0 2rem;
  }

  .section {
    padding: 2.25rem 0;
  }

  .site-nav {
    gap: 0.9rem;
  }
}
