/* ==========================================================================
   DESIGN TOKENS - Haya Atelier - V6 "Warm Glass Atelier"
   Cream page, sand and taupe panels, cocoa-brown ink and dark pills, soft frosted white glass, an olive accent used sparingly, Instrument Serif
   headings (italic for the emphasised word), Instrument Sans for UI and body, rounded 24-32px cards, pill buttons, slow soft motion.
   Reference: docs/DESIGN_V6.md. Measured contrast table, alias list and rules: docs/DESIGN_SYSTEM.md. Motion kit: docs/MOTION_KIT.md.
   Never hard-code these values elsewhere: reference the custom properties.
   FORBIDDEN in the storefront: blue / neon / orange / gold chrome, black or dark sections, a black footer, bold serif (Instrument Serif has one weight),
   olive as small TEXT on cream (4.31:1: use --olive-text), cream text on olive (4.31:1; white on olive is 4.85:1).
   ========================================================================== */
:root {
  /* ---- V6 palette (source of truth; everything else below points here) ---- */
  --cream: #F6F1EA;        /* the page. ink on it 14.8:1 */
  --sand: #EADFD1;         /* calm panels, tiles behind garments, the footer. ink on it 12.6:1 */
  --taupe: #CDBBA6;        /* stronger panels, hover fills, badges, avatar chips. ink on it 8.9:1 */
  --stone: #A89684;        /* DECORATIVE only (borders on photos, dividers, dots): 2.5:1 on cream, never text, never a control boundary */
  --cocoa: #4A2F25;        /* dark pills / primary buttons / headings accent, text (10.8:1 on cream). Never a section background */
  --ink: #2A1B15;          /* body text (14.8:1 on cream) */
  --olive: #6B7650;        /* accent: in-stock dot, check marks, selected rings, tree. FILL / ICON only (4.31:1 on cream); white text on it 4.85:1 */
  --white: #FFFFFF;        /* inputs, white pills, glass highlights */
  --cocoa-rgb: 74, 47, 37;   /* --cocoa as "r, g, b" for rgba(var(--cocoa-rgb), .2) shadows / borders / glass: Admin > Settings > Appearance overrides it together with --cocoa */
  --cream-rgb: 246, 241, 234; /* --cream as "r, g, b" for translucent cream veils and the header glass */

  /* ---- supporting colours (derived, same family) ---- */
  --paper: #FCFAF6;        /* elevated surfaces (cards, dropdowns, drawers): warm white */
  --cocoa-2: #5E3E31;      /* cocoa hover / pressed (white text 9.2:1) */
  --olive-text: #58633F;   /* olive as TEXT or thin icon: 5.71:1 on cream, 4.88:1 on sand, 6.42:1 on white */
  --olive-soft: #E4E6D2;   /* olive tint background (ink 13.1:1, olive-text 5.06:1) */
  --olive-on-dark: #D3DCB2; /* olive text on cocoa (7.6:1) */
  --on-accent: var(--white); /* text / ticks ON an olive fill (4.85:1); Appearance settings switch it to dark ink for a light accent colour */
  --muted: #6B5A4E;        /* secondary text: 5.84:1 on cream, 5.00:1 on sand, 6.57:1 on white, 4.55:1 on mist */
  --muted-strong: #5A483D; /* secondary text ON GLASS over photography (7.69:1 on cream) */
  --faint: #A08F7E;        /* NON-ESSENTIAL only (decorative, disabled): ~2.8:1, never for content */
  --line: #DDD0BF;         /* hairlines (decorative) */
  --line-strong: #C9B8A4;  /* stronger decorative divider (NOT a control boundary) */
  --ctl-border: #8C7A69;   /* form-control boundary: 4.12:1 on white, 3.66:1 on cream, 3.13:1 on sand (WCAG 1.4.11) */
  --mist: #E2D5C3;         /* wells, track fills, pressed states (ink on it 11.5:1) */
  --green: var(--olive-text);          /* in stock / success text and icons */
  --green-soft: var(--olive-soft);
  --green-on-dark: var(--olive-on-dark);
  --warn-soft: #F1E2C8;    /* warning background (cocoa 9.5:1, warn-text 5.84:1) */
  --warn-text: #7A4A12;    /* warning text: 6.64:1 on cream, 5.84:1 on warn-soft */
  --red: #A8281C;          /* danger: 6.26:1 on cream, 7.03:1 on white */
  --red-soft: #F6E2DC;
  --red-on-dark: #F5B3A8;  /* on cocoa */
  --on-dark: #F6F1EA;      /* text on cocoa (10.8:1) */
  --on-dark-muted: #D8C9B8;/* secondary text on cocoa (7.5:1) */

  /* ---- semantic roles (keep names; values point at the palette) ---- */
  --bg: var(--cream);
  --bg-alt: var(--sand);
  --bg-elevated: var(--paper);
  --bg-dark: var(--cocoa);               /* primary buttons, the cursor pill: never a page section */
  --text: var(--ink);
  --text-muted: var(--muted);
  --text-faint: var(--faint);
  --text-on-dark: var(--on-dark);
  --accent: var(--olive);
  --accent-text: var(--ink);             /* links and accent TEXT are ink (underlined); --olive-text for a green label */
  --focus: var(--cocoa);                 /* focus ring: 10.8:1 on cream; remapped to --cream on cocoa surfaces */
  --danger: var(--red);
  --success: var(--olive-text);
  --warning: var(--warn-text);
  --info: var(--cocoa);
  --danger-soft: var(--red-soft);
  --success-soft: var(--olive-soft);
  --warning-soft: var(--warn-soft);
  --info-soft: var(--mist);

  /* ---- ALIASES: every V1-V5 token name still resolves, to the NEAREST V6 role (list and rationale: docs/DESIGN_SYSTEM.md section 3.4).
          Pages that have not been redesigned yet keep rendering with these; new code uses the V6 names above. ---- */
  --page: var(--cream);                  /* V4 page */
  --surface: var(--sand);                /* V4 grey surface -> sand */
  --plaster: var(--sand);                /* V3 alternate band -> sand */
  --fog: var(--sand);                    /* V5 calm panel / footer block -> sand */
  --sky: var(--sand);                    /* V5 soft colour block (was light blue) -> sand */
  --sky-text: var(--ink);
  --sky-soft: var(--mist);
  --sky-on-dark: var(--cream);           /* accent text / focus on cocoa surfaces */
  --tangerine: var(--taupe);             /* V5 hot block / hover fill (was orange) -> taupe; ink text on it, as before */
  --tangerine-text: var(--cocoa);        /* V5 accent text / focus ring -> cocoa */
  --poppy: var(--taupe);
  --poppy-text: var(--cocoa);
  --mint: var(--olive-soft);             /* V5 feature block (was mint) -> olive tint */
  --lemon: var(--taupe);                 /* V5 stickers -> taupe (ink text) */
  --blush: var(--sand);
  --blush-deep: var(--taupe);            /* decorative only */
  --amber: var(--taupe);
  --amber-text: var(--warn-text);
  --amber-soft: var(--warn-soft);
  --c-ivory: var(--cream);
  --c-beige: var(--sand);
  --c-gold: var(--cocoa);
  --c-charcoal: var(--ink);
  --c-espresso: var(--cocoa);
  --c-sage: var(--olive-text);
  --c-white: var(--white);
  --gold-soft: var(--mist);
  --accent-text-alt: var(--ink);
  --accent-on-dark: var(--cream);
  --ink-soft: var(--cocoa);
  --ink-2: var(--cocoa);                 /* raised dark surface: tooltips, the cursor pill (cream text 10.8:1) */
  --surface-dark: var(--cocoa);
  --on-dark-soft: var(--on-dark-muted);

  /* ---- typography: Instrument Serif (display; ONE weight, 400, regular + italic) + Instrument Sans (UI/body: wght 400-700, wdth 75-100); both self-hosted ---- */
  --font-sans: "Instrument Sans", "Helvetica Neue", Arial, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
  --font-display: var(--font-serif);
  --font-body: var(--font-sans);
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700; --fw-display: 400;
  --stretch-display: 100%;               /* Instrument Serif has no width axis; kept so legacy declarations stay valid */
  --tracking-display: -.012em;           /* serif headlines */
  --tracking-title: -.008em;             /* h3/h4, prices, card titles */
  --tracking-caps: .14em;                /* eyebrows / labels / taglines: uppercase sans */
  --tracking-label: .12em;
  --tracking-wide: .2em;                 /* the tiny tracked taglines under the wordmark and hero headline */
  --tracking-brand: .34em;               /* 'MODEST FASHION' tagline */
  /* fluid scale (min @360px, max @1440px) */
  --fs-label: clamp(.6875rem, .66rem + .1vw, .75rem);   /* 11 -> 12px UI labels, uppercase */
  --fs-xs: clamp(.75rem, .73rem + .1vw, .8125rem);
  --fs-sm: clamp(.8125rem, .79rem + .12vw, .9rem);
  --fs-base: clamp(.9375rem, .92rem + .1vw, 1rem);       /* 15 -> 16px body */
  --fs-md: clamp(1.0625rem, 1rem + .3vw, 1.25rem);
  --fs-lg: clamp(1.25rem, 1.1rem + .7vw, 1.75rem);
  --fs-xl: clamp(2.25rem, 1.3rem + 3vw, 3.9rem);         /* serif section titles */
  --fs-2xl: clamp(2.75rem, 1.3rem + 5vw, 6.25rem);
  --fs-3xl: clamp(3.5rem, 1rem + 8.5vw, 10rem);
  --fs-statement: clamp(3rem, 1rem + 7.5vw, 9.5rem);     /* section statements */
  --fs-wordmark: 17vw;                                   /* footer / newsletter giant wordmark */
  --fs-wordmark-hero: 30vw;                              /* hero wordmark behind the person (legacy) */
  --fs-h1: clamp(2.6rem, 1.4rem + 4.4vw, 5.25rem);       /* serif page titles */
  --fs-h2: clamp(2.1rem, 1.3rem + 3vw, 3.9rem);
  --fs-h3: clamp(1.5rem, 1.2rem + 1.1vw, 2.1rem);
  --fs-h4: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --lh-tight: .98;
  --lh-snug: 1.1;
  --lh-base: 1.6;

  /* ---- spacing (4px base) ---- */
  --space-1: .25rem;  --space-2: .5rem;   --space-3: .75rem;  --space-4: 1rem;
  --space-5: 1.5rem;  --space-6: 2rem;    --space-7: 3rem;    --space-8: 4.5rem;
  --space-9: 6.5rem;  --space-10: 9rem;
  --section-y: clamp(3.5rem, 1rem + 9vw, 9rem);          /* 56px mobile -> 144px at 1440 */

  /* ---- grid: full-bleed sections, 12-column inner grid ---- */
  --container: 1680px;
  --container-narrow: 860px;
  --gutter: clamp(1rem, .5rem + 1.6vw, 1.5rem);          /* 16px mobile, 24px desktop */
  --grid-cols: 12;
  --grid-gap: var(--gutter);

  /* ---- radius / borders / shadow: cards 24-32px, pills, inputs 12px ---- */
  --r-0: 0;
  --r-img: 1.25rem;                      /* photographs inside cards and galleries (20px) */
  --r-card: 1.5rem;                      /* cards, panels (24px) */
  --r-card-lg: 2rem;                     /* feature cards, banners, the footer panel (32px) */
  --r-field: .75rem;                     /* inputs, selects (12px) */
  --r-block: 2rem;                       /* section blocks / panel top corners (32px) */
  --r-block-sm: 1.5rem;                  /* the same on phones (24px) */
  --radius-0: 0;
  --radius-sm: .75rem;                   /* 12px */
  --radius-md: 1rem;                     /* 16px */
  --radius-lg: 1.25rem;                  /* 20px */
  --radius-xl: 1.5rem;                   /* 24px */
  --radius-2xl: 2rem;                    /* 32px */
  --radius-pill: 999px;
  --border: 1px solid var(--line);
  --shadow-1: 0 1px 2px rgba(var(--cocoa-rgb), .06), 0 6px 18px -8px rgba(var(--cocoa-rgb), .16);        /* overlays, small lifts */
  --shadow-2: 0 18px 40px -18px rgba(var(--cocoa-rgb), .24), 0 4px 12px -6px rgba(var(--cocoa-rgb), .1);
  --shadow-3: 0 40px 90px -34px rgba(var(--cocoa-rgb), .36), 0 14px 30px -14px rgba(var(--cocoa-rgb), .14);

  /* ---- motion: slower and softer than V5 (luxury = unhurried) ---- */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.45, 0, .2, 1);
  --ease-soft: cubic-bezier(.25, .8, .25, 1);            /* the default for hovers and fades */
  --ease-expo: cubic-bezier(.16, 1, .3, 1);              /* expo.out: reveals, rises */
  --ease-power4: cubic-bezier(.165, .84, .44, 1);        /* power4.out: swings and settles */
  --ease-spring: cubic-bezier(.34, 1.28, .64, 1);        /* the sliding nav highlight, small pops (gentle overshoot) */
  --fx-speed: 1;                                         /* Appearance > Animation speed: 1 normal, 1.5 slow, .65 fast (a duration multiplier, set by the layout's override block) */
  --dur-1: calc(.2s * var(--fx-speed));  --dur-2: calc(.35s * var(--fx-speed));  --dur-3: calc(.6s * var(--fx-speed));  --dur-4: calc(.9s * var(--fx-speed));  --dur-5: calc(1.4s * var(--fx-speed));
  --dur-reveal: calc(1.1s * var(--fx-speed));            /* line / mask reveals */
  --stagger: calc(.08s * var(--fx-speed));
  --showroom-swap: .55s;                 /* garment switch (spec 350-700 ms) */

  /* ---- layers ---- */
  --z-base: 1;  --z-sticky: 50;  --z-header: 100;  --z-drawer: 200;  --z-overlay: 300;  --z-modal: 400;  --z-toast: 500;  --z-cursor: 800;  --z-preloader: 900;

  /* ---- breakpoints (reference only; CSS custom properties cannot be used in @media) ----
     sm 480px | md 768px | lg 1024px | xl 1280px | 2xl 1600px  */

  --header-bar-h: 4.75rem;               /* header bar: 76px on desktop (64px on phones, see below); --header-h is what sticky offsets and the hero use */
  --header-gap: 0px;
  --header-h: 4.75rem;
  --announce-h: 2.25rem;
  color-scheme: light;
}

