/*
 * Wellbrook Medical — site styles.
 *
 * The :root block below is the shared token system from _template, with the
 * three colour anchors tuned to this practice: --palette-hue 185 and
 * --palette-chroma 0.104 reproduce the brand teal (#0d9488) that this site
 * previously hardcoded as --teal. Retune those rather than editing values.
 *
 * See refs/design/DESIGN.md. Typefaces are set on selectors below, not as
 * tokens, because they are this site's own.
 */
:root {
    /* --- Anchors: the dial for this site ------------------------------- */
    --u-min-vw: 320;
    --u-max-vw: 1240;
    --u-min-font: 16;
    --u-max-font: 18;
    --u-min-ratio: 1.2;
    --u-max-ratio: 1.25;
    /* Space unit (rem) at each end, as in _template. Every --space-* step and
     * pair is a fixed multiple of it. */
    --u-space-min: 1;
    --u-space-max: 1.25;

    /* --- Derivation. Not usually edited by hand. ----------------------- */
    /* Slope and intercept of the line between the two anchor viewports,
     * expressed so each step can be written as clamp(min, calc(...), max). */
    --u-vw-range: calc(var(--u-max-vw) - var(--u-min-vw));

    /* Type steps, in rem at each anchor. Each step multiplies the previous
     * one by the ratio, so the relationship between sizes is fixed even as the
     * absolute values move. */
    --u-min-0: calc(var(--u-min-font) / 16);
    --u-max-0: calc(var(--u-max-font) / 16);

    --u-min--2: calc(var(--u-min-0) / var(--u-min-ratio) / var(--u-min-ratio));
    --u-max--2: calc(var(--u-max-0) / var(--u-max-ratio) / var(--u-max-ratio));
    --u-min--1: calc(var(--u-min-0) / var(--u-min-ratio));
    --u-max--1: calc(var(--u-max-0) / var(--u-max-ratio));
    --u-min-1: calc(var(--u-min-0) * var(--u-min-ratio));
    --u-max-1: calc(var(--u-max-0) * var(--u-max-ratio));
    --u-min-2: calc(var(--u-min-1) * var(--u-min-ratio));
    --u-max-2: calc(var(--u-max-1) * var(--u-max-ratio));
    --u-min-3: calc(var(--u-min-2) * var(--u-min-ratio));
    --u-max-3: calc(var(--u-max-2) * var(--u-max-ratio));
    --u-min-4: calc(var(--u-min-3) * var(--u-min-ratio));
    --u-max-4: calc(var(--u-max-3) * var(--u-max-ratio));
    --u-min-5: calc(var(--u-min-4) * var(--u-min-ratio));
    --u-max-5: calc(var(--u-max-4) * var(--u-max-ratio));

    /* --- Type scale ---------------------------------------------------- */
    /* step--2 fine print · step-0 body · step-2/3 section headings ·
     * step-4/5 hero display. Use these, not raw px. */
    --step--2: clamp(calc(var(--u-min--2) * 1rem), calc(var(--u-min--2) * 1rem + (var(--u-max--2) - var(--u-min--2)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max--2) * 1rem));
    --step--1: clamp(calc(var(--u-min--1) * 1rem), calc(var(--u-min--1) * 1rem + (var(--u-max--1) - var(--u-min--1)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max--1) * 1rem));
    --step-0: clamp(calc(var(--u-min-0) * 1rem), calc(var(--u-min-0) * 1rem + (var(--u-max-0) - var(--u-min-0)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max-0) * 1rem));
    --step-1: clamp(calc(var(--u-min-1) * 1rem), calc(var(--u-min-1) * 1rem + (var(--u-max-1) - var(--u-min-1)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max-1) * 1rem));
    --step-2: clamp(calc(var(--u-min-2) * 1rem), calc(var(--u-min-2) * 1rem + (var(--u-max-2) - var(--u-min-2)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max-2) * 1rem));
    --step-3: clamp(calc(var(--u-min-3) * 1rem), calc(var(--u-min-3) * 1rem + (var(--u-max-3) - var(--u-min-3)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max-3) * 1rem));
    --step-4: clamp(calc(var(--u-min-4) * 1rem), calc(var(--u-min-4) * 1rem + (var(--u-max-4) - var(--u-min-4)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max-4) * 1rem));
    --step-5: clamp(calc(var(--u-min-5) * 1rem), calc(var(--u-min-5) * 1rem + (var(--u-max-5) - var(--u-min-5)) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-max-5) * 1rem));

    /* --- Weight -------------------------------------------------------- */
    /* Named by the CSS value, not by a word. "bold" is a claim about how a
     * typeface renders; 700 is what you actually asked for, and two faces
     * disagree about which of their cuts reads as bold.
     *
     * THREE WEIGHTS, DELIBERATELY. Body, emphasis, headline — that is the
     * whole system, and it is expressed by which tokens exist rather than by
     * a rule asking politely. Adding --weight-800 needs a reason: the face
     * has a visibly distinct heavy cut AND 700 alone is not creating enough
     * contrast. If 700 and 800 render identically on screen, that is not one.
     * A flat hierarchy is almost always a spacing or size problem, not a
     * weight problem. */
    --weight-400: 400;  /* body */
    --weight-600: 600;  /* nav, card emphasis, eyebrows */
    --weight-700: 700;  /* headlines, CTAs */

    /* --- Leading ------------------------------------------------------- */
    /* A ladder rather than a derived scale, so it is t-shirt sized like
     * --space-* rather than numbered like --step-*. Tightest to loosest.
     *
     * The relationship worth holding: line-height falls as type size rises.
     * Display type at body leading looks unset; body copy at display leading
     * is unreadable. Pair --leading-xs with --step-4/5 and --leading-l with
     * --step-0. */
    --leading-xs: 1.05;   /* display, very large headlines */
    --leading-s: 1.18;    /* headings */
    --leading-m: 1.3;     /* subheadings, ledes, card copy */
    --leading-l: 1.5;     /* body copy */
    --leading-xl: 1.6;    /* long-form and small print, which need more air */

    /* --- Tracking ------------------------------------------------------ */
    /* Same shape: a ladder, tightest to loosest, in em so it scales with
     * whatever size it is applied to.
     *
     * The relationship: tracking tightens as size grows, and ALL-CAPS always
     * needs opening up — uppercase at 0 tracking reads cramped at any size.
     * Pair --tracking-xs with --step-4/5, --tracking-m with body, and
     * --tracking-l or --tracking-xl with any text-transform: uppercase. */
    --tracking-xs: -0.02em;  /* large display */
    --tracking-s: -0.01em;   /* headings */
    --tracking-m: 0;         /* body — the default, stated so it can be reset to */
    --tracking-l: 0.04em;    /* small caps-ish, buttons */
    --tracking-xl: 0.08em;   /* eyebrows and other all-caps runs */

    /* --- Space scale --------------------------------------------------- */
    /* Multiples of the base size rather than the type ratio, so spacing stays
     * predictable while type can be as dramatic as the site needs. */
    --space-3xs: clamp(calc(var(--u-space-min) * 0.25rem), calc(var(--u-space-min) * 0.25rem + (var(--u-space-max) * 0.3 - var(--u-space-min) * 0.25) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 0.3rem));
    --space-2xs: clamp(calc(var(--u-space-min) * 0.5rem), calc(var(--u-space-min) * 0.5rem + (var(--u-space-max) * 0.5 - var(--u-space-min) * 0.5) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 0.5rem));
    --space-xs: clamp(calc(var(--u-space-min) * 0.75rem), calc(var(--u-space-min) * 0.75rem + (var(--u-space-max) * 0.75 - var(--u-space-min) * 0.75) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 0.75rem));
    --space-s: clamp(calc(var(--u-space-min) * 1rem), calc(var(--u-space-min) * 1rem + (var(--u-space-max) * 1 - var(--u-space-min) * 1) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 1rem));
    --space-m: clamp(calc(var(--u-space-min) * 1.5rem), calc(var(--u-space-min) * 1.5rem + (var(--u-space-max) * 1.5 - var(--u-space-min) * 1.5) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 1.5rem));
    --space-l: clamp(calc(var(--u-space-min) * 2rem), calc(var(--u-space-min) * 2rem + (var(--u-space-max) * 2 - var(--u-space-min) * 2) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 2rem));
    --space-xl: clamp(calc(var(--u-space-min) * 3rem), calc(var(--u-space-min) * 3rem + (var(--u-space-max) * 3 - var(--u-space-min) * 3) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 3rem));
    --space-2xl: clamp(calc(var(--u-space-min) * 4rem), calc(var(--u-space-min) * 4rem + (var(--u-space-max) * 4 - var(--u-space-min) * 4) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 4rem));
    --space-3xl: clamp(calc(var(--u-space-min) * 6rem), calc(var(--u-space-min) * 6rem + (var(--u-space-max) * 6 - var(--u-space-min) * 6) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 6rem));
    --space-4xl: clamp(calc(var(--u-space-min) * 8rem), calc(var(--u-space-min) * 8rem + (var(--u-space-max) * 8 - var(--u-space-min) * 8) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 8rem));

    /* --- Space pairs --------------------------------------------------- */
    /* A pair moves from the SMALLER step on a phone to the LARGER one on a
     * desktop, so the gap changes step rather than merely scaling. This is what
     * replaces per-breakpoint section padding: --space-l-2xl is roughly the old
     * "40-48px mobile, 80-96px desktop" rule, expressed once. */
    --space-2xs-xs: clamp(calc(var(--u-space-min) * 0.5rem), calc(var(--u-space-min) * 0.5rem + (var(--u-space-max) * 0.75 - var(--u-space-min) * 0.5) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 0.75rem));
    --space-xs-s: clamp(calc(var(--u-space-min) * 0.75rem), calc(var(--u-space-min) * 0.75rem + (var(--u-space-max) * 1 - var(--u-space-min) * 0.75) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 1rem));
    --space-s-m: clamp(calc(var(--u-space-min) * 1rem), calc(var(--u-space-min) * 1rem + (var(--u-space-max) * 1.5 - var(--u-space-min) * 1) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 1.5rem));
    --space-m-l: clamp(calc(var(--u-space-min) * 1.5rem), calc(var(--u-space-min) * 1.5rem + (var(--u-space-max) * 2 - var(--u-space-min) * 1.5) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 2rem));
    --space-l-xl: clamp(calc(var(--u-space-min) * 2rem), calc(var(--u-space-min) * 2rem + (var(--u-space-max) * 3 - var(--u-space-min) * 2) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 3rem));
    --space-xl-2xl: clamp(calc(var(--u-space-min) * 3rem), calc(var(--u-space-min) * 3rem + (var(--u-space-max) * 4 - var(--u-space-min) * 3) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 4rem));
    --space-l-2xl: clamp(calc(var(--u-space-min) * 2rem), calc(var(--u-space-min) * 2rem + (var(--u-space-max) * 4 - var(--u-space-min) * 2) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 4rem));
    --space-s-l: clamp(calc(var(--u-space-min) * 1.125rem), calc(var(--u-space-min) * 1.125rem + (var(--u-space-max) * 2 - var(--u-space-min) * 1.125) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 2rem));  /* skip-a-step: grid gutter */
    --space-2xl-3xl: clamp(calc(var(--u-space-min) * 4rem), calc(var(--u-space-min) * 4rem + (var(--u-space-max) * 6 - var(--u-space-min) * 4) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 6rem));
    --space-3xl-4xl: clamp(calc(var(--u-space-min) * 6rem), calc(var(--u-space-min) * 6rem + (var(--u-space-max) * 8 - var(--u-space-min) * 6) * (100vw - var(--u-min-vw) * 1px) / var(--u-vw-range) * 16), calc(var(--u-space-max) * 8rem));

    /* --- Measure ------------------------------------------------------- */
    --measure: 65ch;        /* body copy */
    --measure-tight: 45ch;  /* card and caption copy */

    /* =====================================================================
     * COLOUR
     *
     * Three anchors drive the whole palette. Change them to match the
     * practice; everything else follows. See refs/design/DESIGN.md.
     *
     *   --palette-hue         the practice's brand hue, 0-360.
     *                         Roughly: 25 terracotta · 60 ochre · 145 green
     *                         · 195 teal · 240 blue · 275 violet · 340 rose
     *   --palette-chroma      how saturated the brand reads. OKLCH chroma is
     *                         NOT 0-1 — it runs about 0-0.37 in sRGB, and
     *                         above ~0.15 a surface colour starts to shout.
     *                         0.04 muted · 0.09 confident · 0.14 vivid
     *   --palette-secondary-shift
     *                         degrees from the primary to the secondary.
     *                         150-180 gives a complement; 30-60 an analogous
     *                         neighbour that reads calmer.
     * ===================================================================== */
    --palette-hue: 185;    /* the practice teal, #0d9488 */
    --palette-chroma: 0.104;
    --palette-secondary-shift: 150;

    --hue-primary: var(--palette-hue);
    --hue-secondary: calc(var(--palette-hue) + var(--palette-secondary-shift));

    /* Feedback hues are FIXED and do not follow the brand. A danger colour
     * that rotates with the practice's hue stops reading as danger — the
     * entire value of a semantic colour is that it means the same thing on
     * every site. Only the brand colours above derive from --palette-hue. */
    --hue-success: 145;
    --hue-warning: 75;
    --hue-danger: 27;
    --hue-info: 240;

    /* Lightness ramp. Dark mode overrides these below rather than declaring a
     * second palette — in OKLCH, dark mode is largely an inversion of these
     * four numbers. */
    --l-solid: 0.52;   /* solid fills: buttons, badges. 0.52, not the template's 0.55: at 0.55 this
                        * teal measured 4.42:1 under white text and 4.07:1 on the pale hero, both under AA */
    --l-hover: 0.48;   /* one step darker for hover */
    --l-light: 0.66;   /* one step lighter: gradient partner for --primary */
    --l-pale: 0.96;    /* tinted backgrounds */
    --l-muted: 0.92;   /* a touch stronger than pale, for wash gradients */
    --l-on-solid: 0.99;/* text on a solid fill */

    /* Brand */
    --primary: oklch(var(--l-solid) var(--palette-chroma) var(--hue-primary));
    --primary-hover: oklch(var(--l-hover) var(--palette-chroma) var(--hue-primary));
    --primary-light: oklch(var(--l-light) var(--palette-chroma) var(--hue-primary));
    /* Chroma falls as lightness rises — a pale tint at full chroma reads
     * muddy rather than tinted. */
    --primary-pale: oklch(var(--l-pale) calc(var(--palette-chroma) * 0.25) var(--hue-primary));
    --primary-muted: oklch(var(--l-muted) calc(var(--palette-chroma) * 0.35) var(--hue-primary));
    /* Pale wash that drifts slightly off the brand hue, for large soft
       backgrounds. Derived from the anchor so it follows a re-hued site. */
    --primary-pale-drift: oklch(var(--l-pale) calc(var(--palette-chroma) * 0.2) calc(var(--hue-primary) + 25));
    --on-primary: oklch(var(--l-on-solid) 0 0);

    --secondary: oklch(var(--l-solid) var(--palette-chroma) var(--hue-secondary));
    --secondary-hover: oklch(var(--l-hover) var(--palette-chroma) var(--hue-secondary));
    --secondary-pale: oklch(var(--l-pale) calc(var(--palette-chroma) * 0.25) var(--hue-secondary));

    /* Aliases for the older names in DESIGN.md, so existing markup and any
     * site copied from an earlier template keep working. */
    --accent: var(--primary);
    --accent-dark: var(--primary-hover);
    --accent-pale: var(--primary-pale);

    /* Feedback. Chroma is per-hue: yellows need more to read as yellow, reds
     * less before they turn fluorescent. */
    --success: oklch(calc(var(--l-solid) - 0.03) 0.13 var(--hue-success));
    --success-pale: oklch(var(--l-pale) 0.03 var(--hue-success));
    --warning: oklch(0.75 0.14 var(--hue-warning));
    --warning-pale: oklch(var(--l-pale) 0.04 var(--hue-warning));
    --danger: oklch(var(--l-solid) 0.17 var(--hue-danger));
    --danger-pale: oklch(var(--l-pale) 0.03 var(--hue-danger));
    --info: oklch(var(--l-solid) 0.11 var(--hue-info));
    --info-pale: oklch(var(--l-pale) 0.03 var(--hue-info));

    /* Neutrals carry a trace of the brand hue so greys feel of a piece with
     * the accent rather than dropped in from a different site. This is what
     * DESIGN.md asked for in prose — "a teal practice and a navy practice
     * want different --ink warmth" — expressed once instead of by eye. */
    /* Headings and dark surfaces: deeper and cooler than body copy. */
    --ink-strong: oklch(0.18 0.030 calc(var(--hue-primary) + 80));
    --ink: oklch(0.25 0.015 var(--hue-primary));
    --ink-mid: oklch(0.45 0.012 var(--hue-primary));
    --ink-soft: oklch(0.54 0.010 var(--hue-primary));
    --bg: oklch(0.99 0.004 var(--hue-primary));
    --surface: oklch(1 0 0);
    --border: oklch(0.90 0.008 var(--hue-primary));
    --border-strong: oklch(0.82 0.010 var(--hue-primary));

    /* --- Grid ---------------------------------------------------------- */
    /* Deliberately minimal: the container and gutter are fluid, placement is
     * left to each layout. Use .u-container and .u-grid below. */
    --grid-max-width: 77.5rem;
    --grid-gutter: var(--space-s-l);
    --grid-columns: 12;

    /* --- Radius -------------------------------------------------------- */
    /* Named by intent rather than by number, so a change of scale does not
     * mean auditing every --radius-3 in the stylesheet. */
    --radius-xs: 0.25rem;   /* tags, inline chips */
    --radius-s: 0.5rem;     /* buttons, inputs */
    --radius-m: 0.75rem;    /* cards */
    --radius-l: 1.25rem;    /* panels, modals, hero media */
    --radius-round: 50%;    /* avatars */
    --radius-pill: 999px;   /* pills, badges */

    /* --- Border widths ------------------------------------------------- */
    --border-thin: 1px;
    --border-medium: 2px;
    --border-thick: 4px;    /* accent rules, active states */

    /* --- Touch targets ------------------------------------------------- */
    /* The smallest box a finger hits reliably: 44px (WCAG 2.5.5, Apple's
     * HIG). A fixed dimension rather than spacing, so it does not scale. */
    --target-min: 2.75rem;

    /* --- Shadows ------------------------------------------------------- */
    /* Two knobs drive every shadow. --shadow-color takes the brand hue so a
     * raised card reads as part of this practice rather than as generic grey;
     * --shadow-strength is what dark mode adjusts, because a shadow on a dark
     * background needs MORE opacity to be seen, not less. */
    --shadow-color: var(--hue-primary, 220) 20% 15%;
    --shadow-strength: 1%;

    --shadow-s:
        0 1px 2px -1px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%));
    --shadow-m:
        0 3px 5px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)),
        0 7px 14px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%));
    --shadow-l:
        0 -1px 3px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 2%)),
        0 6px 12px -3px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)),
        0 15px 30px -6px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 5%));

    --shadow-inner-s: inset 0 1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 6%));
    --shadow-inner-m: inset 0 2px 6px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%));

    /* --- Layers -------------------------------------------------------- */
    /* Six values, so z-index is never invented at the call site. */
    --layer-behind: -1;    /* decorative washes sitting behind content */
    --layer-base: 1;
    --layer-raised: 2;      /* hover cards, sticky rows */
    --layer-nav: 3;         /* sticky header */
    --layer-overlay: 4;     /* dropdowns, popovers */
    --layer-modal: 5;       /* dialogs and their backdrop */
    --layer-top: 2147483647;/* skip links, live-region alerts */

    /* --- Motion -------------------------------------------------------- */
    --duration-fast: 120ms;   /* hover, focus */
    --duration-base: 220ms;   /* most transitions */
    --duration-slow: 400ms;   /* entrances */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --reveal-distance: 1.5rem;

    --font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'p22-mackinac-pro', Georgia, serif;
}

