/* ============================================================
   Dr. Ashraf Nageeb — cinematic bilingual build (v2)
   Arabic primary (RTL), English mirrors (LTR).
   Every layout value uses logical properties so dir flipping
   mirrors the page with no extra CSS.

   Fail-safe rule: nothing is hidden unless JS successfully arms
   motion (html.motion-armed), which only happens after the
   libraries load AND prefers-reduced-motion is not set.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --font-ar: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, sans-serif;

  --gutter: clamp(20px, 5vw, 76px);
  --radius: 20px;
  --radius-lg: 30px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --nav-h: 84px;

  /* transform-origin does NOT accept logical keywords (inline-start etc.),
     so growth direction is resolved through these two variables instead. */
  --flow: left;
  --flow-end: right;
  /* Same problem for gradient direction. A veil that has to be opaque on the
     copy side and clear over the artwork needs `to right`/`to left`, which
     cannot be written logically — so it resolves through this token. */
  --grad-to-end: to right;
}

html[dir="rtl"] { --flow: right; --flow-end: left; --grad-to-end: to left; }

html[data-theme="night"] {
  --bg: #05100F;
  --bg-2: #08191A;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .08);
  --border: rgba(255, 255, 255, .12);
  --border-strong: rgba(255, 255, 255, .26);
  --text: #ECF5F3;
  --muted: #8EA5A4;
  --accent: #37D6C6;
  --accent-soft: rgba(55, 214, 198, .14);
  --on-accent: #03211E;
  --brand: #0B3D91;
  --warm: #E4BE86;
  --paper: #EDEFEC;          /* light panel for the white-background portraits */
  --veil: 5 16 15;           /* page colour as channel triple, for gradients that
                                need alpha stops (rgb(var(--veil) / .9)) */
  --hero-photo: saturate(.86) contrast(1.05) brightness(.8);
  --scrim: linear-gradient(to top, #05100F 6%, rgba(5, 16, 15, .35) 55%, transparent);
  --recede-wash: rgba(2, 8, 8, .58);     /* how far a covered card sinks */
}

html[data-theme="day"] {
  --bg: #F4F6F4;
  --bg-2: #FFFFFF;
  --surface: rgba(8, 40, 46, .04);
  --surface-2: rgba(8, 40, 46, .07);
  --border: rgba(8, 40, 46, .14);
  --border-strong: rgba(8, 40, 46, .3);
  --text: #062229;
  /* Contrast-tuned: the old #54727A sampled 1.33–4.4:1 over the hero photo.
     #3F5860 clears 4.5:1 on every ground the theme actually paints (>=5.7:1
     on the scrim and veil mixes, measured against photo-bright wall tones). */
  --muted: #3F5860;
  --accent: #0C8B85;
  --accent-soft: rgba(12, 139, 133, .12);
  --on-accent: #FFFFFF;
  --brand: #0B3D91;
  --warm: #A8742B;
  --paper: #FFFFFF;
  --veil: 244 246 244;
  --scrim: linear-gradient(to top, #F4F6F4 6%, rgba(244, 246, 244, .4) 55%, transparent);
  /* Much lighter than the night value on purpose: in a light theme a receding
     card should go grey, not dark. */
  --recede-wash: rgba(8, 40, 46, .12);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 17px;
  line-height: 1.85;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
html[data-lang="en"] body { font-family: var(--font-en); line-height: 1.7; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.16; letter-spacing: 0; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
figure { margin: 0; }

/* numbers, phone numbers and latin fragments always read left-to-right */
[dir="ltr"], .num, .counter, .clinic-phone, .stat-num, .service-num,
.pillar-num, .clinic-index, .chapter-num, .progress {
  font-family: var(--font-en);
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}

.shell { width: min(1320px, 100% - (var(--gutter) * 2)); margin-inline: auto; }
.sec { padding-block: clamp(90px, 13vh, 170px); position: relative; }

.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: .76rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px;
}
.kicker::before { content: ""; inline-size: 34px; block-size: 1px; background: currentColor; opacity: .7; }
.h2 { font-size: clamp(1.85rem, 4.2vw, 3.4rem); }
.sec-head { margin-bottom: clamp(36px, 6vh, 70px); }

/* ---------- masked line reveals (Arabic-safe: whole lines, never letters) ---------- */
.line { display: block; overflow: hidden; padding-block: .07em; }
.line-i { display: block; will-change: transform; }

.hero-tagline em { font-style: normal; color: var(--accent); position: relative; white-space: nowrap; }
.hero-tagline em::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: .05em;
  block-size: 3px; background: currentColor; opacity: .5;
  transform-origin: var(--flow) center;
}

/* ---------- fail-safe hidden states ---------- */
html.motion-armed .line-i { transform: translateY(118%); }
html.motion-armed .reveal { opacity: 0; transform: translateY(34px); }
html.motion-armed .word { opacity: .14; }
html.motion-armed .fig-mask img,
html.motion-armed .shot-mask img { transform: scale(1.16); }
html.motion-armed .hero-tagline em::after { transform: scaleX(0); }
html.motion-armed .hero-tagline.is-in em::after { transform: scaleX(1); transition: transform 1s var(--ease) .25s; }

/* curated word splitting must never break Arabic joins — words only, never letters */
.word { display: inline-block; }

/* ---------- film grain / progress / cursor ---------- */
/* No mix-blend-mode here, deliberately. A full-viewport FIXED element with a
   blend mode forces the browser to re-read and re-blend the entire backdrop on
   every scroll frame — the single most expensive thing this page could do.
   Plain low-opacity noise gives the same filmic texture for free. */
.grain {
  position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
html[data-theme="day"] .grain { opacity: .035; }

.progress { position: fixed; inset-block-start: 0; inset-inline: 0; block-size: 2px; z-index: 60; background: transparent; }
.progress-bar { display: block; block-size: 100%; inline-size: 100%; background: var(--accent); transform: scaleX(0); transform-origin: var(--flow) center; }

/* ---------- preloader curtain (element is created by JS, never in the HTML) ---------- */
body.has-curtain { overflow: hidden; }
.curtain {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-items: center; will-change: transform;
}
.curtain-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.curtain-name { font-size: clamp(1.25rem, 3vw, 2.1rem); font-weight: 700; }
.curtain-bar { display: block; inline-size: min(260px, 42vw); block-size: 2px; background: var(--border); overflow: hidden; }
.curtain-bar i { display: block; block-size: 100%; inline-size: 100%; background: var(--accent); transform: scaleX(0); transform-origin: var(--flow) center; }
.curtain-pct { font-size: .76rem; color: var(--muted); letter-spacing: .14em; }

.cursor { position: fixed; inset-block-start: 0; inset-inline-start: 0; z-index: 70; pointer-events: none; mix-blend-mode: difference; opacity: 0; }
.cursor-dot, .cursor-ring { position: absolute; border-radius: 50%; display: block; }
.cursor-dot { inline-size: 6px; block-size: 6px; background: #fff; transform: translate(-50%, -50%); }
.cursor-ring {
  inline-size: 40px; block-size: 40px; border: 1px solid rgba(255, 255, 255, .6);
  transform: translate(-50%, -50%); transition: inline-size .35s var(--ease), block-size .35s var(--ease), opacity .3s;
}
.cursor.is-hot .cursor-ring { inline-size: 74px; block-size: 74px; }
html.motion-armed .cursor { opacity: 1; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 50;
  border-block-end: 1px solid transparent;
  transition: background-color .45s var(--ease), border-color .45s;
  /* The top of the page is the photo's BRIGHTEST band (cap, wall) and the
     header is transparent until 30px of scroll — pixel-sampled contrast there
     was 1.33:1 for the language toggle in the day theme. A permanent top
     scrim in the page's own colour (theme-aware via --veil) gives the nav
     guaranteed ground; .is-stuck replaces it with the solid bar below. */
  background: linear-gradient(to bottom, rgb(var(--veil) / .92), rgb(var(--veil) / .6) 62%, transparent);
}
/* A backdrop-filter on a header that is stuck for the whole scroll means a
   full-width blur recomputed every frame. A near-opaque background reads the
   same at this size and costs nothing. */
.site-header.is-stuck {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-block-end-color: var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; padding-block: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  inline-size: 42px; block-size: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 1.02rem; }
.brand-text span { font-size: .75rem; color: var(--muted); }

.nav { display: flex; gap: 24px; margin-inline-start: auto; font-size: .92rem; }
.nav a { color: var(--muted); position: relative; padding-block: 4px; transition: color .3s; }
.nav a::after {
  content: ""; position: absolute; inset-block-end: 0; inset-inline-start: 0;
  block-size: 1px; inline-size: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: var(--flow-end) center; transition: transform .45s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); transform-origin: var(--flow) center; }

.header-actions { display: flex; align-items: center; gap: 12px; margin-inline-start: auto; }
.nav + .header-actions { margin-inline-start: 0; }

.toggle {
  display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--border);
  /* Over the hero photo this pill needs its own page-colour ground and full-
     strength ink: sampled 1.33:1 in the day theme as muted-on-surface. */
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
  transition: border-color .3s, color .3s, background-color .3s;
}
.toggle:hover { border-color: var(--border-strong); color: var(--text); }
.toggle-opt.is-active { color: var(--accent); }
.toggle-sep { opacity: .4; }
.theme-toggle { padding: 10px; }
.theme-dot {
  inline-size: 15px; block-size: 15px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft); transition: transform .5s var(--ease);
}
html[data-theme="day"] .theme-dot { transform: scale(.7); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 32px; border-radius: 999px; font: inherit; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .45s var(--ease), color .35s, border-color .35s, background-color .35s, box-shadow .45s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 16px 44px -20px var(--accent); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 26px 56px -20px var(--accent); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }
/* flex: none + nowrap, deliberately. As a flex child this button was shrunk by
   the header, its label wrapped to three lines, and border-radius:999px turned
   the resulting near-square into a large circle that the header then clipped. */
.header-cta { padding: 11px 22px; font-size: .88rem; flex: none; white-space: nowrap; }

/* ---------- mobile action bar (shown only in the max-width:860px block) ---------- */
.mobile-bar { display: none; }

/* ---------- chapter rail ---------- */
.chapter-rail {
  position: fixed; inset-inline-end: 24px; inset-block-start: 50%; transform: translateY(-50%);
  z-index: 40; display: flex; flex-direction: column; gap: 15px;
}
.chapter { display: flex; align-items: center; gap: 10px; font-size: .72rem; color: var(--muted); }
.chapter-num { opacity: .55; transition: opacity .3s, color .3s; }
.chapter-label {
  display: inline-block; max-inline-size: 0; overflow: hidden; white-space: nowrap;
  opacity: 0; transition: max-inline-size .55s var(--ease), opacity .4s;
}
.chapter::after {
  content: ""; inline-size: 18px; block-size: 1px; background: currentColor; opacity: .4;
  transition: inline-size .55s var(--ease), opacity .3s;
}
.chapter.is-current { color: var(--accent); }
.chapter.is-current .chapter-num { opacity: 1; }
.chapter.is-current::after { inline-size: 38px; opacity: 1; }
.chapter:hover .chapter-label { max-inline-size: 170px; opacity: 1; }

/* ============================================================
   SCENE 01 — HERO (sticky stage over a 160vh travel)
   ============================================================ */
.hero { position: relative; block-size: 160vh; }
.hero-stage {
  position: sticky; inset-block-start: 0; overflow: hidden;
  /* min-height, not height: on a short window the copy can need more than one
     viewport, and a fixed 100vh would clip the credentials off the bottom. */
  min-block-size: 100vh;
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  padding-block: calc(var(--nav-h) + 20px) 40px;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
/* will-change promotes each orb to its own composited layer, so the 90px blur is
   rasterised ONCE and scrolling then only translates a cached texture. Without
   it the browser re-blurs these large circles on every scroll frame. */
.hero-bg .orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.orb-1 { inline-size: 48vw; block-size: 48vw; inset-inline-start: -10vw; inset-block-start: -8vw; background: var(--brand); }
.orb-2 { inline-size: 40vw; block-size: 40vw; inset-inline-end: -8vw; inset-block-start: 16%; background: var(--accent); opacity: .26; }
.orb-3 { inline-size: 30vw; block-size: 30vw; inset-inline-start: 34%; inset-block-end: -14vw; background: var(--warm); opacity: .14; }
html[data-theme="day"] .hero-bg .orb { opacity: .18; }
.hero-grid {
  position: absolute; inset: 0; opacity: .45;
  background-image:
    linear-gradient(to inline-end, var(--border) 1px, transparent 1px),
    linear-gradient(to block-end, var(--border) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 5%, transparent 70%);
}

/* The copy column is capped so it stays on the veiled side of the backdrop —
   the veil is opaque over the first ~55% and clears after that, and nothing
   reads well on the clear part of a photograph. On a phone the backdrop is a
   band in the flow, so the cap is lifted to the full width. */
.hero-inner { position: relative; z-index: 3; }
.hero-copy { max-inline-size: min(940px, 56%); }

/* Shanina-pattern: the NAME is the display type — a single full-width line of
   light type laid across the top of the photograph. Display cut only: font-
   weight 400 reads elegant at this size (700 reads like a poster shouting),
   and it only exists in two sizes so the reveal stays a simple slide. */
.hero-wordmark {
  font-size: clamp(2.6rem, 7.4vw, 7rem);
  font-weight: 400;
  /* overflow:hidden is the reveal mask the intro slides the name up through.
     line-height stays above 1 and padding-block-end adds real room, because
     overflow clipping at line-height ≤1 crops the descenders of ج and ي —
     the same failure the CTA wordmark had on phones. */
  overflow: hidden;
  line-height: 1.12;
  padding-block-end: .12em;
  letter-spacing: .01em;
  margin: 0 0 10px;
  white-space: nowrap;
}
.hero-wordmark span { display: inline-block; will-change: transform; }
/* The promise, small and quiet — exactly the hierarchy the reference uses:
   giant name, small sentence. Em keeps the existing accent underline. */
.hero-tagline { font-size: clamp(1.15rem, 1.8vw, 1.6rem); font-weight: 500; line-height: 1.6; max-inline-size: 34ch; }
.hero-tagline em { font-style: normal; color: var(--accent); }
.hero-sub { max-inline-size: 46ch; color: var(--muted); font-size: clamp(1rem, 1.32vw, 1.13rem); line-height: 1.85; margin-block-start: 14px; }
html[data-lang="en"] .hero-sub { line-height: 1.72; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-block-start: 30px; }

/* The hero visual is a real photograph of the doctor operating, full-bleed
   BEHIND the copy. It used to be a cut-out portrait pinned to the corner
   opposite the text, and that is what left the dead band between picture and
   words — worst in Arabic, where the headline lines are shortest. As a backdrop
   there is no gap left to open. */
.hero-figure-wrap {
  position: absolute; inset: 0; z-index: 1;
  overflow: hidden;
}
.hero-figure-flip {
  /* 160% wide, anchored to the inline-start edge: the visible window is the
     photograph's LEFT ~62% — the two surgeons — with the equipment cabinet at
     the photo's right edge cropped out (it read as "a weird door or window"
     behind the copy on landscape tablets). Anchoring to inline-start mirrors
     the wrapper's overflow in RTL, so the window lands on the SAME slice of
     the photograph in both reading directions. */
  inline-size: 160%;
  position: relative;
  inset-inline-start: 0;
  block-size: 100%;
  /* The RTL mirror lives on this dedicated wrapper, NOT on the image itself.
     The motion engine reads the image's matrix every tween and decomposes a
     mirror into "rotate 180° + flip", which turned the photograph upside
     down. This element is never animated, so a plain mirror on it is safe.
     scaleX(-1) via transform (not the scale property) for the same reason.
     The mirror also flips the -16% offset, which is what keeps the subject
     centred in both reading directions. */
  transform: var(--hero-flip, none);
}
html[dir="rtl"] .hero-figure-flip { transform: scaleX(-1); }
.hero-figure {
  inline-size: 100%; block-size: 100%;
  /* Faces sit ~42% down the photo; 46% keeps them clear of the fixed header
     on landscape tablets instead of cropping them under it. */
  object-fit: cover; object-position: 50% 46%;
  filter: var(--hero-photo);
  /* At rest 1.04 already leaves 18px of bleed, and the scroll tween grows the
     scale faster than it translates, so an edge can never come into view. */
  transform: scale(1.04);
  will-change: transform;
}
/* Directional veil. Opaque on the copy side, clearing over the surgeons, built
   from --grad-to-end so it flips with the page instead of needing its own RTL
   rule. The second layer is a floor vignette for the credential row. */
.hero-figure-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(var(--grad-to-end),
      rgb(var(--veil) / .98) 0%, rgb(var(--veil) / .95) 30%, rgb(var(--veil) / .84) 46%,
      rgb(var(--veil) / .52) 62%, rgb(var(--veil) / .24) 78%, rgb(var(--veil) / .5) 100%),
    linear-gradient(to top,
      rgb(var(--veil) / .95) 0%, rgb(var(--veil) / .46) 20%, transparent 48%);
}
/* The light theme needs its own arithmetic: painting #F4F6F4 at .95 over a
   teal operating theatre turns the whole hero to milk. The veil keeps the copy
   side light and releases the image much earlier, and the photograph is
   desaturated so it reads as a soft grey-green ground for dark ink. */
html[data-theme="day"] .hero-figure-wrap::before {
  background:
    linear-gradient(var(--grad-to-end),
      rgb(var(--veil) / .96) 0%, rgb(var(--veil) / .9) 30%, rgb(var(--veil) / .72) 46%,
      rgb(var(--veil) / .34) 62%, rgb(var(--veil) / .08) 78%, rgb(var(--veil) / .32) 100%),
    /* floor vignette carries the credential row and the scroll cue: muted ink
       needs a near-solid ground down here or it drowns in the photo (the cue
       sampled 1.70:1 with the old .92/.3 ramp). */
    linear-gradient(to top,
      rgb(var(--veil) / .97) 0%, rgb(var(--veil) / .68) 18%, transparent 46%);
}
html[data-theme="day"] .hero-figure { filter: saturate(.55) contrast(1.06) brightness(1.03); }

/* Keeps the brand's teal reading over the photo on the copy side, which would
   otherwise go flat once the veil does its job. */
.hero-figure-wrap::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(58% 52% at var(--flow) 20%, var(--accent-soft), transparent 72%);
}
.hero-figure-cap {
  position: absolute; z-index: 3;
  inset-block-end: clamp(26px, 5vh, 48px);
  inset-inline-end: var(--gutter); inset-inline-start: auto;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 16px; display: flex; flex-direction: column; line-height: 1.3;
}
.hero-figure-cap span { font-size: .88rem; font-weight: 600; }
.hero-figure-cap small { font-size: .78rem; color: var(--muted); }

