/* ═══ AMAI design tokens — the ONE source of colour, type, spacing, radius and layout for the public website ═══
   Read docs/AMAI_DESIGN_SYSTEM.md before adding or changing anything visual. Loaded FIRST on every public page
   (before css/d2.css, css/m2.css, css/m-editorial.css, css/booking.css, which consume these). The values were taken
   from the existing approved pages (homepage, Treatments) — nothing here is new, only gathered in one place.
   My AMAI (hub.html, care-notes.html, pay.html) and the AMAI Studio (admin/) load it too (Nov 2026) and use the app
   surfaces below for their cards and hairlines. */
:root{
  /* ── palette (raw) — the short names are the ones the stylesheets already use ── */
  --ivory:#F3EBE1;      /* primary light background */
  --sand:#E7D8C8;       /* secondary editorial background */
  --warm:#E4D3C1;       /* "nude": warm storytelling background */
  --deep:#2E2622;       /* espresso: primary dark background */
  --choc:#38302B;       /* cocoa: secondary dark surface */
  --cream:#E9D6C4;      /* light action colour on dark; light accents */
  --ink:#2A221E;        /* primary text on light */
  --brown:#685649;      /* secondary text on light */
  --muted:#C9B39F;      /* secondary text on dark; eyebrows on dark */
  --accent:#94745D;     /* marks on light: icons, + / −, ticks, stars, rules (non-text, ≥3:1). Text uses --eyebrow */
  --divider:rgba(46,38,34,.16);          /* hairlines on light */
  --divider-dark:rgba(233,214,196,.16);  /* hairlines on dark */
  /* app surfaces — My AMAI and the Studio (cards, quiet panels, opaque hairlines, things waiting) */
  --surface:#F7F1EA;    /* cards on an ivory page */
  --surface-2:#EFE5D8;  /* quieter surface: done, closed, secondary panels */
  --line:#E0D2C2;       /* opaque hairline / field border on app surfaces */
  --warn-bg:#F3E3C8;    /* something waiting: deposit due, held */

  /* ── semantic ── */
  --bg-page:var(--ivory);
  --bg-editorial:var(--sand);
  --bg-warm:var(--warm);
  --bg-dark:var(--deep);
  --bg-dark-2:var(--choc);
  --text:var(--ink);
  --text-2:var(--brown);
  --text-on-dark:var(--ivory);
  --text-2-on-dark:var(--muted);
  --eyebrow:#6E5745;     /* eyebrows and small text on light: 4.5:1+ on ivory, sand and nude (accent itself is 3.1:1 on sand) */
  --eyebrow-on-dark:var(--muted);
  --btn-bg:var(--deep);  --btn-fg:var(--ivory);     /* primary action on light */
  --btn-inv-bg:var(--cream); --btn-inv-fg:var(--ink);  /* primary action on dark */
  --focus:#94745D;
  --ok:#4F6B4A; --warn:#8A5A1F; --error:#9E3B30;

  /* ── type: the brand fonts (Google Fonts: Marcellus + Mulish 300–700) ── */
  --serif:Marcellus,Georgia,serif;
  --sans:Mulish,system-ui,sans-serif;
  /* desktop (css/d2.css) */
  --fs-display:clamp(56px,5.6vw,84px);   /* .d2-h1 */
  --fs-h1:clamp(46px,4.4vw,64px);        /* .d2-h1.s — page headings */
  --fs-h2:clamp(40px,3.6vw,54px);        /* .d2-h2 */
  --fs-h2-s:clamp(34px,3vw,44px);        /* .d2-h2.s */
  --fs-h3:34px;                          /* .d2-h3 */
  --fs-card:28px;                        /* collection card headings */
  --fs-lead:18px;                        /* .d2-lead */
  --fs-body:16.5px;
  --fs-small:15px;
  --fs-eyebrow:12.5px;                   /* .d2-k */
  /* phones (css/m2.css, css/m-editorial.css) */
  --fs-m-h1:clamp(30px,8.6vw,36px);      /* .m2-h1 / .mm-h */
  --fs-m-h2:clamp(27px,7.6vw,31px);      /* .m2-h2 */
  --fs-m-h3:clamp(21px,6vw,24px);        /* .m2-h3 */
  --fs-m-body:15.5px;                    /* .m2-body / .m2-lead */
  --fs-m-eyebrow:11.5px;                 /* .m2-k / .mm-k */
  --ls-eyebrow:.07em;                    /* eyebrows: uppercase sans, 600, restrained spacing */

  /* ── layout ── */
  --container:1240px;                    /* .d2-wrap */
  --gutter:56px;                         /* desktop side gutter */
  --gutter-m:18px;                       /* phone side gutter (.m2-pad, .mm-pad) */
  --section:clamp(72px, 13svh, 120px);   /* .d2-sec vertical padding — less on short laptop screens (120px from ~920px tall) */
  --section-s:96px;                      /* shorter sections (treatment pages) */
  --section-m:28px;                      /* phone section top padding (bottom 34px) */
  --split-gap:80px;                      /* .d2-split column gap */

  /* ── spacing scale ── */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:24px; --sp-6:32px; --sp-7:48px; --sp-8:64px;

  /* ── geometry ── */
  --r-photo:14px;                        /* photographs (.d2-photo, .m2-img) */
  --r-card:14px;                         /* collection / product / functional cards */
  --r-small:10px;                        /* phone collection cards, thumbnails */
  --r-arch:40px 40px 0 0;                /* THE AMAI arch: every primary button. Never a pill. */
  --hit:44px;                            /* minimum touch target */

  /* ── phones: the usable opening viewport (Mobile opening screens, Nov 2026 — docs §15) ──
     header and bottom bar are given WITHOUT the safe areas, which are added once here and nowhere else */
  --m-header:56px;                       /* .top (js/mobile-nav.js header) */
  --m-nav:64px;                          /* .mbar, the bottom navigation */
  --m-safe-t:env(safe-area-inset-top,0px);
  --m-safe-b:env(safe-area-inset-bottom,0px);
  --m-vh:100vh;                          /* becomes 100svh where supported (below): stable when browser bars move */
  --m-view:calc(var(--m-vh) - var(--m-header) - var(--m-nav) - var(--m-safe-t) - var(--m-safe-b));
  --m-hero-a:clamp(200px, calc(var(--m-view) * .38), 340px);   /* Variant A: editorial image-led opening photo */
  --m-hero-c:clamp(180px, calc(var(--m-view) * .30), 260px);   /* Variant C: treatment / conversion opening photo */
  --m-card-ratio:3/2;                    /* collection cards on phones */
  --m-gap-hero:28px;                     /* image → eyebrow */
}

