/* ==========================================================================
   د. سليمان المحرز — Motion Prototype
   One stylesheet for the prototype pages. Tokens mirror design-system/tokens.json;
   the motion tokens below are the single source of truth for CSS *and* JS
   (the scripts read them with getComputedStyle).
   Only transform, opacity and clip-path are animated.
   ========================================================================== */

/* ---------- Fonts (SIL OFL 1.1, self-hosted WOFF2 subsets) ---------- */
@font-face {
  font-family: "Markazi Text";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/markazi-text-arabic-500-normal.woff2?v=b244d778d3") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Markazi Text";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/markazi-text-latin-500-normal.woff2?v=53279e23f7") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2?v=6010e7fd0d") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2?v=90aef64fea") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2?v=3b646991d3") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2?v=0717336fb3") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2?v=08949f728d") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212;
}

/* ---------- Tokens ---------- */
:root {
  /* colour (approved palette) */
  --charcoal: #111111;
  --ivory: #F7F5F0;
  --graphite: #1C1C1C;
  --champagne: #C6A56D;
  --champagne-hover: #D4B888;
  --gold-deep: #7A5C2E;
  --gold-deep-hover: #5E4622;
  --warm-grey: #5E5A54;
  --stone: #A8A29A;
  --photo-frame: #2B2B2B;
  --hairline-dark: rgba(247, 245, 240, .12);
  --hairline-light: rgba(28, 28, 28, .18);

  /* type */
  --font-display: "Markazi Text", "Noto Naskh Arabic", serif;
  --font-sans: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* space + radius */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px;
  --space-8: 32px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
  --radius-sharp: 2px; --radius-card: 4px;
  --gutter: 20px;
  --header-h: 64px;
  --wire: 1.5px;

  /* motion — one rhythm for the whole site */
  --ease-enter: cubic-bezier(.22, 1, .36, 1);     /* entrances, reveals, the name correction */
  --ease-transit: cubic-bezier(.76, 0, .24, 1);   /* curtains, wire and rule drawing */
  --ease-correct: cubic-bezier(.5, 0, .15, 1);    /* hero: the wire straightens and the crowded name aligns with it */
  --ease-micro: ease-out;
  --dur-micro: 150ms;        /* colour feedback */
  --dur-press: 90ms;         /* button press */
  --dur-line: 320ms;         /* underline travel */
  --dur-settle: 700ms;       /* pointer-driven layers returning to rest */
  --dur-rule: 900ms;         /* rules drawn in reading direction */
  --dur-reveal: 1100ms;      /* masked line reveals */
  --stagger-line: 90ms;
  --dur-wire-draw: 1400ms;   /* hero: the wavy wire is drawn */
  --dur-correct: 3000ms;     /* hero: wire straightens, name aligns */
  --dur-curtain-in: 550ms;
  --dur-curtain-out: 650ms;
  --dur-menu: 600ms;
  --dur-zoom: 460ms;         /* a photograph grows from its place into the enlarged view */

  /* Page-to-page transition style — the one switch:  strips (five strips that level) | single (one curtain) */
  --page-transition: strips;

  /* reading direction: 1 = LTR, -1 = RTL */
  --dir: 1;
  --start: left;
  --end: right;
}
[dir="rtl"] { --dir: -1; --start: right; --end: left; }

