/* Shared by every static page (the landing page, therapies, 404, privacy,
   terms): the bridge onto the ZenLabs tokens, the font, and the parts they
   share (storage notice, sticky CTA, WhatsApp). Loaded after
   zenlabs-tokens.css and zenlabs-components.css. */
/* Google Sans Flex (Matt, 2026-10-30), served from this site: no request to
   Google when someone visits, and the CSP keeps font-src 'self'. Variable
   weight 100-1000, SIL OFL 1.1 (public/fonts/OFL.txt). Latin, and Latin
   Extended only when a page uses it. */
@font-face {
  font-family: "Google Sans Flex"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("/fonts/google-sans-flex-v26-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Google Sans Flex"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("/fonts/google-sans-flex-v26-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* In-page links glide to their section rather than jumping (Matt,
   2026-11-05), except for anyone who has asked their device for less
   motion. The landing page's masthead is sticky, so a section stops below
   it rather than under it. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
html:has(.masthead) { scroll-padding-top: 80px; }

/* --- ZenLabs design system (2026-10-30) ------------------------------------
   zenlabs-tokens.css and zenlabs-components.css are the source; their usage
   notes (zenlabs-tokens.json) set the contrast rules followed here. This maps
   the names the site's own rules use onto those tokens. Lavender is the
   default; data-theme="plum" on any container switches everything inside it
   to the dark theme. Declared on [data-theme] as well as :root, so values
   derived from --ink and --surface are worked out again inside a themed
   container instead of being inherited from the page. */
:root, [data-theme] {
  --bone: var(--surface);
  --panel: var(--bg-paper);
  --panel-alt: var(--bg-haze);
  /* Softer text, still 4.5:1+ (WCAG AA) on every light ground: mist,
     paper and haze. Faint at 74% was 3.9:1 on haze. */
  --ink-soft: color-mix(in srgb, var(--ink) 88%, var(--surface));
  --ink-faint: color-mix(in srgb, var(--ink) 82%, var(--surface));
  --green: var(--ink);
  --green-lift: color-mix(in srgb, var(--ink) 82%, var(--surface));
  --green-deep: var(--plum);
  /* Soft fills (selected rows, hover, highlights): periwinkle, as the tokens'
     light grounds are, never a tint of the plum ink. */
  --tint: var(--periwinkle);
  /* Focus rings and highlights: forest on lavender. */
  --amber: var(--accent);
  --danger: color-mix(in srgb, var(--signal-red) 72%, var(--bg-ink));
  --rule: color-mix(in srgb, var(--ink) 18%, transparent);
  --line-strong: color-mix(in srgb, var(--ink) 34%, transparent);
  --field-border: color-mix(in srgb, var(--ink) 62%, var(--surface));
  --r: var(--radius-sm);
  --r-lg: var(--radius-md);
  --sans: var(--font-sans);
  --shadow: 0 1px 2px rgb(31 21 20 / 0.06), 0 8px 24px rgb(31 21 20 / 0.08);
  color-scheme: light;
}
[data-theme="plum"] {
  --panel: color-mix(in srgb, var(--plum) 84%, var(--bg-ink));
  --panel-alt: color-mix(in srgb, var(--plum) 68%, var(--bg-ink));
  /* No softer text on plum: periwinkle on plum is only 5.0:1, and any
     softening drops body copy under the 4.5:1 WCAG AA needs. */
  --ink-soft: var(--ink);
  --ink-faint: var(--ink);
  /* Lime, not the theme's signal-red accent: red on plum is 2.8:1, under the
     3:1 a focus ring needs. */
  --amber: var(--lime);
  --danger: #ffb3a6;
  color-scheme: dark;
}

/* --- Static pages ---------------------------------------------------------- */
.page { margin: 0; background: var(--bone); color: var(--ink); font-family: var(--sans); line-height: 1.6; }
.page a { color: var(--green); }
.page a:hover { color: var(--green-lift); }
.page-bar { max-width: 760px; margin: 0 auto; padding: 20px 16px; display: flex; justify-content: space-between; align-items: center; }
.page-brand { display: inline-flex; align-items: center; font-weight: 600; font-size: 1.15rem; color: var(--ink) !important; text-decoration: none; }
/* The ZenLab logomark beside the name (public/logomark.svg, 2026-10-30).
   Decorative (alt=""): the name beside it is the link's text. Plum, for the
   lavender headers and footers it sits in. */
.brand-mark { display: inline-block; flex: none; width: auto; height: 1.35em; margin-right: 0.45em; vertical-align: -0.3em; }
.page-main { max-width: 760px; margin: 0 auto; padding: 8px 16px 64px; }
.page-main h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.01em; margin: 24px 0 12px; }
.page-main h2 { font-size: 1.25rem; margin: 36px 0 8px; }
.page-main h3 { font-size: 1.05rem; margin: 24px 0 6px; }
.page-main p, .page-main li { max-width: 68ch; }
.page-main .lede { font-size: 1.15rem; color: var(--ink-soft); }
.page-foot { max-width: 760px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--rule); font-size: 0.9rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 8px 20px; }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: var(--radius-pill); border: 1px solid var(--green); background: var(--green); color: var(--bone) !important; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--green-lift); border-color: var(--green-lift); }
.btn-quiet { background: transparent; color: var(--ink) !important; border-color: var(--line-strong); }
.btn-quiet:hover { background: transparent; border-color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.draft-banner { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--amber); border-radius: var(--r); background: color-mix(in srgb, var(--amber) 12%, transparent); font-size: 0.95rem; }
.todo { background: color-mix(in srgb, var(--amber) 22%, transparent); padding: 0 4px; border-radius: 3px; }
.meta { color: var(--ink-faint); font-size: 0.9rem; }

