/*
 * Optimal Peptides: one stylesheet for the landing page, questionnaire, quote pages and admin.
 *
 * Follows the landing-page-design skill (.claude/skills/landing-page-design):
 *   - one typeface (Outfit), no italics, weights capped at 600 (700 for the tagline statement only)
 *   - every font size is a named text style on the Tailwind type scale (section 1)
 *   - every margin, padding and gap is a --s-* spacing token
 *   - every radius is a --r-* token (Tailwind radii)
 *   - flat backgrounds (a cool grey page, white cards with a ring and soft shadow), no one-sided card borders
 *   - motion uses --ease and animates only transform and opacity
 */

@font-face {
  font-family: 'Outfit';
  src: url('/fonts/outfit-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Backgrounds are neutral and flat: a cool light grey page with white cards lifted off it by a hairline
     ring and a soft shadow. --subtle is the page grey again, for wells inside white cards. Colour is kept
     for actions, icons and status. */
  --paper: #f2f3f7;
  --surface: #ffffff;
  --subtle: #f2f3f7;
  --ink: #0c1f24;
  --muted: #51656a;
  --line: #e3e5ec;
  --line-strong: #cdd0da;
  /* Greens. --brand carries white button text and reads as link text on white, on --subtle and on --mint
     (all above 4.5:1). --brand-bright fails as text, so it is for graphics only (the hero dots). */
  --brand: #1e7a42;
  --brand-deep: #14532d;
  --brand-mid: #23874a; /* large type and graphics only: 4.2:1 on --subtle */
  --brand-bright: #3db663;
  --mint: #eaf4ee;
  --mint-ink: #196b3a;
  --danger: #a8322a;
  --danger-bg: #fbe9e6;
  --warn: #7d5608;
  --warn-bg: #fbf1d6;
  --ok-bg: #e2f2e9;

  --s-25: 2px;
  --s-50: 4px;
  --s-75: 8px;
  --s-100: 12px;
  --s-200: 16px;
  --s-300: 24px;
  --s-400: 32px;
  --s-500: 40px;
  --s-600: 48px;
  --s-700: 64px;
  --s-800: 80px;
  --s-900: 96px;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;
  --r-2xl: 16px;
  --r-3xl: 24px;
  --r-full: 9999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  /* Cards: a hairline ring instead of a border, plus a soft drop. */
  --shadow: 0 0 0 1px rgb(10 40 45 / 0.05), 0 20px 44px -20px rgb(10 40 45 / 0.22);
  /* Panels in the page colour, raised by a light edge above and a shade below. */
  --shadow-raised: 12px 12px 28px rgb(160 166 186 / 0.4), -12px -12px 28px rgb(255 255 255 / 0.95);
  --font: 'Outfit', system-ui, sans-serif;
}

/* The quote, admin and login screens stay minimal: their cards keep the hairline ring and lose the drop. */
.page, .login { --shadow: 0 0 0 1px rgb(10 40 45 / 0.07); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s-900); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 4px; }
h1, h2, h3, p, ul, ol, dl, blockquote, figure { margin: 0; }
h1, h2, h3, .text-balance { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
address { font-style: normal; }
em { font-style: normal; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
strong, b { font-weight: 600; }

/* ============================================================================
   1. Text styles. Every piece of text resolves to one of these.
   ========================================================================== */
.heading-1 { font-size: 3.75rem; line-height: 1; font-weight: 600; }
.heading-2 { font-size: 3rem; line-height: 1; font-weight: 600; }
.heading-3, h1 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 600; }
.heading-4 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; }
.heading-5, h2 { font-size: 1.5rem; line-height: 2rem; font-weight: 600; }
.heading-6, h3, .lines tfoot td, .total-row { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; }

