/* =====================================================================
   BLUE YAMM — بلو يَمّ
   Stylesheet for the static site.

   Design notes, so later edits keep the same discipline:
   · The palette is three colours and their tints — deep sea ink, paper, and
     one teal accent. No gradients on text, no glassmorphism, no coloured
     shadows. Depth comes from hairline rules and whitespace, not effects.
   · Type does the work: a serif for headings, a quiet sans for reading.
   · Motion is limited to a short fade-up on first view and 200ms hovers.
     Nothing moves on its own, nothing loops.

   CONTENTS
     1  Tokens
     2  Base + typography
     3  Header and navigation
     4  Buttons and small parts
     5  Hero
     6  Sections
     7  Article cards
     8  Article page
     9  Contact
    10  Footer
    11  RTL
    12  Responsive + reduced motion
   ===================================================================== */

/* ---------------------------------------------------------------------
   1  TOKENS
   --------------------------------------------------------------------- */
:root {
  /* --- The water column, surface to abyss ---------------------------------
     These are the only colours in the site. Every section paints a slice of
     this column, and the two ink sets below are chosen so text clears 4.5:1
     against every background it can land on. Verified figures are in the
     comments beside each zone. */
  --wc-sky:      #E4F1FA;   /* top of the hero — keeps the logo legible */
  --wc-sky-low:  #BBDFF3;
  --wc-sand:     #EFE2BE;   /* the beach at the foot of the hero */
  --wc-shallow:  #8AD4DA;   /* waterline */
  --wc-w2:       #7ACCD6;
  --wc-w3:       #6BC3D0;
  --wc-lagoon:   #5FBECD;   /* last light-zone colour */
  --wc-photic:   #3496B4;   /* the three mid-blues below live only inside    */
  --wc-mid:      #146480;   /* the descent band, where no text sits — they   */
  --wc-lower:    #0F4E6C;   /* are the range no ink can survive.            */
  --wc-dark:     #0B3B56;
  --wc-d2:       #0A3550;
  --wc-d3:       #093349;
  --wc-deeper:   #072C44;
  --wc-night:    #051E31;
  --wc-abyss:    #04162A;

  /* --- Brand, taken from the Blue Yamm mark --- */
  --indigo:     #26348B;
  --indigo-lt:  #7C8BE8;
  --emerald:    #12A17E;   /* bright — only used on dark backgrounds */
  --emerald-dk: #0C7257;   /* text-safe on the light header: 5.13:1     */
  --emerald-lt: #3FC49E;
  --amber:      #E2A94C;

  /* --- Ink -----------------------------------------------------------------
     Two sets. Sections above the descent band use the light-zone ink; those
     below use the deep-zone ink. Both are applied through the same four
     variables, so every component works in either zone without a fork. */
  --ink:       #042230;
  --ink-soft:  #0B3B4F;
  --ink-faint: #14465C;
  --accent:    #054634;
  --line:        rgba(4, 34, 48, .18);
  --line-strong: rgba(4, 34, 48, .34);
  --panel:       rgba(255, 255, 255, .40);
  --panel-solid: rgba(255, 255, 255, .62);

  /* Type */
  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  /* Rhythm */
  --measure: 1120px;
  --reading: 34rem;
  --gutter: clamp(20px, 5vw, 56px);
  --band: clamp(64px, 9vw, 112px);
  --radius: 6px;
  --header-h: 68px;

  /* Height of the descent band. Must stay below --band's minimum (64px) so
     the mid-blues are crossed entirely inside a section's top padding. */
  --descent: 60px;
}

/* Deep-zone ink. Applied to every section from .zone-deep downwards, and to
   the footer. Contrast on the darkest background reaches 16.4:1. */
.zone-deep {
  --ink:       #E9F5F8;
  --ink-soft:  #A9C9D6;
  --ink-faint: #A9C9D6;
  --accent:    #5FE0BA;
  --line:        rgba(233, 245, 248, .16);
  --line-strong: rgba(233, 245, 248, .30);
  --panel:       rgba(255, 255, 255, .055);
  --panel-solid: rgba(255, 255, 255, .075);
}

/* Arabic swaps the faces, never the structure. */
html[lang="ar"] {
  --serif: "Amiri", "Times New Roman", serif;
  --sans:  "IBM Plex Sans Arabic", system-ui, sans-serif;
}