/* ═══════════════════════════════════════════════════════════════════════
 * RESET
 *
 * Josh Comeau's Custom CSS Reset (joshwcomeau.com/css/custom-css-reset/),
 * lightly adapted. Normalises browser defaults so the base layer below is
 * building on the same ground in every browser. Leave this alone; make
 * design decisions in the base layer and the tokens above it.
 * ═══════════════════════════════════════════════════════════════════════ */

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

* { margin: 0; padding: 0; }

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

body {
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* Media is block-level and never overflows its container. */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* Form controls inherit typography rather than using browser chrome. */
:where(input, button, textarea, select) { font: inherit; }   /* zero specificity: "Form controls" below must win */

/* Long words and URLs wrap instead of forcing a horizontal scrollbar. */
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* A new stacking context on the root, so app-level layers cannot escape. */
#root, #__next { isolation: isolate; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
 * ELEMENT BASE LAYER
 *
 * Bare elements are styled here so a page is correct with no classes at
 * all. Without this, an unclassed <h2> falls back to the browser default
 * and whoever writes the page patches it with an inline style — which is
 * how a site ends up with a different heading treatment per page.
 *
 * Every heading has a matching .h1-.h6 class. Use the ELEMENT for document
 * structure (SEO, screen readers, outline) and the CLASS for appearance,
 * so an <h1> can look like an eyebrow without lying about the hierarchy:
 *
 *     <h1 class="h4">Still the page's real heading, just smaller</h1>
 *
 * Sites override these; they are a floor, not a straitjacket.
 * ═══════════════════════════════════════════════════════════════════════ */

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: var(--weight-400);
    line-height: var(--leading-l);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* Headings ─────────────────────────────────────────────────────────────
 * Margins are top-heavy on purpose: a heading belongs to what follows it,
 * so the space above is larger than the space below. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    margin: var(--space-l) 0 var(--space-s);
    font-family: var(--font-heading);
    font-weight: var(--weight-700);
    line-height: var(--leading-s);
    letter-spacing: var(--tracking-xs);
    color: var(--ink-strong);
    text-wrap: balance;
}