.title-1 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 500; }
.title-2, .lede { font-size: 1.125rem; line-height: 1.75rem; font-weight: 500; }
.title-3, .question legend, .question > label { font-size: 1rem; line-height: 1.5rem; font-weight: 500; }
.title-4, .field > span, .legend, .site-nav a, .admin-nav a, .tabs a, .footer-links a { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.title-5 { font-size: 0.75rem; line-height: 1rem; font-weight: 500; }

.body-1, .brand, .result-list strong, .card details > summary { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.body-2, .chip span, .answers dd, .facts dd { font-size: 1rem; line-height: 1.5rem; font-weight: 500; }
.body-3, body, input, select, textarea, .question > .consent { font-size: 1rem; line-height: 1.5rem; font-weight: 400; }
.body-4, .sub-title, .dose dd, .next li::before { font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; }
.body-5, .notice { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.body-6, .small, .help, .ask summary, .error, .step-count, .disclaimer, .answers dt, .why, .copy-field input { font-size: 0.875rem; line-height: 1.25rem; font-weight: 400; }

.button-lg { font-size: 1.125rem; line-height: 1.75rem; font-weight: 600; }
.button-md, .btn { font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.button-sm, .btn-sm { font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; }
.button-xsm { font-size: 0.75rem; line-height: 1rem; font-weight: 600; }

.caption-1, .eyebrow, .stepper-label { font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; }
.caption-2, .chip .sub { font-size: 0.875rem; line-height: 1.25rem; font-weight: 400; }
.caption-3, .pill, .flag, .count, .lines th, .table th, .catalogue-table td[data-label]::before { font-size: 0.75rem; line-height: 1rem; font-weight: 600; }
.caption-4, .dose dt, .facts dt { font-size: 0.75rem; line-height: 1rem; font-weight: 500; }
.caption-5 { font-size: 0.75rem; line-height: 1rem; font-weight: 400; }

/* ============================================================================
   2. Layout and shared pieces
   ========================================================================== */
.wrap { width: min(1200px, 100% - var(--s-600)); margin-inline: auto; }
.wrap.narrow { width: min(680px, 100% - var(--s-600)); }
.page { padding-block: var(--s-600) var(--s-800); }
.page > h1, .page > .lede, .page > p { margin-bottom: var(--s-200); }
.muted { color: var(--muted); }
.block { display: block; }
/* A row of short facts, set apart by space alone. */
.meta { display: flex; flex-wrap: wrap; gap: var(--s-50) var(--s-200); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.eyebrow { color: var(--mint-ink); margin-bottom: var(--s-100); }
.lede { color: var(--muted); max-width: 680px; }
.icon { width: 24px; height: 24px; flex: none; fill: currentColor; }

.skip { position: absolute; left: var(--s-200); top: var(--s-200); z-index: 40; padding: var(--s-75) var(--s-100); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transform: translateY(-96px); }
.skip:focus { transform: none; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: var(--s-75); color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand { transition: opacity 300ms var(--ease); }
.brand:hover { opacity: 0.75; }
/* The mark: six dots around a centre, in the two logo greens. */
.mark { fill: var(--brand-mid); flex: none; }
.mark-accent { fill: var(--brand-bright); }

/* Navigation: a compact pill floating off the top edge, sized to its content. Links and the button inside
   it are pills too. */
.site-header { position: sticky; top: var(--s-200); z-index: 30; display: flex; justify-content: center; margin-top: var(--s-200); padding-inline: var(--s-200); pointer-events: none; }
.bar { position: relative; z-index: 2; pointer-events: auto; display: inline-flex; align-items: center; gap: var(--s-400); padding: var(--s-75) var(--s-75) var(--s-75) var(--s-300); border: 0; border-radius: var(--r-full); background: rgb(255 255 255 / 0.8); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.site-nav, .admin-nav { display: flex; align-items: center; gap: var(--s-50); }
.site-nav a:not(.btn), .admin-nav a { padding: var(--s-75) var(--s-200); border-radius: var(--r-full); color: var(--ink); text-decoration: none; transition: background-color 300ms var(--ease); }
.site-nav a:not(.btn):hover, .admin-nav a:hover { background: rgb(12 31 36 / 0.06); }
.site-nav a[aria-current], .admin-nav a[aria-current] { background: var(--mint); color: var(--mint-ink); }
.site-nav .btn { margin-left: var(--s-75); padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200); }
/* The arrow sits in a white disc at the end of the header button and nudges on hover. */
.btn-arrow { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-full); background: #fff; color: var(--brand); transition: transform 500ms var(--ease); }
.btn-arrow .icon { width: 16px; height: 16px; }
.btn:hover .btn-arrow { transform: translate(2px, -2px); }
/* A bar that holds only the brand keeps the same space on both sides. */
.bar > .brand:last-child, .bar > .brand:has(+ .bar-note) { margin-right: var(--s-200); }
.bar-note { padding-right: var(--s-75); color: var(--muted); white-space: nowrap; }

.nav-toggle { display: none; position: relative; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--r-full); background: var(--mint); cursor: pointer; }
.nav-toggle span { position: absolute; left: var(--s-100); right: var(--s-100); top: 50%; height: 2px; border-radius: var(--r-full); background: var(--brand-deep); transition: transform 500ms var(--ease); }
.nav-toggle span:first-child { transform: translateY(-4px); }
.nav-toggle span:last-child { transform: translateY(4px); }
.nav-open .nav-toggle span:first-child { transform: rotate(45deg); }
.nav-open .nav-toggle span:last-child { transform: rotate(-45deg); }

/* Mobile menu: a full height panel. Links arrive one after another, 60ms apart. */
.menu-panel { position: fixed; inset: 0; z-index: 1; display: none; flex-direction: column; gap: var(--s-75); padding: var(--s-900) var(--s-300) var(--s-400); background: rgb(242 243 247 / 0.92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 300ms var(--ease), visibility 0s var(--ease) 300ms; }
.menu-panel a { padding: var(--s-100) 0; color: var(--ink); text-decoration: none; opacity: 0; transform: translateY(var(--s-300)); transition: opacity 500ms var(--ease), transform 500ms var(--ease); }
.menu-panel .btn { margin-top: var(--s-200); color: #fff; }
.nav-open .menu-panel { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity 300ms var(--ease), visibility 0s var(--ease); }
.nav-open .menu-panel a { opacity: 1; transform: none; }
.nav-open .menu-panel a:nth-child(2) { transition-delay: 60ms; }
.nav-open .menu-panel a:nth-child(3) { transition-delay: 120ms; }
.nav-open .menu-panel a:nth-child(4) { transition-delay: 180ms; }
.nav-open .menu-panel a:nth-child(5) { transition-delay: 240ms; }
html.nav-open { overflow: hidden; }

/* Buttons */
/* Buttons are pills everywhere. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75); padding: var(--s-75) var(--s-200); border: 1px solid transparent; border-radius: var(--r-full); background: var(--brand); color: #fff; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 300ms var(--ease), transform 500ms var(--ease); }
.btn:hover { background: var(--brand-deep); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-block { display: flex; width: 100%; }
.btn-ghost, .btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover, .btn-quiet:hover { background: var(--subtle); }
.btn-whatsapp { background: #128c4b; }
.btn-whatsapp:hover { background: #0c6f3a; }
button.link { padding: 0; border: 0; background: none; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
button.link.danger { color: var(--danger); }
a:not(.btn, .brand, .goal), button.link { transition: opacity 300ms var(--ease); }
a:not(.btn, .brand, .goal, [aria-current]):hover, button.link:hover { opacity: 0.7; }

/* Cards, notices, forms */
.card { margin-bottom: var(--s-300); padding: var(--s-300); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow); }
.card > * + * { margin-top: var(--s-200); }
.card > h1, .card > h2, .card > h3 { margin-top: 0; }
.card > .field { margin-bottom: 0; }
.notice { padding: var(--s-100) var(--s-200); border-radius: var(--r-lg); background: var(--warn-bg); color: var(--warn); }
.notice-error { background: var(--danger-bg); color: var(--danger); }
.notice-ok { background: var(--ok-bg); color: var(--mint-ink); }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s-100); padding: var(--s-600) var(--s-300); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow); color: var(--muted); text-align: center; }
.empty .icon { width: 32px; height: 32px; color: var(--mint-ink); }
.empty h2 { color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: var(--s-75); }
.back .icon { width: 16px; height: 16px; transform: scaleX(-1); }
.ph { padding: 0 var(--s-50); border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); }

.field { display: block; margin-bottom: var(--s-200); }
.field > span, .legend { display: block; margin-bottom: var(--s-75); }
.help { display: block; margin-bottom: var(--s-75); color: var(--muted); }
input:not([type='checkbox'], [type='radio']), select, textarea { width: 100%; padding: var(--s-75) var(--s-100); color: inherit; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); transition: border-color 300ms var(--ease); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--mint); border-color: var(--brand); }
textarea { resize: vertical; }
.error { display: block; margin-top: var(--s-75); color: var(--danger); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-200); }
.fields .field { grid-column: 1 / -1; }
.fields .field.half { grid-column: span 1; }
.check { display: flex; gap: var(--s-100); align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: var(--s-25) 0 0; accent-color: var(--brand); flex: none; }