@media (min-width: 720px) { :root { --gutter: 32px; --header-h: 72px; } }
@media (min-width: 1080px) { :root { --gutter: 64px; --header-h: 80px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--charcoal);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html[lang="en"] body { font-family: "IBM Plex Sans", system-ui, sans-serif; line-height: 1.65; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.mono { font-family: var(--font-mono); font-size: .75rem; line-height: 1.5; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nb { white-space: nowrap; }   /* short hyphenated Latin tokens (E-WIRE) never split at the hyphen */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* Surfaces set the local palette */
.surface-dark {
  --bg: var(--charcoal); --fg: var(--ivory); --fg-2: var(--stone);
  --accent: var(--champagne); --accent-hover: var(--champagne-hover);
  --hairline: var(--hairline-dark); --focus: var(--champagne);
  background: var(--bg); color: var(--fg);
}
.surface-light {
  --bg: var(--ivory); --fg: var(--graphite); --fg-2: var(--warm-grey);
  --accent: var(--gold-deep); --accent-hover: var(--gold-deep-hover);
  --hairline: var(--hairline-light); --focus: var(--gold-deep);
  background: var(--bg); color: var(--fg);
}

:focus-visible { outline: 2px solid var(--focus, var(--champagne)); outline-offset: 2px; border-radius: var(--radius-sharp); }

.skip {
  position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 1000;
  padding: 10px 16px; background: var(--champagne); color: var(--charcoal);
  font-size: .875rem; font-weight: 500; border-radius: var(--radius-sharp); text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Links: a gold line travels in the reading direction ---------- */
.link {
  position: relative; display: inline-block; text-decoration: none; color: var(--accent);
  padding-block: 2px;
  transition: color var(--dur-micro) var(--ease-micro);
}
.link::before, .link::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 1px; background: currentColor;
}
.link::before { opacity: .35; }                       /* resting underline: links never rely on colour alone */
.link::after {
  transform: scaleX(0); transform-origin: var(--end) center;     /* leaves towards the end side */
  transition: transform var(--dur-line) var(--ease-enter);
}
.link:hover, .link:focus-visible { color: var(--accent-hover); }
.link:hover::after, .link:focus-visible::after { transform: scaleX(1); transform-origin: var(--start) center; }  /* enters from the start side */
.link--quiet { color: inherit; }
.link--quiet::before { opacity: 0; }
.link[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }
.link.is-pending { color: var(--fg-2); cursor: default; }
.link.is-pending::before, .link.is-pending::after { display: none; }
.link__arrow { display: inline-block; margin-inline-start: .5em; transition: transform var(--dur-line) var(--ease-enter); }
.link:hover .link__arrow, .link:focus-visible .link__arrow { transform: translateX(calc(var(--dir) * 5px)); }

/* ---------- Buttons ---------- */
/* The <a> is the fixed hit area; only .btn__face moves (magnetic) so the target never shifts. */
.btn {
  position: relative; display: inline-block; text-decoration: none;
  padding: 8px; margin: -8px;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible { outline: none; }
.btn__face {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 12px 22px; border-radius: var(--radius-sharp);
  font-size: .9375rem; font-weight: 500; line-height: 1.4; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--dur-micro) var(--ease-micro), border-color var(--dur-micro) var(--ease-micro), color var(--dur-micro) var(--ease-micro);
  will-change: transform;
}
.btn__label { display: block; transition: transform var(--dur-press) var(--ease-micro); }
.btn--primary .btn__face { background: var(--champagne); color: var(--charcoal); }
.btn--primary:hover .btn__face, .btn--primary:focus-visible .btn__face { background: var(--champagne-hover); }
.btn--ghost .btn__face { border-color: rgba(247, 245, 240, .55); color: var(--ivory); }
.btn--ghost:hover .btn__face, .btn--ghost:focus-visible .btn__face { border-color: var(--champagne-hover); color: var(--champagne-hover); }
.btn--dark .btn__face { background: var(--charcoal); color: var(--ivory); }
.btn--dark:hover .btn__face, .btn--dark:focus-visible .btn__face { background: var(--gold-deep-hover); }
.btn:focus-visible .btn__face { outline: 2px solid var(--focus, var(--champagne)); outline-offset: 3px; }
.btn:active .btn__label { transform: scale(.96); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 100; height: var(--header-h);
  color: var(--ivory);
  transition: transform 450ms var(--ease-transit);
}
.site-header::before {                      /* solid ground, faded in once the page scrolls */
  content: ""; position: absolute; inset: 0; background: var(--charcoal); opacity: 0;
  transition: opacity 300ms var(--ease-micro);
}
.site-header::after {                       /* the hairline is drawn in the reading direction */
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 1px; background: var(--hairline-dark);
  transform: scaleX(0); transform-origin: var(--start) center;
  transition: transform var(--dur-rule) var(--ease-transit);
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-scrolled::after { transform: scaleX(1); }
.site-header.is-hidden { transform: translateY(-101%); }
.site-header:focus-within { transform: none; }
.site-header__in { position: relative; z-index: 1; height: 100%; display: flex; align-items: center; gap: var(--space-6); }
.brand { display: block; flex: none; margin-inline-end: auto; border-radius: var(--radius-sharp); }
.brand img { height: 44px; width: auto; }
@media (min-width: 1080px) { .brand img { height: 52px; } }

.nav__list { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
.nav__num { display: none; }
.nav .link { font-size: .875rem; font-weight: 500; color: var(--ivory); padding-block: 6px; }
.nav .link:hover, .nav .link:focus-visible { color: var(--champagne-hover); }
.nav .link::after { background: var(--champagne); }
.nav .link.is-pending { color: var(--stone); }
.header-tools { display: flex; align-items: center; gap: var(--space-4); flex: none; }
.lang { font-size: .8125rem; font-weight: 500; color: var(--ivory); padding: 10px 2px; }
.lang::after { background: var(--champagne); }
.menu-btn {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 8px 4px;
  background: none; border: 0; cursor: pointer; font-size: .875rem; font-weight: 500; color: var(--ivory);
}
.menu-btn__bars { position: relative; width: 22px; height: 9px; flex: none; }
.menu-btn__bars::before, .menu-btn__bars::after {
  content: ""; position: absolute; inset-inline: 0; height: 1.5px; background: var(--champagne);
  transition: transform 400ms var(--ease-transit);
}
.menu-btn__bars::before { top: 0; }
.menu-btn__bars::after { bottom: 0; }
.menu-btn[aria-expanded="true"] .menu-btn__bars::before { transform: translateY(3.75px); }
.menu-btn[aria-expanded="true"] .menu-btn__bars::after { transform: translateY(-3.75px); }
.menu__foot { display: none; }

/* Small screens with JS: the nav becomes a full-screen panel that enters from the reading-start side,
   led by a gold edge (the wire). Without JS the list stays inline and wraps. */
@media (max-width: 1079.98px) {
  html:not(.js) .site-header { position: static; height: auto; padding-block: 12px; }
  html:not(.js) .site-header__in { flex-wrap: wrap; }
  .js .menu-btn { display: inline-flex; }
  .js .nav {
    position: fixed; inset: 0; z-index: -1; height: 100dvh;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: calc(var(--header-h) + 24px) var(--gutter) 28px;
    background: var(--graphite);
    overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden;
    transform: translateX(calc(var(--dir) * -100%));
    transition: transform var(--dur-menu) var(--ease-transit), visibility 0s linear var(--dur-menu);
  }
  .js .nav::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: var(--wire); background: var(--champagne);
  }
  .js .nav.is-open { visibility: visible; transform: none; transition-delay: 0s; }
  .js .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .js .nav__item { border-block-end: 1px solid var(--hairline-dark); overflow: hidden; }
  .js .nav__item > .link {
    display: flex; align-items: baseline; gap: 16px; padding-block: 12px;
    font-family: var(--font-display); font-size: clamp(1.875rem, 8.4vw, 2.5rem); font-weight: 500; line-height: 1.2;
  }
  .js .nav__item > .link::before, .js .nav__item > .link::after { display: none; }
  .js .nav__num { display: inline; font-family: var(--font-mono); font-size: .75rem; color: var(--champagne); letter-spacing: .04em; }
  .js .menu__foot { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-block-start: 28px; font-size: .875rem; color: var(--stone); }
  .motion-ok .nav__item > .link { transform: translateY(105%); transition: transform 800ms var(--ease-enter); }
  .motion-ok .nav.is-open .nav__item > .link { transform: none; transition-delay: calc(180ms + var(--i, 0) * 55ms); }
  .site-header.is-menu-open { transform: none; }
  .site-header.is-menu-open::before { opacity: 0; }
}

/* ---------- Living wire: the gold rules are wires that flex with scroll speed and touch,
              then return to straight (no overshoot). Built by site.js; a plain line without JS. ---------- */
.wireline { position: relative; display: block; overflow-x: clip; height: var(--wire); background: var(--accent); margin-block: 12px 28px; transform-origin: var(--start) center; }
.wireline.is-live { background: none; }
.wireline svg { position: absolute; left: 0; top: -15.25px; width: 100%; height: 32px; overflow: visible; pointer-events: none; }
.wireline path { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: clip; z-index: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 100svh; padding-block-start: var(--header-h);
}
/* With motion on, the hero stays put and the next sheet rises over it (natural scroll, nothing hijacked). */
.motion-ok .hero { position: sticky; inset-block-start: var(--hero-stick, 0px); }
/* once the sheets cover the hero its picture layers are not painted; its heading and text stay in the accessibility tree */
.hero.is-covered > :not(.hero__body) { visibility: hidden; }
.hero__veil { position: absolute; inset: 0; z-index: 8; background: var(--charcoal); opacity: 0; pointer-events: none; }

/* near-invisible measurement lines */
.hero__grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(247, 245, 240, .045) 1px, transparent 1px);
  background-size: calc((100% - 2 * var(--gutter)) / 6) 100%;
  background-position: var(--gutter) 0;
}
/* Spotlight (mouse): a soft loupe that locally reveals the fine measurement grid.
   The disc moves with transform only; its grid counter-moves so the grid itself stays still. */
.hero__spot {
  position: absolute; z-index: 0; top: 0; left: 0;
  width: 460px; height: 460px; margin: -230px 0 0 -230px; border-radius: 50%; overflow: hidden;
  pointer-events: none; opacity: 0; transition: opacity 500ms var(--ease-micro);
  background: radial-gradient(circle, rgba(247, 245, 240, .055), rgba(247, 245, 240, 0) 68%);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  mask-image: radial-gradient(circle, #000 30%, transparent 70%);
  will-change: transform;
}
.hero__spot.is-on { opacity: 1; }
.hero__spot-grid {
  position: absolute; top: 230px; left: 230px; width: 100vw; height: 100svh;
  background-image:
    linear-gradient(to right, rgba(247, 245, 240, .13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(247, 245, 240, .13) 1px, transparent 1px);
  background-size: 32px 32px;
  will-change: transform;
}

/* The figure: one portrait, emerging from the dark ground. Three nested boxes keep concerns apart:
   .hero__figure (scroll) > .hero__figure-in (pointer) > .hero__figure-set (intro settle). */
.hero__figure {
  position: absolute; z-index: 1; inset-block-start: calc(var(--header-h) - 14px); left: 50%;
  width: min(108vw, 66svh, 560px); aspect-ratio: 3 / 4; margin-inline-start: 0; margin-left: calc(min(108vw, 66svh, 560px) / -2);
  transform-origin: 50% 28%; will-change: transform;
  -webkit-tap-highlight-color: transparent;
}
.hero__figure-in, .hero__figure-set { position: absolute; inset: 0; will-change: transform; }
.hero__figure-set {
  transform-origin: 56% 30%;
  /* the portrait is a cut-out on transparency: no plate, no halo. Only the outer 5% of the frame is feathered,
     where the sleeves are cut by the photograph's own edge. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent);
}
/* Direction of the portrait follows the language: as photographed in Arabic, mirrored in English so the figure
   still turns towards the text. The mirror sits on its own wrapper, apart from every motion transform, and applies
   to the hero portrait only (never to the logo, the cover, clinical photographs or the About photographs). */
.hero__flip { position: absolute; inset: 0; }
html[dir="ltr"] .hero__flip { transform: scaleX(-1); }
html[dir="ltr"] .hero__figure-set { transform-origin: 44% 30%; }
.hero__portrait { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__portrait--dim { opacity: .3; }
/* starting pose: only the dim figure; the lit copy opens from the loupe light (56% 30% of the image) */
.motion-ok:not(.hero-done) .hero__portrait--lit { clip-path: circle(0% at 56% 30%); }
/* the opening is a slow pull-back from the loupe */
.motion-ok:not(.hero-done) .hero__figure-set { transform: scale(1.3); }

.hero__body { position: relative; z-index: 5; }
.hero__text { position: relative; padding-block: 0 clamp(22px, 4svh, 40px); container-type: inline-size; will-change: transform; }
/* scrim: the text always sits on charcoal, whatever the viewport height; the figure fades into it */
.hero__text::before {
  content: ""; position: absolute; z-index: -1; inset-block: -84px 0; inset-inline: calc(var(--gutter) * -1);
  background: var(--charcoal);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 124px);
  mask-image: linear-gradient(to bottom, transparent, #000 124px);
}

.hero__name {
  font-family: var(--font-display); font-weight: 500; line-height: 1.05; white-space: nowrap;
  font-size: clamp(2.75rem, 14.6vw, 9rem);
  font-size: clamp(2.75rem, 16.8cqi, 9rem);
  padding-block-end: .1em;
}
html[lang="en"] .hero__name {
  letter-spacing: -.005em;
  font-size: clamp(1.9rem, 9.2vw, 6.5rem);
  font-size: clamp(1.9rem, 10.6cqi, 6.5rem);
}
html[lang="en"] .hero__actions { flex-wrap: nowrap; gap: 8px; }
html[lang="en"] .hero__actions .btn__face { padding-inline: 12px; font-size: .8125rem; }
@media (min-width: 420px) { html[lang="en"] .hero__actions { gap: 10px; } html[lang="en"] .hero__actions .btn__face { padding-inline: 18px; font-size: .875rem; } }
.hero__name .w { display: inline-block; will-change: transform; }
/* The "crowded" starting pose. hero.js reads --sx/--sy/--sr and drives them to zero with the wire. */
.motion-ok:not(.hero-done) .hero__name .w,
.motion-ok:not(.hero-done) .hero__title {
  transform: translate(calc(var(--sx, 0em) * var(--dir)), var(--sy, 0em)) rotate(calc(var(--sr, 0deg) * var(--dir)));
}
.hero-done .hero__name .w, .hero-done .hero__title { transform: none !important; }

/* The wire. Without JS this is the straight line under the name; with JS an SVG wire spanning the hero replaces it. */
.hero__wire { position: relative; height: 0; margin-block: clamp(10px, 2.4vw, 22px) clamp(20px, 3vw, 32px); }
.hero__wire-line {
  position: absolute; inset-block-start: 0; inset-inline: calc(var(--gutter) * -1) 0; height: var(--wire);
  background: var(--champagne);
}
.wire-ready .hero__wire-line { opacity: 0; }
.motion-ok:not(.hero-done):not(.wire-ready) .hero__wire-line { opacity: 0; }
.wire { position: absolute; left: 0; width: 100%; z-index: 6; overflow: visible; pointer-events: none; }
.wire path, .wire line { fill: none; stroke: var(--champagne); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.wire .bracket rect { fill: var(--charcoal); stroke: var(--champagne); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.wire .bracket line { stroke-width: 1; }

.hero__title {
  display: inline-block; color: var(--champagne); font-size: .9375rem; font-weight: 500; line-height: 1.7;
  transform-origin: var(--start) center;
}
.hero__lead { margin-block-start: var(--space-3); max-width: 34em; color: var(--stone); font-size: 1rem; line-height: 1.75; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px 10px; margin-block-start: var(--space-6); }
.hero__actions .btn__face { padding-inline: 16px; font-size: .875rem; }

@media (min-width: 720px) {
  .hero__lead { font-size: 1.0625rem; }
  .hero__actions .btn__face { padding-inline: 22px; font-size: .9375rem; }
}
@media (min-width: 1080px) {
  .hero { justify-content: center; }
  .hero__grid { background-size: calc((100% - 2 * var(--gutter)) / 12) 100%; }
  .hero__figure {
    inset-block: var(--header-h) 0; left: auto; inset-inline-end: 5vw; margin: 0;
    width: auto; height: calc(100% - var(--header-h));
  }
  .hero__text { width: 56%; padding-block: 24px 40px; }
  .hero__text::before { display: none; }
  .hero__title { font-size: 1.0625rem; }
  .hero__lead { font-size: 1.1875rem; margin-block-start: var(--space-4); }
  .hero__actions { margin-block-start: var(--space-8); }
  .wire { z-index: 0; }             /* on wide screens the wire passes behind the figure */
}

/* ---------- Section furniture ---------- */
.eyebrow { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-sans); font-size: .8125rem; font-weight: 500; line-height: 1.5; color: var(--fg-2); }
.eyebrow .mono { color: var(--accent); }

/* Masked reveals — word spans keep Arabic letters joined; the mask moves per line */
.w { display: inline-block; }
.is-split .w { overflow: hidden; vertical-align: top; padding-block: .14em; margin-block: -.14em; }
.is-split .w__in { display: inline-block; will-change: transform; }
.will-reveal.is-split .w__in { transform: translateY(118%); }
.will-reveal.is-split.is-in .w__in {
  transform: none;
  transition: transform var(--dur-reveal) var(--ease-enter);
  transition-delay: calc(var(--line, 0) * var(--stagger-line));
}
.will-reveal[data-reveal="rule"] { transform: scaleX(0); }
.will-reveal[data-reveal="rule"].is-in { transform: none; transition: transform var(--dur-rule) var(--ease-transit); }

/* ---------- Scroll scene: treatments — a sheet that rises over the hero ---------- */
main { position: relative; z-index: 2; }
.scene { position: relative; z-index: 2; overflow-x: clip; padding-block: 0 var(--space-12); }
.scene__edge { position: absolute; z-index: 5; inset-block-start: 0; inset-inline: 0; margin: 0; --accent: var(--champagne); }
.scene__title {
  font-family: var(--font-display); font-weight: 500; line-height: 1.1;
  font-size: clamp(2.5rem, 11vw, 4.5rem); text-wrap: balance;
}
.scene__intro { color: var(--fg-2); font-size: 1rem; margin-block-start: var(--space-6); }

/* Kinetic line. Default (no JS, reduced motion): an ordinary heading block. */
.kinetic__pin { position: relative; padding-block: var(--space-12) 0; }
.kinetic__img { display: none; }
.kinetic__sheet { padding-inline: var(--gutter); max-width: 1440px; margin-inline: auto; }
.kinetic__head { position: absolute; inset-block-start: var(--space-12); inset-inline: 0; }
.kinetic__sheet { padding-block-start: 72px; }
/* With motion: the screen is held (sticky) for a short scroll — about two thirds of a screen. The title is a
   large wrapped block, readable from the start. Two identical copies sit on top of each other: below, black
   letters on an ivory sheet blended with "lighten" (the letters become windows onto the image); above, the same
   words in graphite. The graphite words fade out in reading order, so the image floods into the title. */
.kinetic-ready .kinetic { height: 168svh; }
.kinetic-ready .kinetic__pin { position: sticky; inset-block-start: 0; height: 100svh; padding: 0; overflow: clip; isolation: isolate; }
.kinetic-ready .kinetic__img { display: block; position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; will-change: transform; }
/* .5 keeps even the brightest pixel of the image at 3.2:1 or more against the ivory sheet (large text needs 3:1) */
.kinetic-ready .kinetic__pin::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--charcoal); opacity: .5; }
.kinetic-ready .kinetic__sheet, .kinetic__top {
  position: absolute; inset: 0; max-width: none; margin: 0; padding: calc(var(--header-h) + 48px) var(--gutter) 24px;
  display: flex; align-items: center;
}
.kinetic-ready .kinetic__sheet { z-index: 2; background: var(--ivory); mix-blend-mode: lighten; }
.kinetic__top { z-index: 3; pointer-events: none; color: var(--warm-grey); }   /* the resting colour before the image floods in (6.29:1) */
.kinetic-ready .kinetic__line {
  width: 100%; max-width: 1180px; margin-inline: auto;
  font-size: clamp(3rem, 15.4vw, 9.5rem); line-height: 1.16; text-wrap: balance;
}
html[lang="en"].kinetic-ready .kinetic__line { font-size: clamp(2.5rem, 11.8vw, 7.75rem); line-height: 1.06; letter-spacing: -.01em; }
.kinetic-ready .kinetic__sheet .kinetic__line { color: #000; }
.kinetic-ready .kinetic__head { z-index: 4; inset-block-start: calc(var(--header-h) + 20px); }

/* The options ride an arch-shaped wire. Without JS: a straight wire and a plain list. */
.options { position: relative; --arc-h: 76svh; --arc-top: 12svh; margin-block-start: var(--space-6); }
.options__arc { position: absolute; inset-block: 0; inset-inline-start: 0; width: 100%; pointer-events: none; }
.options__wire-line { position: absolute; inset-block: 0; inset-inline-start: 11.25px; width: var(--wire); background: var(--gold-deep); }
/* the arch sticks inside a box that covers the list, so it can never run past the list's end */
.options__arc-in { position: sticky; inset-block-start: var(--arc-top); height: var(--arc-h); display: none; }
.dial-ready .options__arc-in { display: block; }
.options__arc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.options__arc path { fill: none; stroke: var(--gold-deep); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* giant outlined numeral that turns like a counter with the active option */
.options__ghost {
  position: absolute; inset-block-start: 50%; inset-inline-end: -6vw; height: 1em; margin-block-start: -.5em; overflow: hidden;
  font-family: var(--font-mono); font-size: min(38svh, 50vw); line-height: 1; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.25px rgba(122, 92, 46, .34);
}
.options__ghost-strip { display: flex; flex-direction: column; direction: ltr; transition: transform 900ms var(--ease-enter); will-change: transform; }
.options__ghost-strip span { display: block; height: 1em; }
.dial-ready .options__wire-line { display: none; }
.dial-ready .options ol { position: relative; padding-block: calc(var(--arc-h) / 2 - 36px); }
.options__item {
  position: relative; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); align-items: baseline; column-gap: 6px;
  padding-block: 16px; padding-inline: 34px 0; will-change: transform;
}
.dial-ready .options__item { padding-inline-end: 78px; }
.options__num { color: var(--gold-deep); }
.options__name {
  display: block; font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem, 7.4vw, 2.75rem); line-height: 1.15;
  transform-origin: var(--start) 60%;
  transition: color 300ms var(--ease-micro), transform 500ms var(--ease-enter);
}
.dial-ready .options__name { color: var(--warm-grey); }
.dial-ready .options__item.is-active .options__name { color: var(--graphite); transform: scale(1.16); }
/* bracket on the wire for each option */
.options__bracket {
  position: absolute; inset-block-start: 50%; inset-inline-start: 6.5px; width: 11px; height: 14px; margin-block-start: -7px;
  border: 1.25px solid var(--gold-deep); border-radius: 1px; background: var(--ivory);
  will-change: transform;
}
.options__bracket::after { content: ""; position: absolute; inset: 1.5px; background: var(--gold-deep); transition: opacity 300ms var(--ease-micro), transform 500ms var(--ease-enter); }
.dial-ready .options__bracket::after { opacity: 0; transform: scale(.2); }
.dial-ready .options__item.is-passed .options__bracket::after { opacity: 1; transform: none; }
.scene__links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-block-start: var(--space-8); font-size: 1rem; font-weight: 500; }
.disclaimer { margin-block-start: var(--space-12); padding-block-start: var(--space-6); border-block-start: 1px solid var(--hairline); font-size: .875rem; line-height: 1.7; color: var(--fg-2); max-width: 62em; }

@media (min-width: 1080px) {
  .scene { padding-block-end: var(--space-24); }
  .scene__body { max-width: 1180px; }
  .options__item { padding-block: 20px; padding-inline-start: 44px; }
  .dial-ready .options__item { padding-inline-end: 42%; }
  .options__ghost { inset-inline-end: 2vw; }
}

/* ---------- Moving divider: the macro image as a window that opens with scroll ---------- */
.window { position: relative; z-index: 2; height: 62svh; min-height: 320px; overflow: clip; }
.window__frame { position: absolute; inset: 0; overflow: hidden; background: var(--photo-frame); will-change: clip-path; }
.window__media { position: absolute; inset: 0; will-change: transform; }
.window__media img, .window__media canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.window__frame::after { content: ""; position: absolute; inset: 0; background: var(--charcoal); opacity: .22; }
@media (min-width: 1080px) { .window { height: 78vh; } }

/* ---------- Research band (home) ---------- */
.band { position: relative; z-index: 2; overflow-x: clip; padding-block: var(--space-12); }
.band__text { font-size: 1.0625rem; line-height: 1.8; max-width: 46em; color: var(--ivory); }
.band__text.is-split .w { overflow: visible; padding: 0; margin: 0; }
.band__study { margin-block-start: 1em; }          /* the study line (round nine): a paragraph of its own, no new colour */
.band__links { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-block-start: var(--space-8); font-weight: 500; }
@media (min-width: 1080px) {
  .band { padding-block: var(--space-24); }
  .band__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); column-gap: var(--space-16); align-items: start; }
  .band__text { font-size: 1.1875rem; }
}
.h2 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.875rem, 4vw, 2.5rem); line-height: 1.15; }