/* In the flow, directly under the copy. It used to be pinned to the stage's
   bottom edge while the copy was centred in the content box — so the credentials
   lived inside the space the copy could also occupy, and on a short window the
   trust row was drawn straight through the CTA buttons. Stacking them makes the
   collision impossible at any width or language. */
.hero-foot {
  position: static; z-index: 3;
  margin-block-start: clamp(26px, 4.5vh, 46px);
  padding-inline: var(--gutter);
  display: flex; align-items: flex-end; justify-content: flex-start; gap: 24px;
}
/* flex-start (not space-between) so the scroll cue sits with the trust list on the
   text side, instead of being pushed to the far edge opposite the copy. */
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: .82rem; color: var(--muted); max-inline-size: 56%; }
.hero-trust li { display: inline-flex; align-items: center; gap: 10px; }
.hero-trust li::before { content: ""; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--accent); flex: none; }
/* A link, not a label — full-strength ink over the photo's floor vignette
   (muted ink sampled 4.29–4.38:1 worst-case here in the day theme). */
.scroll-cue { display: inline-flex; align-items: center; gap: 12px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text); opacity: .88; }
.scroll-cue-line { inline-size: 46px; block-size: 1px; background: currentColor; position: relative; overflow: hidden; }
.scroll-cue-line::after { content: ""; position: absolute; inset: 0; background: var(--accent); animation: cue 2.6s var(--ease) infinite; }
@keyframes cue { 0% { transform: translateX(-100%) } 60%, 100% { transform: translateX(100%) } }