:where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) + * {
    margin-top: 0;
}

/* A heading opening its container needs no space above it. */
:where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6):first-child {
    margin-top: 0;
}

h1, .h1 { font-size: var(--step-5); }
h2, .h2 { font-size: var(--step-4); }
h3, .h3 { font-size: var(--step-3); }
h4, .h4 { font-size: var(--step-2); }
h5, .h5 { font-size: var(--step-1); line-height: var(--leading-m); }
/* A small heading at body size, sentence case — for panel and card titles
 * that sit below the .h5 step but should not become an uppercase label. */
.h6-plain {
    font-size: var(--step-0);
    line-height: var(--leading-m);
    letter-spacing: normal;
    text-transform: none;
}

h6, .h6 {
    font-size: var(--step-0);
    line-height: var(--leading-m);
    letter-spacing: var(--tracking-m);
    text-transform: uppercase;
}

/* A highlighted phrase inside a heading. One mechanism, not three. */
:where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) em {
    font-style: italic;
    color: var(--primary);
}

/* Text ─────────────────────────────────────────────────────────────── */
p, ul, ol, dl, blockquote, figure, table, pre {
    margin: 0 0 var(--space-m);
}

/*
 * Line length is a container's job, not every paragraph's — capping each <p>
 * leaves text hugging the left of any column already sized for reading.
 * Use .measure (or set a width on the container) where prose needs it.
 */
.measure { max-width: var(--measure); }
.measure-tight { max-width: var(--measure-tight); }

/* Opening paragraph: larger and looser than body copy. */
.lede {
    max-width: 600px;
    font-size: var(--step-1);
    line-height: var(--leading-xl);
    color: var(--ink-mid);
}

/* Small label above a heading. */
.eyebrow {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    margin-bottom: var(--space-s);
    font-size: var(--step--2);
    font-weight: var(--weight-600);
    letter-spacing: var(--tracking-xl);
    text-transform: uppercase;
    color: var(--primary-hover);
}

/* The short rule that sets an eyebrow off from the heading below it. */
.eyebrow::before {
    content: '';
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--primary);
}

small, .text-small { font-size: var(--step--1); }

strong, b { font-weight: var(--weight-700); }

a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--primary-hover); }

ul, ol { padding-left: var(--space-m); }

/*
 * List spacing applies to PROSE lists only. Navigation, button groups and
 * card grids are lists too, and flow margins on those knock flex/grid items
 * out of alignment (the site header) or balloon the spacing (the footer).
 *
 * Presence of a class is not the test — a footer nav is a nav whether or not
 * anyone put a class on it — so navigation context opts out explicitly.
 */
:where(ul, ol) > li { margin-bottom: var(--space-2xs); }
:where(ul, ol) > li:last-child { margin-bottom: 0; }

nav ul, nav ol,
header ul, header ol,
footer ul, footer ol,
menu {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

nav li, header li, footer li, menu li {
    margin-bottom: 0;
}

/* A list explicitly used for layout carries no bullets, indent or margin. */
:where(ul, ol)[class] {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

:where(ul, ol)[class] > li { margin-bottom: 0; }

blockquote {
    padding-left: var(--space-m);
    border-left: var(--border-thick) solid var(--primary-pale);
    color: var(--ink-mid);
    font-style: italic;
}

hr {
    height: 0;
    margin: var(--space-l) 0;
    border: 0;
    border-top: var(--border-thin) solid var(--border);
}

code, kbd, samp, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
}

/* Media ────────────────────────────────────────────────────────────────
 * Images are rounded by default. The square-photo bug on Wellbrook was an
 * <img> with no radius sitting beside cards that had one. */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-radius: var(--radius-m);
    background: var(--surface);
}

/*
 * Logos, icons and inline SVG are not photographs — a background plate and a
 * radius are wrong for them, and show up as a white box on a dark footer.
 */
img[class*="logo"], img[class*="icon"], .logo img, svg {
    border-radius: 0;
    background: none;
}

/* Opt out where a radius is wrong: full-bleed art, decorative crops. */
img.is-flush, .is-flush img { border-radius: 0; background: none; }

figure { margin-inline: 0; }

figcaption {
    margin-top: var(--space-2xs);
    font-size: var(--step--1);
    color: var(--ink-soft);
}

/* Tables ───────────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: var(--space-2xs) var(--space-xs);
    border-bottom: var(--border-thin) solid var(--border);
    vertical-align: top;
}

th {
    font-weight: var(--weight-600);
    color: var(--ink-strong);
}

tbody tr:last-child :where(th, td) { border-bottom: 0; }

/* ═══ Form controls & focus ═══ form-controls:begin ══════════════════════
 * A text field's look, and every focus ring on the site, are set ONCE,
 * here: by the --field-* and --focus-ring* tokens and a few base rules.
 * Every text-like control on the site (contact, search, careers, booking,
 * anything mediflare.js or Connect writes) inherits it, so they match by
 * construction.
 *
 * - This section is copied VERBATIM from _template and never edited in a
 *   site: check-system.sh fails the site if its copy differs by a character.
 *   A site differs only in TOKEN VALUES, set in the site layer's own :root,
 *   below this section (a later :root wins over the defaults here).
 * - Never restyle a control inside a component. A component rule may place
 *   a field (grid, margin, width) but never sets its border, radius,
 *   background or height -- check-system.sh fails the site if one does.
 * - Fields and buttons share ONE corner, --control-radius: set it in the
 *   site layer's :root and both follow. Never set --field-radius
 *   (check-system.sh fails it), except to 0 in underline mode below;
 *   pill buttons mean pill fields.
 * - The base rules are at zero specificity (:where), so any token change
 *   reaches every field and nothing here outranks a deliberate override.
 * - ONE focus ring per site, on links, buttons and fields alike: an outline
 *   in --focus-ring at --focus-ring-w. No other rule sets a focus outline,
 *   colour or box-shadow (check-system.sh fails one); outline-offset may be
 *   adjusted where a ring would be clipped.
 * - Underline-only fields: set --field-border-w: 0,
 *   --field-border-bottom: var(--border-thin) solid <colour> and
 *   --field-radius: 0 (an underline has no corners to share; a rounded one
 *   curves at its ends, and buttons keep --control-radius); optionally
 *   --field-focus-border-bottom: var(--focus-ring-w) solid var(--focus-ring)
 *   so the underline thickens with the ring. No extra rules. Underline
 *   mode is the only time a site sets --field-radius, and check-system.sh
 *   then requires the 0.
 * - Dark panels and bands: the container re-sets the tokens for its
 *   descendants, never the rules. Tokens defined here are resolved on :root,
 *   so re-set the leaf values, not the ones they derive from:
 *     .band--dark {
 *         --focus-ring: var(--surface);
 *         --field-bg: transparent;
 *         --field-ink: var(--on-primary);
 *         --field-border: var(--on-primary);
 *         --field-placeholder: color-mix(in oklab, var(--on-primary) 70%, transparent);
 *     }
 *   --focus-ring must reach >= 3:1 against every ground it is drawn on.
 * The guard finds this section by the begin/end markers; keep both.
 * ═══════════════════════════════════════════════════════════════════════ */