/* Line items (quotes) */
.lines { width: 100%; border-collapse: collapse; }
.lines td, .lines th { padding: var(--s-100) 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.lines th { padding-top: 0; color: var(--muted); }
.lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lines tfoot td { padding-top: var(--s-200); border-bottom: 0; }
.doctor-note { padding: var(--s-200); background: var(--subtle); border-radius: var(--r-xl); white-space: pre-wrap; }

/* Quote stepper (/quote.js). Without the script the three steps simply stack. */
.quote-flow > .notice { margin-bottom: var(--s-200); }
.quote-flow h1:focus, .quote-flow h2:focus { outline: none; }
.flow-step > h1 { margin-bottom: var(--s-200); }
.flow-actions { display: flex; gap: var(--s-100); }
.flow-actions .btn:not(.btn-ghost) { flex: 1; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-75); margin: 0 0 var(--s-300); padding: 0; list-style: none; }
.stepper-bar { display: block; height: 4px; margin-bottom: var(--s-75); background: var(--line); border-radius: var(--r-full); overflow: hidden; }
.stepper-bar::after { content: ''; display: block; height: 100%; background: var(--brand); border-radius: var(--r-full); transform: scaleX(0); transform-origin: left; transition: transform 500ms var(--ease); }
.is-done .stepper-bar::after, .is-current .stepper-bar::after { transform: none; }
.stepper-label { color: var(--muted); }
.is-current .stepper-label { color: var(--ink); }
.is-stepped .flow-step:not([hidden]) { animation: step-in 500ms var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(var(--s-200)); } }
.summary { padding: var(--s-200); background: var(--subtle); border-radius: var(--r-xl); }
.total-row { display: flex; justify-content: space-between; gap: var(--s-200); }
.total-row .num { font-variant-numeric: tabular-nums; }