/* ---------------------------------------------------------------------
   2  BASE + TYPOGRAPHY
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  /* No background here: each section paints its own slice of the water
     column, so the page darkens continuously from sky to abyss. */
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4 { line-height: 1.5; letter-spacing: 0; font-weight: 700; }

h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.25rem); }
h3 { font-size: 1.2rem; }

p { text-wrap: pretty; }
a { color: var(--accent); }

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

::selection { background: rgba(255,255,255,.55); color: var(--wc-abyss); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.wrap { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-reading { max-width: calc(var(--reading) + var(--gutter) * 2); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; inset-inline-start: 12px; top: -60px;
  z-index: 200; padding: 10px 18px;
  background: var(--wc-abyss); color: #F1F6F7;
  text-decoration: none; border-radius: var(--radius);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* A small label above a heading — used instead of decorative icons. */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}
.eyebrow::after {
  content: ""; flex: 1 1 auto; height: 1px;
  background: var(--line); max-width: 120px;
}
html[lang="ar"] .eyebrow {
  font-family: var(--sans);
  letter-spacing: 0; text-transform: none; font-size: .84rem;
}

.lead {
  font-size: clamp(1.06rem, 1.5vw, 1.2rem);
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 62ch;
}
html[lang="ar"] .lead { line-height: 2; }

.prose p { color: var(--ink-soft); max-width: 66ch; }
.prose p + p { margin-top: 1.1em; }
.prose strong { color: var(--ink); font-weight: 600; }
html[lang="ar"] .prose p { line-height: 2.05; }

/* ---------------------------------------------------------------------
   3  HEADER AND NAVIGATION
   Desktop: a plain horizontal bar. Mobile: the same list, revealed as a
   dropdown panel beneath the header. One markup, two presentations.
   --------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  /* Sits above the water: light near the surface, and switching to a dark
     translucent bar once you have descended past the hero, so the bar never
     fights the water behind it. .is-deep is set in script.js. */
  background: rgba(228, 241, 250, .90);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  color: var(--wc-abyss);
  transition: border-color .3s ease, background .3s ease, color .3s ease;
}
.site-header.is-scrolled { border-bottom-color: rgba(4, 34, 48, .16); }
.site-header.is-deep {
  background: rgba(5, 30, 49, .88);
  border-bottom-color: rgba(233, 245, 248, .16);
  color: #E9F5F8;
}

.header-inner {
  width: 100%; max-width: var(--measure); margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand-name {
  font-family: var(--serif); font-weight: 700;
  font-size: 1.02rem; letter-spacing: .04em; line-height: 1;
  white-space: nowrap;
}
.brand-name .a { color: var(--indigo); }
.brand-name .b { color: var(--emerald-dk); }
.is-deep .brand-name .a { color: var(--indigo-lt); }
.is-deep .brand-name .b { color: var(--emerald-lt); }
html[lang="ar"] .brand-name { letter-spacing: 0; font-size: 1.18rem; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 12px;
  font-size: .92rem;
  color: currentColor; opacity: .78;
  text-decoration: none;
  border-radius: var(--radius);
  transition: color .2s ease, background .2s ease;
  white-space: nowrap;
}
.nav a:hover { opacity: 1; background: rgba(127, 179, 191, .18); }
.nav a[aria-current="page"] { opacity: 1; font-weight: 500; }

.header-tools { display: flex; align-items: center; gap: 8px; }

/* Language toggle — two states, current one filled. */
.lang {
  display: inline-flex; align-items: center;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  overflow: hidden;
  background: transparent;
}
.lang button {
  font-family: var(--sans);
  font-size: .8rem; font-weight: 500;
  padding: 7px 12px;
  border: 0; background: transparent; color: currentColor; opacity: .72;
  cursor: pointer; line-height: 1.2;
  transition: background .2s ease, color .2s ease;
}
.lang button:hover { opacity: 1; }
.lang button[aria-pressed="true"] { background: var(--wc-mid); color: #fff; opacity: 1; }
.lang button + button { border-inline-start: 1px solid currentColor; }

/* Mobile trigger */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid currentColor;
  border-radius: var(--radius); cursor: pointer; color: currentColor;
}
.nav-toggle span {
  position: relative; display: block; width: 17px; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: background .2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; position: absolute; left: 0;
  width: 17px; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform .25s ease;
}
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after  { top:  5.5px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------------------------------------------------------------------
   4  BUTTONS AND SMALL PARTS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: .94rem; font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--wc-mid); color: #fff; }
.btn-primary:hover { background: var(--wc-lower); }
/* Bright emerald with white text is only 3.27:1, so the label is dark here. */
.zone-deep .btn-primary { background: var(--emerald-lt); color: var(--wc-abyss); }
.zone-deep .btn-primary:hover { background: #6FDCB4; color: var(--wc-abyss); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
/* Kept for markup compatibility; the hero is now light, so this reads as a
   quiet outline button rather than a light-on-dark one. */
.btn-on-dark { border-color: var(--line-strong); color: var(--ink); }
.btn-on-dark:hover { border-color: var(--accent); color: var(--accent); }

.arw { transition: transform .2s ease; }
html[dir="rtl"] .arw { transform: scaleX(-1); }
.btn:hover .arw { transform: translateX(3px); }
html[dir="rtl"] .btn:hover .arw { transform: scaleX(-1) translateX(3px); }

/* first-view fade. Deliberately small: 12px and 500ms. */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

/* ---------------------------------------------------------------------
   5  HERO
   A single deep band. The wave is one low-contrast shape, not an animation.
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  /* Clear sky at the top so the logo reads, warming down to sand at the foot. */
  background: linear-gradient(180deg,
    var(--wc-sky)     0%,
    var(--wc-sky-low) 54%,
    var(--wc-sand)    100%);
  color: var(--ink);
  padding-block: clamp(72px, 12vw, 132px) clamp(96px, 14vw, 150px);
  overflow: hidden;
}
/* A single low sun above the horizon. Static, very low contrast. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, .55), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-logo { width: min(72vw, 420px); margin-bottom: 28px; }
.hero h1 {
  color: var(--wc-abyss);
  max-width: 18ch;
  margin-bottom: 18px;
}
.hero-tagline {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  font-style: italic; font-weight: 300;
  color: var(--wc-mid);
  margin-bottom: 34px;
}
html[lang="ar"] .hero-tagline { font-style: normal; font-weight: 400; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-wave { position: absolute; inset-inline: 0; bottom: -1px; line-height: 0; }
.hero-wave svg { width: 100%; height: clamp(40px, 6vw, 72px); display: block; }
/* The wave is filled with the first water colour, so the beach meets the sea
   here and the section below continues from exactly that tone. */
.hero-wave path { fill: var(--wc-shallow); }

/* ---------------------------------------------------------------------
   6  SECTIONS
   --------------------------------------------------------------------- */
.section { padding-block: var(--band); position: relative; }

/* --- The descent ---------------------------------------------------------
   Each section paints from its own colour to the next one's, so the joins are
   seamless whatever the section heights. Only .zone-deep carries a hard
   transition: it crosses the three mid-blues within --descent (60px), which
   sits inside its top padding (--band, minimum 64px) where no text is placed.
   That range is the one no ink can clear 4.5:1 against, so nothing reads on it. */
.d-shallow  { background: linear-gradient(180deg, var(--wc-shallow) 0%, var(--wc-w2)     100%); }
.d-w2       { background: linear-gradient(180deg, var(--wc-w2)      0%, var(--wc-w3)     100%); }
.d-w3       { background: linear-gradient(180deg, var(--wc-w3)      0%, var(--wc-lagoon) 100%); }
.d-descent  { background: linear-gradient(180deg,
                var(--wc-lagoon) 0px,
                var(--wc-photic) calc(var(--descent) * .40),
                var(--wc-mid)    calc(var(--descent) * .74),
                var(--wc-lower)  var(--descent),
                var(--wc-dark)   100%); }
.d-dark     { background: linear-gradient(180deg, var(--wc-dark)    0%, var(--wc-d2)     100%); }
.d-d2       { background: linear-gradient(180deg, var(--wc-d2)      0%, var(--wc-d3)     100%); }
.d-d3       { background: linear-gradient(180deg, var(--wc-d3)      0%, var(--wc-deeper) 100%); }
.d-deeper   { background: linear-gradient(180deg, var(--wc-deeper)  0%, var(--wc-night)  100%); }
.d-night    { background: linear-gradient(180deg, var(--wc-night)   0%, var(--wc-abyss)  100%); }

/* Kept so existing markup keeps working; the water column now supplies the
   alternation that this class used to provide. */
.section-alt { background: none; }
.section-head { max-width: 62ch; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head h2 { margin-bottom: 16px; }

/* two columns of prose */
.duo {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
}
.duo-item { border-inline-start: 2px solid var(--line-strong); padding-inline-start: 22px; }
.duo-item h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); margin-bottom: 12px; }
.pull {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: 1.08rem; line-height: 1.6; color: var(--ink);
}
html[lang="ar"] .pull { font-style: normal; font-weight: 400; line-height: 1.9; }

/* numbered list of gaps */
.points { border-top: 1px solid var(--line); }
.point {
  display: grid; grid-template-columns: auto 1fr; gap: 20px;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.point .n {
  font-family: var(--mono); font-size: .78rem; color: var(--accent);
  padding-top: 4px; min-width: 2.2ch;
}
.point p { color: var(--ink-soft); max-width: 70ch; }
html[lang="ar"] .point p { line-height: 2; }

/* three commitments */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* Panels are translucent white so they pick up whatever depth they sit at,
   rather than punching a paper-coloured hole in the water. */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-solid); }