/* ============================================================
   SCENE 02 — TICKER
   ============================================================ */
.ticker { border-block: 1px solid var(--border); padding-block: 20px; overflow: hidden; background: var(--bg-2); }
.ticker-track { display: flex; align-items: center; gap: 38px; width: max-content; will-change: transform; }
.ticker-item { font-size: clamp(1.05rem, 2vw, 1.6rem); font-weight: 600; color: var(--muted); white-space: nowrap; }
.ticker-sep { color: var(--accent); font-size: .75rem; }

/* ============================================================
   SCENE 03 — STATEMENT (word-by-word scrub)
   ============================================================ */
.statement-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: clamp(34px, 5vw, 90px); align-items: start; }
.statement-text {
  font-size: clamp(1.4rem, 3.1vw, 2.75rem);
  line-height: 1.6; font-weight: 500; margin-block: 10px 30px;
}
html[data-lang="en"] .statement-text { line-height: 1.35; letter-spacing: -.01em; }
.statement-note { color: var(--muted); font-size: 1.05rem; max-inline-size: 52ch; }

.portrait-card { position: relative; }
.portrait-mask {
  border-radius: var(--radius-lg); overflow: hidden; background: var(--paper);
  aspect-ratio: 4 / 5;
}
.portrait-mask img { inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 8%; }
.portrait-card figcaption { margin-block-start: 14px; font-size: .8rem; color: var(--muted); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-block-start: clamp(50px, 8vh, 90px);
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stat { background: var(--bg); padding: 26px 22px; }
.stat-num { display: block; font-size: clamp(2.1rem, 4.2vw, 3rem); font-weight: 700; color: var(--accent); line-height: 1; }
.stat-num::after { content: "+"; font-size: .5em; vertical-align: super; opacity: .5; }
.stat-label { display: block; font-size: .82rem; color: var(--muted); margin-block-start: 10px; }

/* ============================================================
   SCENE 04 — SPECIALTIES (horizontal travel)
   ============================================================ */
.pillars-h { position: relative; block-size: 320vh; }
.pillars-viewport {
  position: sticky; inset-block-start: 0; block-size: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 40px;
}
.pillars-head { flex: none; }
.pillars-track { display: flex; gap: clamp(16px, 1.8vw, 30px); padding-inline: var(--gutter); width: max-content; will-change: transform; }
/* Panel width IS the horizontal travel: four ~1/3-viewport panels left only
   ~650px of slide spread across a 320vh section, which read as "stuck" rather
   than cinematic. Bigger slides give the scrub something to travel through. */
/* flex:none is load-bearing, not cosmetic. In rail mode the track is a flex row
   with overflow-x:auto, and flex items shrink by default — which squashed these
   slides to ~120px on a phone and left the gallery rail unable to scroll at all,
   putting every shot past the first out of reach. */
.pillar-panel {
  flex: none;
  inline-size: clamp(290px, 44vw, 660px);
  padding: clamp(28px, 3vw, 46px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-2), transparent 70%);
  display: flex; flex-direction: column; gap: 16px; min-block-size: min(54vh, 520px);
}
.pillar-panel h3 { font-size: clamp(1.5rem, 2.4vw, 2.2rem); margin-block-start: auto; }
.pillar-panel p { color: var(--muted); font-size: .98rem; line-height: 1.9; }
.pillar-num { font-size: .78rem; color: var(--accent); letter-spacing: .12em; }
.pillars-progress { position: absolute; inset-inline: var(--gutter); inset-block-end: 8vh; block-size: 1px; background: var(--border); }
.pillars-progress-bar { display: block; block-size: 100%; inline-size: 100%; background: var(--accent); transform: scaleX(0); transform-origin: var(--flow) center; }