/* ============================================================================
   3. Landing page
   ========================================================================== */
.section { padding-block: var(--s-800); }
.section-head { max-width: 680px; margin-bottom: var(--s-600); }
.section-head > * + * { margin-top: var(--s-200); }
.section-head .eyebrow { margin-bottom: 0; }

.hero { padding-block: var(--s-800); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-600); align-items: center; }
.js .hero-grid { grid-template-columns: minmax(0, 11fr) minmax(0, 10fr); }
.hero-copy > * + * { margin-top: var(--s-300); }
.hero-copy .eyebrow { margin-bottom: 0; }
/* The one gradient on the site: left to right on the hero heading text. */
.hero-title { max-width: 680px; background: linear-gradient(90deg, #000000, #666666); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 680px; color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-200); }

/* Hero visual: a peptide chain drawn from dots on a canvas (/hero.js). Decorative. The box has a fixed
   aspect ratio, so nothing moves when the script starts. Without the script the copy takes the full width. */
.hero-art { display: grid; justify-items: start; gap: var(--s-200); }
.hero-canvas { display: none; width: 100%; aspect-ratio: 4 / 3; }
.js .hero-art { justify-items: center; }
.js .hero-canvas { display: block; }
/* The hero names the doctor once, here. */
.hero-doctor { display: inline-flex; align-items: center; gap: var(--s-100); padding: var(--s-75) var(--s-300) var(--s-75) var(--s-75); background: var(--surface); border-radius: var(--r-full); box-shadow: var(--shadow); }
.hero-doctor img { width: 40px; height: 40px; flex: none; border-radius: var(--r-full); object-fit: cover; object-position: top; }

/* How it works: the three steps drawn as a short peptide chain. Each step is a residue built from dots,
   joined to the next by a dotted bond. Residues arrive one after another, then each bond draws across. */
.defs { position: absolute; width: 0; height: 0; }
.chain { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-300); list-style: none; padding: 0; }
.chain-step { position: relative; display: grid; justify-items: start; gap: var(--s-75); }
.chain-node { display: block; width: 96px; height: 96px; margin-bottom: var(--s-200); }
.chain-node svg { display: block; width: 100%; height: 100%; }
.chain-step:nth-child(1) .chain-node { fill: var(--brand-deep); }
.chain-step:nth-child(2) .chain-node { fill: var(--brand-mid); }
.chain-step:nth-child(3) .chain-node { fill: var(--brand-bright); }
/* The bond: a row of round dots from this residue to the next. */
.chain-step:not(:last-child)::after { content: ''; position: absolute; top: 46px; left: 112px; right: calc(var(--s-300) * -1 + var(--s-200)); border-top: 4px dotted var(--line-strong); transform-origin: left; }
.js .chain-step.reveal { transform: none; }
.js .chain-step .chain-node { transform: scale(0.6); transition: transform 700ms var(--ease); }
.js .chain-step.in .chain-node { transform: none; }
.js .chain-step::after { transform: scaleX(0); transition: transform 700ms var(--ease) 300ms; }
.js .chain-step.in::after { transform: none; }
.js .chain-step:nth-child(2), .js .chain-step:nth-child(2) .chain-node { transition-delay: 250ms; }
.js .chain-step:nth-child(2)::after { transition-delay: 550ms; }
.js .chain-step:nth-child(3), .js .chain-step:nth-child(3) .chain-node { transition-delay: 500ms; }
/* Energy: once the chain has arrived, a pulse runs along each bond in turn and the residue it reaches
   swells for a moment. One slow loop, only while the chain is on screen (site.js sets .live on it). */
.chain-step { container-type: inline-size; }
.chain-step:not(:last-child)::before { content: ''; position: absolute; top: 42px; left: 112px; z-index: 1; width: 36px; height: 12px; border-radius: var(--r-full); background: var(--brand-mid); box-shadow: 0 0 0 4px rgb(61 182 99 / 0.3), 0 0 20px 4px rgb(61 182 99 / 0.55); opacity: 0; --run: calc(100cqw - 140px); }
.js .live .chain-step.in:nth-child(1)::before { animation: flow-a 5s cubic-bezier(0.65, 0, 0.35, 1) 1600ms infinite; }
.js .live .chain-step.in:nth-child(2)::before { animation: flow-b 5s cubic-bezier(0.65, 0, 0.35, 1) 1600ms infinite; }
.js .live .chain-step.in .chain-node { animation: beat 5s var(--ease) 1600ms infinite; }
.js .live .chain-step.in:nth-child(2) .chain-node { animation-delay: 3100ms; }
.js .live .chain-step.in:nth-child(3) .chain-node { animation-delay: 4600ms; }
@keyframes flow-a {
  0% { opacity: 0; transform: translateX(0); }
  4%, 26% { opacity: 1; }
  30%, 100% { opacity: 0; transform: translateX(var(--run)); }
}
@keyframes flow-b {
  0%, 30% { opacity: 0; transform: translateX(0); }
  34%, 56% { opacity: 1; }
  60%, 100% { opacity: 0; transform: translateX(var(--run)); }
}
@keyframes flow-a-down {
  0% { opacity: 0; transform: translateY(0); }
  4%, 26% { opacity: 1; }
  30%, 100% { opacity: 0; transform: translateY(var(--run)); }
}
@keyframes flow-b-down {
  0%, 30% { opacity: 0; transform: translateY(0); }
  34%, 56% { opacity: 1; }
  60%, 100% { opacity: 0; transform: translateY(var(--run)); }
}
@keyframes beat { 0%, 18%, 100% { transform: none; } 7% { transform: scale(1.16); } }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-300); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-300); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-200); }
.grid-2, .grid-3, .grid-4 { list-style: none; padding: 0; }