:root{
  /* ── motion (docs/AMAI_INTERACTION_STANDARD.md): restrained, never bouncy; all of it off with reduced motion ── */
  --motion-fast:140ms;                   /* immediate feedback: press, hover, colour */
  --motion-std:220ms;                    /* standard: tab underline, panel fade-in, accordion */
  --motion-panel:280ms;                  /* sheets and overlays */
  --motion-slow:340ms;                   /* a larger purposeful change, rarely */
  --ease-out:cubic-bezier(.2,.7,.2,1);   /* things arriving: decelerate */
  --ease-std:cubic-bezier(.4,0,.2,1);    /* state changes: balanced */
}
:root{
  /* ── computers: height-aware composition (Desktop viewport composition, Nov 2026 — docs §16) ── */
  --d-header:83px;                       /* js/site-header.js bar */
  --d-vh:100vh;
  --d-view:calc(var(--d-vh) - var(--d-header));
  --d-hero-pad:clamp(40px, calc(var(--d-view) * .09), 88px);              /* opening section top/bottom */
  --d-hero-h:clamp(380px, calc(var(--d-view) - 2 * var(--d-hero-pad)), 680px);  /* Variant A opening photo */
  --d-hero-b:clamp(300px, calc(var(--d-view) * .5), 460px);               /* Variant B: a collection's intro photo */
  --d-read:62ch;                         /* longest comfortable line for editorial copy */
}
@supports (height:100svh){ :root{ --m-vh:100svh; --d-vh:100svh; } }

/* accessible focus, everywhere on the public site (keyboard only) */
.desktop-shell :focus-visible,.mobile-shell :focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.d2-dark :focus-visible,.m2-dark :focus-visible,.mm-sec.dark :focus-visible{outline-color:var(--cream)}
@media (prefers-reduced-motion:reduce){
  .desktop-shell *,.mobile-shell *{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}
}
@media (prefers-reduced-motion:reduce){ :root{ --motion-fast:0ms; --motion-std:0ms; --motion-panel:0ms; --motion-slow:0ms; } }