:root {
    --field-h: var(--target-min);                 /* the single-line height: exact, never below the 44px target */
    --field-textarea-h: calc(var(--field-h) * 3); /* the textarea's minimum height */
    --field-pad-block: var(--space-2xs);          /* textarea only; a one-line field centres its text in --field-h */
    --field-pad-inline: var(--space-xs);
    --field-font-size: max(var(--step-0), 1rem);  /* never below 16px, or iOS zooms the page on focus */
    --field-leading: var(--leading-m);
    --field-weight: var(--weight-400);            /* one weight wherever the field sits */
    --field-radius: var(--control-radius);        /* = the .btn radius, by construction; never set it */
    --field-textarea-radius: min(var(--field-radius), var(--radius-l));   /* a pill textarea is a capsule; cap it */
    --field-bg: var(--surface);
    --field-ink: var(--ink);
    --field-border-w: var(--border-thin);
    --field-border: var(--border-strong);
    --field-border-hover: var(--ink-soft);
    --field-placeholder: var(--ink-soft);
    /* Unset by default, so they follow --field-border-w/--field-border:
     * --field-border-bottom          the resting bottom edge (underline mode)
     * --field-focus-border-bottom    the bottom edge while focused
     * --field-focus-outline          the field's ring; leave it to the default */
    --focus-ring: var(--primary);                 /* >= 3:1 against --bg, --field-bg and every ground it lands on */
    --focus-ring-w: var(--border-medium);         /* >= --field-border-w, so the ring covers the border */
}

/* THE focus ring: every interactive element, always. Fields refine the
 * offset and radius below; nothing else sets a focus outline. */
:focus-visible {
    outline: var(--focus-ring-w) solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

label {
    display: block;
    margin-bottom: var(--space-3xs);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--ink-strong);
}

/* THE base rule. Every text-like control: text, email, tel, search, number,
 * date, url, password, select and textarea -- not checkboxes, radios,
 * ranges, files or button-type inputs. */
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=submit],[type=button],[type=reset],[type=image],[type=hidden]), select, textarea) {
    --_field-radius: var(--field-radius);
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    height: var(--field-h);
    min-height: var(--field-h);
    padding: 0 var(--field-pad-inline);
    font: inherit;
    font-size: var(--field-font-size);
    font-weight: var(--field-weight);
    line-height: var(--field-leading);
    color: var(--field-ink);
    background-color: var(--field-bg);
    border: var(--field-border-w) solid var(--field-border);
    border-bottom: var(--field-border-bottom, var(--field-border-w) solid var(--field-border));
    border-radius: var(--_field-radius);
    box-shadow: none;
    transition: border-color var(--duration-fast) var(--ease-out);
}

:where(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=submit],[type=button],[type=reset],[type=image],[type=hidden]), select, textarea):hover {
    border-color: var(--field-border-hover);
}

/* One edge on focus. The offset pulls the ring in by the border's width, so
 * it is drawn ON the border (covering it) rather than outside it; the border
 * and shadow are held at rest so nothing draws a second edge. Specificity
 * 0,1,0 and later than the global :focus-visible, so it wins over that one
 * (whose offset and radius suit links, not fields). In underline mode the
 * bottom edge may take --field-focus-border-bottom as well. */
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=submit],[type=button],[type=reset],[type=image],[type=hidden]), select, textarea):focus {
    border-color: var(--field-border);
    border-bottom: var(--field-border-bottom, var(--field-border-w) solid var(--field-border));
    box-shadow: none;
    outline: none;
}
:where(input:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=submit],[type=button],[type=reset],[type=image],[type=hidden]), select, textarea):focus-visible {
    outline: var(--field-focus-outline, var(--focus-ring-w) solid var(--focus-ring));
    outline-offset: calc(var(--field-border-w) * -1);
    border-bottom: var(--field-focus-border-bottom, var(--field-border-bottom, var(--field-border-w) solid var(--field-border)));
    border-radius: var(--_field-radius);
}

:where(textarea) {
    --_field-radius: var(--field-textarea-radius);
    height: auto;
    min-height: var(--field-textarea-h);
    padding-block: var(--field-pad-block);
    resize: vertical;
}

/* The chevron is one conic-gradient wedge in --field-ink: tokens only, no
 * image, so it recolours with the palette and the scheme. (Two half-square
 * linear gradients leave a seam where they meet.) */
:where(select) {
    padding-inline-end: calc(var(--field-pad-inline) * 2 + var(--space-xs));
    background-image: conic-gradient(from -45deg at 50% 100%, var(--field-ink) 90deg, transparent 0);
    background-position: calc(100% - var(--field-pad-inline)) 50%;
    background-size: calc(var(--space-3xs) * 2.5) calc(var(--space-3xs) * 1.25);
    background-repeat: no-repeat;
    cursor: pointer;
}
:where(select[multiple], select[size]) { height: auto; padding-block: var(--field-pad-block); padding-inline-end: var(--field-pad-inline); background-image: none; }

:where(input, textarea)::placeholder { color: var(--field-placeholder); opacity: 1; }

/* The browser's own clear (x) in a search box, redrawn as a mask so it takes
 * --field-ink instead of the browser's grey. */
:where(input[type=search])::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    inline-size: 1em;
    block-size: 1em;
    cursor: pointer;
    background-color: var(--field-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }

fieldset { margin: 0 0 var(--space-m); padding: 0; border: 0; }

/* ═══ form-controls:end (Form controls & focus) ═════════════════════════ */

/* Wellbrook's field look: the contact form's fields, which every other field
 * (search included) now matches. Set here, after the section's defaults, so
 * these win; never restyle a control in a component. */
:root {
    --field-h: var(--target-min);                 /* 44px: the contact fields' 46-48px normalised to the search row's button */
    --field-pad-block: 0.75rem;
    --field-pad-inline: 1rem;
    --control-radius: var(--radius-s);            /* buttons AND fields: the Book button's 8px corner */
    --field-border-w: 1.5px;
    --field-border: var(--border);
    --field-border-hover: var(--border);          /* the contact fields never changed on hover */
    --focus-ring: var(--primary);                 /* the site's one ring: links, buttons, fields; 4.6-5.1:1 on every light ground, 3.7:1 on the ink-strong footer */
    --focus-ring-w: var(--border-medium);         /* 2px */

    /* The container (.u-container): Wellbrook's 1200px measure. Its gutter is
     * the template's --grid-gutter (--space-s-l), the header's and the hero's too. */
    --grid-max-width: 75rem;
    /* The fixed header bar: a dimension, not spacing. The hero, the inner-page
     * hero and the mobile menu clear it by this much. */
    --header-h: 4.5rem;

    /* Wellbrook's own colours: the ones the palette dials above cannot derive.
     * Each holds the exact value the rules used to write inline, so moving a
     * literal here changed nothing on screen; a re-hue changes them here, once. */
    --header-glass: rgba(255, 255, 255, 0.92);          /* the frosted plate behind the fixed header */
    --hero-glow: rgba(13, 148, 136, 0.08);              /* the radial glow in the home hero (the old brand teal, #0d9488) */
    --hero-rule: rgba(13, 148, 136, 0.15);              /* the rule above the hero stats */
    --placeholder-hatch: rgba(13, 148, 136, 0.06);      /* .img-placeholder fill and hatching */
    --placeholder-hatch-on-dark: rgba(255, 255, 255, 0.06);
    --placeholder-ink-on-dark: rgba(255, 255, 255, 0.5);
    --photo-plate-on-dark: rgba(255, 255, 255, 0.1);    /* behind a photo on .section-dark while it loads */
    --photo-plate-on-dark-soft: rgba(255, 255, 255, 0.08);
    --on-dark-copy-strong: rgba(255, 255, 255, 0.9);    /* text on the dark footer, the teal strip and .section-dark */
    --on-dark-copy: rgba(255, 255, 255, 0.8);
    --on-dark-muted-hover: rgba(255, 255, 255, 0.7);
    --on-dark-muted: rgba(255, 255, 255, 0.6);
    --on-dark-underline-hover: rgba(255, 255, 255, 0.4);
    --on-dark-underline: rgba(255, 255, 255, 0.3);
    --on-dark-underline-faint: rgba(255, 255, 255, 0.2);
    --on-dark-divider: rgba(255, 255, 255, 0.18);       /* between the strip's items */
    --on-dark-fill: rgba(255, 255, 255, 0.15);          /* the strip's icon discs */
    --on-dark-rule: rgba(255, 255, 255, 0.1);           /* above the footer's bottom row */
    --feedback-success-border: rgb(167, 243, 208);      /* #a7f3d0 */
    --feedback-error-bg: rgb(254, 242, 242);            /* #fef2f2 */
    --feedback-error-ink: rgb(153, 27, 27);             /* #991b1b */
    --feedback-error-border: rgb(254, 202, 202);        /* #fecaca */
    --wash-amber-from: rgb(254, 243, 199);              /* #fef3c7 */
    --wash-amber-to: rgb(253, 230, 138);                /* #fde68a */
    --wash-violet-from: rgb(221, 214, 254);             /* #ddd6fe */
    --wash-violet-to: rgb(196, 181, 253);               /* #c4b5fd */
}

/* The teal strip: the ring would vanish on its own colour. */
.strip { --focus-ring: var(--on-primary); }

/* Buttons ──────────────────────────────────────────────────────────────
 * .btn is the base; variants change colour, sizes change scale. Applies to
 * <button>, <a class="btn"> and inputs alike. */

/* Cards ────────────────────────────────────────────────────────────────
 * Deliberately minimal — a surface with a radius. Sites compose their own
 * card variants on top; modelling every one here would be guesswork. */
.card {
    padding: var(--space-m);
    background: var(--surface);
    border: var(--border-thin) solid var(--border);
    border-radius: var(--radius-m);
}

/* Utility ──────────────────────────────────────────────────────────── */
.visually-hidden, .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/*
 * The base layer gives bare headings space above them, which is right for
 * flowing prose. These classes sit inside laid-out sections that already
 * control their own spacing, so they opt out.
 */
.hero-title,
.section-heading,
.page-hero h1 {
    margin-top: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--surface);
    color: var(--ink);
    line-height: var(--leading-l);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--ink-strong);
    color: var(--on-primary);
    padding: var(--space-xs) var(--space-m);
    border-radius: var(--radius-m);
    z-index: var(--layer-overlay);
    font-weight: var(--weight-600);
}

