/* ============================================================================
   Helm Pediatrics site stylesheet (RND-236)
   Brand: @helmpediatrics/ui, vendored byte for byte under
   vendor/helmpediatrics-ui-<version>/ and pinned in tools/vendor_ui.json.
   Every colour, font family, type size and weight below is a token from those
   files; tools/vendor_ui.py check fails on a raw colour literal here or in a
   page. Brand rules: the design-system brand book and reference/SURFACES.md
   ("L&F" is Scott's "Helm Pediatrics: look and feel", 2026-10-07).

   Surfaces, not themes: a container with .surface-paper (also :root),
   .surface-tint or .surface-navy redefines the semantic --color-* tokens, so a
   rule written once against them is correct on every surface. .field-slate
   bands carry .surface-navy beside it.

   Every page links vendor/helmpediatrics-ui-<version>/brand.css before this
   file: the @font-face rules, the @theme tokens restated on :root and the
   surface blocks, generated by tools/vendor_ui.py from the byte-identical
   vendored fonts.css and tokens.css. One <link>, not @import, so it downloads
   in parallel with this file; an @import chain and three separate files
   raised phone LCP past the 4000 ms budget in the RND-236 audit.

   Fonts are served from this origin (OPS-111; HS-06 section 3.10). The files
   live under /assets/ because vercel.json exempts only /assets/ from the gate
   redirect. The vendored directory name carries the version, so a pin bump
   changes every URL and the seven-day /assets/ cache never serves a mix.

   Every rule sits in the `site` cascade layer, which tools/ui/ui.css declares
   below the component utilities, so the markup rendered from the package
   (site/_includes/ui/) keeps its own styling on every page (RND-991).
   ============================================================================ */
@layer site {

/* ---------- Site layout values (not brand tokens) ---------- */
:root {
  /* Unitless line heights, so a clamp()ed size keeps its ratio. Body is the
     base.css setting (26/16); headings follow base.css (1.2). */
  --leading-display: 1.08;
  --leading-heading: 1.2;
  --leading-body: 1.625;
  --measure-lede: 56ch;
}

/* Base element rules (box-sizing, body, headings, paragraphs, links, selection, focus, media, reduced
   motion) come from the vendored base.css inside ui.css, in its base layer. This file sets none of them: a
   bare element rule here would sit above the component utilities and recolour rendered components. */

/* Skip link: visible only on focus */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-action);
  color: var(--color-action-ink);
  padding: var(--spacing-3) var(--spacing-4);
  z-index: 10;
  text-decoration: none;
}
.skip:focus { left: var(--spacing-3); top: var(--spacing-3); color: var(--color-action-ink); }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--page-margin);
}

.band { padding-block: var(--spacing-9); }
.band-tight { padding-block: var(--spacing-8); }

/* Fields. Paper is the default page ground. .field-slate is a Navy band and
   carries .surface-navy, which repaints it and re-points every semantic token.
   .field-mineral, the old light band, is a white band on the Paper surface:
   L&F 5 separates areas with "paper versus white". */
.field-slate { background: var(--color-ground); color: var(--color-ink); }
.field-mineral { background: var(--color-raised); color: var(--color-ink); }
.field-paper { background: var(--color-ground); color: var(--color-ink); }

.rule-top { border-top: var(--rule-w) solid var(--color-rule); }
.rule-top-strong { border-top: var(--rule-w) solid var(--color-rule-strong); }
.hairline {
  border: 0;
  border-top: var(--rule-w) solid var(--color-rule);
  margin: 0;
}

/* Asymmetrical splits only. */
.split-60 { display: grid; grid-template-columns: 7fr 5fr; gap: var(--spacing-8); }
.split-40 { display: grid; grid-template-columns: 4fr 7fr; gap: var(--spacing-8); }
.split-50 { display: grid; grid-template-columns: 5fr 7fr; gap: var(--spacing-8); }

/* ---------- Type utilities ---------- */
/* The eyebrow (brand book, Type): 12/16, weight 700, normal case, tracking 0,
   in the surface's accent ink (Action on Paper, Sail on Navy). No all caps
   anywhere (L&F 4). */