/* --- Storage notice (notice.js) ------------------------------------------- */
.storage-notice {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto;
  display: flex; gap: 12px; align-items: center; padding: 12px 14px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgb(31 21 20 / 0.12); font: 0.9rem/1.45 var(--sans);
}
.storage-notice p { margin: 0; }
.storage-notice a { color: var(--green); }
.storage-notice button {
  flex: none; min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--green); background: var(--green); color: var(--bone); font: 600 0.9rem var(--sans); cursor: pointer;
}
.storage-notice button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
/* Above the sticky CTA on a phone, never over it. */
@media (max-width: 760px) { .has-sticky-cta .storage-notice { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* --- WhatsApp chat (Matt, 2026-10-30) --------------------------------------
   A link, not a widget: nothing from WhatsApp loads until someone taps it.
   WhatsApp's own green and glyph (unaltered, as its brand rules ask). Sits
   above the storage notice (--notice-h, set by notice.js) and, on a phone,
   above the landing page's sticky button. */
.wa-chat {
  position: fixed; z-index: 58; right: 16px;
  bottom: calc(16px + var(--notice-h, 0px) + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 18px 0 14px; border-radius: 999px;
  background: #25d366; color: #0b1f14 !important; text-decoration: none;
  font: 600 0.95rem/1 var(--sans);
  box-shadow: 0 6px 18px rgb(31 21 20 / 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wa-chat:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgb(31 21 20 / 0.28); }
.wa-chat:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.wa-chat svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
@media (max-width: 760px) {
  /* A round button on a phone: the label goes, the name stays for screen readers. */
  .wa-chat { width: 56px; height: 56px; min-height: 0; padding: 0; justify-content: center; }
  .wa-chat-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wa-chat svg { width: 30px; height: 30px; }
  .has-sticky-cta .wa-chat { bottom: calc(84px + var(--notice-h, 0px) + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .wa-chat { transition: none; } .wa-chat:hover { transform: none; } }
@media print { .wa-chat { display: none; } }

/* --- Device icons (Matt's set, 2026-10-10) --------------------------------
   Each file is drawn as a MASK filled with the text colour, so one SVG works
   in light and dark and takes any colour around it. Decorative: the name is
   always written beside it. Map: web/src/lib/modalityIcons.ts. */
.mi {
  display: inline-block; flex: none; width: 1.2em; height: 1.2em; margin-right: 0.35em; vertical-align: -0.25em;
  background-color: currentColor;
  -webkit-mask: var(--mi) center / contain no-repeat; mask: var(--mi) center / contain no-repeat;
}
.mi-hbot { --mi: url("/icons/hbot.svg"); }
.mi-pemf { --mi: url("/icons/pemf.svg"); }
.mi-ice-bath { --mi: url("/icons/ice-bath.svg"); }
.mi-infrared-sauna { --mi: url("/icons/infrared-sauna.svg"); }
.mi-red-light { --mi: url("/icons/red-light.svg"); }
.mi-cryotherapy { --mi: url("/icons/cryotherapy.svg"); }