.skip-link:focus {
    top: 1rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ─── REVEAL ANIMATIONS ──────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.72s cubic-bezier(0.22,1,0.36,1),
                transform 0.72s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.10s; }
.reveal-delay-2 { transition-delay: 0.20s; }
.reveal-delay-3 { transition-delay: 0.32s; }
.reveal-delay-4 { transition-delay: 0.44s; }

/* ─── HEADER ─────────────────────────────────────────────── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--layer-nav);
    border-bottom: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--header-glass);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    z-index: var(--layer-behind);
}

.header.scrolled { box-shadow: var(--shadow-s); }

.header-inner {   /* also .u-container in the markup */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    color: var(--on-primary);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: var(--leading-xs);
}

.logo-name {
    font-size: var(--step--1);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
    letter-spacing: var(--tracking-s);
}

.logo-sub {
    font-size: var(--step--2);
    color: var(--ink-soft);
    letter-spacing: var(--tracking-xl);
    text-transform: uppercase;
    font-weight: var(--weight-600);
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    list-style: none;
}

.nav-links a {
    color: var(--ink-mid);
    text-decoration: none;
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
}

.nav-links a:hover,
.nav-links a.active { color: var(--primary); }

.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

/* ─── NAV DROPDOWN ──────────────────────────────────────── */
.nav-dropdown {
    position: relative;
    cursor: pointer;
}

.nav-dropdown > button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink-mid);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    padding: 0;
    transition: color 0.2s;
    position: relative;
}

.nav-dropdown > button::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 1.5px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s cubic-bezier(0.22,1,0.36,1);
}

.nav-dropdown > button:hover,
.nav-dropdown > button[aria-expanded="true"] {
    color: var(--primary);
}

.nav-dropdown > button:hover::after,
.nav-dropdown > button[aria-expanded="true"]::after {
    transform: scaleX(1);
}

.nav-dropdown > button svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.nav-dropdown > button[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-m);
    min-width: 200px;
    padding: var(--space-2xs);
    z-index: var(--layer-overlay);
    list-style: none;
}

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--border);
}

.nav-dropdown-menu::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--surface);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: var(--space-2xs) var(--space-s);
    border-radius: var(--radius-s);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--ink-mid);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    cursor: pointer;
}

.nav-dropdown-menu a::after {
    display: none;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
    background: var(--primary-pale);
    color: var(--primary);
}

.nav-buttons {
    display: flex;
    gap: var(--space-xs);
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: var(--target-min);   /* the 44px tap target, every size and variant */
    gap: var(--space-2xs);
    padding: var(--space-2xs) var(--space-s);
    border-radius: var(--control-radius);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s, border-color 0.2s;
    border: none;
    font-family: inherit;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-pale);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--on-primary);
    box-shadow: 0 2px 4px color-mix(in oklab, var(--primary) 20%, transparent);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 4px 8px color-mix(in oklab, var(--primary) 30%, transparent);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-large {
    padding: var(--space-xs) var(--space-m);
    font-size: var(--step-0);
}

/*
 * ON A DARK GROUND
 *
 * The two button variants above assume a light background. On a dark or
 * brand-coloured section they invert: the solid button becomes white, the
 * outline picks up a translucent white edge. One modifier rather than a
 * second set of names — it was three copies of an inline style before.
 */
/*
 * Text on a dark or brand-coloured ground. Pair with .strip / .section-dark
 * so headings and copy invert without a per-element colour override.
 */
.on-dark,
.strip,
.section-dark {
    color: var(--on-primary);
}

.on-dark :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6),
.strip :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6),
.section-dark :where(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
    color: var(--on-primary);
}

.on-dark .btn-primary,
.btn-primary.on-dark {
    background: var(--surface);
    color: var(--primary);
    box-shadow: none;
}

.on-dark .btn-primary:hover,
.btn-primary.on-dark:hover {
    background: var(--surface);
    color: var(--primary-hover);
    transform: translateY(-1px);
}

.on-dark .btn-outline,
.btn-outline.on-dark {
    color: var(--on-primary);
    border-color: color-mix(in oklab, var(--on-primary) 40%, transparent);
}

.on-dark .btn-outline:hover,
.btn-outline.on-dark:hover {
    background: color-mix(in oklab, var(--on-primary) 12%, transparent);
    color: var(--on-primary);
}

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--primary-pale) 0%, var(--primary-pale-drift) 50%, var(--info-pale) 100%);
    min-height: calc(100vh - var(--header-h));
    padding-top: var(--header-h);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, var(--hero-glow) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {   /* also .u-container in the markup */
    padding-block: var(--space-2xl);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-l);   /* wider and the 52px title wraps to three lines at 1440 */
    align-items: center;
    position: relative;
}

.hero-content {
    max-width: 540px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    background: var(--surface);
    padding: var(--space-2xs) var(--space-s);
    border-radius: 100px;
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--primary);
    box-shadow: var(--shadow-s);
    margin-bottom: var(--space-m);
}

.hero-badge svg {
    width: 16px;
    height: 16px;
}

.hero-title {
    font-family: 'p22-mackinac-pro', Georgia, serif;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
    line-height: var(--leading-s);
    margin-bottom: var(--space-m);
}

.hero-title span {
    color: var(--primary);
}

.hero-description {
    font-size: var(--step-1);
    color: var(--ink-soft);
    margin-bottom: var(--space-l);
    line-height: var(--leading-xl);
}

.hero-buttons {
    display: flex;
    gap: var(--space-s);
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: var(--space-l);
    margin-top: var(--space-xl);
    padding-top: var(--space-l);
    border-top: 1px solid var(--hero-rule);
}

.stat { text-align: left; }

.stat-value {
    font-size: var(--step-2);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
}

.stat-label {
    font-size: var(--step--1);
    color: var(--ink-soft);
}

/* Hero Visual / Card */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-self: stretch;
}

.hero-img {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-l);
    object-fit: cover;
}

.hero-card {
    background: var(--surface);
    border-radius: var(--radius-l);
    padding: var(--space-l);
    box-shadow: var(--shadow-l);
    max-width: 400px;
    position: relative;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--wash-amber-from) 0%, var(--wash-amber-to) 100%);
    border-radius: 50%;
    z-index: var(--layer-behind);
}

.hero-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--wash-violet-from) 0%, var(--wash-violet-to) 100%);
    border-radius: 50%;
    z-index: var(--layer-behind);
}

.doctor-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-m);
}

.doctor-avatar svg {
    width: 40px;
    height: 40px;
    color: var(--on-primary);
}

.hero-card h3 {
    font-size: var(--step-1);
    font-weight: var(--weight-600);
    color: var(--ink-strong);
    margin-bottom: var(--space-3xs);
}

.hero-card p {
    color: var(--ink-soft);
    font-size: var(--step--1);
    margin-bottom: var(--space-m);
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs);
    margin-bottom: var(--space-m);
}

.service-tag {
    background: var(--primary-pale);
    color: var(--primary);
    padding: var(--space-3xs) var(--space-xs);
    border-radius: 100px;
    font-size: var(--step--1);
    font-weight: var(--weight-600);
}

.availability {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    color: var(--success);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
}

.availability-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ─── SECTION SHARED ─────────────────────────────────────── */
.section { padding: var(--space-3xl) 0; }
.section-alt { background: var(--primary-pale); }
.section-dark { background: var(--ink-strong); color: var(--on-primary); }

/* The template's container. Wellbrook's measure and gutter are set as its
 * tokens in the site layer's :root (--grid-max-width, --grid-gutter). */
.u-container {
    max-width: var(--grid-max-width);
    margin-inline: auto;
    padding-inline: var(--grid-gutter);
}

.section-heading {
    font-family: 'p22-mackinac-pro', Georgia, serif;
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: var(--weight-700);
    line-height: var(--leading-s);
    letter-spacing: var(--tracking-xs);
    color: var(--ink-strong);
    max-width: 520px;
}

.section-heading em,
.page-hero h1 em,
.hero-title em {
    font-style: italic;
    color: var(--primary);
}

/* ─── SERVICES GRID ──────────────────────────────────────── */
.services-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    gap: var(--space-l);
    flex-wrap: wrap;
}

.services-intro {
    font-size: var(--step-0);
    line-height: var(--leading-xl);
    color: var(--ink-mid);
    max-width: 360px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-m);
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: var(--space-l) var(--space-l) var(--space-l);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s;
}

.section-alt .service-card {
    background: var(--surface);
    border-color: transparent;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-m);
}

.service-card:hover::before { transform: scaleX(1); }

.service-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-s);
    background: var(--primary-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-m);
}

.service-icon svg {
    color: var(--primary);
}

.service-title {
    font-family: var(--font-body);
    font-size: var(--step-1);
    font-weight: var(--weight-600);
    color: var(--ink-strong);
    margin-top: 0;
    margin-bottom: var(--space-xs);
}

.service-body {
    font-size: var(--step--1);
    line-height: var(--leading-xl);
    color: var(--ink-mid);
    margin-bottom: var(--space-m);
}

.service-link {
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-3xs);
    transition: gap 0.2s;
}

.service-card:hover .service-link { gap: var(--space-2xs); }