.label {
  font-family: var(--font-sans);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--text-eyebrow--letter-spacing);
  line-height: var(--text-eyebrow--line-height);
  color: var(--color-ink-accent);
  font-variant-numeric: tabular-nums;
  margin: 0;
}
/* A form field label is a label, not an eyebrow: Medium (L&F 4). */
.flabel .label { font-weight: var(--font-weight-medium); }
.label-muted, .label-on-slate { color: var(--color-ink-muted); }
.label-brick, .label-lightbrick { color: var(--color-ink-accent); }

.display {
  font-size: clamp(var(--text-h1), 5.2vw, var(--text-display));
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-display);
  letter-spacing: var(--text-display--letter-spacing);
}
.h1 { font-size: clamp(var(--text-h2), 3.4vw, var(--text-h1)); font-weight: var(--font-weight-bold); letter-spacing: var(--text-h1--letter-spacing); }
.h2 { font-size: var(--text-h2); font-weight: var(--font-weight-bold); letter-spacing: var(--text-h2--letter-spacing); }
.h3 { font-size: var(--text-h3); font-weight: var(--font-weight-bold); }

.lede { font-size: var(--text-h3); max-width: var(--measure-lede); }
.small { font-size: var(--text-small); }
.caption { font-size: var(--text-caption); color: var(--color-ink-muted); }
.muted, .muted-on-slate { color: var(--color-ink-muted); }
.tnum { font-variant-numeric: tabular-nums; }
.measure-tight { max-width: var(--measure-tight); }

/* Feature availability is separate from product identity. */
.availability { margin-top: 24px; }
.availability p { color: var(--color-ink); line-height: 1.6; }
.btn:disabled { cursor: not-allowed; color: var(--color-ink-muted); background: var(--color-ground); border-color: var(--color-rule); }

/* ---------- Logo ---------- */
/* Master artwork from the design system (assets/brand/, pinned in
   tools/vendor_ui.json), never retyped (L&F 2, OQ-15): helm-primary-light.svg
   on Paper and white, helm-primary-dark.svg on Navy. The files are cropped to
   the ink, so clear space is added here: the sail is 0.177 of the lockup width
   (49.6 of 280.66 units). --logo-w never goes below the 96px minimum. */
.logo {
  --logo-w: 104px;
  display: block;
  width: var(--logo-w);
  height: auto;
  margin-block: calc(var(--logo-w) * 0.177);
}
.logo-link { display: block; flex: none; }

/* ---------- Buttons ---------- */
/* .btn-primary is the page's one call to action: Action orange with white
   text on Paper, Sail with navy text on Navy (action-strong; the brand book's
   "single orange call to action"). Every .btn-primary on a page carries the
   same action. .btn-secondary is the outlined control: the surface's strong
   ink on a Navy 800 boundary (Navy 100 on Navy). */
.btn {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-small);
  line-height: 1;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: var(--rule-w) solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 150ms linear, color 150ms linear, border-color 150ms linear;
}
.btn-primary, .btn-primary-on-slate {
  background: var(--color-action-strong);
  color: var(--color-action-strong-ink);
  border-color: var(--color-action-strong);
}
.btn-primary:hover, .btn-primary:active, .btn-primary-on-slate:hover, .btn-primary-on-slate:active {
  background: var(--color-action-strong-press);
  border-color: var(--color-action-strong-press);
  color: var(--color-action-strong-ink);
}

.btn-secondary, .btn-secondary-on-slate {
  background: transparent;
  color: var(--color-ink-strong);
  border-color: var(--color-rule-strong);
}
.btn-secondary:hover, .btn-secondary-on-slate:hover {
  background: var(--color-action);
  border-color: var(--color-action);
  color: var(--color-action-ink);
}

.btn[disabled], .btn[aria-disabled="true"] { pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--spacing-3); }

/* ---------- Header ---------- */
.site-header { border-bottom: var(--rule-w) solid var(--color-rule); background: var(--color-ground); }