/* ---------- About page ---------- */
.page-head { position: relative; isolation: isolate; overflow: clip; padding-block: calc(var(--header-h) + 8px) var(--space-12); }
.page-head__name { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.5rem, 9vw, 4.5rem); line-height: 1.08; margin-block-start: clamp(28px, 6vw, 64px); }
.page-head__title { color: var(--champagne); font-size: .9375rem; font-weight: 500; line-height: 1.7; }
.page-head__focus { color: var(--stone); font-size: 1rem; margin-block-start: 6px; }
.page-head__wire { margin-block: 18px 22px; margin-inline-start: calc(var(--gutter) * -1); }
.page-head__alt { margin-block-start: var(--space-8); padding-block-start: var(--space-6); border-block-start: 1px solid var(--hairline-dark); font-family: "IBM Plex Sans", system-ui, sans-serif; line-height: 1.65; }
.page-head__alt-name { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.15; }
@media (min-width: 1080px) {
  .page-head { padding-block-end: var(--space-16); }
  .page-head__cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: var(--space-16); align-items: end; }
  .page-head__alt { margin: 0; padding: 0 0 4px; border: 0; }
  .page-head__wire { margin-block: 22px 24px; }
}

.cv { padding-block: var(--space-8) var(--space-12); }
.cv__section { padding-block: var(--space-8); }
.cv__body { font-size: 1.0625rem; }
.cv__list > li { position: relative; padding-block: 14px; border-block-end: 1px solid var(--hairline); }
.cv__list > li:first-child { border-block-start: 1px solid var(--hairline); }
.cv__list strong { font-weight: 500; }
.cv__line + .cv__line { margin-block-start: 10px; }
.cv__contact li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
/* One photograph per section, exactly as supplied: whole (object-fit: contain), never cropped, filtered or mirrored,
   on a graphite carrier, with its space reserved by its own aspect ratio. */
