/* Landing page. Brand colors come from brand.css (generated from config); everything here is layout and type. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
}

/* Illustration palette: the stains and media of a microbiology bench. Not brand colors: they only identify
   taxa in the example profile. */
:root {
  --t1: #5b2d8e; /* crystal violet */
  --t2: #b8325a; /* safranin */
  --t3: #2f6fa8; /* methylene blue */
  --t4: #d49a2a; /* Gram's iodine */
  --t5: #2e8b6a; /* malachite green */
  --t6: #e58fa6; /* eosin */
  --t7: #7a8597; /* nigrosin */
  --t8: #a9c86b; /* agar */
  --t-other: #d6d4df;
  --t-on-dark: #ffffff;
  --t-on-light: #1d1a2b;

  --measure: 66ch;
  --gutter: clamp(1rem, 4vw, 3rem);
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root { --t-other: #3a3748; }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-weight: 420;
}

a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.015em; }
h2 { font-size: 1.75rem; line-height: 1.15; }
h3 { font-size: 1.15rem; line-height: 1.3; }
p { margin: 0; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Header and footer ------------------------------------------------------------------------------------------ */

.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--gutter);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em;
}
.header-cta { font-weight: 600; }

.site-footer {
  margin-top: clamp(4rem, 10vw, 8rem);
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid color-mix(in srgb, var(--muted) 35%, transparent);
  color: var(--muted); font-size: 0.9rem;
  display: grid; gap: 0.75rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: inherit; }
.disclaimer { max-width: var(--measure); }

/* Hero ------------------------------------------------------------------------------------------------------- */

main > section, .prose, .intro { padding-inline: var(--gutter); }

.hero { padding-top: clamp(2rem, 7vw, 6rem); display: grid; gap: 1.5rem; }
.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 820;
  max-width: 13ch;
}
.lead { font-size: 1.25rem; line-height: 1.5; max-width: 52ch; }

.waitlist { display: grid; gap: 0.85rem; max-width: 40rem; margin-top: 0.5rem; }
.waitlist-intro { font-weight: 600; }
.field-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.field-row input {
  flex: 1 1 16rem; min-width: 0;
  font: inherit; color: var(--ink); background: var(--paper);
  padding: 0.8rem 1rem;
  border: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); border-radius: var(--radius);
}
.field-row input:focus-visible { outline-offset: 1px; border-color: var(--primary); }
.field-row input[aria-invalid="true"] { border-color: var(--accent); }

button, .button-link {
  font: inherit; font-weight: 700; cursor: pointer;
  color: var(--on-primary); background: var(--primary);
  border: 2px solid var(--primary); border-radius: var(--radius);
  padding: 0.8rem 1.4rem; text-decoration: none; display: inline-block;
}
button:hover, .button-link:hover { background: color-mix(in srgb, var(--primary) 85%, var(--ink)); }