.tile { display: flex; flex-direction: column; gap: var(--s-100); padding: var(--s-400); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow); }
.tile p { color: var(--muted); }
/* Tile icons sit in a mint disc. */
.tile > .icon { box-sizing: content-box; width: 24px; height: 24px; padding: var(--s-100); border-radius: var(--r-full); background: var(--mint); color: var(--mint-ink); }
/* The quiet tile stays in the page colour and is raised instead of white. */
.tile-quiet { background: var(--paper); box-shadow: var(--shadow-raised); }
.step-no { color: var(--mint-ink); }

.compare ul { display: grid; gap: var(--s-100); list-style: none; padding: 0; }
.compare li { display: flex; gap: var(--s-100); align-items: flex-start; }
.compare .icon { margin-top: 0; color: var(--muted); }
.compare .tile-good { box-shadow: 0 0 0 2px var(--brand-mid), 0 20px 44px -20px rgb(10 40 45 / 0.22); }
.compare .tile-good .icon { color: var(--mint-ink); }

/* Tagline reveal: one wide statement in heavy type. Words go from pale to full colour one at a time on
   scroll, and the highlighted words arrive in green. The background stays quiet. */
.tagline { padding-block: var(--s-900); }
.tagline p { max-width: 1120px; font-weight: 700; letter-spacing: -0.03em; text-wrap: pretty; }
.tagline .hl { color: var(--brand-mid); }
.tagline .word { opacity: 0.25; transition: opacity 500ms var(--ease); }
.tagline .word.on { opacity: 1; }

.goal { display: flex; flex-direction: column; gap: var(--s-50); padding: var(--s-300); background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform 500ms var(--ease); }
.goal:hover { transform: translateY(-4px); }
.goal:active { transform: scale(0.98); }
.goal .caption-2 { color: var(--muted); }
.goal .icon { box-sizing: content-box; width: 16px; height: 16px; margin-top: var(--s-200); padding: var(--s-75); align-self: flex-end; border-radius: var(--r-full); background: var(--brand); color: #fff; }

.credential { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-300); align-items: start; }
.credential-media { display: block; width: 128px; height: auto; border-radius: var(--r-xl); }
.credential-icon { display: grid; place-items: center; height: 128px; background: var(--mint); color: var(--mint-ink); }
.credential-body p { color: var(--ink); }
.credential-body p.muted { color: var(--muted); }
.credential-icon .icon { width: 48px; height: 48px; }
.credential-body > * + * { margin-top: var(--s-100); }

.faq { display: grid; gap: var(--s-100); max-width: 680px; }
.faq details { background: var(--surface); border-radius: var(--r-2xl); box-shadow: var(--shadow); }
.faq summary { border-radius: var(--r-2xl); transition: opacity 300ms var(--ease); }
.faq summary:hover { opacity: 0.7; }
.faq summary:active .icon { transform: scale(0.9); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-200); padding: var(--s-200) var(--s-300); list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { box-sizing: content-box; width: 16px; height: 16px; padding: var(--s-75); border-radius: var(--r-full); background: var(--mint); color: var(--mint-ink); transition: transform 500ms var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq-a { padding: 0 var(--s-300) var(--s-300); color: var(--muted); }
.faq details[open] .faq-a { animation: fade-in 500ms var(--ease); }
@keyframes fade-in { from { opacity: 0; } }

.cta-panel { display: flex; flex-direction: column; align-items: center; gap: var(--s-300); padding: var(--s-700) var(--s-300); background: var(--paper); border-radius: var(--r-3xl); box-shadow: var(--shadow-raised); text-align: center; }
.cta-panel h2, .cta-panel p { max-width: 680px; }
.cta-panel p { color: var(--muted); }
.assurances { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-100) var(--s-300); list-style: none; padding: 0; }
.assurances li { display: flex; align-items: center; gap: var(--s-75); }
.assurances .icon { color: var(--mint-ink); }