/* ─── ABOUT SECTION ──────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.about-visual { position: relative; }

.about-img-main {
    border-radius: var(--radius-l);
    overflow: hidden;
    aspect-ratio: 4/5;
    background: var(--photo-plate-on-dark);
}

.about-img-float {
    position: absolute;
    bottom: -28px;
    right: -28px;
    width: 52%;
    border-radius: var(--radius-m);
    overflow: hidden;
    border: 4px solid var(--ink-strong);
    box-shadow: var(--shadow-l);
    aspect-ratio: 4/3;
    background: var(--photo-plate-on-dark-soft);
}

.img-placeholder {
    background-color: var(--placeholder-hatch);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        var(--placeholder-hatch) 8px,
        var(--placeholder-hatch) 9px
    );
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-3xs);
    color: var(--ink-soft);
    font-size: var(--step--2);
    letter-spacing: var(--tracking-xl);
    text-align: center;
    line-height: var(--leading-l);
    user-select: none;
    width: 100%;
    height: 100%;
}

.section-dark .img-placeholder {
    background-color: var(--placeholder-hatch-on-dark);
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        var(--placeholder-hatch-on-dark) 8px,
        var(--placeholder-hatch-on-dark) 9px
    );
    color: var(--placeholder-ink-on-dark);
}

.section-dark .eyebrow { color: var(--primary); }
.section-dark .eyebrow::before { background: var(--primary); }
.section-dark .section-heading { color: var(--on-primary); max-width: 100%; }

.about-body {
    font-size: var(--step-0);
    line-height: var(--leading-xl);
    color: var(--on-dark-copy);
    margin: var(--space-m) 0 var(--space-l);
}

.about-points {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.about-point {
    display: flex;
    align-items: flex-start;
    gap: var(--space-s);
    font-size: var(--step--1);
    color: var(--on-dark-copy-strong);
}

.about-point svg {
    flex-shrink: 0;
    margin-top: calc(var(--space-3xs) / 2);
    color: var(--primary);
}

/* ─── HIGHLIGHT STRIP ────────────────────────────────────── */
.strip {
    background: var(--primary);
    padding: var(--space-xl) 0;
}

.strip-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
}

.strip-item {
    padding: var(--space-m) var(--space-l);
    display: flex;
    align-items: center;
    gap: var(--space-s);
    border-right: 1px solid var(--on-dark-divider);
}

.strip-item:last-child { border-right: none; }

.strip-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--on-dark-fill);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.strip-text .t1 {
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--on-primary);
}

.strip-text .t2 {
    font-size: var(--step--1);
    color: var(--on-dark-copy-strong);
    margin-top: calc(var(--space-3xs) / 2);
}

/* ─── CONTACT SECTION ────────────────────────────────────── */
.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-2xl);
    align-items: start;
}

.contact-map {
    border-radius: var(--radius-l);
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-m);
}

.info-blocks {
    display: flex;
    flex-direction: column;
    gap: var(--space-m);
}

.info-block {
    display: flex;
    gap: var(--space-s);
    align-items: flex-start;
}

.info-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-s);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-s);
}

.section-alt .info-icon { background: var(--surface); }

.info-icon svg { color: var(--primary); }

.info-text .label {
    font-size: var(--step--2);
    font-weight: var(--weight-600);
    letter-spacing: var(--tracking-xl);
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: var(--space-3xs);
}

.info-text .val {
    font-size: var(--step--1);
    color: var(--ink);
    line-height: var(--leading-l);
}

.info-text .val a {
    color: var(--ink);
    transition: color 0.2s;
}

.info-text .val a:hover { color: var(--primary); }

.contact-cta {
    margin-top: var(--space-l);
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

/* ─── CONTACT FORM ───────────────────────────────────────── */
.form-section {
    padding: var(--space-3xl) 0;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
}

.form-group {
    margin-bottom: var(--space-s);
}

.form-group label {
    display: block;
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--ink);
    margin-bottom: var(--space-3xs);
}

.form-group label .required {
    color: var(--danger);
    margin-left: calc(var(--space-3xs) / 2);
}

[data-mf-feedback] {
    margin-top: var(--space-s);
    padding: var(--space-s) var(--space-s);
    border-radius: var(--radius-m);
    font-size: var(--step-0);
    line-height: var(--leading-l);
}

[data-mf-feedback][data-status="success"] {
    background: var(--success-pale);
    color: var(--success);
    border: 1px solid var(--feedback-success-border);
}

[data-mf-feedback][data-status="error"] {
    background: var(--feedback-error-bg);
    color: var(--feedback-error-ink);
    border: 1px solid var(--feedback-error-border);
}

/* ─── LEGAL PAGES ───────────────────────────────────────── */
.legal-content h2 {
    font-size: var(--step-1);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
    margin: var(--space-l) 0 var(--space-xs);
}

.legal-content h3 {
    font-size: var(--step-1);
    font-weight: var(--weight-600);
    color: var(--ink-strong);
    margin: var(--space-l) 0 var(--space-2xs);
}

.legal-content p {
    color: var(--ink-mid);
    line-height: var(--leading-xl);
    margin-bottom: var(--space-s);
}

.legal-content ul {
    list-style: disc;
    padding-left: var(--space-m);
    margin-bottom: var(--space-s);
}

.legal-content li {
    color: var(--ink-mid);
    line-height: var(--leading-xl);
    margin-bottom: var(--space-3xs);
}

.legal-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--primary) 30%, transparent);
    text-underline-offset: 2px;
}

.legal-content a:hover {
    text-decoration-color: var(--primary);
}

.legal-updated {
    font-size: var(--step--1);
    color: var(--ink-soft);
    margin-top: var(--space-xl);
}

/* ─── PATIENT INFO PAGE ────────────────────────────────── */
.patient-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-l);
}

.patient-info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: var(--space-l);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s, transform 0.3s;
}

.patient-info-card:hover {
    box-shadow: var(--shadow-m);
    transform: translateY(-2px);
}

.patient-info-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-pale), var(--primary-muted));
    border-radius: var(--radius-m);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-s);
    color: var(--primary);
}

.patient-info-card h2 {
    font-size: var(--step-1);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
    margin-bottom: var(--space-xs);
}

.patient-info-body {
    color: var(--ink-mid);
    font-size: var(--step--1);
    line-height: var(--leading-xl);
    flex: 1;
}

.patient-info-body p {
    margin-bottom: var(--space-2xs);
}

.patient-info-actions {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-top: var(--space-m);
    padding-top: var(--space-m);
    border-top: 1px solid var(--border);
}

.patient-info-actions .btn {
    font-size: var(--step--1);
    padding: var(--space-2xs) var(--space-s);
}

/* Policy cards */
.policy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-l);
}

.policy-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: var(--space-l);
    transition: box-shadow 0.3s, transform 0.3s;
}

.policy-card:hover {
    box-shadow: var(--shadow-m);
    transform: translateY(-2px);
}

.policy-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-pale);
    border-radius: var(--radius-s);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-s);
    color: var(--primary);
}

.policy-card h3 {
    font-size: var(--step-1);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
    margin-bottom: var(--space-2xs);
}

.policy-body {
    color: var(--ink-mid);
    font-size: var(--step--1);
    line-height: var(--leading-xl);
}

.policy-body p {
    margin-bottom: var(--space-2xs);
}

.policy-body a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--primary) 30%, transparent);
    text-underline-offset: 2px;
}

.policy-body a:hover {
    text-decoration-color: var(--primary);
}

@media (max-width: 768px) {
    .patient-info-grid {
        grid-template-columns: 1fr;
    }
    .policy-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── HOURS TABLE ───────────────────────────────────────── */
.hours-table {
    width: 100%;
    border-collapse: collapse;
}

.hours-table td {
    padding: var(--space-3xs) 0;
    font-size: var(--step--1);
    line-height: var(--leading-l);
    vertical-align: top;
}

.hours-table td:first-child {
    font-weight: var(--weight-600);
    color: var(--ink);
    padding-right: var(--space-m);
    white-space: nowrap;
}

.hours-table td:last-child {
    color: var(--ink-mid);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
    background: var(--ink-strong);
    padding: var(--space-xl) 0 var(--space-l);
    color: var(--on-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.footer-brand .logo-img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-brand p {
    font-size: var(--step--1);
    line-height: var(--leading-xl);
    color: var(--on-dark-muted);
    margin-top: var(--space-s);
}

.footer-col h4 {
    font-size: var(--step--2);
    font-weight: var(--weight-600);
    letter-spacing: var(--tracking-xl);
    text-transform: uppercase;
    color: var(--primary-light);   /* --primary is 3.7:1 on the ink-strong footer */
    margin-bottom: var(--space-s);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.footer-col ul li {
    font-size: var(--step--1);
    line-height: var(--leading-m);
}

.footer-col ul li a {
    color: var(--on-dark-muted);
    transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--on-primary); }

.footer-col p {
    font-size: var(--step--1);
    line-height: var(--leading-xl);
    color: var(--on-dark-muted);
}

.footer-col p a {
    transition: color 0.2s;
}

.footer-col p a:hover { color: var(--on-primary); }

.footer-bottom {
    border-top: 1px solid var(--on-dark-rule);
    padding-top: var(--space-m);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-m);
    flex-wrap: wrap;
}

.footer-bottom p {
    font-size: var(--step--1);
    color: color-mix(in oklab, var(--on-primary) 50%, transparent);   /* 0.4 was 3.8:1 */
}

.footer-bottom a {
    text-decoration: underline;
    text-decoration-color: var(--on-dark-underline-faint);
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.footer-bottom a:hover {
    color: var(--on-dark-muted-hover);
    text-decoration-color: var(--on-dark-underline-hover);
}

/* ─── PAGE HERO (inner pages) ────────────────────────────── */
.page-hero {
    background: linear-gradient(135deg, var(--primary-pale) 0%, var(--primary-pale-drift) 100%);
    padding: calc(var(--header-h) + var(--space-xl)) 0 var(--space-2xl);
}

.page-hero h1 {
    font-family: 'p22-mackinac-pro', Georgia, serif;
    font-size: var(--step-5);
    font-weight: var(--weight-700);
    line-height: var(--leading-s);
    letter-spacing: var(--tracking-xs);
    color: var(--ink-strong);
    margin-bottom: var(--space-s);
}

/* ─── TEAM GRID ──────────────────────────────────────────── */
.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-m);
}

.team-card {
    flex: 0 1 calc(33.333% - 1rem);
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: var(--space-l);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-m);
}

.team-avatar {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-s);
    position: relative;
    overflow: hidden;
}