.cv__photo { margin: 0 0 var(--space-6); background: var(--graphite); border-radius: var(--radius-card); overflow: hidden; }
.cv__photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cv__stage { display: none; }
.will-reveal[data-reveal="rise"] { transform: translateY(28px); }
.will-reveal[data-reveal="rise"].is-in { transform: none; transition: transform var(--dur-reveal) var(--ease-enter); }
.cv__count { display: none; }
.cv__after .cv__section { max-width: 46em; }
@media (min-width: 720px) { .cv__photo { max-width: 560px; } }
@media (min-width: 900px) {
  .cv { padding-block: var(--space-16) var(--space-24); }
  .cv__section { padding-block: var(--space-12); max-width: 46em; }
  /* Sticky Scroll Reveal (wide screens, with JS): the text column scrolls naturally; the photograph panel stays in
     view and shows the photograph of the section crossing the reading line (site.js). No 3D, no pinning. */
  .cv-staged .cv__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(32px, 4.5vw, 64px); align-items: start; }
  .cv-staged .cv__sections .cv__section { max-width: none; min-height: 62vh; }
  .cv-staged .cv__stage {
    display: block; position: sticky; inset-block-start: calc(var(--header-h) + 28px); height: calc(100vh - var(--header-h) - 56px);
    background: var(--graphite); border-radius: var(--radius-card); overflow: hidden;
  }
  .cv-staged .cv__stage .cv__photo {
    display: none; position: absolute; inset: 18px 18px 44px; margin: 0; max-width: none; aspect-ratio: auto !important; background: none;
    opacity: 0; transform: translateY(calc(var(--from, 1) * 14px)) scale(.985);
    transition: opacity 520ms var(--ease-micro), transform var(--dur-rule) var(--ease-enter);
  }
  .cv-staged .cv__stage .cv__photo.is-near { display: block; }
  .cv-staged .cv__stage .cv__photo.is-active { opacity: 1; transform: none; }
  .cv-staged .cv__count { display: block; position: absolute; inset-block-end: 14px; inset-inline-start: 18px; color: var(--champagne); direction: ltr; }
  /* the section being read is marked on its number, never by dimming the others */
  .cv-staged .cv__section .eyebrow .mono { transition: transform var(--dur-line) var(--ease-enter); display: inline-block; transform-origin: var(--start) 50%; }
  .cv-staged .cv__section.is-reading .eyebrow .mono { transform: scale(1.35); }
}

/* ---------- Footer ---------- */
.site-footer { position: relative; z-index: 1; overflow: clip; padding-block: var(--space-16) var(--space-12); font-size: .9375rem; }
/* with motion on, the footer waits under the page and the last sheet lifts off it */
.motion-ok .site-footer { position: sticky; inset-block-end: 0; }
.site-footer__in { will-change: transform; }
/* while the page still covers the footer, its decorative layers are not painted (site.js sets and clears the class) */
.footer-wait .site-footer__mark, .footer-wait .site-footer > canvas.lines { visibility: hidden; }
.site-footer__mark { width: min(78vw, 520px); height: auto; margin-block-end: var(--space-8); margin-inline-start: -4%; }
.site-footer .wireline { margin-block: 0 var(--space-8); }
.site-footer__grid { display: grid; gap: var(--space-8); }
.site-footer__list li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding-block: 5px; }
.site-footer__list .k { color: var(--stone); }
.site-footer__meta { color: var(--stone); display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: baseline; }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: end; } .site-footer__meta { justify-content: flex-end; } }
/* Pause motion / Play motion (WCAG 2.2.2). Only with JavaScript (without it nothing moves), and not while the
   system's reduced-motion setting is on (the still version is already shown and the setting is never overridden).
   Both labels are in the page; the saved state shows one of them before the first paint (no change of size later). */
.motion-toggle {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 6px 0; margin: 0;
  background: none; border: 0; color: var(--ivory); font: inherit; cursor: pointer;
  transition: color var(--dur-micro) var(--ease-micro); --focus: var(--champagne);
}
.js .motion-toggle { display: inline-flex; }
.motion-sys .motion-toggle { display: none; }
.motion-toggle:hover, .motion-toggle:focus-visible { color: var(--champagne-hover); }
.motion-toggle__icon { position: relative; flex: none; inline-size: 14px; block-size: 14px; }
.motion-toggle__icon::before, .motion-toggle__icon::after {
  content: ""; position: absolute; inset-block: 1px; inline-size: 4px; background: currentColor;
}
.motion-toggle__icon::before { inset-inline-start: 2px; }
.motion-toggle__icon::after { inset-inline-end: 2px; }
.motion-paused .motion-toggle__icon::before {                     /* play: one triangle (media icons are not mirrored in RTL) */
  inset-block: 0; inset-inline: auto; left: 2px; inline-size: 0; background: none;
  border-block: 7px solid transparent; border-left: 11px solid currentColor;
}
.motion-paused .motion-toggle__icon::after { display: none; }
.motion-toggle__play, .motion-paused .motion-toggle__pause { display: none; }
.motion-paused .motion-toggle__play { display: inline; }

/* ---------- Page transition ----------
   Page to page: five graphite strips, each edged by the wire, rise out of step and are level when they cover
   (the alignment motif), then lift away. Language switch: one curtain sweeping in the new reading direction.
   1.2 s in total, cross-document View Transitions; the old page is swapped for the new one while covered. */