/* ---------- Section heads ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-2) var(--spacing-5);
  border-top: var(--rule-w) solid var(--color-rule-strong);
  padding-top: var(--spacing-4);
  margin-bottom: var(--spacing-6);
}
.section-head h2 { font-size: clamp(var(--text-h2), 3.4vw, var(--text-h1)); font-weight: var(--font-weight-bold); color: var(--color-ink-strong); }
.section-head .label { flex: 0 1 auto; min-width: 0; }

/* ---------- Ruled list ---------- */
.ruled { list-style: none; margin: 0; padding: 0; }
.ruled > li {
  border-top: var(--rule-w) solid var(--color-rule);
  padding-block: var(--spacing-5);
}
.ruled > li:last-child { border-bottom: var(--rule-w) solid var(--color-rule); }

.ruled-row { display: grid; grid-template-columns: 4fr 7fr; gap: var(--spacing-6); align-items: start; }
.ruled-row .ruled-term { font-size: var(--text-h2); font-weight: var(--font-weight-bold); color: var(--color-ink-strong); }
.ruled-row p { font-size: var(--text-small); }

/* Editorial numbered list: large typographic numbers in muted ink. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps > li {
  border-top: var(--rule-w) solid var(--color-rule);
  padding-block: var(--spacing-5);
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: var(--spacing-6);
  align-items: start;
}
.steps > li:last-child { border-bottom: var(--rule-w) solid var(--color-rule); }
.steps .step-n {
  font-size: clamp(var(--text-h2), 3.4vw, var(--text-h1));
  font-weight: var(--font-weight-bold);
  color: var(--color-ink-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.steps .step-body { max-width: var(--measure); }
.steps h3 { font-size: var(--text-h2); font-weight: var(--font-weight-bold); margin-bottom: var(--spacing-2); }
.steps p { font-size: var(--text-small); }

.cols-ruled { display: grid; gap: 0; }
.cols-ruled > div { padding-block: var(--spacing-5); border-top: var(--rule-w) solid var(--color-rule); }
.cols-ruled > div p { font-size: var(--text-small); }
@media (min-width: 900px) {
  .cols-ruled.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .cols-ruled { grid-template-columns: repeat(3, 1fr); border-top: var(--rule-w) solid var(--color-rule); }
  .cols-ruled > div { border-top: 0; padding-block: var(--spacing-5) 0; padding-right: var(--spacing-6); }
  .cols-ruled > div + div { border-left: var(--rule-w) solid var(--color-rule); padding-left: var(--spacing-6); }
}

/* ---------- Figure band ---------- */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-5); }
.figure-cell { border-top: var(--rule-w) solid var(--color-rule); padding-top: var(--spacing-3); }
.figure-cell .fig {
  font-size: clamp(var(--text-h2), 3.6vw, var(--text-figure));
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--text-figure--letter-spacing);
  line-height: 1.1;
  color: var(--color-ink-strong);
  font-variant-numeric: tabular-nums;
  display: block;
}
.figure-cell .label { margin-top: var(--spacing-1); color: var(--color-ink-muted); }

/* ---------- Definition list ---------- */
.dl { margin: 0; }
.dl > div {
  border-top: var(--rule-w) solid var(--color-rule);
  padding-block: var(--spacing-5);
}
.dl > div:last-child { border-bottom: var(--rule-w) solid var(--color-rule); }
.dl dt { font-weight: var(--font-weight-bold); color: var(--color-ink-strong); font-size: var(--text-h3); }
.dl dd { margin: var(--spacing-2) 0 0; font-size: var(--text-small); max-width: 68ch; color: var(--color-ink); }

/* ---------- Table ---------- */
.table-scroll { overflow-x: auto; }
table.ruled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}
table.ruled-table th {
  text-align: left;
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-medium);
  color: var(--color-ink-muted);
  border-bottom: var(--rule-w) solid var(--color-rule-strong);
  padding: var(--spacing-3) var(--spacing-4) var(--spacing-3) 0;
  white-space: nowrap;
}
table.ruled-table td {
  border-bottom: var(--rule-w) solid var(--color-rule);
  padding: var(--spacing-4) var(--spacing-4) var(--spacing-4) 0;
  vertical-align: top;
}
table.ruled-table .num { text-align: right; padding-right: 0; white-space: nowrap; }
table.ruled-table th.num { text-align: right; padding-right: 0; }