.team-avatar svg {
    width: 36px;
    height: 36px;
    color: var(--on-primary);
}

.team-card h3 {
    font-size: var(--step-1);
    font-weight: var(--weight-600);
    color: var(--ink-strong);
    margin-bottom: var(--space-3xs);
}

.team-card .role {
    font-size: var(--step--1);
    color: var(--primary);
    font-weight: var(--weight-600);
    margin-bottom: var(--space-xs);
}

.team-card .bio {
    font-size: var(--step--1);
    color: var(--ink-mid);
    line-height: var(--leading-l);
}

/* ─── DOCTORS PAGE ──────────────────────────────────────── */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-l);
}

.doctor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: var(--space-l) var(--space-l) var(--space-l);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s;
}

.doctor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-m);
}

.doctor-card .doctor-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-m);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 0 4px var(--primary-pale), var(--shadow-s);
}

.doctor-card .doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    z-index: var(--layer-base);
}

.doctor-card .doctor-avatar svg {
    width: 48px;
    height: 48px;
    color: var(--on-primary);
    position: absolute;
}

.doctor-card h3 {
    font-size: var(--step-1);
    font-weight: var(--weight-700);
    color: var(--ink-strong);
    margin-bottom: var(--space-3xs);
}

.doctor-qualifications {
    font-size: var(--step--1);
    color: var(--ink-soft);
    font-weight: var(--weight-600);
    letter-spacing: var(--tracking-l);
    margin-bottom: var(--space-s);
}

.doctor-card .bio {
    font-size: var(--step--1);
    color: var(--ink-mid);
    line-height: var(--leading-xl);
    margin-bottom: var(--space-s);
}

.doctor-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    margin-bottom: var(--space-m);
    padding-top: var(--space-s);
    border-top: 1px solid var(--border);
}

.doctor-meta-item {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: var(--space-2xs);
    font-size: var(--step--1);
    color: var(--ink-mid);
    line-height: var(--leading-l);
    text-align: center;
}

.doctor-meta-item svg {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.doctor-book-btn {
    margin-top: auto;
    font-size: var(--step--1);
    padding: var(--space-2xs) var(--space-s);
}

.doctor-days {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3xs);
    font-size: var(--step--2);
    color: var(--ink-soft);
    margin-top: var(--space-xs);
}

.doctor-days svg {
    color: var(--ink-soft);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .doctors-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── MOBILE MENU ────────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2xs);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    color: var(--ink-mid);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-m);
    z-index: var(--layer-nav);
    padding: var(--space-s) var(--space-m) var(--space-m);
}

.mobile-menu.open { display: block; }

.mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    margin-bottom: var(--space-s);
}

.mobile-menu ul a {
    display: block;
    padding: var(--space-xs) var(--space-s);
    border-radius: var(--radius-s);
    font-size: var(--step-0);
    font-weight: var(--weight-600);
    color: var(--ink-mid);
    transition: background 0.2s, color 0.2s;
}

.mobile-menu ul a:hover,
.mobile-menu ul a.active {
    background: var(--primary-pale);
    color: var(--primary);
}

.mobile-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: var(--space-xs) var(--space-s);
    border-radius: var(--radius-s);
    font-size: var(--step-0);
    font-weight: var(--weight-600);
    color: var(--ink-mid);
    transition: background 0.2s, color 0.2s;
}

.mobile-submenu-toggle:hover {
    background: var(--primary-pale);
    color: var(--primary);
}

.mobile-submenu-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.mobile-submenu-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.mobile-submenu-toggle[aria-expanded="true"] {
    color: var(--primary);
}

.mobile-submenu {
    display: none;
    list-style: none;
    padding-left: var(--space-s);
}

.mobile-submenu.open {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
}

.mobile-submenu a {
    display: block;
    padding: var(--space-2xs) var(--space-s);
    border-radius: var(--radius-s);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--ink-mid);
    transition: background 0.2s, color 0.2s;
}

.mobile-submenu a:hover,
.mobile-submenu a.active {
    background: var(--primary-pale);
    color: var(--primary);
}

.mobile-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.mobile-menu-buttons .btn {
    justify-content: center;
    width: 100%;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }

    .hero-inner {
        display: flex;
        flex-direction: column;
        gap: var(--space-2xl);
        text-align: center;
    }

    .hero-content {
        max-width: 600px;
        margin: 0 auto;
        order: -1;
    }

    .hero-img {
        min-height: 0;
        max-height: 320px;
        border-radius: var(--radius-m);
    }

    .hero-buttons { justify-content: center; }
    .hero-stats { justify-content: center; }

    .about-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    .about-img-float { right: 0; }
    .contact-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    .form-grid { grid-template-columns: 1fr; gap: var(--space-xl); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .strip-grid { grid-template-columns: repeat(2, 1fr); }
    .strip-item:nth-child(2) { border-right: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-l); }
}

@media (max-width: 640px) {
    .nav-buttons { display: none; }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-s);
        align-items: center;
    }

    .stat { text-align: center; }

    .services-grid { grid-template-columns: 1fr; }
    .strip-grid { grid-template-columns: 1fr; }
    .strip-item {
        border-right: none;
        border-bottom: 1px solid var(--on-dark-divider);
    }
    .strip-item:last-child { border-bottom: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .about-img-float { display: none; }
    .page-hero { padding: calc(var(--header-h) + var(--space-m)) 0 var(--space-xl); }
    .team-card { flex: 0 0 100%; }
}

/* ─── FOCUS STYLES ──────────────────────────────────────── */
/* The card lifts with a focused link inside it, as on hover; the ring itself
 * is the global one (Form controls & focus). */
.service-card:focus-within,
a.service-card:focus {
    transform: translateY(-6px);
}

.footer-col ul li a,
.footer-col p a,
.info-text .val a {
    text-decoration: underline;
    text-decoration-color: var(--on-dark-underline);
    text-underline-offset: 2px;
}

.info-text .val a {
    text-decoration-color: var(--border);
}

.info-text .val a:hover {
    text-decoration-color: var(--primary);
}

.footer-col ul li a:hover,
.footer-col p a:hover {
    text-decoration-color: var(--on-primary);
}

/* ── 404 ──────────────────────────────────────────────────────────────
 * Served for any unmatched path, so it stands alone: say what happened, then
 * offer the way back rather than leaving a dead end.
 *
 * Deliberately written against fallbacks rather than this site's own token
 * names - every site in the fleet has a different vocabulary, and a 404 that
 * silently loses its layout because one variable is spelt differently is
 * worse than one that is slightly plainer. */
.notfound {
    padding-block: var(--space-3xl-4xl) var(--space-2xl-3xl);
    text-align: center;
}
.notfound__inner { max-width: 46rem; margin-inline: auto; }

/* Decorative, aria-hidden in the markup - the <h1> carries the meaning. Sized
 * large but kept at a legible contrast: a very pale numeral fails WCAG even
 * when it is ornamental. */
.notfound__code {
    font-size: clamp(4.5rem, 18vw, 9rem);
    font-weight: 700;
    line-height: 0.9;
    margin: 0 0 var(--space-s-l);
    opacity: 0.55;
}
.notfound h1 { margin-top: 0; }
.notfound__lede { font-size: 1.125rem; line-height: 1.5; margin-inline: auto; max-width: 40rem; }

.notfound__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-s);
    justify-content: center;
    margin-top: var(--space-l);
}

.notfound__links {
    margin-top: var(--space-xl);
    padding-top: var(--space-l);
    border-top: 1px solid currentColor;
    /* The rule is a hairline of the surrounding ink rather than a named border
     * token, so it works whatever the site's palette is. */
    border-color: color-mix(in oklab, currentColor 22%, transparent);
}
.notfound__links-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 var(--space-s);
}
.notfound__links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-m);
    justify-content: center;
}
.notfound__links a {
    display: inline-block;
    /* WCAG 2.2 target size. */
    min-height: 24px;
    line-height: 24px;
    font-weight: 600;
}

/* Heading-level preservation (SEO outline fix). These headings changed tag level so the page
   outline has no skipped levels; each class re-applies the exact declarations the old tag had,
   so the rendering is unchanged. Repeated class = specificity above every element-based rule. */
.hl-4a.hl-4a.hl-4a.hl-4a{box-sizing:border-box;color:var(--primary-light);font-family:var(--font-heading);font-size:var(--step--2);font-weight:var(--weight-600);letter-spacing:var(--tracking-xl);line-height:var(--leading-s);margin-bottom:var(--space-s);margin-left:0;margin-right:0;margin-top:0px;overflow-wrap:break-word;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-transform:uppercase;text-wrap-mode:initial;text-wrap-style:balance}
.hl-3a.hl-3a.hl-3a.hl-3a{box-sizing:border-box;color:var(--ink-strong);font-family:var(--font-heading);font-size:var(--step-1);font-weight:var(--weight-700);letter-spacing:var(--tracking-xs);line-height:var(--leading-s);margin-bottom:var(--space-3xs);margin-left:0;margin-right:0;margin-top:var(--space-l);overflow-wrap:break-word;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;text-wrap-mode:initial;text-wrap-style:balance}

/* ─── SITE SEARCH ────────────────────────────────────────── */
/*
 * One placement at every width: a trigger (data-mf-search-open) opens the
 * overlay mediflare.js builds (.mf-search-overlay), styled here with this
 * site's tokens. The overlay is a centred card over a dimmed page above
 * 640px, and full screen at 640px and below. The same element at every
 * width; only these rules change.
 *
 * Exactly one trigger shows at any width:
 *   - above 640px, .search-trigger in .nav-buttons, a button styled as the
 *     search field (magnifier + "Search…"), hidden with .nav-buttons;
 *   - at 640px and below, .header-search-open, an icon beside the hamburger.
 *     Never inside the mobile menu: search hidden behind the hamburger is
 *     search most patients never find.
 * The first trigger in the page carries data-label/data-placeholder, which
 * the overlay's box takes from it.
 */