.vt-anchor { position: fixed; inset-block-start: 0; left: 0; width: 1px; height: 1px; pointer-events: none; view-transition-name: curtain; }
.vt-anchor--1 { view-transition-name: strip-1; } .vt-anchor--2 { view-transition-name: strip-2; } .vt-anchor--3 { view-transition-name: strip-3; }
.vt-anchor--4 { view-transition-name: strip-4; } .vt-anchor--5 { view-transition-name: strip-5; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(root) { animation: none; }
::view-transition-image-pair(root) { isolation: auto; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { animation: vt-hide 1ms linear 600ms both; }
::view-transition-new(root) { animation: vt-show 1ms linear 600ms both; }
html[data-vt="lang"]::view-transition-old(root) { animation-delay: 550ms; }
html[data-vt="lang"]::view-transition-new(root) { animation-delay: 550ms; }
::view-transition-image-pair(curtain), ::view-transition-image-pair(strip-1), ::view-transition-image-pair(strip-2),
::view-transition-image-pair(strip-3), ::view-transition-image-pair(strip-4), ::view-transition-image-pair(strip-5) { display: none; }

::view-transition-group(strip-1), ::view-transition-group(strip-2), ::view-transition-group(strip-3),
::view-transition-group(strip-4), ::view-transition-group(strip-5) {
  top: 0; width: 20.4vw; height: 100vh; height: 100lvh; box-sizing: border-box;
  background: var(--graphite); border-block: 1.5px solid var(--champagne);
  animation: vt-strip 1080ms linear both;
}
::view-transition-group(strip-1) { left: 0; animation-delay: 0ms; }
::view-transition-group(strip-2) { left: 20vw; animation-delay: 30ms; }
::view-transition-group(strip-3) { left: 40vw; animation-delay: 60ms; }
::view-transition-group(strip-4) { left: 60vw; animation-delay: 90ms; }
::view-transition-group(strip-5) { left: 80vw; animation-delay: 120ms; }
html[dir="rtl"]::view-transition-group(strip-1) { animation-delay: 120ms; }
html[dir="rtl"]::view-transition-group(strip-2) { animation-delay: 90ms; }
html[dir="rtl"]::view-transition-group(strip-4) { animation-delay: 30ms; }
html[dir="rtl"]::view-transition-group(strip-5) { animation-delay: 0ms; }
html[data-vt="lang"]::view-transition-group(strip-1), html[data-vt="lang"]::view-transition-group(strip-2), html[data-vt="lang"]::view-transition-group(strip-3),
html[data-vt="lang"]::view-transition-group(strip-4), html[data-vt="lang"]::view-transition-group(strip-5) { display: none; }

::view-transition-group(curtain) { display: none; }
html[data-vt="lang"]::view-transition-group(curtain) {
  display: block; top: 0; left: 0; width: 100vw; height: 100vh; height: 100lvh; box-sizing: border-box;
  background: var(--graphite); border-inline: 1.5px solid var(--champagne);
  animation: vt-curtain-x 1200ms linear both;
}
html[dir="rtl"][data-vt="lang"]::view-transition-group(curtain) { animation-name: vt-curtain-x-rtl; }
/* --page-transition: single → one curtain rising, edged by the wire (the boot script sets data-curtain) */
html[data-curtain="single"]::view-transition-group(strip-1), html[data-curtain="single"]::view-transition-group(strip-2), html[data-curtain="single"]::view-transition-group(strip-3),
html[data-curtain="single"]::view-transition-group(strip-4), html[data-curtain="single"]::view-transition-group(strip-5) { display: none; }
html[data-curtain="single"]:not([data-vt="lang"])::view-transition-group(curtain) {
  display: block; top: 0; left: 0; width: 100vw; height: 100vh; height: 100lvh; box-sizing: border-box;
  background: var(--graphite); border-block: 1.5px solid var(--champagne);
  animation: vt-curtain-y 1200ms linear both;
}
html[data-curtain="single"]::view-transition-old(root), html[data-curtain="single"]::view-transition-new(root) { animation-delay: 550ms; }
@keyframes vt-curtain-y {
  0% { transform: translateY(100%); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  45.83% { transform: translateY(0); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  100% { transform: translateY(-100%); }
}
@keyframes vt-hide { from { opacity: 1; } to { opacity: 0; } }
@keyframes vt-show { from { opacity: 0; } to { opacity: 1; } }
@keyframes vt-strip {
  0% { transform: translateY(100%); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  40.74% { transform: translateY(0); }
  59.26% { transform: translateY(0); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  100% { transform: translateY(-100%); }
}
/* language switch: the curtain sweeps in the reading direction of the language being entered */
@keyframes vt-curtain-x {
  0% { transform: translateX(-100%); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  45.83% { transform: translateX(0); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  100% { transform: translateX(100%); }
}
@keyframes vt-curtain-x-rtl {
  0% { transform: translateX(100%); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  45.83% { transform: translateX(0); animation-timing-function: cubic-bezier(.76, 0, .24, 1); }
  100% { transform: translateX(-100%); }
}

/* Fallback where cross-document view transitions are missing: the same curtain, as a real element.
   Covering is animated by site.js before navigating; uncovering is pure CSS so it can never get stuck. */
.curtain, html.is-arriving::after {
  content: ""; position: fixed; inset: 0; z-index: 900; pointer-events: none;
  background: var(--graphite); border-block: 1.5px solid var(--champagne);
}
html[data-vt="lang"] .curtain, html.is-arriving[data-vt="lang"]::after { border-block: 0; border-inline: 1.5px solid var(--champagne); }
.curtain { transform: translateY(101%); }
.curtain--strip { inset-inline: auto; width: 20.4vw; }
html.is-arriving::after { animation: curtain-out-y var(--dur-curtain-out) var(--ease-transit) both; }
/* Arrival in strips (the default style): five real elements at the top of <body>, shown only while the page is
   arriving without a browser view transition. They start level, covering the page, and lift out of step from the
   reading-start side — the second half of the motion the browser's own transition plays. CSS only. */
.arrive { display: none; }
html.is-arriving:not([data-vt="lang"]):not([data-curtain="single"])::after { display: none; }
html.is-arriving:not([data-vt="lang"]):not([data-curtain="single"]) .arrive { display: block; position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.arrive i {
  position: absolute; inset-block: 0; left: calc(var(--n) * 20vw); width: 20.4vw; background: var(--graphite); border-block: 1.5px solid var(--champagne);
  animation: strip-out 440ms var(--ease-transit) both; animation-delay: calc(140ms + var(--n) * 30ms);
}
[dir="rtl"] .arrive i { animation-delay: calc(140ms + (4 - var(--n)) * 30ms); }
@keyframes strip-out { from { transform: none; } to { transform: translateY(-101%); } }
html.is-arriving[data-vt="lang"]::after { animation-name: curtain-out-x; }
@keyframes curtain-out-y { from { transform: none; } to { transform: translateY(-101%); } }
@keyframes curtain-out-x { from { transform: none; } to { transform: translateX(calc(var(--dir) * 101%)); } }

/* ---------- Stagger Text (every heading: data-heading="rise") ----------
   Units rise out of a mask one after another in the reading direction, on every entry of the heading. An Arabic word is always one unit
   (its letters must stay joined); Latin text is staggered letter by letter. Built by site.js; without JS the
   text is plain. Reduced motion: no movement, one short fade of the whole heading. */
.st-u { display: inline-block; overflow: hidden; vertical-align: top; padding-block: .16em; margin-block: -.16em; }
.st-w { display: inline-block; white-space: nowrap; }
.st-i {
  display: inline-block; will-change: transform;
  transform: translateY(118%) rotate(calc(var(--dir) * 7deg)); transform-origin: var(--start) 100%;
}
/* the transition belongs to the entry only: when a heading is re-armed (fully off screen) it returns at once */
.is-in > span > .st-w .st-i, .is-in .st-i {
  transform: none;
  transition: transform var(--dur-stagger, 900ms) var(--ease-enter);
  transition-delay: calc(var(--i, 0) * var(--stagger-unit, 70ms));
}
.st-latin { --stagger-unit: 22ms; }
/* scrub variant: the scroll drives each unit (inline styles from site.js); no mask, so nothing is ever cut */
.st-scrub .st-u { overflow: visible; }
.st-scrub .st-i, .st-scrub.is-in .st-i { transform: none; transition: none; }
.st-scrub > span[aria-hidden] { display: inline-block; transform-origin: var(--start) 60%; will-change: transform; }

/* ---------- Floating lines (canvas under the content of a [data-lines] section) ---------- */
[data-lines] { position: relative; isolation: isolate; }
canvas.lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero > canvas.lines { z-index: 0; }
/* a section start: the bundle lives in the section's top margin only, so it can never run behind text or a photograph */
.lines-strip { position: absolute; z-index: 1; inset-inline: 0; inset-block-start: 0; height: 44px; pointer-events: none; }

/* ---------- Object: an abstract bracket on its wire, flat layers set in depth ---------- */
.obj { width: 132px; height: 132px; perspective: 720px; pointer-events: none; }
.obj__in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-12deg) rotateY(calc(var(--dir) * 28deg)); will-change: transform; }
.obj__l { position: absolute; left: 50%; top: 50%; border: 1.5px solid var(--accent); border-radius: 5px; background: var(--bg); }
.obj__l--base { width: 62px; height: 84px; margin: -42px 0 0 -31px; transform: translateZ(0); }
.obj__l--wing { width: 92px; height: 26px; margin: -34px 0 0 -46px; transform: translateZ(14px); }
.obj__l--wing2 { width: 92px; height: 26px; margin: 8px 0 0 -46px; transform: translateZ(14px); }
.obj__l--slot { width: 104px; height: 8px; margin: -4px 0 0 -52px; border-radius: 2px; background: var(--accent); transform: translateZ(26px); }
.obj__wire { position: absolute; left: 50%; top: 50%; width: 320px; height: 1.5px; margin: -0.75px 0 0 -160px; background: var(--accent); transform: translateZ(26px); }
.motion-reduced .st-fade { opacity: .001; }
.motion-reduced .st-fade.is-in { opacity: 1; transition: opacity 400ms ease-out !important; }

/* ---------- Shared section furniture for the inner pages ---------- */
.sec-head .wireline { margin-block: 12px 16px; }
.sec-head .h2 { margin-block-end: var(--space-6); }
@media (min-width: 1080px) { .rs__grid > .sec-head .h2, .band__grid > .sec-head .h2 { margin-block-end: 0; } }
.page-head__intro { color: var(--stone); font-size: 1.0625rem; max-width: 40em; }
.hold { color: var(--fg-2); font-size: .875em; border: 1px dashed currentColor; border-radius: var(--radius-sharp); padding: 0 6px; white-space: nowrap; }
/* link rows built on the gateway pattern, at a calmer size inside a page */
.gate .portal__name { font-size: clamp(1.625rem, 5.4vw, 2.5rem); }
.gate .portal__link { min-height: 60px; padding-block: 14px; }

/* ---------- Clinical photographs: light deterrents (these photographs only) ----------
   Every web copy already carries the watermark. Here: no dragging out of the page, no long-press "save image"
   sheet on phones. The right mouse button is not blocked anywhere and alternative text is untouched. */
[data-clin] { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
a[data-zoom] { -webkit-touch-callout: none; -webkit-user-drag: none; }

/* ---------- Cases page ---------- */
/* Dome gallery (after React Bits "Dome Gallery"). Default — no JS, weak device, data saving, reduced motion — is a
   still grid of the same square tiles. */
.dome-sec { position: relative; z-index: 1; overflow: clip; padding-block: 0 var(--space-12); }
.dome { max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.dome__sphere { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .dome__sphere { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 900px) { .dome__sphere { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 1200px) { .dome__sphere { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.dome__card, .panel__frame {
  display: block; position: relative; background: var(--photo-frame); overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.dome__card { aspect-ratio: 1; border-radius: 14%; }
.dome__card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dome__card:focus-visible, .panel__frame:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.dome__nav { display: none; }
/* with motion: the tiles sit on a sphere, in staggered rows; dragging (or the two buttons, or the arrow keys) turns it */
/* html.dome-3d (boot script, before the first paint): the sphere's box and its two buttons hold their final size from
   the start; the still grid waits unseen inside it for the few hundred milliseconds until cases.js builds the sphere
   (.dome.is-3d). The default heights are the ones cases.js computes (phone: R = 82vw within 280–420px, H = 1.16 R;
   wider: H = 72vh within 420–640px), so building it shifts nothing. Without the class: the still grid. */
.dome-3d .dome { max-width: none; padding-inline: 0; }
.dome-3d .dome__stage {
  position: relative; height: var(--dome-h, clamp(420px, 72vh, 640px)); perspective: var(--dome-p, 1000px); perspective-origin: 50% 50%; overflow: hidden;
  touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none;
}
@media (max-width: 719.98px) { .dome-3d .dome__stage { height: var(--dome-h, calc(clamp(280px, 82vw, 420px) * 1.16)); } }
.dome-3d .dome:not(.is-3d) .dome__sphere { visibility: hidden; }
/* the sphere sinks into the ground at its rim, as in the reference: a vignette and two edge fades, no blur filter */
.dome-3d .dome__stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, var(--charcoal), rgba(17, 17, 17, 0) 13%, rgba(17, 17, 17, 0) 87%, var(--charcoal)),
    radial-gradient(ellipse 62% 78% at 50% 50%, rgba(17, 17, 17, 0) 62%, rgba(17, 17, 17, .86) 100%);
}
.dome.is-3d .dome__stage.is-dragging { cursor: grabbing; }
.dome.is-3d .dome__sphere { display: block; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.dome.is-3d .dome__tile {
  position: absolute; left: calc(var(--tile) / -2); top: calc(var(--tile) / -2); width: var(--tile); height: var(--tile);
  padding: calc(var(--tile) * .075);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.dome.is-3d .dome__tile.is-off { opacity: 0; pointer-events: none; }
.dome.is-3d .dome__card { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 16%; transition: transform var(--dur-line) var(--ease-enter); }
.dome.is-3d .dome__card img { pointer-events: none; }
@media (hover: hover) { .dome.is-3d .dome__stage:not(.is-dragging) .dome__card:hover { transform: scale(1.045); } }
.dome-3d .dome__nav { display: flex; justify-content: center; gap: 12px; margin-block-start: 14px; }
.dome__btn {
  min-width: 48px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(247, 245, 240, .55); border-radius: var(--radius-sharp); color: var(--ivory);
  font-size: 1.125rem; cursor: pointer; transition: border-color var(--dur-micro) var(--ease-micro), color var(--dur-micro) var(--ease-micro);
}
.dome__btn:hover, .dome__btn:focus-visible { border-color: var(--champagne-hover); color: var(--champagne-hover); }
.dome__btn:active { transform: scale(.96); }

/* One card per case, the same on every screen: a dark bar with the case number and its status; an ivory sheet with
   the title, the facts, the duration (set large) and, for a case that is not finished, the notice; then the
   photographs, one frame per row. */
.cases { position: relative; z-index: 2; padding-block: var(--space-12); }
.case { margin-block-end: var(--space-12); border-radius: var(--radius-card); overflow: clip; border: 1px solid var(--hairline); scroll-margin-top: calc(var(--header-h) + 12px); background: var(--ivory); }
.case__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; padding: 14px 16px; background: var(--charcoal); color: var(--ivory); align-items: baseline; }
.case__no { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-weight: 500; font-size: 1.75rem; line-height: 1.1; color: var(--champagne); }
.case__no .mono { font-size: 1.125rem; }
.case__state { font-size: .875rem; color: var(--stone); }
.case__state-v { color: var(--ivory); font-weight: 500; }
.case[data-status="ongoing"] .case__state-v, .case[data-status="phase"] .case__state-v { color: var(--champagne); }
.case__sheet { padding: 20px 14px 22px; }
.case__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 4.6vw, 2.125rem); line-height: 1.2; }
.case__facts { margin-block: 12px 4px; display: grid; gap: 8px; font-size: .9375rem; max-width: 60em; }
.case__facts > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 10px; align-items: baseline; }
.case__facts dt { color: var(--fg-2); font-weight: 500; font-size: .8125rem; }
/* the duration: larger and clearer than every other field */
.case__dur { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-block-start: 16px; padding-block: 10px 8px; border-block: 1px solid var(--hairline); }
.case__dur-k { font-size: 1rem; font-weight: 500; color: var(--fg-2); }
.case__dur-v { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 7vw, 2.75rem); line-height: 1.1; color: var(--gold-deep); }
/* the notice of a case that is not finished: always in view inside the card */
.case__notice {
  margin-block-start: 14px; padding: 10px 14px; border-inline-start: var(--wire) solid var(--gold-deep);
  background: rgba(122, 92, 46, .08); font-size: .9375rem; font-weight: 500; line-height: 1.6;
}
/* One frame per row of photographs. Its vocabulary comes from the study pathway of the Research page — a gold wire
   with its bracket, hairline borders — set here on the neutral frame colour of the case photographs (#2B2B2B). */
.shots {
  position: relative; margin-block-start: 22px; padding: 12px 8px 10px; background: var(--photo-frame); color: var(--ivory);
  border: 1px solid var(--hairline-dark); border-radius: var(--radius-card);
  --focus: var(--champagne);
}
.shots::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: -1px; height: var(--wire); background: var(--champagne); border-radius: var(--radius-card) var(--radius-card) 0 0; }
.shots__bracket {
  position: absolute; inset-block-start: -8px; inset-inline-start: 18px; width: 15px; height: 15px;
  border: 1.5px solid var(--champagne); border-radius: 2px; background: var(--charcoal);
}
.shots__bracket::after { content: ""; position: absolute; inset: 2px; border-radius: 1px; background: var(--champagne); }
.shots__track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: start; }
.shots[data-n="1"] .shots__track { grid-template-columns: minmax(0, 1fr); }
.panel { margin: 0; min-width: 0; }
.panel__frame { aspect-ratio: var(--ratio); border-radius: var(--radius-sharp); background: #1f1f1f; }
.panel__frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.panel__cap { margin-block-start: 7px; font-size: .75rem; font-weight: 500; line-height: 1.5; text-align: center; color: var(--ivory); text-wrap: balance; }
/* Phones: a row of three photographs or more is one strip, swiped sideways inside its frame (the page itself never
   scrolls sideways). The stage indicator under the frame names the photographs and moves the strip. */
.shots__stages { display: none; }
@media (max-width: 719.98px) {
  .shots:not([data-n="1"]):not([data-n="2"]) .shots__track {
    display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .shots:not([data-n="1"]):not([data-n="2"]) .shots__track::-webkit-scrollbar { display: none; }
  .shots:not([data-n="1"]):not([data-n="2"]) .panel { flex: 0 0 86%; scroll-snap-align: center; }
  .shots__stages {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin-block-start: 10px; padding-block-start: 8px;
    border-block-start: 1px solid var(--hairline-dark); font-size: .75rem; font-weight: 500; line-height: 1.4; color: var(--stone);
  }
  .shots__stages li { display: flex; align-items: center; }
  .shots__stages li + li::before { content: "·"; margin-inline-end: 6px; color: var(--stone); }
  .shots__stages li > span, .shots__stage { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px; border-block-end: var(--wire) solid transparent; }
  .shots__stage { background: none; border-inline: 0; border-block-start: 0; color: inherit; font: inherit; cursor: pointer; }
  .shots__stages li.is-on > span, .shots__stages li.is-on .shots__stage { color: var(--champagne); border-block-end-color: var(--champagne); }
  .shots__stage:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
}
@media (min-width: 720px) {
  .case__bar { padding: 16px 28px; }
  .case__sheet { padding: 28px 28px 36px; }
  .case__facts > div { grid-template-columns: minmax(9.5em, auto) minmax(0, 1fr); }
  .case__facts dt { font-size: inherit; }
  .case__facts dt::after { content: ":"; }
  .shots { padding: 18px 16px 14px; margin-block-start: 28px; }
  .shots__track { gap: 14px; }
  .shots[data-n="1"] { max-width: 660px; margin-inline: auto; }
  .shots[data-n="2"] { max-width: 1040px; margin-inline: auto; }
  .shots:not([data-n="1"]):not([data-n="2"]) .shots__track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel__cap { font-size: .8125rem; }
}
/* Before/after comparison (built by cases.js when asked for). The divider is a native range input over the frame. */
.cmp-tools { margin-block: 12px 0; display: flex; justify-content: center; }
.cmp-toggle, .cmp__btn {
  min-height: 44px; padding: 8px 16px; background: none; border: 1px solid rgba(247, 245, 240, .55); border-radius: var(--radius-sharp);
  color: var(--ivory); font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-micro), color var(--dur-micro) var(--ease-micro), border-color var(--dur-micro) var(--ease-micro);
}
.cmp-toggle:hover, .cmp-toggle:focus-visible, .cmp__btn:hover, .cmp__btn:focus-visible { background: var(--ivory); color: var(--charcoal); border-color: var(--ivory); }
.cmp-toggle:active, .cmp__btn:active { transform: scale(.98); }
.cmp { display: none; width: 100%; margin-inline: auto; --pos: 50; }
.shots.is-comparing > .cmp { display: block; }
/* the phone strip rule (.shots:not([data-n="1"]):not([data-n="2"]) .shots__track) is more specific than a plain
   .is-comparing rule: without the second selector a row of three kept its strip under the comparison (round nine) */
.shots.is-comparing > .shots__track, .shots.is-comparing:not([data-n="1"]):not([data-n="2"]) > .shots__track,
.shots.is-comparing > .shots__stages { display: none; }
.cmp__view { position: relative; background: #1f1f1f; border-radius: var(--radius-sharp); overflow: hidden; cursor: ew-resize; touch-action: pan-y pinch-zoom; -webkit-user-select: none; user-select: none; }
.cmp__view.is-focus { outline: 2px solid var(--focus); outline-offset: 3px; }
.cmp__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
/* the "before" photograph fills the reading-start side up to the divider, the "after" photograph the rest */
.cmp__img--after { background: #1f1f1f; clip-path: inset(0 0 0 calc(var(--pos) * 1%)); }
[dir="rtl"] .cmp__img--after { clip-path: inset(0 calc(var(--pos) * 1%) 0 0); }
.cmp__bar { position: absolute; inset: 0; pointer-events: none; transform: translateX(calc(var(--dir) * var(--pos) * 1%)); }
.cmp__bar::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: -1px; width: 2px; background: var(--ivory); }
.cmp__bar i { position: absolute; inset-block-start: 50%; inset-inline-start: -17px; width: 34px; height: 34px; margin-block-start: -17px; border-radius: 50%; background: var(--ivory); border: 2px solid var(--charcoal); }
.cmp__bar i::before, .cmp__bar i::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: solid var(--charcoal); border-width: 0 0 2px 2px; }
.cmp__bar i::before { left: 7px; transform: rotate(45deg); }
.cmp__bar i::after { right: 7px; transform: rotate(-135deg); }
/* the range input holds the value and the keyboard (arrows); pointer and touch are handled on the frame (cases.js) */
.cmp__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; -webkit-appearance: none; appearance: none; background: none; }
.cmp__range::-webkit-slider-thumb { -webkit-appearance: none; width: 48px; height: 400px; }
.cmp__range::-moz-range-thumb { width: 48px; height: 400px; border: 0; }
.cmp__foot { display: flex; justify-content: space-between; gap: 10px; margin-block-start: 10px; }
.cmp__btn { flex: 0 1 auto; text-align: start; font-size: .8125rem; padding-inline: 12px; }
.cases__next { margin-block-start: var(--space-16); }

/* Enlarged view (zoom.js): the photograph alone, whole, at its true aspect ratio. It grows from its own place and
   returns to it (transform and opacity, driven by zoom.js with --dur-zoom). */
html.zoom-open { overflow: hidden; }
.zoom { border: 0; padding: 0; margin: auto; max-width: none; max-height: none; width: 100vw; height: 100dvh; background: rgba(17, 17, 17, .96); color: var(--ivory); }
.zoom[open] { display: flex; flex-direction: column; }
.zoom::backdrop { background: rgba(17, 17, 17, .9); }
.motion-ok .zoom[open] { animation: zoom-ground 320ms var(--ease-micro) both; }
.motion-ok .zoom.is-closing { background: rgba(17, 17, 17, 0); transition: background-color 300ms var(--ease-micro); }
.motion-ok .zoom.is-closing::backdrop { background: rgba(17, 17, 17, 0); transition: background-color 300ms var(--ease-micro); }
.motion-ok .zoom.is-closing .zoom__foot, .motion-ok .zoom.is-closing .zoom__close { opacity: 0; transition: opacity 160ms var(--ease-micro); }
@keyframes zoom-ground { from { background-color: rgba(17, 17, 17, 0); } }
.zoom__in { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 12px 8px; }
.zoom__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; background: var(--photo-frame); will-change: transform; }
.zoom__foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; padding: 6px 16px 16px; font-size: .875rem; color: var(--stone); text-align: center; }
.zoom__jump { --accent: var(--champagne); --accent-hover: var(--champagne-hover); }
.zoom__close {
  position: absolute; z-index: 2; inset-block-start: 8px; inset-inline-end: 8px; min-width: 44px; min-height: 44px;
  background: none; border: 1px solid rgba(247, 245, 240, .55); border-radius: var(--radius-sharp); color: var(--ivory); font-size: 1.125rem; cursor: pointer;
}
.zoom__close:hover, .zoom__close:focus-visible { border-color: var(--champagne-hover); color: var(--champagne-hover); }
.zoom, .zoom * { --focus: var(--champagne); }

/* ---------- Page gateway (home): the first sheet that rises over the hero ----------
   Five large rows, one per page, named from the approved menu. A wire is drawn under the row in the reading
   direction on hover and on keyboard focus; the abstract bracket turns with the scroll (see site.js). */
.portal { position: relative; z-index: 2; overflow-x: clip; padding-block: var(--space-8) var(--space-8); }
.portal__in { position: relative; }
.portal .obj { margin-inline-start: auto; margin-block: -6px -34px; transform: scale(.72); transform-origin: var(--end) 0; }
.portal__list { border-block-start: 1px solid var(--hairline); }
.portal__item { border-block-end: 1px solid var(--hairline); }
.portal__link {
  position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px;
  min-height: 64px; padding-block: 16px; text-decoration: none;
}
.portal__num { color: var(--accent); }
.portal__name {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 8.6vw, 4.25rem); line-height: 1.12;
  transition: transform var(--dur-line) var(--ease-enter);
}
.portal__link .link__arrow { margin: 0; color: var(--accent); font-size: 1.25rem; }
.portal__link::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: var(--wire); background: var(--accent);
  transform: scaleX(0); transform-origin: var(--end) center; transition: transform var(--dur-line) var(--ease-transit);
}
.portal__link:hover::after, .portal__link:focus-visible::after { transform: none; transform-origin: var(--start) center; }
.portal__link:hover .portal__name, .portal__link:focus-visible .portal__name { transform: translateX(calc(var(--dir) * 12px)); }
.portal__link:hover .link__arrow, .portal__link:focus-visible .link__arrow { transform: translateX(calc(var(--dir) * 6px)); }
.will-reveal[data-reveal="rise"].is-in { transition-delay: calc(var(--i, 0) * 70ms); }
@media (min-width: 1080px) {
  .portal { padding-block: var(--space-24) var(--space-16); }
  .portal__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); column-gap: var(--space-16); align-items: center; }
  .portal .obj { margin: 0 auto; transform: scale(1.5); transform-origin: 50% 50%; }
  .portal__link { grid-template-columns: 3.5rem minmax(0, 1fr) auto; padding-block: 20px; }
}

/* ---------- Home: biography and education ---------- */
.bio { position: relative; z-index: 2; overflow-x: clip; padding-block: var(--space-16) var(--space-12); }
.bio__lead { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.625rem, 4.4vw, 2.375rem); line-height: 1.45; max-width: 26em; }
html[lang="en"] .bio__lead { line-height: 1.22; }
.bio__more { margin-block-start: var(--space-6); font-size: 1.0625rem; max-width: 44em; color: var(--ivory); }
.bio__more strong { font-weight: 500; color: var(--champagne); }
.bio__edu { margin-block-start: var(--space-16); }
.bio .cv__list { font-size: 1.0625rem; }
@media (min-width: 1080px) { .bio { padding-block: var(--space-24); } }

/* ---------- Home: «حالات مختارة» — the smile photographs of each case. A photograph opens enlarged in place
   (zoom.js); the one line under the pair is the link to the whole case, and the wide frame under the cards leads to
   the cases page. Small screens: one row that scrolls sideways inside itself (the page never does). From 600px: rows
   that wrap, and a row that is not full sits in the middle (four cases, then three centred under them). */
.picked { margin-block-start: var(--space-16); padding-block-end: var(--space-12); }
.smiles {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(80vw, 340px); gap: 14px; margin-block: var(--space-2) var(--space-6);
  margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 14px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent;
}
.smile { scroll-snap-align: start; }
.smile__card {
  position: relative; display: block; height: 100%; padding: 10px 10px 8px; background: var(--photo-frame); color: var(--ivory);
  border-radius: var(--radius-card); overflow: hidden; --focus: var(--champagne);
}
.smile__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.smile__frame { display: block; position: relative; aspect-ratio: 4 / 3; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.smile__frame:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.smile__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.smile__note { display: block; margin-block: 2px 6px; padding-inline-start: 8px; border-inline-start: var(--wire) solid var(--champagne); font-size: .75rem; line-height: 1.5; color: var(--ivory); }
.smile__foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-height: 44px; padding: 10px 4px 6px; font-size: .9375rem; font-weight: 500; line-height: 1.5; color: inherit; text-decoration: none; }
.smile__foot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.smile__foot .mono { color: var(--champagne); font-size: .875rem; }
.smile__foot .link__arrow { color: var(--champagne); margin: 0; }
.smile__card::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; height: 2px; background: var(--champagne);
  transform: scaleX(0); transform-origin: var(--end) center; transition: transform var(--dur-line) var(--ease-transit);
}
.smile__card:hover::after, .smile__card:focus-within::after { transform: none; transform-origin: var(--start) center; }
.smile__foot:hover .link__arrow, .smile__foot:focus-visible .link__arrow { transform: translateX(calc(var(--dir) * 6px)); }
@media (min-width: 600px) {
  .smiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-inline: 0; padding: 0; overflow: visible; }
  .smile { flex: 0 0 calc((100% - 20px) / 2); min-width: 0; }
}
@media (min-width: 900px) { .smile { flex-basis: calc((100% - 40px) / 3); } }
@media (min-width: 1200px) { .smile { flex-basis: calc((100% - 60px) / 4); } }
/* the wide frame under the cards: the one way from here to the cases page */
.browse {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px;
  margin-block: var(--space-2) var(--space-8); padding: 16px 20px; border: var(--wire) solid var(--gold-deep); border-radius: var(--radius-card);
  color: var(--graphite); text-decoration: none; overflow: hidden; isolation: isolate;
  transition: color var(--dur-line) var(--ease-micro);
}
.browse::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--charcoal);
  transform: scaleX(0); transform-origin: var(--end) center; transition: transform var(--dur-line) var(--ease-transit);
}
.browse__name { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.625rem, 5.4vw, 2.5rem); line-height: 1.15; }
.browse .link__arrow { margin: 0; font-size: 1.5rem; color: var(--gold-deep); transition: transform var(--dur-line) var(--ease-enter), color var(--dur-line) var(--ease-micro); }
.browse:hover, .browse:focus-visible { color: var(--ivory); }
.browse:hover::before, .browse:focus-visible::before { transform: none; transform-origin: var(--start) center; }
.browse:hover .link__arrow, .browse:focus-visible .link__arrow { color: var(--champagne); transform: translateX(calc(var(--dir) * 8px)); }
.browse:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.browse:active { transform: scale(.995); }
@media (min-width: 720px) { .browse { padding: 22px 32px; min-height: 96px; } }