/* ============================================================
   SCENE 05 — SERVICES
   ============================================================ */
.services-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(34px, 5vw, 90px); align-items: start; }
.services-sticky { position: sticky; inset-block-start: 16vh; }
.services-copy { color: var(--muted); margin-block-start: 20px; max-inline-size: 42ch; }
.service-figure { margin-block-start: 34px; }
.fig-mask { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; }
.fig-mask img { inline-size: 100%; block-size: 100%; object-fit: cover; filter: saturate(.7) contrast(1.05); }
/* A portrait in this column, not a landscape scene. The cutout sits on a
   theme-adaptive gradient panel instead of the plain paper card: the white
   card read as a flat block and shrank the figure. Bottom-anchored contain
   keeps the face large at any card width. */
/* Capped rather than full column width: at 4/5 the full column made a very
   large block on the page. At 300px it reads as a portrait accent. */
.service-figure .fig-mask {
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(90% 60% at 50% 30%, var(--accent-soft), transparent 70%),
    linear-gradient(168deg, color-mix(in srgb, var(--bg-2) 88%, var(--accent)), var(--bg));
  inline-size: 100%; max-inline-size: 300px;
}
.service-figure .fig-mask img {
  object-fit: contain; object-position: 50% 100%;
  filter: saturate(.92) contrast(1.03) drop-shadow(0 18px 28px rgba(0, 0, 0, .35));
}