@media (max-width: 63.99rem) { :root { --header-bar-h: 4rem; --header-h: 4rem; } }   /* slim bar + round menu button on phones and tablets */

/* Reduced motion: honour the OS setting and the in-site toggle (html[data-motion="reduced"]). */
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: .01ms; --dur-2: .01ms; --dur-3: .01ms; --dur-4: .01ms; --dur-5: .01ms; --dur-reveal: .01ms; --showroom-swap: .01ms; }
}
html[data-motion="reduced"] {
  --dur-1: .01ms; --dur-2: .01ms; --dur-3: .01ms; --dur-4: .01ms; --dur-5: .01ms; --dur-reveal: .01ms; --showroom-swap: .01ms;
}

/* Right-to-left readiness (Urdu): logical properties are used throughout; this flips typography only. */
html[dir="rtl"] { --font-body: var(--font-urdu), "Instrument Sans", system-ui, sans-serif; }

/* Admin dark mode (warm graphite, same roles) */
html[data-theme="dark"] {
  --bg: #1B1511; --bg-alt: #241C17; --bg-elevated: #2C221C; --text: #F3EBE1; --text-muted: #BDAE9F;
  --line: rgba(243, 235, 225, .14); --line-strong: rgba(243, 235, 225, .3); --ctl-border: rgba(243, 235, 225, .5); --accent-text: #F3EBE1;
  --focus: #E3CDB0; color-scheme: dark;
}

