/* ============================================================
   Mousto4AI — site stylesheet
   Mobile-first. Logical properties throughout so the same rules
   serve Arabic (RTL) and English (LTR) without duplication.
   Depends on tokens.css for every colour, size and easing value.
   ============================================================ */

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-block-start: 84px; /* clears the sticky header on anchor jumps */
  /* "clip" rather than "hidden": hidden makes the element a scroll container,
     which breaks window.scrollTo, anchor jumps and position:sticky on the
     header. clip prevents the same sideways overflow with none of that. */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-on-bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;              /* Arabic needs more leading than Latin */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-accent); }

button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  hyphens: none;
  text-wrap: balance;
  margin: 0;
}

p { margin: 0; text-wrap: pretty; }

ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--color-accent); color: var(--color-on-accent); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* Skip link — first tab stop for keyboard and screen-reader users. */
.skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  top: 8px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
}
.skip-link:focus { inset-inline-start: 16px; color: var(--color-on-primary); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- layout ---------- */

.shell {
  width: min(1240px, 100% - 2 * var(--margin-mobile));
  margin-inline: auto;
}

@media (min-width: 768px) {
  .shell { width: min(1240px, 100% - 64px); }
}

.section { padding-block: clamp(48px, 7vw, 96px); position: relative; }
.section--tight { padding-block: clamp(32px, 5vw, 64px); }

/* Prose columns stay inside the 45–90 character readable band. */
.prose { max-width: 62ch; }
.prose-wide { max-width: 72ch; }

/* ---------- ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  contain: strict;               /* keeps the blurs off the main paint path */
}

.ambient__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  will-change: transform;
}

.ambient__glow--1 {
  width: 70vw; height: 70vw;
  top: -14vw; inset-inline-end: -12vw;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--color-accent) 26%, transparent), transparent 70%);
  opacity: .7;
  animation: drift 24s ease-in-out infinite;
}

.ambient__glow--2 {
  width: 52vw; height: 52vw;
  top: 52vh; inset-inline-start: -16vw;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--brand-slate) 22%, transparent), transparent 70%);
  opacity: .55;
  animation: drift 31s ease-in-out infinite reverse;
}

.ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-module) var(--grid-module);
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 75%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 75%);
}

/* Phones get a static, cheap background — the blurred glows are the single
   most expensive thing to composite on a low-end device. */
@media (max-width: 767px) {
  .ambient__glow { animation: none; filter: blur(60px); opacity: .35; }
  .ambient__glow--2 { display: none; }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(4%, -3%, 0) scale(1.08); }
}

/* ---------- header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--color-bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-block-end: 1px solid var(--color-hairline);
}

.header__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-on-bg);
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.wordmark:hover { color: var(--color-on-bg); }
/* Padding, not height, so the 44px tap target does not change the bar layout. */
.wordmark { min-height: 44px; padding-inline-end: 4px; }
.wordmark img { width: 26px; height: 26px; object-fit: contain; }

.nav {
  display: none;
  align-items: center;
  gap: 2px;
  margin-inline-start: auto;
}

.nav__link {
  padding: 9px 13px;
  border-radius: var(--radius-full);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-on-surface-variant);
  transition: background var(--dur) var(--ease-standard), color var(--dur) var(--ease-standard);
}
.nav__link:hover { background: var(--color-surface-low); color: var(--color-on-surface); }
.nav__link[aria-current="page"] { color: var(--color-accent); background: var(--color-surface-low); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
}

@media (min-width: 1024px) {
  .nav { display: flex; }
  .header__actions { margin-inline-start: 12px; }
}

/* Every tappable control clears the 44px touch-target floor. */
.icon-btn {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-outline-variant);
  background: transparent;
  color: var(--color-on-surface);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: border-color var(--dur) var(--ease-standard), color var(--dur) var(--ease-standard);
}
.icon-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }

.nav-toggle { display: grid; }
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.mobile-nav {
  display: grid;
  gap: 4px;
  padding-block: 14px 20px;
  border-block-start: 1px solid var(--color-hairline);
  background: var(--color-bg);
  animation: fade var(--dur) var(--ease-standard) both;
}
.mobile-nav[hidden] { display: none; }

.mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 500;
  color: var(--color-on-surface);
}
.mobile-nav__link:hover,
.mobile-nav__link[aria-current="page"] { background: var(--color-surface-low); color: var(--color-accent); }
.mobile-nav__num { font-family: var(--font-display); font-size: 12px; color: var(--color-muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: filter var(--dur) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard),
              border-color var(--dur) var(--ease-standard),
              color var(--dur) var(--ease-standard);
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--primary:hover { filter: brightness(1.08); color: var(--color-on-primary); }

.btn--ghost { border-color: var(--color-outline-variant); color: var(--color-on-surface); background: transparent; }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- kicker / section heads ---------- */

/* All-caps needs letterspacing to stay readable — Latin only, never Arabic. */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface-lowest);
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent);
  line-height: 1.4;
}
:root[lang="en"] .kicker { text-transform: uppercase; }

.kicker__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex: none;
  animation: pulse 2.4s ease-in-out infinite;
}

.section-head { margin-block-end: clamp(28px, 4vw, 48px); }
.section-head__title {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.3;
  letter-spacing: var(--tracking-snug);
  margin-block: 16px 0;
}
.section-head__lede {
  margin-block-start: 14px;
  color: var(--color-on-surface-variant);
  font-size: clamp(15px, 1.4vw, 17px);
}

/* ---------- cards ---------- */

/* One card primitive. Variants change accent and padding, never structure —
   which is what keeps twenty-two program cards visually identical in rhythm. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface-lowest);
  overflow: hidden;
  transition: transform var(--dur) var(--ease-standard),
              box-shadow var(--dur) var(--ease-standard);
}

/* The lit edge. A full border is drawn on an overlay so it can animate without
   shifting layout, and the right and bottom edges are thicker than the top and
   left — the same asymmetry a real object gets from a light source above and to
   the side, which is what reads as depth rather than as a coloured outline.

   Physical sides on purpose, not logical ones: the light does not flip when the
   page does, so this must look identical in Arabic and English. */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid transparent;
  border-right-width: 1px;
  border-bottom-width: 1px;
  transition: border-color var(--dur) var(--ease-standard),
              border-width var(--dur) var(--ease-standard);
}

.card:hover,
.card:focus-within {
  transform: translateY(-5px);
  box-shadow:
    var(--shadow-card),
    8px 10px 26px -12px color-mix(in oklab, var(--color-accent) 55%, transparent);
}

/* Four explicit longhands. The border-color shorthand does not expand
   reliably when its value is a color-mix(), which left the lit edges blank. */
.card:hover::after,
.card:focus-within::after {
  border-top-color: color-mix(in oklab, var(--color-accent) 30%, transparent);
  border-left-color: color-mix(in oklab, var(--color-accent) 30%, transparent);
  border-right-color: color-mix(in oklab, var(--color-accent) 70%, transparent);
  border-bottom-color: color-mix(in oklab, var(--color-accent) 70%, transparent);
  border-right-width: 3px;
  border-bottom-width: 3px;
}

.card__icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
  margin-block-end: 18px;
  flex: none;
}

.card__title {
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.4;
  margin-block-end: 10px;
}

/* Grow the tappable box to 44px without shifting the card's rhythm: the
   negative margin cancels exactly the padding that created the target. */
.card__title a {
  display: inline-block;
  padding-block: 11px;
  margin-block: -11px;
}

.card__text {
  color: var(--color-on-surface-variant);
  font-size: 15px;
  line-height: 1.75;
}

.card__footer { margin-block-start: auto; padding-block-start: 18px; }

/* Chips — tool names, tiers, tags. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-low);
  font-size: 12.5px;
  color: var(--color-on-surface-variant);
  white-space: nowrap;
}
.chip--accent {
  border-color: color-mix(in oklab, var(--color-accent) 40%, transparent);
  background: color-mix(in oklab, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- grids ---------- */

.grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.grid--cards { grid-template-columns: 1fr; }

@media (min-width: 600px) { .grid--cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--cards { grid-template-columns: repeat(3, 1fr); } }

.grid--two { grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid--two { grid-template-columns: repeat(2, 1fr); } }

/* Hairline stat strip — 2-up on phones, 4-up from tablet. */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--color-hairline);
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-block-start: clamp(32px, 5vw, 56px);
}
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }

.stat { background: var(--color-bg); padding: clamp(18px, 2.4vw, 26px); text-align: center; }
.stat__k {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1.1;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums lining-nums;
}
.stat__l { font-size: 13.5px; color: var(--color-muted); margin-block-start: 6px; line-height: 1.5; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(32px, 5vw, 72px) clamp(24px, 3vw, 44px); }

.hero__layout {
  display: grid;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) { .hero__layout { grid-template-columns: 1.05fr 0.95fr; } }

.hero__title {
  font-size: clamp(30px, 5vw, 60px);
  line-height: 1.28;
  letter-spacing: var(--tracking-tight);
  margin-block: 20px 0;
}

.hero__lede {
  font-size: clamp(15.5px, 1.5vw, 18.5px);
  line-height: 1.8;
  color: var(--color-on-surface-variant);
  margin-block-start: 20px;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 30px; }
.hero__note { margin-block-start: 18px; font-size: 13.5px; color: var(--color-muted); }

/* Square by default. --portrait-ratio lets the frame follow a differently
   shaped image without touching this file, and because the ratio is reserved
   up front the hero never shifts as the picture decodes. */
.portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface-low);
  aspect-ratio: var(--portrait-ratio, 1 / 1);
  max-width: 460px;
  width: 100%;
  justify-self: center;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }

.portrait__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in oklab, var(--color-bg) 74%, transparent), transparent 45%);
}

.portrait__meta {
  position: absolute;
  inset-block-end: 18px;
  inset-inline: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.portrait__name { font-family: var(--font-display); font-size: clamp(19px, 2.4vw, 26px); line-height: 1.3; }
.portrait__org { font-size: 13.5px; color: var(--color-on-surface-variant); margin-block-start: 4px; }
.portrait__loc {
  font-family: var(--font-label);
  font-size: 10.5px;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent);
  text-align: end;
  line-height: 1.5;
}

/* Corner brackets — the technical-drawing motif from the design system. */
.portrait__corner {
  position: absolute;
  width: 22px; height: 22px;
  top: 14px;
  border-block-start: 2px solid var(--color-accent);
}
.portrait__corner--start { inset-inline-start: 14px; border-inline-start: 2px solid var(--color-accent); border-start-start-radius: 8px; }
.portrait__corner--end { inset-inline-end: 14px; border-inline-end: 2px solid var(--color-accent); border-start-end-radius: 8px; }

/* ---------- quote ---------- */

.quote {
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.6;
  font-weight: 600;
  border-inline-start: 4px solid var(--color-accent);
  padding-inline-start: 20px;
  margin-block: 28px;
  color: var(--color-on-bg);
}

/* ---------- timeline ---------- */

.timeline { display: grid; gap: 0; position: relative; }

.timeline__item {
  position: relative;
  padding-inline-start: 30px;
  padding-block: 18px;
  border-inline-start: 1px solid var(--color-outline-variant);
}
.timeline__item:last-child { border-inline-start-color: transparent; }

.timeline__item::before {
  content: "";
  position: absolute;
  inset-inline-start: -6px;
  top: 26px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
}

.timeline__when {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: var(--tracking-wide);
  color: var(--color-accent);
}
.timeline__role { font-family: var(--font-display); font-size: 18px; line-height: 1.4; margin-block-start: 6px; }
.timeline__org { font-size: 14px; color: var(--color-muted); margin-block-start: 2px; }
.timeline__note { font-size: 14.5px; color: var(--color-on-surface-variant); margin-block-start: 8px; line-height: 1.7; }

/* ---------- filters & search ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-block-end: 26px;
}

.filter-btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-outline-variant);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-size: 14.5px;
  cursor: pointer;
  transition: all var(--dur) var(--ease-standard);
}
.filter-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.filter-btn[aria-pressed="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-on-primary);
}

.search {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface-lowest);
  color: var(--color-on-surface);
  font-size: 15px;
}
.search::placeholder { color: var(--color-muted); }

/* ---------- forms ---------- */

.field { display: grid; gap: 7px; margin-block-end: 16px; }
.field__label { font-size: 13.5px; color: var(--color-muted); }
.field__label .req { color: var(--color-error); }