.pets { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; }
.pets legend { float: left; margin-right: 0.5rem; font-weight: 600; }
.pets label { display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.pets input { accent-color: var(--primary); width: 1.1rem; height: 1.1rem; margin: 0; }
.optional { font-weight: 420; color: var(--muted); }

.notice { font-size: 0.9rem; color: var(--muted); max-width: 52ch; }
.notice a { color: inherit; }

.form-error {
  font-weight: 600; color: var(--accent);
  padding-left: 0.75rem; border-left: 4px solid var(--accent);
}

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

/* The example profile: the one loud element on the page ----------------------------------------------------- */

.profile { margin: clamp(3rem, 8vw, 6rem) 0 0; display: grid; gap: 1rem; }

.profile-bar {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  /* --profile-tracks comes from brand.css, generated from the profile data (pages.rs). */
  grid-template-columns: var(--profile-tracks);
  height: clamp(5.5rem, 14vw, 10rem);
  gap: 3px;
}
.seg {
  display: flex; align-items: flex-end; padding: 0.5rem 0.6rem;
  font-weight: 800; font-size: clamp(0.95rem, 2vw, 1.5rem); letter-spacing: -0.02em;
  transform-origin: left center;
  animation: grow 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.seg:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.seg:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.seg:nth-child(2) { animation-delay: 60ms; }
.seg:nth-child(3) { animation-delay: 120ms; }
.seg:nth-child(4) { animation-delay: 180ms; }
.seg:nth-child(5) { animation-delay: 240ms; }
.seg:nth-child(6) { animation-delay: 300ms; }
.seg:nth-child(7) { animation-delay: 360ms; }
.seg:nth-child(8) { animation-delay: 420ms; }
.seg:nth-child(9) { animation-delay: 480ms; }

@keyframes grow { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

.seg-1 { background: var(--t1); color: var(--t-on-dark); }
.seg-2 { background: var(--t2); color: var(--t-on-dark); }
.seg-3 { background: var(--t3); color: var(--t-on-dark); }
.seg-4 { background: var(--t4); color: var(--t-on-light); }
.seg-5 { background: var(--t5); color: var(--t-on-dark); }
.seg-6 { background: var(--t6); color: var(--t-on-light); }
.seg-7 { background: var(--t7); color: var(--t-on-dark); }
.seg-8 { background: var(--t8); color: var(--t-on-light); }
.seg-9 { background: var(--t-other); color: var(--ink); }

.profile-legend {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.95rem;
}
.profile-legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.swatch { width: 0.8rem; height: 0.8rem; border-radius: 2px; flex: none; }
.profile-legend .pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.profile figcaption { color: var(--muted); font-size: 0.95rem; max-width: var(--measure); }

@media (max-width: 40rem) {
  /* Narrow bars can't hold a number; the legend carries them. */
  .seg span { display: none; }
}

/* Wide screens: the profile stands beside the hero as a stacked column, each label level with its band. */
@media (min-width: 64rem) {
  .intro {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
    gap: clamp(2rem, 5vw, 5rem); align-items: start;
  }
  .profile {
    margin: 0; padding-top: clamp(2rem, 7vw, 6rem);
    grid-template-columns: 5.5rem 1fr; column-gap: 1rem;
  }
  .profile-bar, .profile-legend { grid-template-rows: var(--profile-tracks); height: 34rem; }
  .profile-bar { grid-template-columns: none; }
  .profile-legend { display: grid; gap: 3px; }
  .profile-legend li { align-self: center; }
  .profile-legend .swatch { display: none; }
  .profile figcaption { grid-column: 1 / -1; }
  .seg { align-items: flex-start; transform-origin: center top; animation-name: grow-down; }
  .seg:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .seg:last-child { border-radius: 0 0 var(--radius) var(--radius); }
}
@keyframes grow-down { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

/* Content sections ------------------------------------------------------------------------------------------- */

/* minmax(0, 1fr): without a definite track, the auto-fit grids inside size as if every column fit. */
.steps, .tests, .report { margin-top: clamp(4rem, 9vw, 7rem); display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }

.steps ol {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; gap: 1.5rem 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.steps li { counter-increment: step; display: grid; gap: 0.35rem; align-content: start; }
.steps li::before {
  content: counter(step);
  font-size: 2.75rem; font-weight: 820; line-height: 1; letter-spacing: -0.04em; color: var(--primary);
}
.steps p { color: color-mix(in srgb, var(--ink) 80%, var(--paper)); }

.test-grid { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); max-width: 60rem; }
.test-grid article { display: grid; gap: 0.5rem; align-content: start; padding-top: 1rem; border-top: 4px solid var(--primary); }
.test-grid article + article { border-top-color: var(--accent); }
.collect { font-weight: 600; }

.report ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.5rem; max-width: var(--measure); }
.report li::marker { color: var(--accent); }

/* Secondary pages -------------------------------------------------------------------------------------------- */

.message { padding-top: clamp(3rem, 10vw, 7rem); display: grid; gap: 1.25rem; }
.message h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.02; letter-spacing: -0.03em; }

.prose { padding-top: clamp(2rem, 6vw, 4rem); max-width: calc(var(--measure) + 2 * var(--gutter)); }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.25rem); line-height: 1.05; margin-bottom: 0.75rem; }
.prose h2 { font-size: 1.3rem; margin-top: 2.25rem; margin-bottom: 0.5rem; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 0.75rem; }
.prose ul { padding-left: 1.2rem; margin: 0.5rem 0 0; }
.effective { color: var(--muted); }

/* Last, so no later rule can turn the animation back on. */
@media (prefers-reduced-motion: reduce) { .seg { animation: none; } }