/* ---------- Orthodontic Treatments page ---------- */
/* Head: Dr. Suleiman's cover, whole (no crop, no mask, no mirror), as a banner across the top; the page title follows
   as real text. A tap or click sends a ripple across the cover (cover.js). */
.th { padding-block: var(--header-h) 0; }
.th__cover { position: relative; width: min(100%, 1440px, max(72%, calc((100svh - var(--header-h) - 150px) * 2.4))); margin-inline: auto; aspect-ratio: 2400 / 1000; overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.th__media { position: absolute; inset: 0; }
.th__media img { display: block; width: 100%; height: 100%; }
.th__cover canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; }
.th__cover.is-rippling canvas { opacity: 1; }
/* the ripple without WebGL (weak devices, data saving): two rings spread from the finger (transform and opacity) */
.th__ring {
  position: absolute; width: 40px; height: 40px; margin: -20px; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(212, 184, 136, .9); opacity: 0; will-change: transform, opacity;
  animation: cover-ring 1100ms var(--ease-enter) both;
}
.th__ring + .th__ring { animation-delay: 160ms; }
@keyframes cover-ring { from { transform: scale(.2); opacity: .9; } to { transform: scale(var(--ring, 14)); opacity: 0; } }
.th__body { position: relative; padding-block: var(--space-8) var(--space-12); }
.th .page-head__name { margin-block-start: 0; }
@media (min-width: 900px) { .th__body { padding-block: var(--space-12) var(--space-16); } }
.tr { position: relative; z-index: 2; padding-block: var(--space-12); }
.tr + .tr { padding-block-start: var(--space-8); }
.tr__lead { font-size: clamp(1.125rem, 2.3vw, 1.4375rem); line-height: 1.85; max-width: 46em; }
html[lang="en"] .tr__lead { line-height: 1.6; }
.tr__k { margin-block: var(--space-12) var(--space-4); color: var(--fg-2); font-weight: 500; }
.rs .tr__k { margin-block-start: 0; }
.tr__p { font-size: 1.0625rem; max-width: 46em; }
/* The nine options: numbered brackets on one gold wire. This is the still version — a straight wire, every bracket
   lit — shown without JS, with reduced motion and on weak devices. options.js turns it live (.is-live): the wire is
   drawn and straightens with the scroll, the brackets light in order, and hovering or touching an option ripples the
   wire beside it. The names are real text and never move away from where they are read. */