.input, .textarea, .select {
  width: 100%;
  min-height: 50px;
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--color-outline-variant);
  background: var(--color-surface-lowest);
  color: var(--color-on-surface);
  font-size: 16px;                  /* 16px stops iOS Safari zooming on focus */
  transition: border-color var(--dur) var(--ease-standard);
}
.input:hover, .textarea:hover, .select:hover { border-color: var(--color-outline); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--color-error); }

.field__error { font-size: 13px; color: var(--color-error); min-height: 1em; }

.alert {
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 14.5px;
  line-height: 1.7;
  margin-block-end: 20px;
  border: 1px solid transparent;
}
.alert--success {
  background: color-mix(in oklab, var(--color-success) 12%, transparent);
  border-color: color-mix(in oklab, var(--color-success) 40%, transparent);
  color: var(--color-success);
}
.alert--error {
  background: var(--color-error-container);
  border-color: color-mix(in oklab, var(--color-error) 40%, transparent);
  color: var(--color-on-error-container);
}

/* Bot trap — must be reachable by nothing, visible to nobody. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0;
  height: 0;
  width: 0;
  pointer-events: none;
}

/* ---------- plans ---------- */

.plan { position: relative; }
.plan--best { border-color: color-mix(in oklab, var(--color-accent) 55%, transparent); }
.plan--best::after {
  border-top-color: color-mix(in oklab, var(--color-accent) 20%, transparent);
  border-left-color: color-mix(in oklab, var(--color-accent) 20%, transparent);
  border-right-color: color-mix(in oklab, var(--color-accent) 45%, transparent);
  border-bottom-color: color-mix(in oklab, var(--color-accent) 45%, transparent);
  border-right-width: 3px;
  border-bottom-width: 3px;
}

.plan__badge {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
}

.plan__price {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 46px);
  line-height: 1.1;
  color: var(--color-on-bg);
  font-variant-numeric: tabular-nums lining-nums;
}
.plan__dur { font-size: 14.5px; color: var(--color-muted); margin-block-start: 6px; }

.plan__list { display: grid; gap: 11px; margin-block-start: 20px; }
.plan__list li { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.65; color: var(--color-on-surface-variant); }
.plan__list svg { flex: none; color: var(--color-accent); margin-block-start: 4px; }

/* ---------- tabs ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 26px; }

.tab {
  min-height: 44px;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-outline-variant);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-size: 14.5px;
  cursor: pointer;
  transition: all var(--dur) var(--ease-standard);
}
.tab[aria-selected="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }

/* Masonry-ish gallery that degrades to a simple grid without JS. */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1050px) { .gallery { grid-template-columns: repeat(4, 1fr); } }

.gallery__item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  background: var(--color-surface-low);
  cursor: zoom-in;
  transition: transform var(--dur) var(--ease-standard), border-color var(--dur) var(--ease-standard);
}
.gallery__item:hover { transform: scale(1.02); border-color: var(--color-accent); }
.gallery__item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.videos { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .videos { grid-template-columns: repeat(3, 1fr); } }
.videos video { width: 100%; border-radius: var(--radius); border: 1px solid var(--color-hairline); background: #000; }

/* ---------- modal ---------- */

.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(760px, calc(100vw - 24px));
  width: 100%;
  max-height: calc(100dvh - 32px);
}
.modal::backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(4px); }

.modal__panel {
  background: var(--color-bg);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 34px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal__close {
  position: sticky;
  top: 0;
  margin-inline-start: auto;
  display: grid;
}

.lightbox img { width: 100%; height: auto; border-radius: var(--radius); }

/* ---------- footer ---------- */

.footer {
  border-block-start: 1px solid var(--color-hairline);
  padding-block: clamp(32px, 4vw, 52px);
  margin-block-start: clamp(40px, 6vw, 80px);
  position: relative;
  z-index: 1;
  background: var(--color-bg);
}

.footer__grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }

.footer__title { font-family: var(--font-label); font-size: 11.5px; letter-spacing: var(--tracking-wider); color: var(--color-muted); margin-block-end: 12px; }
.footer__link { display: flex; align-items: center; padding-block: 10px; font-size: 14.5px; color: var(--color-on-surface-variant); min-height: 44px; }
.footer__link:hover { color: var(--color-accent); }
.footer__legal {
  margin-block-start: 30px;
  padding-block-start: 22px;
  border-block-start: 1px solid var(--color-hairline);
  font-size: 13px;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: space-between;
  align-items: center;
}
/* Same negative-margin trick: a real 44px target with no added whitespace. */
.footer__legal a { display: none; align-items: center; min-height: 44px; padding-inline: 6px; margin-block: -11px; }

/* ---------- scroll-reveal ---------- */

/* Applied by JS only after IntersectionObserver is confirmed available, so a
   no-JS or failed-JS load still shows every section at full opacity.

   Distance is deliberately modest: a long slide reads as a page still loading,
   and on a phone it costs real frames. 34px is enough to register as motion. */
.js-reveal {
  opacity: 0;
  transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 18px), 0);
  will-change: opacity, transform;
}

.js-reveal[data-reveal="right"] { --reveal-x: 34px;  --reveal-y: 0; }
.js-reveal[data-reveal="left"]  { --reveal-x: -34px; --reveal-y: 0; }
.js-reveal[data-reveal="up"]    { --reveal-x: 0;     --reveal-y: 26px; }

.js-reveal.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-slow) var(--ease-standard),
    transform 520ms cubic-bezier(.22, .68, .3, 1);
}

/* Once revealed the hint is spent — dropping it frees the compositor layer. */
.js-reveal.is-visible { will-change: auto; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.78); } }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal { opacity: 1; transform: none; }
  .card:hover { transform: none; }
}

/* ---------- print ---------- */

@media print {
  .ambient, .header, .footer, .btn, .toolbar { display: none !important; }
  body { background: #fff; color: #000; }
  .card { break-inside: avoid; border-color: #ccc; }
}

/* Header CTA is desktop-only; on phones the same action sits in the sheet. */
.cta-desktop { display: none; }
@media (min-width: 1024px) { .cta-desktop { display: inline-flex; } }

/* ---------- partners marquee ---------- */

.partners {
  border-block: 1px solid var(--color-hairline);
  padding-block: clamp(26px, 3.5vw, 40px);
  margin-block-start: clamp(32px, 4vw, 52px);
}

.partners__title {
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: var(--tracking-wider);
  color: var(--color-muted);
  text-align: center;
  margin-block-end: 22px;
}

.marquee {
  overflow: hidden;
  /* Forced LTR so the strip travels the same way in both languages. A band of
     logos that reverses direction between Arabic and English reads as a bug,
     not as localisation. Each name keeps its own dir attribute. */
  direction: ltr;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__viewport { display: flex; width: max-content; }

.marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding-inline-end: clamp(28px, 4vw, 56px);
  flex: none;
  margin: 0;
  list-style: none;
}
.marquee__track > li { display: flex; flex: none; }

.marquee.is-running .marquee__viewport {
  animation: marquee var(--marquee-duration, 30s) linear infinite;
}

.marquee.is-paused .marquee__viewport { animation-play-state: paused; }

/* Without JS, or with reduced motion, it becomes a plain wrapping row. */
.marquee.is-static { overflow: visible; mask-image: none; -webkit-mask-image: none; }
.marquee.is-static .marquee__viewport { width: auto; justify-content: center; }
.marquee.is-static .marquee__track { flex-wrap: wrap; justify-content: center; }

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  /* Half, because the viewport holds the list twice. */
  to   { transform: translate3d(-50%, 0, 0); }
}

.partner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 8px 4px;
  color: var(--color-on-surface-variant);
  /* Greyscale by default so eleven different brand palettes do not fight the
     page; colour returns on hover. */
  filter: grayscale(1);
  opacity: .72;
  transition: filter var(--dur) var(--ease-standard),
              opacity var(--dur) var(--ease-standard);
}

.partner:hover,
.partner:focus-visible {
  filter: grayscale(0);
  opacity: 1;
  color: var(--color-on-surface);
}

.partner__mark {
  width: 42px;
  padding: 5px;
  background-color: #ffffff;
  border-radius: 12px;
  flex: none;
  display: grid;
  place-items: center;
}
.partner__mark svg,
.partner__mark img { width: 100%; height: 100%; object-fit: contain; }

.partner__name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .marquee .marquee__track { animation: none; }
}