/* ---------- Cards and panels ---------- */
.card {
  border: var(--rule-w) solid var(--color-rule);
  border-radius: var(--radius-container);
  background: transparent;
  padding: var(--spacing-5);
}

/* Inside a white (.field-mineral) band the panel is the Paper ground. */
.panel-paper {
  background: var(--color-ground);
  border-radius: var(--radius-container);
  padding: var(--spacing-6);
}

.cols-lg > div p { font-size: var(--text-h2); line-height: 1.35; max-width: 26ch; }
.cols-lg > div .col-term {
  font-size: var(--text-h2);
  font-weight: var(--font-weight-bold);
  color: var(--color-ink-strong);
  margin-bottom: var(--spacing-2);
}

/* ---------- Tags: outlined chip, fully round (L&F 5), Medium (L&F 4) ---------- */
.tag {
  display: inline-block;
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-medium);
  padding: 4px 8px;
  border-radius: 999px;
  border: var(--rule-w) solid var(--color-rule-strong);
  color: var(--color-ink-strong);
}
.tag-brick { color: var(--color-ink-accent); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-5); }
.field { display: flex; flex-direction: column; gap: var(--spacing-2); }
.field-full { grid-column: 1 / -1; }

.field label {
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-medium);
  color: var(--color-ink-muted);
}

/* Inputs: the surface's input ground, a strong boundary (3:1 or more; the
   brand book's control border is Navy 800 on Paper), and the global focus
   outline. 16px text prevents iOS zoom on focus. */
.field input,
.field select,
.field textarea,
.fld {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  line-height: 1.4;
  color: var(--color-ink);
  background: var(--color-input-bg);
  border: var(--rule-w) solid var(--color-rule-strong);
  border-radius: var(--radius);
  padding: 11px 12px;
  width: 100%;
  transition: border-color 150ms linear;
}
.field input::placeholder, .fld::placeholder { color: var(--color-ink-muted); }

.field .hint { font-size: var(--text-caption); color: var(--color-ink-muted); }

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

.form-note {
  font-size: var(--text-caption);
  color: var(--color-ink-muted);
  max-width: var(--measure);
  border-top: var(--rule-w) solid var(--color-rule);
  padding-top: var(--spacing-3);
}

/* ---------- Footer (v1 class; no page uses it) ---------- */
.site-footer { background: var(--color-ground); color: var(--color-ink); }
.site-footer a { color: var(--color-ink); text-decoration: none; font-size: var(--text-small); }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-top {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--spacing-8);
  padding-block: var(--spacing-8) var(--spacing-7);
}
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-6); }
.footer-col { display: flex; flex-direction: column; gap: var(--spacing-2); }
.footer-col .label { margin-bottom: var(--spacing-2); color: var(--color-ink-muted); }
.footer-bottom {
  border-top: var(--rule-w) solid var(--color-rule);
  padding-block: var(--spacing-5) var(--spacing-7);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--spacing-4);
}
.footer-bottom .label { color: var(--color-ink-muted); }
.footer-legal { font-size: var(--text-caption); color: var(--color-ink-muted); max-width: 78ch; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .split-60, .split-40, .split-50 { grid-template-columns: 1fr; gap: var(--spacing-7); }
  .figures { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-5) var(--spacing-6); }
  .footer-top { grid-template-columns: 1fr; gap: var(--spacing-7); }
}

@media (max-width: 899px) {
  .band { padding-block: var(--spacing-8); }
  .band-tight { padding-block: var(--spacing-7); }
  .ruled-row { grid-template-columns: 1fr; gap: var(--spacing-3); }
  .steps > li { grid-template-columns: 1fr; gap: var(--spacing-3); }
  .steps .step-n { font-size: var(--text-h2); }
  .form-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 559px) {
  .figures { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: var(--spacing-5); }
  .btn { width: 100%; }
  .navlinks .btn, .mobilenav .btn { width: auto; }
}