.site-footer { padding-block: var(--s-600); }
.site-footer > .wrap > * + * { margin-top: var(--s-200); }
.footer-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-300); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-300); }
.footer-links a { color: var(--ink); }
.footer-links a[aria-current] { color: var(--mint-ink); text-decoration: none; }
.disclaimer { max-width: 680px; color: var(--muted); }

.prose { max-width: 680px; }
.prose > * + * { margin-top: var(--s-200); }
.prose h2 { margin-top: var(--s-500); }
.prose ul { display: grid; gap: var(--s-75); padding-left: var(--s-300); }

/* Scroll reveals: rise 32px and fade in once. Only when JavaScript is running. */
.js .reveal { opacity: 0; transform: translateY(var(--s-400)); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ============================================================================
   4. Questionnaire
   ========================================================================== */
.intake-main { padding-block: var(--s-600) var(--s-800); }
.intake-main form > h1 { margin-bottom: var(--s-100); }
.intake-main h1:focus { outline: none; }
.intake-main form > .lede { margin-bottom: var(--s-400); }
.intake-main form > .notice { margin-bottom: var(--s-300); }
.progress { height: 4px; margin-bottom: var(--s-100); background: var(--line); border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; background: var(--brand); border-radius: var(--r-full); transform-origin: left; transform: scaleX(0); transition: transform 500ms var(--ease); }
.step-count { margin-bottom: var(--s-400); color: var(--muted); }
.question { min-width: 0; margin: 0 0 var(--s-400); padding: 0; border: 0; }
.question legend, .question > label { display: block; margin-bottom: var(--s-100); padding: 0; }
/* Options sit on an even grid, so every choice is the same size and easy to tap. */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-flow: dense; gap: var(--s-75); }
.chip { position: relative; display: flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span { flex: 1; padding: var(--s-100) var(--s-200); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); transition: background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease), transform 500ms var(--ease); }
.chip input:active + span { transform: scale(0.98); }
.chip input:hover + span { border-color: var(--brand); }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--brand-deep); outline-offset: 2px; }
.chip input:disabled + span { opacity: 0.45; }
.chip .sub { display: block; color: var(--muted); }
.chip input:checked + span .sub { color: inherit; opacity: 0.8; }
.chips + .notice { margin-top: var(--s-100); }
/* "Why we ask": the reason for a question, closed until asked for. */
.ask { margin-bottom: var(--s-100); }
.ask summary { display: inline-block; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; list-style: none; cursor: pointer; transition: opacity 300ms var(--ease); }
.ask summary::-webkit-details-marker { display: none; }
.ask summary:hover { opacity: 0.7; }
.ask .help { margin: var(--s-75) 0 0; }
.sub-title { display: block; margin-bottom: var(--s-75); }
/* Options that belong to a chosen answer open in a panel under it. */
.sub-panel { grid-column: 1 / -1; padding: var(--s-200); background: var(--surface); border-radius: var(--r-xl); box-shadow: 0 0 0 1px var(--line); animation: step-in 500ms var(--ease) both; }
/* Scoped under .question so it outranks the generic `.question > label` rule above. */
.question > .consent { display: flex; gap: var(--s-100); align-items: flex-start; margin-bottom: 0; padding: var(--s-200); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); cursor: pointer; }
.consent { transition: border-color 300ms var(--ease); }
.consent:hover { border-color: var(--brand); }
.consent input { width: 24px; height: 24px; margin: 0; accent-color: var(--brand); flex: none; }
.question:has(> .consent) { margin-bottom: var(--s-100); }
.intake-actions { display: flex; justify-content: space-between; gap: var(--s-100); margin-top: var(--s-400); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.result > * + * { margin-top: var(--s-200); }
.result > h2 { margin-top: var(--s-500); }
.result-list { display: grid; gap: var(--s-100); list-style: none; padding: 0; }
.result-list li { padding: var(--s-200) var(--s-300); background: var(--surface); border-radius: var(--r-2xl); box-shadow: var(--shadow); }
.result-list .why { margin-top: var(--s-75); color: var(--mint-ink); }
.result-list p { margin-top: var(--s-50); color: var(--muted); }
.next { display: grid; gap: var(--s-200); list-style: none; padding: 0; counter-reset: n; }
.next li { position: relative; padding-left: var(--s-600); counter-increment: n; }
.next li::before { content: counter(n); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-full); background: var(--mint); color: var(--mint-ink); }
/* Loading placeholder shaped like the first step. */
.skeleton { display: grid; gap: var(--s-200); }
.skeleton span { display: block; height: 24px; border-radius: var(--r-lg); background: var(--line); animation: pulse 1200ms var(--ease) infinite alternate; }
.skeleton span:nth-child(1) { height: 4px; }
.skeleton span:nth-child(2) { width: 40%; height: 40px; }
.skeleton span:nth-child(n + 3) { height: 48px; }
/* Without JavaScript the questions never arrive, so only the notice is shown. */
@media (scripting: none) { .skeleton { display: none; } }
noscript > * + * { margin-top: var(--s-200); }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ============================================================================
   5. Admin
   ========================================================================== */
