/* ==========================================================================
   Bedaya — global.css
   Reset, base typography, container, layout skeleton, organic dividers,
   fade-out masks, reveal utilities. Built to Art-Direction v3 (§2.11, §4.4/4.5).
   ========================================================================== */

/* ----- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }            /* Lenis smooth-scroll */
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-weight: 200;                 /* light, classy */
  font-size: 1.125rem;              /* slightly larger than before (was 1.0625rem) */
  line-height: 1.72;
  letter-spacing: 0.002em;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video, canvas { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--purple-18); }

/* ----- Typography --------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 200; line-height: var(--lh-heading); letter-spacing: -0.015em; color: var(--text); text-wrap: balance; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 400; letter-spacing: 0; }
strong, b { font-weight: 400; }
p { text-wrap: pretty; }   /* line width governed by each section, not a global cap */
.lead { font-size: var(--fs-body-lg); color: var(--body); }
.muted { color: var(--muted); }

/* Display headline — Aktiv Thin, airy */
.display {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.display em { font-style: normal; color: var(--purple-deep); }
/* every display-class headline gets balanced line breaks (no orphan last word) */
.adbanner__title, .bgband__title, .deptv2__title, .imgcard__title, .cta-band h2 { text-wrap: balance; }

/* Eyebrow / label — the Aesop captioning move */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--fs-small);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--muted);
  display: inline-block;
}
.eyebrow--accent { color: var(--purple-deep); }
.eyebrow--sage { color: var(--sage-dark); }

/* ----- Layout skeleton (§2.11) ------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--wide { max-width: 1320px; }
.container--narrow { max-width: 880px; }

/* establish a stacking context so the floating-leaf field (z-index:-1) stays behind page content */
#main { position: relative; z-index: 0; }

.section { position: relative; padding-block: var(--section-y); }
.section--sm { padding-block: var(--section-y-sm); }
.section--flush { padding-block: 0; }

/* Hero grid (col 2 = imagery / trust) */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-7); align-items: center; }
@media (min-width: 768px) { .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: var(--s-8); } }

/* Bento grid (Departments) */
.bento { display: grid; grid-template-columns: 1fr; gap: var(--s-5); }
@media (min-width: 700px) { .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(220px, auto); } }
.bento__span2 { grid-column: 1 / -1; }
@media (min-width: 700px) { .bento__span2 { grid-column: span 2; } }

/* Generic auto-fit card row */
.cards { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
/* single-card row — keep the lone card a normal size and centred instead of stretching full-width */
.cards--solo { grid-template-columns: minmax(0, 360px); justify-content: center; }

/* ----- Section vertical rhythm helpers ----------------------------------- */
.stack > * + * { margin-top: var(--s-5); }
.stack-lg > * + * { margin-top: var(--s-7); }
.measure { max-width: none; }   /* centered sections run full width of their container */
.center { text-align: center; margin-inline: auto; }

/* ----- Organic dividers (§4.5) — never hard rectangles ------------------- */
.divider { display: block; line-height: 0; margin-bottom: -1px; pointer-events: none; }
.divider svg { display: block; width: 100%; height: clamp(60px, 8vw, 120px); }
.divider--flip svg { transform: scaleY(-1); }

/* ----- Fade-out corners & soft edges (§4.4) ------------------------------ */
.vignette-soft {
  -webkit-mask-image: radial-gradient(120% 100% at 50% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(120% 100% at 50% 50%, #000 62%, transparent 100%);
}
.fade-edges {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.corner-fade { position: relative; }
.corner-fade::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(140% 120% at 0% 0%, transparent 70%, var(--bg) 100%),
    radial-gradient(140% 120% at 100% 0%, transparent 70%, var(--bg) 100%),
    radial-gradient(140% 120% at 0% 100%, transparent 70%, var(--bg) 100%),
    radial-gradient(140% 120% at 100% 100%, transparent 70%, var(--bg) 100%);
}

/* ----- Reveal utilities (§2.4 focal layer) ------------------------------- */
/* progressive enhancement: only hide when JS is active (html.js) so content
   is ALWAYS visible without/with-broken JS. is-in carries higher specificity. */
.reveal { transition: opacity var(--t) var(--breathe), transform var(--t) var(--breathe); will-change: opacity, transform; }
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.is-in { opacity: 1; transform: none; }
/* staggered children: set --i on each child (transition-based — robust, no fill-mode traps) */
html.js .reveal-group > * { opacity: 0; transform: translateY(24px); transition: opacity var(--t) var(--breathe), transform var(--t) var(--breathe); transition-delay: calc(var(--i, 0) * 100ms); will-change: opacity, transform; }
html.js .reveal-group.is-in > * { opacity: 1; transform: none; }

[data-parallax] { will-change: transform; }

/* ----- Eyebrow rule / small flourishes ----------------------------------- */
.rule { width: 48px; height: 2px; background: var(--purple); border: 0; opacity: .5; }
.rule--sage { background: var(--sage-dark); }

/* ----- Visually hidden (a11y) -------------------------------------------- */
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 1100; background: var(--surface); padding: .6rem 1rem; border-radius: var(--r-sm); box-shadow: var(--shadow-soft); transition: top var(--t-fast) var(--breathe); }
.skip-link:focus { top: 16px; }

/* ----- Reduced motion: freeze the ambient + soften reveals --------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .reveal-group > * { opacity: 1; transform: none; transition: none; }
  [data-parallax] { transform: none !important; }
}

/* no bold anywhere — <b>/<strong> emphasise with the brand purple instead of weight */
b, strong { font-weight: 400; color: var(--purple-deep); }
