/* ==========================================================================
   Holistic Physiotherapy & Wellness — Design Tokens
   --------------------------------------------------------------------------
   THREE LAYERS. Never skip a layer.

   1. BRAND      Exact values from "HPW Visual Brand Identity" (client-supplied).
                 Do not change these. Ever.
   2. DERIVED    CanRank additions. Every one exists because a brand colour
                 fails WCAG contrast in a specific role. Measured ratios noted.
   3. SEMANTIC   What templates and blocks are actually allowed to reference.

   RULE FOR EVERY BLOCK STYLESHEET: use layer 3 only.
   A block that references --hpw-teal-700 directly is a bug. Rebranding this
   site should be an edit to this one file, not a hunt through 13 blocks.
   ========================================================================== */

:root {

  /* --- LAYER 1: BRAND (verbatim from the brand guide) --------------------
     Single source of truth for these hex values is theme.json, so the
     WordPress editor swatches and the front end can never drift apart.
     The hex after the comma is a fallback so this file also works standalone
     (e.g. in the client mock-ups, outside WordPress).                      */

  --hpw-teal-700:  var(--wp--preset--color--dark-teal,   #0B4C5F); /* primary  */
  --hpw-teal-400:  var(--wp--preset--color--medium-teal, #17C7B0); /* highlight*/
  --hpw-teal-200:  var(--wp--preset--color--light-teal,  #7CC4C9); /* bg tint  */
  --hpw-gold-500:  var(--wp--preset--color--gold,        #C9A56A); /* accent   */
  --hpw-gold-300:  var(--wp--preset--color--soft-gold,   #DCC6A1); /* calm bg  */
  --hpw-blush-300: var(--wp--preset--color--blush,       #E8BFC3);
  --hpw-charcoal:  var(--wp--preset--color--charcoal,    #3C3C3C); /* body text*/
  --hpw-black:     var(--wp--preset--color--near-black,  #1C1C1C);
  --hpw-white:     var(--wp--preset--color--off-white,   #FAFAFA); /* page bg  */
  --hpw-grey-200:  var(--wp--preset--color--light-grey,  #E5E5E9);
  --hpw-taupe-300: var(--wp--preset--color--stone-taupe, #C8BFB3);

  /* --- LAYER 2: DERIVED (CanRank — accessibility only) ------------------- */
  /* Each value was computed, not eyeballed. Ratios measured 2026-09-01
     against Soft White #FAFAFA unless stated.                              */

  --hpw-teal-800:      #083B49;  /* teal hover/active. 11.62:1  AAA          */
  --hpw-gold-700:      #906E34;  /* GOLD FOR TEXT+LINKS. 4.51:1 AA           */
                                 /* Brand gold #C9A56A is 2.22:1 — it FAILS  */
                                 /* as text on light. Never set body copy or */
                                 /* a link in --hpw-gold-500.                */
  --hpw-gold-800:      #7A5E2C;  /* gold text hover.    5.81:1  AA           */
  --hpw-teal-600:      #127E9B;  /* medium teal as text. 4.68:1 AA           */
                                 /* Brand #17C7B0 is 2.05:1 — decoration only*/
  --hpw-grey-400:      #8D8D9F;  /* form/control borders. 3.12:1 — meets     */
                                 /* WCAG 1.4.11 non-text minimum of 3:1.     */
                                 /* --hpw-grey-200 is 1.20:1: decorative     */
                                 /* dividers ONLY, never an input border.    */
  --hpw-taupe-500:     #988771;  /* warm border that passes. 3.33:1          */

  /* Tile tints. Each is its brand parent mixed 40% over white, which is what
     the brand guide asks for when it says to blend soft gold and blush into
     backgrounds. The parents themselves are too dark to sit behind text: a
     Dark Teal heading on brand Light Teal #7CC4C9 measures 3.27:1, under the
     4.5:1 a heading at body size needs, and Gold 800 on brand Soft Gold
     #DCC6A1 is 3.65:1. At 40% all four clear it comfortably. These are the
     values the mock-ups and the two client documents were measured against.  */
  --hpw-tint-gold:     #F1E8D9;  /* from --hpw-gold-300.  charcoal 9.08:1     */
  --hpw-tint-teal:     #CBE7E9;  /* from --hpw-teal-200.  charcoal 8.48:1     */
  --hpw-tint-blush:    #F6E5E7;  /* from --hpw-blush-300. charcoal 9.08:1     */
  --hpw-tint-taupe:    #E9E5E1;  /* from --hpw-taupe-300. charcoal 8.80:1     */

  --hpw-teal-500:      #5FA8AE;  /* Light Teal stepped toward Dark Teal. This */
                                 /* is the tile edge on a light teal ground,  */
                                 /* 2.10:1 on the tint — decoration only, and */
                                 /* it never carries meaning on its own.      */

  /* --- LAYER 3: SEMANTIC (the only layer templates may use) -------------- */

  /* Surfaces
     PAGE GROUND IS PURE WHITE, not Soft White. Reason, found by measuring the
     client's own images: their in-body photos are CIRCULAR CROPS sitting on a
     pure-white square. On a #FAFAFA ground every one of them shows as a visible
     white box around a circle. Seven of the nineteen images in a single sample
     post are like this, so it is the norm rather than an exception.
     Soft White #FAFAFA is still the brand value and remains available as a
     section tint (--color-bg-tint) — it is simply not the page ground. */
  --color-bg:               #FFFFFF;
  --color-bg-alt:           var(--hpw-white);
  --color-bg-tint:          var(--hpw-white);
  --color-surface:          #FFFFFF;
  /* These three point at the 40% TINTS, not at the brand parents. A card
     background carries body copy, and the parents do not have the headroom
     for it — see the note in layer 2. The parents stay available above for
     decorative use (icon strokes, illustration fills, the utility bar).     */
  --color-surface-calm:     var(--hpw-tint-gold);  /* soft gold card tint    */
  --color-surface-blush:    var(--hpw-tint-blush);
  --color-surface-cool:     var(--hpw-tint-teal);
  --color-surface-warm:     var(--hpw-tint-taupe); /* stone taupe, the warm  */
                                                   /* neutral that replaced  */
                                                   /* grey as a tile ground  */
  --color-surface-invert:   var(--hpw-teal-700);   /* dark teal panels       */
  --color-surface-on-dark:  var(--hpw-white);      /* light chip ON a dark    */
                                                  /* panel — e.g. the footer */
                                                  /* logo, until a reversed  */
                                                  /* lockup arrives.         */

  /* Text */
  --color-text:             var(--hpw-charcoal);   /* 10.57:1 on bg  AAA     */
  --color-text-strong:      var(--hpw-black);      /* 16.33:1 on bg  AAA     */
  --color-text-muted:       #5F5F5F;               /* 6.63:1 on bg   AA      */
  --color-text-invert:      var(--hpw-white);      /*  9.49:1 on teal AAA    */
  --color-heading:          var(--hpw-teal-700);   /*  9.09:1 on bg  AAA     */
  --color-heading-invert:   var(--hpw-white);

  /* IMPORTANT: on tinted surfaces (calm/blush/cool) --color-heading drops to
     3.3-3.9:1 — large text only. Small print on a tinted card must use
     --color-text or --color-text-strong. See docs/02-brand-tokens.md.      */
  --color-text-on-tint:     var(--hpw-black);

  /* Links */
  --color-link:             var(--hpw-teal-700);
  --color-link-hover:       var(--hpw-teal-800);
  --color-link-accent:      var(--hpw-gold-700);   /* the "Read More →" gold */
  --color-link-accent-hover:var(--hpw-gold-800);
  /* The accent gold is measured against WHITE, where it is 4.51:1 — which
     leaves it no headroom at all. On the stone taupe band it drops to 3.75:1
     and fails. Measured 18 Sep on #E9E5E1: gold 700 3.75:1, gold 800 4.84:1.
     Any accent link on a warm ground uses this instead. */
  --color-link-accent-on-warm: var(--hpw-gold-800);

  /* Buttons — primary: dark teal, white label */
  --color-btn-primary-bg:       var(--hpw-teal-700);
  --color-btn-primary-fg:       #FFFFFF;           /* 9.49:1  AAA            */
  --color-btn-primary-bg-hover: var(--hpw-teal-800);

  /* Buttons — secondary: outlined */
  --color-btn-secondary-bg:     transparent;
  --color-btn-secondary-fg:     var(--hpw-teal-700);
  --color-btn-secondary-border: var(--hpw-teal-700);

  /* Buttons — accent (gold). SECONDARY USE ONLY.
     The brand guide assigns buttons to Dark Teal; gold is listed as "strong
     accents". So --color-btn-primary (teal) is the default and this variant is
     for the few places the client mock-up uses a gold button: the nav
     "Book Now", "Subscribe", "Meet the Team", and "Free Discovery Call" on the
     dark teal panel.
     NOTE the label is near-black, NOT white. Brand gold #C9A56A is much
     lighter than the amber the June mock-up actually used, so it cannot carry
     a white label: white on #C9A56A measures 2.31:1 against a 4.5:1
     requirement. Near-black on it measures 7.36:1 — AAA.                   */
  --color-btn-accent-bg:        var(--hpw-gold-500);
  --color-btn-accent-fg:        var(--hpw-black);  /* 7.36:1  AAA            */
  --color-btn-accent-bg-hover:  #B8934F;

  /* Tile grounds. Five approved backgrounds for a tile, and nothing else.
     Blocks reference these rather than the surface tokens above so that a
     tile and a full-width tinted section can diverge later without one
     dragging the other with it.                                            */
  --color-tile-white:      var(--color-surface);
  --color-tile-gold:       var(--color-surface-calm);
  --color-tile-teal:       var(--color-surface-cool);
  --color-tile-blush:      var(--color-surface-blush);
  --color-tile-stone:      var(--color-surface-warm);
  --color-tile-invert:     var(--color-surface-invert);

  /* Tile edge: 4px, on the left, a deeper step of the tile's own colour.
     Gold on white, soft white, soft gold and dark teal; a deeper teal on
     light teal. Blush and stone taupe get no edge, because neither has a
     deeper step in the palette, so there is nothing to reach for that would
     not introduce a colour the tile does not contain.                      */
  --color-edge-gold:       var(--hpw-gold-500);   /* 2.31:1 on white         */
  --color-edge-teal:       var(--hpw-teal-500);   /* 2.10:1 on the teal tint */

  /* Eyebrow ink — the small uppercase label above a heading.
     Gold 700, the accent-link gold, fails on every tinted tile (3.62-3.87:1),
     so the eyebrow steps one shade darker. Gold 800 passes on white and on
     three of the four tints. On the light teal tint it reaches 4.66:1, which
     passes but is the tightest of the set, and the mock-ups use Teal 800
     there instead at 9.32:1.                                               */
  --color-eyebrow:         var(--hpw-gold-800);   /* 6.06:1 on white         */
  --color-eyebrow-on-cool: var(--hpw-teal-800);   /* 9.32:1 on the teal tint */
  --color-eyebrow-on-dark: var(--hpw-white);      /* 9.49:1 on dark teal     */

  /* Small icons on dark teal (utility bar, footer contact lines). Soft gold
     is 3.90:1 there, above the 3:1 an icon needs; brand gold is 2.80:1 and
     fails. */
  --color-icon-on-dark:    var(--hpw-gold-300);

  /* Lines and edges */
  --color-divider:          var(--hpw-grey-200);   /* decorative only        */
  --color-border:           var(--hpw-taupe-500);  /* 3.33:1 — real borders  */
  --color-border-input:     var(--hpw-grey-400);   /* 3.12:1 — form controls */
  --color-focus:            var(--hpw-teal-700);   /* 6.21:1 focus ring      */

  /* Decoration — these are NOT allowed to carry meaning on their own,
     because none of them reach 3:1 against the page background.           */
  --color-accent-deco:      var(--hpw-teal-400);   /* 2.05:1                 */
  --color-accent-gold:      var(--hpw-gold-500);   /* 2.31:1. The decorative */
                                                   /* gold mark: the underline */
                                                   /* inside a quote, the FAQ  */
                                                   /* chevron, a short rule.   */
                                                   /* Never text, never the    */
                                                   /* only signal for anything.*/
  --color-accent-deco-soft: var(--hpw-teal-200);   /* 1.90:1                 */


  /* --- TYPOGRAPHY -------------------------------------------------------- */
  /* Brand guide: Montserrat headings + body, Raleway Medium Italic accents,
     Brittney script sparingly. Brittney is a commercial face — see
     assets/fonts/README.md before it goes live.                            */

  --font-heading: "Montserrat", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Montserrat", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-accent:  "Raleway", var(--font-body);
  --font-script:  "Brittney", "Raleway", cursive;

  --fw-light:  300;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;
  --fw-bold:   700;

  /* Fluid scale, 320px → 1280px viewport. Body never below 16px. */
  --fs-xs:   0.8125rem;                              /* 13px  labels only    */
  --fs-sm:   0.9375rem;                              /* 15px  captions       */
  --fs-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-lg:   clamp(1.125rem, 1.08rem + 0.22vw, 1.25rem);
  --fs-h6:   clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-h5:   clamp(1.125rem, 1.05rem + 0.37vw, 1.375rem);
  --fs-h4:   clamp(1.25rem, 1.11rem + 0.7vw, 1.625rem);
  --fs-h3:   clamp(1.5rem, 1.28rem + 1.09vw, 2.125rem);
  --fs-h2:   clamp(1.875rem, 1.52rem + 1.77vw, 2.875rem);
  --fs-h1:   clamp(2.25rem, 1.68rem + 2.85vw, 4rem);

  --lh-tight: 1.15;
  --lh-snug:  1.3;
  --lh-base:  1.65;
  --ls-tight: -0.02em;
  --ls-wide:   0.08em;

  /* --- SPACE (4px base) --------------------------------------------------- */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.5rem;   --sp-6: 2rem;     --sp-7: 3rem;     --sp-8: 4rem;
  --sp-9: 6rem;     --sp-10: 8rem;
  /* Tightened twice on 18 Sep at Liam's ask for shorter sections, closer
     together. Started at 6rem / 3.5rem at desktop, now 3.25rem / 2rem. */
  --section-y: clamp(2rem, 1.6rem + 2.2vw, 3.25rem);
  /* Tinted full-width strips — the newsletter band, the reassurance strip —
     sit between full sections and should read as a matched pair rather than
     each picking its own padding. Roughly 60% of --section-y. */
  --band-y:    clamp(1.25rem, 1rem + 1.2vw, 2rem);

  /* --- LAYOUT ------------------------------------------------------------- */
  --width-content: 42rem;   /* 672px — comfortable measure for article body  */
  --width-wide:    80rem;   /* 1280px — standard container                   */
                            /* Widened from 75rem on 18 Sep at Liam's ask for */
                            /* "a bit wider". Changed HERE rather than on the  */
                            /* homepage sections alone, because the header and */
                            /* every band read off this one value — widening   */
                            /* the sections by themselves would have pushed    */
                            /* them out of line with the logo above them,      */
                            /* which is the opposite of what was wanted.       */
  /* Height of the sticky site header (logo + padding + hairline), measured
     128px on a wide screen. Things that stick or jump below the header read
     this. navigation.js overwrites it with the real height on load and on
     resize, so a change to the header cannot leave them tucked under it
     again (the condition booking card sat 40px under it, 26 Oct 2026). */
  --header-h:      8.125rem;
  --width-full:    90rem;   /* 1440px — full-bleed sections                  */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  /* --- SHAPE & DEPTH ------------------------------------------------------ */
  /* Brand keyword "Calm" calls for soft gradients and rounded edges.        */
  --radius-sm: 4px;  --radius-md: 8px;  --radius-lg: 16px; --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(28,28,28,.05), 0 1px 3px rgba(28,28,28,.05);
  --shadow-md: 0 2px 4px rgba(28,28,28,.04), 0 8px 24px rgba(28,28,28,.06);
  --shadow-lg: 0 4px 8px rgba(28,28,28,.04), 0 16px 48px rgba(28,28,28,.08);

  --transition: 180ms cubic-bezier(.4,0,.2,1);
}

/* Respect the user's motion preference — part of "Calm" and an a11y baseline */
@media (prefers-reduced-motion: reduce) {
  :root { --transition: 0ms; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