.admin-nav button.link { white-space: nowrap; }
.admin-nav form { display: flex; margin-left: var(--s-75); padding-right: var(--s-75); }
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--s-300); }
.login .card { width: min(400px, 100%); }

.tabs { display: flex; flex-wrap: wrap; gap: var(--s-50); margin-block: var(--s-300); }
.tabs a { display: inline-flex; align-items: center; gap: var(--s-75); padding: var(--s-75) var(--s-100); border-radius: var(--r-lg); color: var(--muted); text-decoration: none; transition: background-color 300ms var(--ease); }
.tabs a:hover { background: rgb(12 31 36 / 0.06); }
.tabs a[aria-current='page'] { background: var(--surface); color: var(--brand-deep); box-shadow: var(--shadow); }
.count { display: inline-block; min-width: 24px; padding: var(--s-25) var(--s-75); border-radius: var(--r-full); background: var(--line); color: var(--ink); text-align: center; }
.tabs a[aria-current='page'] .count { background: var(--mint); color: var(--mint-ink); }

.table-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--r-3xl); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--s-100) var(--s-200); border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.table th { color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table td:last-child { text-align: right; }

.pill, .flag { display: inline-block; padding: var(--s-50) var(--s-75); border-radius: var(--r-full); white-space: nowrap; }
.pill-review { background: var(--warn-bg); color: var(--warn); }
.pill-quoted { background: #e6ecf7; color: #2c4a80; }
.pill-paid { background: var(--ok-bg); color: var(--mint-ink); }
.pill-shipped { background: var(--line); color: var(--ink); }
.pill-declined { background: var(--danger-bg); color: var(--danger); }
.flag { margin-right: var(--s-75); }
.flag-review, .wada-prohibited { background: var(--danger-bg); color: var(--danger); }
.flag-note, .wada-check { background: var(--warn-bg); color: var(--warn); }
.wada-permitted { background: var(--ok-bg); color: var(--mint-ink); }
.flags ul { display: grid; gap: var(--s-100); list-style: none; padding: 0; }
.matches { display: grid; gap: var(--s-200); list-style: none; padding: 0; }
.match { display: grid; gap: var(--s-75); padding: var(--s-200); background: var(--subtle); border-radius: var(--r-lg); }
.match-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-75); }
.dose { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-100); }
.dose dt { color: var(--muted); }
.dose dd { margin: 0; }

/* The patient's key facts: a small label over each value, set out in a row. */
.facts { display: flex; flex-wrap: wrap; gap: var(--s-200) var(--s-500); margin: var(--s-200) 0 0; }
.facts dt { margin-bottom: var(--s-25); color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-200); margin-block: var(--s-200) var(--s-75); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: var(--s-300); align-items: start; margin-top: var(--s-300); }
.detail aside { position: sticky; top: var(--s-900); }
.answers { display: grid; grid-template-columns: minmax(140px, 0.9fr) 1.4fr; gap: var(--s-100) var(--s-300); }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.suggestions { display: grid; gap: var(--s-100); list-style: none; padding: 0; }
.reason { color: var(--mint-ink); }
.picker td { padding: var(--s-100) 0; }
.picker td:not(:first-child) { width: 1%; padding-left: var(--s-100); }
.picker .qty { width: 64px; }
.money { display: inline-flex; align-items: center; gap: var(--s-75); white-space: nowrap; }
.money input { width: 96px; text-align: right; }
.card details > summary { color: var(--brand); cursor: pointer; }
.card details[open] > summary { margin-bottom: var(--s-100); }
.copy-field input { cursor: copy; }
.catalogue { margin-top: var(--s-300); }
/* The catalogue is a table of editable rows. Fields are quiet until hovered or focused. */
.catalogue-table td { padding: var(--s-75) var(--s-100); }
.catalogue-table th:first-child, .catalogue-table td:first-child { padding-left: var(--s-200); }
.catalogue-table td:last-child { padding-right: var(--s-200); }
.catalogue-table td:nth-child(1) { width: 20%; }
.catalogue-table td:nth-child(2) { width: 14%; }
.catalogue-table td:nth-child(3) { width: 10%; }
.catalogue-table td:nth-child(5), .catalogue-table td:nth-child(6) { width: 1%; }
.catalogue-table th:nth-child(5), .catalogue-table td:nth-child(5) { text-align: center; }
.catalogue-table input:not([type='checkbox']) { border-color: transparent; background: transparent; }
.catalogue-table tr:hover input:not([type='checkbox']), .catalogue-table input:not([type='checkbox']):focus { border-color: var(--line-strong); background: var(--surface); }
.catalogue-table .has-error input { border-color: var(--danger); }
.catalogue-table input[type='checkbox'] { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); vertical-align: middle; }
.catalogue-table form { display: flex; }