.tr-opts__grid { margin-block-start: var(--space-12); }
.tr-opts__grid .tr__k { margin-block: 0 var(--space-4); }
.tr-opts__box { position: relative; --bx: 26px; }
.tr-opts__box::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: calc(var(--bx) - .75px); width: var(--wire); background: var(--accent); }
.tr-opts__box.is-live::before { display: none; }
.tr-opts__wire { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: calc(var(--bx) * 2); height: 100%; overflow: visible; pointer-events: none; }
.tr-opts__wire path { fill: none; stroke-width: 1.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tr-opts__wire .ghost { stroke: var(--hairline); }
.tr-opts__wire .gold { stroke: var(--accent); }
.tr-opt { position: relative; display: grid; grid-template-columns: calc(var(--bx) * 2) minmax(0, 1fr); column-gap: 14px; align-items: center; min-height: 68px; padding-block: 10px; }
.tr-opt__bracket {
  position: relative; z-index: 1; justify-self: center; display: grid; place-items: center; width: 36px; height: 42px;
  border: 1.5px solid var(--accent); border-radius: 3px; background: var(--bg); font-style: normal; will-change: transform;
}
.tr-opt__bracket::before { content: ""; position: absolute; inset: 2px; border-radius: 1.5px; background: var(--accent); transition: opacity 300ms var(--ease-micro), transform 500ms var(--ease-enter); }
.tr-opt__num { position: relative; color: var(--ivory); transition: color 300ms var(--ease-micro), transform var(--dur-line) var(--ease-enter); }
.tr-opt__name { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.5rem, 3.2vw, 2.25rem); line-height: 1.25; transition: transform var(--dur-line) var(--ease-enter); }
.tr-opts__box.is-live .tr-opt:not(.is-lit) .tr-opt__bracket::before { opacity: 0; transform: scale(.2); }
.tr-opts__box.is-live .tr-opt:not(.is-lit) .tr-opt__num { color: var(--accent); }
/* the option under the pointer or the finger: its number stands out and its name leans in the reading direction */
.tr-opt.is-hot .tr-opt__num { transform: scale(1.35); }
.tr-opt.is-hot .tr-opt__bracket { outline: 1.5px solid var(--accent); outline-offset: 3px; }
.tr-opt.is-hot .tr-opt__name { transform: translateX(calc(var(--dir) * 10px)); }
@media (min-width: 1080px) {
  .tr-opts__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); column-gap: var(--space-16); align-items: start; margin-block-start: var(--space-16); }
  .tr-opts__grid .tr__k { position: sticky; inset-block-start: calc(var(--header-h) + 40px); }
  .tr-opt { min-height: 76px; }
}
.tr-choose__p { font-size: clamp(1.125rem, 2.1vw, 1.375rem); line-height: 1.85; max-width: 40em; color: var(--ivory); }
html[lang="en"] .tr-choose__p { line-height: 1.6; }
.tr-choose .wireline, .ct-rp .wireline { margin-block: 12px 16px; }
/* frequently asked questions: native <details>, so it works without JS; the answer eases in when opened */
.faq { border-block-start: 1px solid var(--hairline); }
.faq__item { position: relative; border-block-end: 1px solid var(--hairline); }
.faq__item::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: var(--wire); background: var(--accent);
  transform: scaleX(0); transform-origin: var(--start) center; transition: transform var(--dur-rule) var(--ease-transit);
}
.faq__item[open]::after { transform: none; }
.faq__sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; min-height: 64px; padding-block: 16px; cursor: pointer; list-style: none; -webkit-tap-highlight-color: transparent; }
.faq__sum::-webkit-details-marker { display: none; }
.faq__q { font-family: var(--font-sans); font-weight: 500; font-size: 1.0625rem; line-height: 1.6; transition: color var(--dur-micro) var(--ease-micro); }
.faq__sum:hover .faq__q { color: var(--accent-hover); }
.faq__icon { position: relative; width: 16px; height: 16px; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--accent); transition: transform var(--dur-line) var(--ease-enter); }
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__a { padding-block: 0 22px; max-width: 46em; font-size: 1.0625rem; }
.motion-ok .faq__item[open] .faq__a { animation: faq-in 520ms var(--ease-enter) both; }
@keyframes faq-in { from { opacity: 0; transform: translateY(-8px); } }
.tr__next { margin-block-start: var(--space-16); }
@media (min-width: 1080px) { .tr { padding-block: var(--space-16); } .faq__q { font-size: 1.1875rem; } .tr--faq { padding-block-end: var(--space-24); } }