.service-list { border-block-start: 1px solid var(--border); }
.service-row {
  display: grid; grid-template-columns: 62px 1fr; gap: 6px 22px;
  padding-block: clamp(22px, 3vh, 34px);
  border-block-end: 1px solid var(--border);
  position: relative;
}
.service-row::after {
  content: ""; position: absolute; inset-block-end: -1px; inset-inline-start: 0;
  block-size: 1px; inline-size: 0; background: var(--accent);
}
.service-num { font-size: .76rem; color: var(--muted); letter-spacing: .1em; padding-block-start: 6px; }
.service-row h3 { font-size: clamp(1.06rem, 1.6vw, 1.35rem); }
.service-row p { grid-column: 2; color: var(--muted); font-size: .94rem; line-height: 1.9; max-inline-size: 62ch; }
.service-row:hover::after { inline-size: 100%; transition: inline-size .6s var(--ease); }
.service-row:hover .service-num { color: var(--accent); }

/* ============================================================
   SCENE 06 — AWARENESS (sticky stage)
   ============================================================ */
.awareness { position: relative; block-size: 200vh; background: #04161A; color: #ECF5F3; }
.awareness-stage {
  position: sticky; inset-block-start: 0; block-size: 100vh; overflow: hidden;
  display: flex; align-items: center;
  background:
    radial-gradient(ellipse at 18% 12%, rgba(55, 214, 198, .16), transparent 58%),
    linear-gradient(150deg, #041417, #06282E 55%, #041417);
}
.awareness-media { position: absolute; inset: 0; z-index: 0; }
.awareness-figure { position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 52%; overflow: hidden; }
.awareness-figure img { inline-size: 100%; block-size: 100%; object-fit: cover; filter: saturate(.55) brightness(.42) contrast(1.1); }
.awareness-figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to inline-start, #04161A 8%, transparent 70%); }
.awareness-inner { position: relative; z-index: 2; max-inline-size: 760px; }
.awareness-icon { inline-size: clamp(44px, 5vw, 66px); block-size: auto; margin-bottom: 22px; filter: invert(1) brightness(1.5); opacity: .85; }
.aware-title { font-size: clamp(2rem, 6vw, 4.9rem); line-height: 1.1; margin-block: 0 24px; }
.aware-line { inline-size: 100%; block-size: 8px; color: #37D6C6; display: block; margin-block: 6px 28px; opacity: .85; }
.aware-text { max-inline-size: 60ch; color: rgba(236, 245, 243, .74); font-size: 1.04rem; line-height: 1.95; }
.aware-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 26px; margin-block-start: 38px; }
.aware-phone { display: inline-flex; flex-direction: column; gap: 2px; }
.aware-phone-label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #37D6C6; }
.aware-phone-num { font-size: 1.3rem; font-weight: 600; }
.aware-video-note { margin-block-start: 30px; font-size: .78rem; color: rgba(236, 245, 243, .55); } /* was .45 ≈ 3.9:1 on the scene ground */

/* ============================================================
   SCENE 07 — GALLERY (horizontal travel)
   ============================================================ */
/* 3 shots instead of 5: less track to traverse, so a shorter pin. */
.gallery { position: relative; block-size: 260vh; }
.gallery-viewport {
  position: sticky; inset-block-start: 0; block-size: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 34px;
}
.gallery-head { flex: none; }
.gallery-track { display: flex; gap: clamp(14px, 1.4vw, 24px); padding-inline: var(--gutter); width: max-content; will-change: transform; }
.shot { flex: none; inline-size: clamp(230px, 32vw, 460px); }
.shot-mask { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface); }
.shot-mask img { inline-size: 100%; block-size: 100%; object-fit: cover; filter: saturate(.75) contrast(1.05); }
.shot figcaption { margin-block-start: 12px; font-size: .78rem; color: var(--muted); }
.gallery-note { margin-block-start: 22px; font-size: .74rem; color: var(--muted); opacity: .8; }

/* ============================================================
   SCENE 08 — VOICES (stacking deck)
   ============================================================ */
.voice-deck { display: flex; flex-direction: column; gap: 22px; }
.voice-card {
  position: sticky; inset-block-start: 18vh;
  margin: 0; padding: clamp(28px, 3.4vw, 52px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 -18px 50px -30px rgba(0, 0, 0, .5);
}
.voice-card p { font-size: clamp(1.15rem, 2.1vw, 1.75rem); line-height: 1.75; }
.voice-card cite { display: block; margin-block-start: 20px; font-style: normal; font-size: .84rem; color: var(--muted); }
.voice-mark { font-family: var(--font-en); font-size: 4.4rem; line-height: 1; color: var(--accent); opacity: .25; display: block; }

/* The deck's "covered cards recede" wash.
   This used to be filter: brightness(.42) tweened on the card, which was wrong
   twice over: GSAP captures a brightness() that is absent from the current
   filter as 0, not 1 — so every covered card swept through FULL BLACK before
   settling (measured: 0.042 at 10% progress) — and .42 is a dark-theme value,
   which on a light theme turns a white card black.
   The tween now drives the --recede number (0 → 1) and the wash colour, strength
   included, is a theme token. Two consequences worth having: no brightness maths
   in JS, and the wash repaints correctly the instant the theme changes, because
   the browser resolves var(--recede-wash) at paint time. */
.voice-card { --recede: 0; }
.voice-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--recede-wash); opacity: var(--recede);
  pointer-events: none;
}