/* The header row is tight in two bands: just above 640px (logo, trigger, two
 * buttons, hamburger) and just above 1024px (where the six nav links come
 * back). There the trigger shortens to magnifier + "Search" and the gaps close
 * up a step; past that only the logo gives way, shrinking proportionally
 * (never below a step from the nav), so no nav label and no button wraps. */
.header-inner { column-gap: var(--space-xs); }

.header .logo {
    flex: 0 1 auto;
    min-inline-size: 0;
}

.header .logo-img { max-inline-size: 100%; }

.header .nav { flex: none; }

.search-trigger {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--space-2xs);
    inline-size: 10rem;
    padding-inline: var(--space-xs) var(--space-s);
    font-size: var(--step--1);
    font-weight: var(--weight-400);
    white-space: nowrap;
    color: var(--ink-mid);
    background: var(--field-bg);
    border: var(--field-border-w) solid var(--field-border);   /* drawn as a field: same tokens */
    border-radius: var(--field-radius);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out);
}

.search-trigger svg { flex: none; }

/* The ellipsis is drawn, not spoken: the name stays "Search this site". */
.search-trigger__text::after { content: "…" / ""; }

.search-trigger:hover {
    color: var(--primary);
}

.search-trigger:focus-visible {
    outline-offset: calc(var(--field-border-w) * -1);   /* it is drawn as a field: the ring sits on its border */
}

/* With the links gone, the hamburger sits a step from the buttons. */
@media (max-width: 1024px) {
    .header .nav { gap: var(--space-xs); }
}

/* The two tight bands. */
@media (min-width: 641px) and (max-width: 767px), (min-width: 1025px) and (max-width: 1199px) {
    .search-trigger {
        inline-size: auto;
        gap: var(--space-3xs);
        padding-inline: var(--space-2xs) var(--space-xs);
    }
    .search-trigger__text::after { content: none; }
    .header .nav-buttons { gap: var(--space-2xs); }
}

@media (min-width: 1025px) and (max-width: 1199px) {
    .header .nav { gap: var(--space-s); }
    .header .nav-links { gap: var(--space-xs); }
}

.mf-search__form {
    display: flex;
    flex-direction: column;
}

.mf-search__status {
    margin: var(--space-2xs) 0 0;
    font-size: var(--step--1);
    line-height: var(--leading-m);
    color: var(--ink-mid);
}

.mf-search__status:empty { display: none; }

.mf-search__results {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
    margin-top: var(--space-2xs);
    max-block-size: min(60vh, 26rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* display: flex above would otherwise beat the hidden attribute. */
.mf-search__results[hidden] { display: none; }

.mf-search__link {
    display: block;
    padding: var(--space-2xs) var(--space-xs);
    border-radius: var(--radius-s);
    color: var(--ink);
    overflow-wrap: anywhere;
    transition: background var(--duration-fast) var(--ease-out);
}

.mf-search__link:hover,
.mf-search__link:focus-visible {
    background: var(--primary-pale);
}

/* Inside a scrolling list an outset ring is clipped, so it sits inset. */
.mf-search__link:focus-visible {
    outline-offset: calc(var(--focus-ring-w) * -1);
    border-radius: var(--radius-s);
}

.mf-search__title {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--step-0);
    font-weight: var(--weight-700);
    line-height: var(--leading-s);
    letter-spacing: var(--tracking-s);
    color: var(--ink-strong);
}

.mf-search__excerpt {
    display: block;
    margin-top: var(--space-3xs);
    font-size: var(--step--1);
    line-height: var(--leading-l);
    color: var(--ink);
}

.mf-search__excerpt mark {
    background: color-mix(in oklab, var(--primary) 16%, transparent);
    color: var(--ink-strong);
    border-radius: var(--radius-xs);
}


/* Phones: the trigger beside the hamburger, the same size and ink. Only
 * where .nav-buttons (and so .search-trigger) is hidden. */
.header-search-open {
    display: none;
    flex: none;
    align-items: center;
    justify-content: center;
    inline-size: var(--target-min);
    block-size: var(--target-min);
    padding: 0;
    color: var(--ink-mid);
    background: none;
    border: 0;
    cursor: pointer;
    border-radius: var(--radius-s);
    transition: color var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out);
}

.header-search-open:hover {
    color: var(--primary);
    background: var(--primary-pale);
}

@media (max-width: 640px) {
    .header-search-open { display: inline-flex; }
    /* Only the trigger and the hamburger are left in the bar here. */
    .header .nav { gap: var(--space-3xs); }
}

/* The overlay, full screen (the phone layout, and the base for the card
 * below). One bar holds Close, the field and Search, in that order (Close
 * first, matching the focus order); the results scroll beneath it, inside
 * the overlay. mediflare.js locks the page behind.
 *
 * Styled only through :not([hidden]): a display of its own would override
 * the browser's [hidden] { display: none } and the overlay would never close.
 *
 * The bar is the overlay's own header, spanning the first row; the box's
 * children join the overlay's grid through subgrid, so the field and Search
 * sit in that row beside Close while the results run the full width below.
 * The first column is exactly one touch target wide because the only thing
 * in it is Close, which lives inside the spanning bar and so cannot size it. */
.mf-search-overlay:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: var(--layer-modal);
    display: grid;
    grid-template-columns: var(--target-min) minmax(0, 1fr) auto;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: var(--space-xs) var(--space-2xs);
    padding-block-start: max(var(--space-xs), env(safe-area-inset-top));
    padding-inline: max(var(--space-s), env(safe-area-inset-left)) max(var(--space-s), env(safe-area-inset-right));
    background: var(--surface);
}

.mf-search-overlay__header {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    padding-block-end: var(--space-xs);
    border-bottom: var(--border-thin) solid var(--border);
}

/* The text "Close" stays as the button's name; an icon shows instead. */
.mf-search-overlay__close {
    position: relative;
    z-index: var(--layer-base);   /* above the box, which spans this row too */
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: var(--target-min);
    block-size: var(--target-min);
    padding: 0;
    font-size: 0;
    color: var(--ink-mid);
    background: none;
    border: 0;
    cursor: pointer;
    border-radius: var(--radius-s);
    transition: color var(--duration-fast) var(--ease-out),
                background var(--duration-fast) var(--ease-out);
}

.mf-search-overlay__close::before {
    content: "";
    inline-size: 1.5rem;
    block-size: 1.5rem;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18 18 6M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18 18 6M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mf-search-overlay__close:hover {
    color: var(--primary);
    background: var(--primary-pale);
}

.mf-search-overlay__close:focus-visible {
    outline-offset: calc(var(--focus-ring-w) * -1);
}

.mf-search--overlay,
.mf-search--overlay .mf-search__form {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;
    align-items: start;
}

.mf-search--overlay .mf-search__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.mf-search--overlay .mf-search__input {
    grid-column: 2;
    grid-row: 1;
}

.mf-search--overlay .mf-search__submit {
    grid-column: 3;
    grid-row: 1;
    block-size: var(--target-min);
    padding-inline: var(--space-s);
    font-size: var(--step--1);
    font-weight: var(--weight-600);
    color: var(--on-primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: 0;
    border-radius: var(--control-radius);
    cursor: pointer;
}

.mf-search--overlay .mf-search__submit:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
}

.mf-search--overlay .mf-search__status {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 0;
}

.mf-search--overlay .mf-search__results {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: stretch;
    max-block-size: none;
    min-block-size: 0;
    margin: 0;
    padding-block-end: max(var(--space-s), env(safe-area-inset-bottom));
}

/* Close shows as an ×; its text "Close" is hidden (font-size: 0), and the alt
 * text below completes its name as "Close search". The zero-width space is
 * there because an empty string generates no box, and so no alt text. A
 * browser without CSS alt text drops the declaration and names it "Close". */
.mf-search-overlay__close::after { content: "\200b" / "search"; }

/* Above 640px the same overlay is a centred card (the DocSearch pattern):
 * offset from the top rather than vertically centred, so it grows downward
 * with its results up to max-block-size, past which the results scroll inside
 * it. A press on the dimmed page closes it (mediflare.js, #249).
 *
 * Stacking: the backdrop is body::after at --layer-modal, above the fixed
 * header (--layer-nav) and the nav dropdown (--layer-overlay). The card sits
 * one above it, since body::after follows the overlay in tree order and at
 * an equal z-index would paint over it. */
@media (min-width: 641px) {
    .mf-search-overlay:not([hidden]) {
        inset: var(--space-2xl) 0 auto;
        z-index: calc(var(--layer-modal) + 1);
        inline-size: calc(100% - 2 * var(--space-m));
        max-inline-size: 38.75rem;   /* the card's width before --grid-max-width became the 75rem container */
        max-block-size: calc(100dvh - 2 * var(--space-2xl));
        margin-inline: auto;
        padding: var(--space-s);
        border-radius: var(--radius-l);
        box-shadow: var(--shadow-l);
    }

    .mf-search--overlay .mf-search__results {
        padding-block-end: 0;
    }

    html[data-mf-search-overlay="open"] body::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: var(--layer-modal);
        background: color-mix(in oklch, var(--ink-strong) 50%, transparent);
        -webkit-backdrop-filter: blur(calc(var(--space-3xs) / 2));
        backdrop-filter: blur(calc(var(--space-3xs) / 2));
    }
}

/* Opening is a short fade and settle, and nothing at all under reduced
 * motion. Closing is immediate. */
@media (min-width: 641px) and (prefers-reduced-motion: no-preference) {
    .mf-search-overlay:not([hidden]) {
        animation: search-card-in var(--duration-base) var(--ease-out);
    }

    html[data-mf-search-overlay="open"] body::after {
        animation: search-backdrop-in var(--duration-base) var(--ease-out);
    }
}

@keyframes search-card-in {
    from { opacity: 0; transform: scale(0.98); }
}

@keyframes search-backdrop-in {
    from { opacity: 0; }
}