/* On wide screens the hero visual runs past the text column toward the page edge. */
@media (min-width: 1360px) {
  .js .hero-art { margin-right: calc(var(--s-700) * -1); }
}

/* ============================================================================
   6. Responsive. Sizes step down the same type scale.
   ========================================================================== */
@media (max-width: 1000px) {
  .js .hero-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-300); }
  .js .hero-art { justify-items: start; }
  .hero-canvas { max-width: 560px; }
  .heading-1 { font-size: 3rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; }
  .detail aside { position: static; }
  /* Narrow screens: each product becomes a small labelled block; the header row is hidden. */
  .catalogue-table thead { display: none; }
  .catalogue-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-100) var(--s-200); padding: var(--s-200); border-bottom: 1px solid var(--line); }
  .catalogue-table tr:last-child { border-bottom: 0; }
  .catalogue-table td, .catalogue-table td:first-child, .catalogue-table td:last-child { width: auto; padding: 0; border: 0; text-align: left; }
  .catalogue-table td:nth-child(n) { width: auto; }
  .catalogue-table td:nth-child(1), .catalogue-table td:nth-child(4) { grid-column: 1 / -1; }
  .catalogue-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: var(--s-50); color: var(--muted); }
  .catalogue-table td:nth-child(6) { display: flex; justify-content: flex-end; align-items: end; }
  .catalogue-table input:not([type='checkbox']) { border-color: var(--line-strong); background: var(--surface); }
}
@media (max-width: 800px) {
  .site-nav { display: none; }
  .nav-toggle, .menu-panel { display: flex; }
  .site-header.has-menu .bar { gap: var(--s-200); }
  .grid-2 { grid-template-columns: 1fr; }
  /* The chain turns to run down the page: residue on the left, bond dropping to the next one. */
  .chain { grid-template-columns: 1fr; gap: var(--s-400); }
  .chain-step { grid-template-columns: 64px minmax(0, 1fr); column-gap: var(--s-200); align-items: center; }
  .chain-node { grid-row: 1 / 3; width: 64px; height: 64px; margin-bottom: 0; }
  .chain-step .step-no { align-self: end; }
  .chain-step h3 { align-self: start; }
  .chain-step:not(:last-child)::after { top: 68px; left: 30px; right: auto; height: var(--s-300); border-top: 0; border-left: 4px dotted var(--line-strong); transform-origin: top; }
  .js .chain-step::after { transform: scaleY(0); }
  .chain { gap: var(--s-600); }
  .chain-step:not(:last-child)::after { height: var(--s-500); }
  .chain-step:not(:last-child)::before { top: 64px; left: 26px; width: 12px; height: 20px; --run: 28px; }
  .js .live .chain-step.in:nth-child(1)::before { animation-name: flow-a-down; }
  .js .live .chain-step.in:nth-child(2)::before { animation-name: flow-b-down; }
  .section, .tagline { padding-block: var(--s-700); }
  .hero { padding-block: var(--s-500) var(--s-700); }
  .section-head { margin-bottom: var(--s-400); }
}
@media (max-width: 560px) {
  .wrap, .wrap.narrow { width: calc(100% - var(--s-400)); }
  .heading-1 { font-size: 1.875rem; line-height: 2.25rem; }
  .heading-2 { font-size: 1.875rem; line-height: 2.25rem; }
  .heading-3, h1 { font-size: 1.875rem; line-height: 2.25rem; }
  .fields .field.half { grid-column: 1 / -1; }
  /* One column: the panel sits right under its choice, so its title would only repeat it. */
  .sub-title { display: none; }
  .quote-flow .fields .field.half { grid-column: span 1; }
  .quote-flow .fields { gap: 0 var(--s-100); }
  .page:has(.quote-flow) { padding-top: var(--s-300); }
  .stepper { margin-bottom: var(--s-200); }
  .card { padding: var(--s-200); }
  .answers { grid-template-columns: 1fr; gap: var(--s-25) 0; }
  .answers dd { margin-bottom: var(--s-100); }
  .credential { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .assurances { flex-direction: column; align-items: flex-start; }
  .cta-panel { padding: var(--s-500) var(--s-300); }
  .credential-media { width: 96px; }
  .credential-icon { height: 96px; }
  .admin-header .brand span, .bar-note { display: none; }
  .bar { gap: var(--s-200); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Movement becomes a plain fade. */
  .js .reveal, .menu-panel a, .js .chain-step .chain-node, .js .chain-step::after { transform: none; }
  .is-stepped .flow-step:not([hidden]), .sub-panel { animation: none; }
  .stepper-bar::after { transition: none; }
  .btn:hover .btn-arrow, .btn:active, .goal:hover, .goal:active, .chip input:active + span, .faq summary:active .icon { transform: none; }
  .tagline .word { opacity: 1; transition: none; }
  .skeleton span { animation: none; }
  .js .live .chain-step.in::before, .js .live .chain-step.in .chain-node { animation: none; }
}