/* ============================================================
   SCENE 09 — CLINICS
   ============================================================ */
.clinic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.clinic-card {
  padding: clamp(30px, 3.2vw, 48px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex; flex-direction: column; gap: 14px;
  transition: transform .5s var(--ease), border-color .4s, background-color .4s;
}
.clinic-card:hover { transform: translateY(-6px); border-color: var(--accent); background: var(--surface-2); }
.clinic-index { font-size: .74rem; color: var(--accent); letter-spacing: .12em; }
.clinic-tag { font-size: clamp(1.3rem, 2vw, 1.7rem); }
.clinic-addr { color: var(--muted); font-size: .97rem; line-height: 1.9; }
.clinic-phone { font-size: 1.24rem; font-weight: 600; color: var(--accent); }
.clinic-link { font-size: .86rem; color: var(--muted); border-block-end: 1px solid var(--border-strong); align-self: flex-start; padding-block-end: 3px; transition: color .3s, border-color .3s; }
.clinic-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================================
   SCENE 10 — CTA + giant wordmark
   ============================================================ */
.cta { position: relative; padding-block: clamp(90px, 14vh, 180px) 0; overflow: hidden; border-block-start: 1px solid var(--border); }
.cta-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.cta-title { font-size: clamp(1.9rem, 5vw, 4rem); }
.cta-sub { color: var(--muted); margin-block-start: 18px; font-size: 1.06rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-block-start: 34px; }
.cta-note { color: var(--muted); font-size: .82rem; margin-block-start: 32px; max-inline-size: 64ch; opacity: .85; }
.cta-wordmark {
  margin-block-start: clamp(40px, 8vh, 90px);
  line-height: .82; text-align: center; overflow: hidden;
  padding-inline: var(--gutter);
}
.cta-wordmark span {
  display: block;
  font-size: clamp(3.4rem, 17vw, 15rem);
  font-weight: 700; letter-spacing: -.03em;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-strong);
  background: linear-gradient(to top, var(--accent), transparent 70%);
  -webkit-background-clip: text; background-clip: text;
}