/* ---- SHELL additions (additive; same naming scheme) ---- */
:root {
  --ease-editorial: cubic-bezier(.16, 1, .3, 1);
  --radius-arch: 999px 999px 0 0;
  --hairline: 1px solid var(--line);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus);
  --tap: 2.75rem;                        /* minimum touch target (44px) */
  --prose-w: 68ch;
  --scrollbar-w: 0px;
}

/* ---- glass + depth tokens (frosted warm white: header, hero stage, drawers, sheets, toasts, the cookie card) - additive ---- */
:root {
  --sand-1: var(--cream);                 /* legacy names (see aliases list) */
  --sand-2: var(--sand);
  --sand-3: var(--line);
  --sand-4: var(--taupe);
  --glass-rgb: 255, 250, 244;
  --glass-bg: rgba(255, 250, 244, .62);   /* ink text >= 6:1 even over pure black; secondary (muted) text needs --glass-bg-strong */
  --glass-bg-strong: rgba(255, 250, 244, .78);
  --glass-bg-soft: rgba(255, 250, 244, .34);   /* decorative only (no text) */
  --glass-bg-dark: rgba(var(--cocoa-rgb), .78);       /* cocoa glass: cream/white text >= 4.5:1 even over pure white */
  --glass-border: rgba(255, 255, 255, .7);
  --glass-blur: 22px;
  --glass-sat: 1.15;
  --glass-shadow: 0 0 0 1px rgba(var(--cocoa-rgb), .06), 0 1px 0 rgba(255, 255, 255, .7) inset, 0 20px 50px -22px rgba(var(--cocoa-rgb), .3), 0 6px 18px -8px rgba(var(--cocoa-rgb), .14);
  --glass-shadow-lg: 0 0 0 1px rgba(var(--cocoa-rgb), .06), 0 1px 0 rgba(255, 255, 255, .7) inset, 0 40px 90px -34px rgba(var(--cocoa-rgb), .42), 0 14px 30px -14px rgba(var(--cocoa-rgb), .16);
  --persp: 1200px;
  --ease-silk: cubic-bezier(.77, 0, .18, 1);
  --depth-1: 12px; --depth-2: 28px; --depth-3: 56px; --depth-4: 96px;   /* translateZ steps for layered scenes */
  /* Photo veils: warm scrims so text over photography keeps AA */
  --scrim-light: linear-gradient(180deg, rgba(var(--cream-rgb), 0), rgba(var(--cream-rgb), .8));
  --scrim-dark: linear-gradient(180deg, rgba(42, 27, 21, 0), rgba(42, 27, 21, .66));
  --scrim-dark-top: linear-gradient(0deg, rgba(42, 27, 21, 0), rgba(42, 27, 21, .62));
  --scrim-flat-dark: rgba(42, 27, 21, .66);     /* flat veil over a whole photograph, CREAM text: >= 4.5:1 even over a pure-white photo (needs alpha >= .64) */
  --scrim-flat-light: rgba(var(--cream-rgb), .58); /* flat veil, INK text: >= 5:1 even over a pure-black photo */
  /* retired decorative blobs: kept as inert (fully transparent) images so legacy `background: var(--aura-*)` declarations stay valid */
  --aura-gold: linear-gradient(transparent, transparent);
  --aura-sage: linear-gradient(transparent, transparent);
  --aura-rose: linear-gradient(transparent, transparent);
  --ph-cool: linear-gradient(180deg, #EFE6DA 0%, #E4D7C6 100%);   /* warm photo placeholder (never artwork) */
  --ph-warm: var(--ph-cool);              /* legacy name */
  --btn-h: 3rem;
}