/* ============================================================================
   Site chrome: header nav, footer, form fields and FAQ accordion shared by
   the three launch pages (August 2026 mockup layout).
   ============================================================================ */

/* Header nav: wordmark left, links + CTA right, burger under 761px. */
.sitenav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: var(--spacing-5);
}
.navlinks { display: flex; align-items: center; gap: 30px; }
.navlinks > a:not(.btn),
.mobilenav > a:not(.btn) {
  font-size: var(--text-small);
  color: var(--color-ink-strong);
  text-decoration: none;
}
.navlinks > a:not(.btn):hover,
.mobilenav > a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.navlinks > a[aria-current="page"],
.mobilenav > a[aria-current="page"] { font-weight: var(--font-weight-bold); }
.navburger {
  display: none;
  font-size: var(--text-h3);
  color: var(--color-icon);
  line-height: 1;
  background: none;
  border: 0;
  padding: var(--spacing-2);
  cursor: pointer;
}
.mobilenav[hidden], .navburger[hidden] { display: none; }
.mobilenav {
  display: none;
  flex-direction: column;
  gap: var(--spacing-4);
  padding: var(--spacing-4) var(--page-margin) var(--spacing-5);
  border-top: var(--rule-w) solid var(--color-rule);
}
.mobilenav .btn { align-self: flex-start; }
@media (max-width: 760px) {
  .navlinks { display: none; }
  .navburger { display: block; }
  .mobilenav { display: flex; }
}

/* Form fields: stacked label above field. */
.flabel { display: flex; flex-direction: column; gap: 6px; }
.grid2f { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .grid2f { grid-template-columns: 1fr; } }

/* FAQ accordion: hairline dividers, no containers, unicode glyphs only. */
details.faq { border-top: var(--rule-w) solid var(--color-rule); }
details.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-5);
  padding: 18px 0;
  font-size: var(--text-h3);
  font-weight: var(--font-weight-bold);
  color: var(--color-ink-strong);
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-weight: var(--font-weight-regular); color: var(--color-icon-secondary); }
details.faq[open] summary::after { content: "\00d7"; }
details.faq p {
  margin: 0 0 20px;
  max-width: var(--measure);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

/* Footer per the mockups: 40/30/30 columns over a legal strip, on the white
   band (the old Mineral footer). */
.site-ftr { background: var(--color-raised); }
.ftr3 { display: grid; grid-template-columns: 40fr 30fr 30fr; gap: 40px; }
.ftr-col { display: flex; flex-direction: column; gap: 10px; }
.ftr-col a,
.ftr-col span:not(.label) { font-size: var(--text-small); color: var(--color-ink-strong); text-decoration: none; }
.ftr-col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ftr-btm {
  border-top: var(--rule-w) solid var(--color-rule);
  margin-top: 36px;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
@media (max-width: 760px) { .ftr3 { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Print: one colour, black on white (L&F 2, single-ink print) ---------- */
@media print {
  .site-header .site-nav, .site-footer .footer-cols, .btn { display: none; }
  body { background: var(--color-white); }
  .field-slate, .field-mineral { background: var(--color-white) !important; color: var(--color-black) !important; }
  .field-slate h1, .field-slate h2, .field-slate p { color: var(--color-black) !important; }
}
}

/* RND-799 legal documents: Drive structure only; the words come from site/_includes/legal/. */
.legal-document { max-width: 78ch; }
.legal-document ul { list-style: disc; padding-left: 1.5em; }
.legal-document ol { list-style: decimal; padding-left: 1.5em; }
.legal-document .legal-level-1 { margin-left: 1.5em; list-style: circle; }
.legal-document li + li { margin-top: 0.25em; }
.legal-document h1 { font-size: var(--text-h1, 2rem); }
.legal-document a { overflow-wrap: anywhere; }