.site-footer { border-block-start: 1px solid var(--border); padding-block: 38px; background: var(--bg-2); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand strong { font-size: 1rem; }
.footer-brand span, .footer-meta { font-size: .8rem; color: var(--muted); }
.footer-meta { display: inline-flex; gap: 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .nav { display: none; }
  .chapter-rail { display: none; }
  .statement-grid, .services-grid { grid-template-columns: 1fr; }
  .services-sticky { position: static; }
  /* Narrow desktops: the copy column is a larger share of the stage so the
     headline keeps its four lines, and the type is capped slightly lower so the
     longest English line still fits that column. Without both, "begins with
     trust" broke onto a fifth line at 1024 and pushed the copy into the foot. */
  .hero-copy { max-inline-size: min(940px, 62%); }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .hero-trust { max-inline-size: 100%; }
}

/* Short laptop viewports (1366×660 with browser chrome is the common one).
   The hero's fixed furniture — nav padding, sub, buttons, credentials — used to
   come to about 470px, which left too little for the display type and pushed
   the credential row past the fold, breaking the pin. Everything here buys back
   roughly 130px without shrinking the name below legibility. Below ~620px tall
   the stack still cannot fit; it then simply behaves like a tall section, and
   nothing is clipped or overlapping either way. */
@media (min-width: 861px) and (max-height: 800px) {
  .hero-stage { padding-block: calc(var(--nav-h) + 8px) 24px; }
  .hero-wordmark { font-size: clamp(2.2rem, 5.6vw, 5.2rem); margin-block-end: 6px; }
  .hero-tagline { line-height: 1.45; margin-block-end: 8px; }
  .hero-sub { line-height: 1.68; }
  .hero-cta { margin-block-start: 16px; }
  .hero-foot { margin-block-start: 12px; }
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .clinic-grid { grid-template-columns: 1fr; }

  /* the horizontal travel becomes a native swipe rail */
  .pillars-h, .gallery { block-size: auto; }
  .pillars-viewport, .gallery-viewport { position: static; block-size: auto; padding-block: clamp(70px, 11vh, 120px); }
  .pillars-track, .gallery-track {
    width: auto; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-block-end: 18px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pillars-track::-webkit-scrollbar, .gallery-track::-webkit-scrollbar { display: none; }
  .pillar-panel { scroll-snap-align: center; min-block-size: auto; }
  .shot { scroll-snap-align: center; }
  .pillars-progress { display: none; }

  /* pinned cinematic stages become normal flowing sections on phones */
  .hero, .awareness { block-size: auto; }
  /* position:relative rather than static. Left static, these stages stop being
     the containing block for their absolutely-positioned background layers, so
     the decorative orbs escape the stage's own overflow:hidden and push the
     whole document ~9px wider than the viewport. */
  .awareness-stage { position: relative; block-size: auto; padding-block: calc(var(--nav-h) + 40px) 56px; }
  /* The hero flows on phones instead of pinning: copy, then the operating-room
     image as its own full-bleed band, then the credentials. On the desktop
     sticky stage the backdrop sits behind everything; at this width it becomes
     a band instead, so the copy never has to sit on the photograph. */
  .hero-stage {
    position: relative; block-size: auto; min-block-size: 0;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    padding-block: calc(var(--nav-h) + 34px) 0;
  }
  .hero-copy { max-inline-size: 100%; }
  .awareness-figure { position: relative; inline-size: 100%; block-size: 46vh; }
  .awareness-figure::after { background: linear-gradient(to top, #04161A 10%, transparent 70%); }
  .awareness-inner { margin-block-start: -12vh; }
  /* The cards stop being positioned here, so the recede wash would be sized
     against an ancestor instead of the card. The recede is desktop-only anyway. */
  .voice-card { position: static; }
  .voice-card::after { display: none; }

  /* mobile is where these visitors arrive: drop the GPU-heavy layers */
  .grain { display: none; }
  .cursor { display: none; }
  .hero-bg .orb { filter: blur(52px); }
  .site-header.is-stuck { backdrop-filter: none; background: color-mix(in srgb, var(--bg) 95%, transparent); }
  /* Full-bleed band, so no mask fade on the outer edges — only a floor vignette
     that carries it into the section below. */
  .hero-figure-wrap {
    position: relative; inset: auto;
    inline-size: 100%; block-size: min(42vh, 320px);
    margin-block: 30px 0;
    /* the parallax that needed a composited layer is desktop-only */
  }
  .hero-figure { transform: none; will-change: auto; object-position: 50% 46%; }
  .hero-figure-wrap::before {
    background: linear-gradient(to top, var(--bg) 0%, rgb(var(--veil) / .55) 44%, transparent 88%);
  }
  .hero-figure-wrap::after { display: none; }
  .hero-figure-cap { display: none; }
  /* static, so it needs the gutter back as padding — it was inset by it before */
  .hero-foot { position: static; inset: auto; margin-block-start: 0; gap: 18px; padding: 6px var(--gutter) 34px; }
  .hero-trust { font-size: .9rem; gap: 10px 20px; }

  /* Phones are touched, not clicked: every interactive element gets a thumb-height
     target, and the labels that sat at 11–12px get a readable size. */
  .toggle { min-block-size: 44px; padding-inline: 14px; }
  .theme-toggle { min-inline-size: 44px; }
  .brand { min-block-size: 44px; }
  .scroll-cue { min-block-size: 44px; font-size: .78rem; }
  .clinic-phone { min-block-size: 44px; display: inline-flex; align-items: center; }
  .clinic-link {
    display: inline-flex; align-items: center; min-block-size: 44px;
    border-block-end: 0; text-decoration: underline;
    text-decoration-color: var(--border-strong); text-underline-offset: 5px;
  }
  .clinic-link:hover { text-decoration-color: var(--accent); }
  .kicker, .gallery-note, .clinic-index, .service-num, .aware-video-note, .shot figcaption { font-size: .8rem; }
  .aware-phone-label { font-size: .78rem; }

  /* The header CTA has no room here (see .header-cta). Booking moves to a fixed
     bar instead, so it is one thumb-tap away at every scroll position. */
  .header-cta { display: none; }
  .mobile-bar {
    display: grid; grid-template-columns: 1fr auto; gap: 10px;
    position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 55;
    padding: 10px max(var(--gutter), 14px) calc(10px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    border-block-start: 1px solid var(--border);
  }
  .mobile-bar a {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-block-size: 52px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  }
  .mobile-bar-cta { background: var(--accent); color: var(--on-accent); box-shadow: 0 14px 34px -18px var(--accent); }
  .mobile-bar-call { border: 1px solid var(--border-strong); color: var(--text); padding-inline: 20px; }
  .mobile-bar-call svg { inline-size: 17px; block-size: 17px; flex: none; }
  /* the bar is fixed, so its height has to be reserved at the end of the document */
  body { padding-block-end: calc(78px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-block-end: 88px; }
  /* Belt-and-braces: nothing on a phone may open horizontal panning, even the
     sub-pixel residue the emulation reports (real devices cannot scroll it,
     measured scrollLeft range [0, 0] in RTL — this only guarantees it). */
  html, body { overflow-x: clip; }

  /* A thumb scrolls far less per gesture than a wheel, so the desktop-scale
     breathing room between sections reads as dead space on a phone. */
  .sec { padding-block: clamp(56px, 8vh, 92px); }
  .sec-head { margin-bottom: clamp(26px, 4vh, 42px); }
  .pillars-viewport, .gallery-viewport { padding-block: clamp(44px, 7vh, 74px); }
  .cta { padding-block: clamp(56px, 9vh, 100px) 0; }

  /* line-height .82 plus overflow:hidden crops Arabic descenders (the tails of
     ج and ي), which cuts the script through the middle of the glyphs. */
  .cta-wordmark { line-height: 1; padding-block-end: 10px; }
  .cta-wordmark span { -webkit-text-stroke-width: 1px; }
}

@media (max-width: 560px) {
  .header-inner { gap: 10px; padding-block: 13px; }
  .brand-text span { display: none; }
  .brand-text strong { white-space: nowrap; font-size: .95rem; }
  .brand-mark { inline-size: 38px; block-size: 38px; }
  .toggle { padding: 7px 11px; font-size: .78rem; }
  .theme-toggle { padding: 8px; }
  /* The name is the display type now — the 7.4vw desktop clamp is huge on a
     phone, and at 320px "د. أشرف نجيب" + the gutters must stay on one line. */
  .hero-wordmark { font-size: clamp(2rem, 9.4vw, 3.4rem); white-space: normal; }
  .hero-tagline { font-size: 1.06rem; }
}

@media (max-width: 480px) {
  /* The four header controls + the full name overflow a small phone:
     the theme switch was clipped (AR) or pushed off-screen (EN). */
  .header-inner { gap: 6px; }
  .brand { gap: 8px; }
  .brand-mark { inline-size: 32px; block-size: 32px; }
  .brand-text strong { font-size: .85rem; }
  .header-actions { gap: 6px; }
  .toggle { padding: 7px 9px; }
  .menu-toggle .wa-ar, .menu-toggle .wa-en { display: none !important; }
  .theme-toggle { padding: 7px; }
}
@media (max-width: 350px) {
  /* 320-350px: everything fits only without the theme switch (night is the
     default look; the toggle returns from 351px up). */
  .theme-toggle { display: none; }
}

/* ---------- reduced motion: everything readable, nothing hidden ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html.motion-armed .line-i, html.motion-armed .reveal, html.motion-armed .fig-mask img,
  html.motion-armed .shot-mask img { transform: none !important; }
  html.motion-armed .reveal { opacity: 1 !important; }
  html.motion-armed .word { opacity: 1 !important; }
}

/* ============================================================
   NO-JS / MOTION-OFF FALLBACK (desktop)
   The pinned stages and the horizontal tracks only exist because a script
   drives them. If that script never arms — JS blocked, or reduced motion —
   a 340vh sticky stage is 340vh of dead scroll, and everything past the first
   viewport of a horizontal track is unreachable content. So the travel
   sections collapse to normal flow and the tracks become native scroll rails.
   Phones are already handled by the max-width:860px block above.
   ============================================================ */
@media (min-width: 861px) {
  /* The stage below goes overflow:visible here, which lets the hero's -8vw
     decorative orb spill past the viewport edge and open a horizontal
     scrollbar (115px at 1440). Clipping the axis on the fallback root only —
     the animated path keeps its own precise layout. */
  html:not(.motion-armed), html:not(.motion-armed) body { overflow-x: clip; }
  html:not(.motion-armed) .hero,
  html:not(.motion-armed) .pillars-h,
  html:not(.motion-armed) .awareness,
  html:not(.motion-armed) .gallery { block-size: auto; }

  html:not(.motion-armed) .hero-stage,
  html:not(.motion-armed) .pillars-viewport,
  html:not(.motion-armed) .awareness-stage,
  html:not(.motion-armed) .gallery-viewport {
    position: static; block-size: auto; overflow: visible;
    padding-block: calc(var(--nav-h) + 40px) 60px;
  }

  html:not(.motion-armed) .pillars-track,
  html:not(.motion-armed) .gallery-track {
    inline-size: auto; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-block-end: 18px; scrollbar-width: none;
  }
  html:not(.motion-armed) .pillars-track::-webkit-scrollbar,
  html:not(.motion-armed) .gallery-track::-webkit-scrollbar { display: none; }
  html:not(.motion-armed) .pillar-panel,
  html:not(.motion-armed) .shot { scroll-snap-align: center; }
  html:not(.motion-armed) .pillars-progress { display: none; }
}

/* ---------- mobile main menu (desktop .nav is hidden at <=1180px) ---------- */
.menu-toggle { display: none; }
.mobile-menu { display: none; }
@media (max-width: 1180px) {
  .menu-toggle { display: inline-flex; align-items: center; gap: 7px; }
  .mobile-menu {
    position: fixed; inset-block-start: var(--nav-h); inset-inline: 0; z-index: 49;
    flex-direction: column;
    padding: 6px max(var(--gutter), 16px) 14px;
    background: color-mix(in srgb, var(--bg) 97%, transparent);
    border-block-end: 1px solid var(--border);
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a {
    padding-block: 13px; font-size: 1.05rem; font-weight: 600; color: var(--text);
    border-block-end: 1px solid var(--border);
  }
  .mobile-menu a:last-child { border-block-end: 0; }
}

/* ---------- footer social links ---------- */
.footer-social { display: inline-flex; gap: 10px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  inline-size: 40px; block-size: 40px; border-radius: 50%;
  border: 1px solid var(--border); color: var(--muted);
  transition: color .3s, border-color .3s;
}
.footer-social a:hover { color: var(--accent); border-color: var(--border-strong); }
.footer-social svg { inline-size: 18px; block-size: 18px; }

/* Mobile: the fixed chat bubble sits over the first footer social icon;
   shift the row clear of it on phones. */
@media (max-width: 860px) {
  .footer-social { margin-inline-start: 72px; }
  /* keep the social row and copyright visually above the fixed chat teaser band */
  .site-footer { padding-block-end: 144px; }
}