.card .mark { width: 26px; height: 26px; color: var(--accent); margin-bottom: 16px; }
.card h3 { margin-bottom: 10px; }
.card p { color: var(--ink-soft); font-size: .96rem; }
html[lang="ar"] .card p { line-height: 1.95; }

/* audience chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); border-radius: 100px;
  padding: 8px 16px; font-size: .88rem; color: var(--ink-soft);
  background: var(--panel);
  transition: border-color .2s ease, color .2s ease;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

/* partnership list */
.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 28px 0 32px; }
.form-item {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px; font-size: .92rem; color: var(--ink-soft);
  background: var(--panel);
}

/* ---------------------------------------------------------------------
   7  ARTICLE CARDS
   Calm by construction: paper, one hairline, no image overlays or shadows.
   --------------------------------------------------------------------- */
.articles { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 22px; }

.article-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-solid); }

/* A quiet tinted band instead of stock photography. */
.article-card .thumb {
  height: 128px;
  background: rgba(255, 255, 255, .10);
  border-bottom: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.article-card .thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.article-card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }

.article-card .kicker {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
html[lang="ar"] .article-card .kicker {
  font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: .8rem;
}
.article-card h3 { font-size: 1.18rem; line-height: 1.32; margin-bottom: 10px; }
html[lang="ar"] .article-card h3 { line-height: 1.6; }
.article-card h3 a { color: inherit; text-decoration: none; }
.article-card h3 a::after { content: ""; position: absolute; inset: 0; }
.article-card p { font-size: .93rem; color: var(--ink-soft); margin-bottom: 18px; }
html[lang="ar"] .article-card p { line-height: 1.95; }
.article-card .meta {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: .72rem; color: var(--ink-faint);
  unicode-bidi: isolate;
}
html[lang="ar"] .article-card .meta { font-family: var(--sans); font-size: .8rem; }
.article-card .go { color: var(--accent); font-family: var(--sans); font-size: .85rem; }

/* ---------------------------------------------------------------------
   8  ARTICLE PAGE
   One column, one measure, nothing in the margins.
   --------------------------------------------------------------------- */
.progress {
  position: fixed; top: var(--header-h); inset-inline-start: 0;
  height: 2px; width: 0;
  background: var(--accent);
  z-index: 99;
  transition: width .08s linear;
}

.article-head { padding-block: clamp(40px, 6vw, 68px) 0; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .88rem; color: var(--ink-soft); text-decoration: none;
  margin-bottom: 32px;
}
.back-link:hover { color: var(--accent); }

.article-title { margin-bottom: 18px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  padding-bottom: 26px; margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .78rem; color: var(--ink-faint);
  unicode-bidi: isolate;
}
html[lang="ar"] .article-meta { font-family: var(--sans); font-size: .88rem; }

/* The reading column. Larger type, looser leading, generous paragraph gap. */
.article-body {
  font-size: 1.09rem;
  line-height: 1.78;
  color: #24424F;
}
html[lang="ar"] .article-body { font-size: 1.14rem; line-height: 2.15; }
.article-body > * + * { margin-top: 1.35em; }
.article-body h2 {
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  margin-top: 2.2em; color: var(--wc-mid);
}
.article-body h3 { margin-top: 1.8em; }
.article-body a { color: var(--accent); text-underline-offset: 3px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body em { font-style: italic; }
html[lang="ar"] .article-body em { font-style: normal; color: var(--wc-mid); }

.article-body ul { list-style: none; padding-inline-start: 0; }
.article-body li { position: relative; padding-inline-start: 22px; }
.article-body li + li { margin-top: .6em; }
.article-body li::before {
  content: ""; position: absolute;
  inset-inline-start: 4px; top: .72em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

.article-body figure { margin-block: 2em; }
.article-body figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.article-body figcaption {
  margin-top: 10px; font-size: .82rem; color: var(--ink-faint);
  text-align: center; line-height: 1.55;
}

.article-body blockquote {
  border-inline-start: 2px solid var(--accent);
  padding-inline-start: 20px;
  font-family: var(--serif); font-style: italic;
  color: var(--wc-mid);
}
html[lang="ar"] .article-body blockquote { font-style: normal; }

/* A quiet callout for the key figure of the piece. */
.keynote {
  background: rgba(255, 255, 255, .45);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-block: 2em;
}
.keynote .k-label {
  font-family: var(--mono); font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
html[lang="ar"] .keynote .k-label {
  font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: .8rem;
}
.keynote p { font-size: 1rem; color: var(--ink); }

.refs { margin-top: 3.4em; padding-top: 26px; border-top: 1px solid var(--line); }
.refs h2 {
  font-family: var(--mono); font-size: .74rem;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 16px;
}
html[lang="ar"] .refs h2 {
  font-family: var(--sans); letter-spacing: 0; text-transform: none; font-size: .9rem;
}
.refs p { font-size: .84rem; line-height: 1.6; color: var(--ink-faint); }
.refs p + p { margin-top: 10px; }

.article-foot { padding-block: clamp(40px, 6vw, 64px); }

/* --- The article page -----------------------------------------------------
   Deliberately NOT a descent. A gradient running dark would force the body
   text to change colour partway through a long read, which is exactly what
   made the earlier build unreadable. Instead the page stays in the surface
   band: sky at the top easing to shallow water at the foot, one ink
   throughout, 14.3:1 at the top and 12.1:1 at the bottom.                   */
body.reading {
  background: linear-gradient(180deg,
    var(--wc-sky)      0%,
    #D9ECF3           45%,
    #C6E2EA          100%) no-repeat;
  background-attachment: fixed;
}
body.reading .article-body { color: #0A2E3E; }

/* ---------------------------------------------------------------------
   9  CONTACT
   --------------------------------------------------------------------- */
.contact-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 44px);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { position: relative; margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-size: .84rem; font-weight: 500; color: var(--ink-soft);
}
.field input, .field textarea {
  width: 100%; display: block;
  font-family: var(--sans); font-size: .98rem; line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 255, 255, .10);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover, .field textarea:hover { border-color: var(--accent); }
.field input:focus, .field textarea:focus {
  outline: none; background: rgba(255, 255, 255, .17);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95, 224, 186, .20);
}
.field input.invalid, .field textarea.invalid { border-color: #F0938C; }
.field .err { display: block; min-height: 1.1em; margin-top: 5px; font-size: .8rem; color: #F0938C; }

.counter {
  position: absolute; inset-inline-end: 12px; bottom: 30px;
  font-family: var(--mono); font-size: .7rem; color: var(--ink-faint);
  pointer-events: none; unicode-bidi: isolate;
}
.counter.near { color: var(--amber); }

.form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-top: 6px;
}
.form-note { font-size: .84rem; color: var(--ink-faint); max-width: 44ch; }

.send-spin {
  display: none; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.sending .send-spin { display: block; }
.btn.sending .arw { display: none; }

.form-status {
  margin-top: 16px; font-size: .92rem; line-height: 1.6;
  max-height: 0; overflow: hidden; padding: 0;
  transition: max-height .3s ease, padding .3s ease;
}
.form-status.ok, .form-status.warn, .form-status.bad {
  max-height: 10em; padding: 13px 16px; border-radius: var(--radius);
}
.form-status.ok   { background: rgba(95, 224, 186, .13); border: 1px solid rgba(95, 224, 186, .42); color: #8DEBCC; }
.form-status.warn { background: rgba(226, 169, 76, .13);  border: 1px solid rgba(226, 169, 76, .45); color: #EBC178; }
.form-status.bad  { background: rgba(240, 147, 140, .13); border: 1px solid rgba(240, 147, 140, .42); color: #F0938C; }

.copy-btn {
  margin-top: 12px;
  font-family: var(--sans); font-size: .86rem;
  background: transparent; color: var(--accent);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 9px 16px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); }
.copy-btn[hidden] { display: none; }

/* Off-canvas honeypot: people never reach it, bots fill it. */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* --- Direct contacts ------------------------------------------------------
   Sits below the form in the contact section, which is deep water, so it
   inherits the deep-zone ink automatically. */
.direct {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: clamp(22px, 3.4vw, 32px);
}
.direct-title {
  font-family: var(--serif);
  font-size: 1.12rem; font-weight: 600;
  color: var(--ink);
  margin-bottom: 18px;
}

.people { list-style: none; margin: 0 0 22px; padding: 0; }
.person {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 4px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.person:last-child { border-bottom: 1px solid var(--line); }
.p-name {
  font-weight: 500; color: var(--ink);
  min-width: 11rem;
}
.p-mail {
  color: var(--accent);
  font-size: .94rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
  /* Addresses stay left-to-right even in the Arabic layout. */
  direction: ltr; unicode-bidi: isolate;
}
.p-mail:hover { border-bottom-color: currentColor; }

.wa {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .94rem; font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.wa svg { width: 19px; height: 19px; flex: 0 0 auto; color: var(--accent); }
.wa:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,255,255,.05); }
.wa:hover svg { color: inherit; }

.direct-note {
  margin-top: 16px;
  font-size: .86rem; line-height: 1.65;
  color: var(--ink-faint);
  max-width: 52ch;
}

@media (max-width: 560px) {
  .person { flex-direction: column; gap: 3px; }
  .p-name { min-width: 0; }
  .wa { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------------
   10  FOOTER
   --------------------------------------------------------------------- */
.site-footer {
  background: var(--wc-abyss);
  color: #A9C9D6;
  padding-block: clamp(48px, 7vw, 76px) 36px;
  margin-top: auto;
}
.footer-top {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  padding-bottom: 32px; border-bottom: 1px solid rgba(233, 245, 248, .16);
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand img { width: 30px; height: 30px; }
.footer-brand .brand-name .a { color: var(--indigo-lt); }
.footer-brand .brand-name .b { color: var(--emerald-lt); }
.footer-top p { font-size: .93rem; max-width: 46ch; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: #A9C9D6; text-decoration: none; font-size: .92rem; width: fit-content; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  padding-top: 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .82rem; color: rgba(169, 201, 214, .72);
}

/* ---------------------------------------------------------------------
   11  RTL
   The layout uses logical properties throughout, so this block only holds
   the few genuinely directional things.
   --------------------------------------------------------------------- */
html[dir="rtl"] .hero h1 { max-width: 22ch; }
html[dir="rtl"] .back-link .arw { transform: scaleX(-1); }
html[dir="rtl"] .eyebrow::after { max-width: 120px; }

/* Language blocks: only the active one is in the document flow. */
[data-lang-block] { display: none; }
[data-lang-block].is-active { display: block; }

/* ---------------------------------------------------------------------
   12  RESPONSIVE + REDUCED MOTION
   --------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .cards3 { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-flex; }

  /* The dropdown: same list, revealed under the header. */
  .nav {
    position: absolute;
    top: var(--header-h); inset-inline: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 18px;
    background: rgba(228, 241, 250, .97);
    color: var(--wc-abyss);
    border-bottom: 1px solid rgba(4, 34, 48, .16);
    box-shadow: 0 12px 24px -18px rgba(4, 22, 42, .55);

    /* Collapsed by default. Animating max-height keeps the page from
       jumping and needs no JS measurement. */
    max-height: 0; overflow: hidden;
    opacity: 0; visibility: hidden;
    transition: max-height .28s ease, opacity .2s ease, visibility .28s;
  }
  .nav.is-open { max-height: 70vh; opacity: 1; visibility: visible; overflow-y: auto; }
  .nav a {
    padding: 13px 4px; font-size: 1rem;
    border-bottom: 1px solid rgba(4, 34, 48, .14);
    border-radius: 0; opacity: 1;
  }
  /* The panel is always light, so it keeps dark links even when the header
     behind it has gone deep. */
  .site-header.is-deep .nav { color: var(--wc-abyss); }
  .nav a:last-child { border-bottom: 0; }
  .nav a:hover { background: transparent; opacity: 1; }

  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-foot { flex-direction: column; align-items: stretch; }
  .form-foot .btn { justify-content: center; }
}

@media (max-width: 520px) {
  .brand-name { font-size: .94rem; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

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

@media print {
  .site-header, .site-footer, .progress, .back-link, .article-foot { display: none; }
  body, .article-page, .section { background: #fff !important; }
  .article-body { font-size: 11pt; color: #000; }
}