/* ---------- Contact page: every channel is one large row that opens WhatsApp, the dialler or the mail app ---------- */
.reach { margin-block-start: var(--space-6); border-block-start: 1px solid var(--hairline); }
.reach__item { border-block-end: 1px solid var(--hairline); }
.reach__link {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k a" "v a"; column-gap: 16px; align-items: center;
  min-height: 76px; padding-block: 14px; text-decoration: none;
}
.reach__k { grid-area: k; font-size: .8125rem; font-weight: 500; color: var(--fg-2); }
.reach__v { grid-area: v; justify-self: start; font-weight: 500; font-size: clamp(1rem, 4.3vw, 1.625rem); line-height: 1.4; overflow-wrap: anywhere; transition: transform var(--dur-line) var(--ease-enter); }
.reach__link .link__arrow { grid-area: a; margin: 0; color: var(--accent); font-size: 1.25rem; }
.reach__link::after {
  content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: var(--wire); background: var(--accent);
  transform: scaleX(0); transform-origin: var(--end) center; transition: transform var(--dur-line) var(--ease-transit);
}
.reach__link:hover::after, .reach__link:focus-visible::after { transform: none; transform-origin: var(--start) center; }
.reach__link:hover .reach__v, .reach__link:focus-visible .reach__v { transform: translateX(calc(var(--dir) * 10px)); }
.reach__link:hover .link__arrow, .reach__link:focus-visible .link__arrow { transform: translateX(calc(var(--dir) * 6px)); }
.ct-rp__text { font-size: 1.0625rem; max-width: 46em; color: var(--ivory); }
.ct-rp__text p + p { margin-block-start: var(--space-4); }
.ct__note { margin-block-start: var(--space-12); }
@media (min-width: 1080px) { .ct__note { margin-block-start: var(--space-16); } }

/* ---------- Research page ---------- */
.rs { position: relative; z-index: 2; padding-block: var(--space-12); }
.rs__grid + .rs__grid { margin-block-start: var(--space-12); }
.rs .wireline { margin-block: 12px 16px; }
.rs .h2 { margin-block-end: var(--space-6); }
@media (min-width: 1080px) {
  .rs { padding-block: var(--space-24); }
  .rs__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); column-gap: var(--space-16); align-items: start; }
  .rs__grid + .rs__grid { margin-block-start: var(--space-16); }
  .rs .h2 { margin-block-end: 0; }
}

/* The pathway. Stages sit on one wire as its brackets; the wire is drawn with the scroll, in both directions
   (path.js). Used twice: the study pathway of the Research page (dark ground) and the first visit of the Treatments
   page (light ground, .path--visit); the colours come from the surface. Default — no JS, reduced motion — is the
   finished state: every stage shown, nothing dimmed. With motion, stages ahead of the wire wait slightly dimmed
   (still readable, ≥ 4.5:1) and step into place. */
.path { position: relative; z-index: 2; isolation: isolate; overflow-x: clip; padding-block: var(--space-16); }
.path__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.path__head > div:first-child { flex: 1 1 auto; min-width: 0; }
.path__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.5rem, 10vw, 4.25rem); line-height: 1.08; text-wrap: balance; }
.path .obj { flex: none; margin: -14px 0 -44px; margin-inline-start: -46px; transform: scale(.62); transform-origin: var(--end) 0; }
.path .obj__wire { width: 168px; margin-left: -84px; }
.path__lead { margin-block-start: var(--space-6); max-width: 34em; color: var(--fg-2); }
.path__official {
  margin-block-start: var(--space-6); padding-inline-start: 16px; border-inline-start: var(--wire) solid var(--accent);
  max-width: 36em; font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: .9375rem; line-height: 1.6; text-align: left;
}
.path__rail { position: relative; margin-block-start: var(--space-12); padding-inline-start: 36px; }
.path__wire { position: absolute; inset-block: 0; inset-inline-start: 6.75px; width: var(--wire); background: var(--hairline); }
.path__fill { position: absolute; inset: 0; background: var(--accent); transform-origin: 50% 0; }
.path--armed .path__fill { transform: scaleY(0); will-change: transform; }
/* the one light of the scene: a small bead at the head of the wire (never on text) */
.path__tip {
  position: absolute; inset-block-start: 0; inset-inline-start: 7.5px; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%;
  background: var(--accent-hover); box-shadow: 0 0 14px 3px var(--tip-glow, rgba(198, 165, 109, .5)); will-change: transform; pointer-events: none;
}
.path__node { position: relative; padding-block: 18px; border-block-end: 1px solid var(--hairline); }
.path__node:first-child { padding-block-start: 0; }
.path__bracket {
  position: absolute; inset-inline-start: -36px; inset-block-start: 20px; width: 15px; height: 19px;
  border: 1.5px solid var(--accent); border-radius: 2px; background: var(--bg);
}
.path__node:first-child .path__bracket { inset-block-start: 2px; }
.path__bracket::before { content: ""; position: absolute; inset-inline: -5px; inset-block-start: calc(50% - .75px); height: 1.5px; background: var(--accent); }
.path__bracket::after {
  content: ""; position: absolute; inset: 2px; border-radius: 1px; background: var(--accent);
  transform: scale(0); transition: transform 420ms var(--ease-enter);
}
.path__node.is-active .path__bracket::after { transform: none; }
.path__k { font-size: .8125rem; font-weight: 500; line-height: 1.5; color: var(--accent); }
.path__v { margin-block-start: 4px; max-width: 38em; font-size: 1.0625rem; }
.path__k, .path__v, .path__points, .path__num, .path__step { transition: opacity 480ms var(--ease-micro), transform var(--dur-rule) var(--ease-enter), color 300ms var(--ease-micro); }
.path--armed .path__node:not(.is-on) > :not(.path__bracket) { opacity: .72; transform: translateX(calc(var(--dir) * -10px)); }
/* the first visit (Treatments page): four numbered steps on the light ground. The wire fills and darkens with the
   scroll; the step being read is marked by its filled bracket and its title. */
.path--visit { padding-block-start: 76px; }
.path--visit { --tip-glow: rgba(122, 92, 46, .35); }
.path--visit .sec-head .h2 { margin-block-end: 0; }
.path--visit .path__lead { color: var(--fg); font-size: 1.0625rem; max-width: 46em; }
.path__num { display: block; color: var(--accent); }
.path__step { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.3; }
.path--visit .path__node.is-active .path__step { color: var(--accent); }
.path--armed .path__node:not(.is-on) > .path__num { opacity: 1; }      /* small gold figures keep their full contrast */
.path__after { margin-block-start: var(--space-8); padding-inline-start: 36px; }
/* measurement time points of the primary outcome: a schedule, not data */
.path__points { display: flex; gap: 5px; margin-block-start: 14px; max-width: 26rem; }
.path__points li { position: relative; isolation: isolate; flex: 1 1 0; min-width: 0; padding: 5px 2px; text-align: center; border: 1px solid var(--hairline-dark); border-radius: var(--radius-sharp); }
.path__points li::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(198, 165, 109, .2);
  transform-origin: var(--start) center; transition: transform 420ms var(--ease-enter); transition-delay: calc(var(--i, 0) * 80ms);
}
.path--armed .path__node:not(.is-on) .path__points li::before { transform: scaleX(0); transition-delay: 0s; }
@media (min-width: 1080px) {
  .path { padding-block: var(--space-24); }
  .path__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: var(--space-16); align-items: start; }
  .path--visit { padding-block-start: var(--space-24); }
  .path--visit .path__in { grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); }
  .path__step { font-size: 1.75rem; }
  .path__after { padding-inline-start: 48px; }
  .path__aside { position: sticky; inset-block-start: calc(var(--header-h) + 40px); }
  .path .obj { margin: 0; margin-inline-start: -30px; transform: scale(.9); }
  .path__rail { margin-block-start: 8px; padding-inline-start: 48px; }
  .path__bracket { inset-inline-start: -48px; }
  .path__node { padding-block: 26px; }
  .path__node:first-child .path__bracket { inset-block-start: 4px; }
  .path__v { font-size: 1.125rem; }
}


/* ---------- Reduced motion: a designed still version ---------- */
.motion-reduced *, .motion-reduced *::before, .motion-reduced *::after,
.motion-off *, .motion-off *::before, .motion-off *::after {
  transition: none !important;
  animation-duration: .01ms !important; animation-delay: 0s !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation-duration: .01ms !important; animation-delay: 0s !important;
  }
}
@media print { .site-header, .proto, .hero__spot { display: none; } }
