/* =============================================================
   Nasser Al Badi — Portfolio
   Design system taken from the Al Badi Investment Group identity: the deep
   green of the group's Arabic wordmark, with its orange as the accent.
   Fully responsive, RTL-first, dark mode.

   The --navy-* token NAMES are kept even though the ramp is now green: they are
   referenced ~40 times across style.css and drive.css, and renaming them buys
   nothing while risking a missed reference. Read them as "the brand ramp,
   darkest to lightest".
   ============================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette — Al Badi Investment Group green + orange */
  --navy-900: #0d3319;   /* deepest green */
  --navy-800: #124223;
  --navy-700: #17552c;   /* header base — the wordmark green */
  --navy-600: #1d6835;
  --steel:    #1c7038;   /* interactive green: 4.8:1 on white */
  --gold:     #d2730c;   /* Al Badi orange — fills, badges, rules (3.4:1 on white) */
  --gold-ink: #b35f00;   /* the same orange darkened for TEXT: 4.6:1 on white */
  --gold-soft:#f0a94e;

  /* Light theme surfaces */
  --bg:        #ffffff;
  --bg-alt:    #f2f6f2;   /* faint green-grey */
  --surface:   #ffffff;
  --surface-2: #f6faf6;
  --border:    #e0e8e1;
  --text:      #1f2a22;
  --text-soft: #47554a;
  --muted:     #74857a;
  --shadow:    0 1px 2px rgba(13,51,25,.06), 0 8px 24px rgba(13,51,25,.09);
  --shadow-lg: 0 18px 48px rgba(13,51,25,.17);

  /* Semantic */
  --header-bg: var(--navy-700);
  --accent:    var(--steel);
  /* opaque, not a wash: the old translucent ring measured 1.5:1 against the
     surface it painted on, so the focus indicator was barely visible */
  --ring:      #1c7038;

  --radius:   16px;
  --radius-sm: 10px;
  --maxw:     1160px;
  --nav-h:    68px;

  --ff-ar: "Tajawal", "Segoe UI", system-ui, sans-serif;
  --ff-en: "Poppins", "Segoe UI", system-ui, sans-serif;
  --ff: var(--ff-ar);
}

html[data-theme="dark"] {
  --bg:        #101a13;
  --bg-alt:    #14211a;
  --surface:   #17261c;
  --surface-2: #1c2e22;
  --border:    #2a4232;
  --text:      #e9f1ea;
  --text-soft: #b7c8bb;
  --muted:     #8ba191;
  --header-bg: #14211a;
  --accent:    #5cc482;   /* 7.4:1 on the dark surface */
  --gold:      #f0a94e;
  --gold-ink:  #f0a94e;  /* already 7.9:1 on the dark surface */
  --ring:      #5cc482;
  --shadow:    0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.5);
}

html[lang="en"] { --ff: var(--ff-en); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  transition: background .35s ease, color .35s ease;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }
.section { padding: 76px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head .eyebrow {
  display: inline-block; color: var(--accent); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; color: var(--text); }
.section-head p { color: var(--muted); max-width: 620px; margin: 14px auto 0; }
.section-head .rule { width: 64px; height: 4px; border-radius: 4px; background: linear-gradient(90deg,var(--accent),var(--gold)); margin: 16px auto 0; }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s, box-shadow .3s;
}
.nav.scrolled { box-shadow: var(--shadow); }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .01em; }
.brand .mono {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .95rem;
  background: linear-gradient(145deg, var(--navy-600), var(--navy-900));
  box-shadow: 0 6px 16px rgba(37,51,64,.28);
}
.brand .btxt { line-height: 1.15; }
.brand .btxt small { display: block; font-weight: 600; font-size: .68rem; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: .93rem; color: var(--text-soft);
  position: relative; transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); }
.nav-links a.active::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 2px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center;
  color: var(--text-soft); border: 1px solid var(--border); background: var(--surface);
  transition: .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
/* .icon-btn is a single-column grid, so an icon + a label would stack into two
   rows (and `gap` would become vertical). The language button is the only
   icon-btn with a label, so it switches to a row. */
.lang-btn {
  width: auto; padding-inline: 14px; gap: 7px;
  display: flex; flex-direction: row; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem; line-height: 1; white-space: nowrap;
}
.lang-btn svg { flex: none; }
/* Poppins carries no Arabic glyph, so the "ع" label needs the Arabic face or it
   falls back to whatever the system offers and sits off the baseline. */
.lang-btn [lang="ar"] { font-family: var(--ff-ar); font-size: 1.05rem; }

.burger { display: none; }

/* Mobile drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15,22,29,.5); opacity: 0; visibility: hidden; transition: .3s; z-index: 70; }
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; inset-inline-end: 0; height: 100%; width: min(320px, 84vw);
  background: var(--bg); z-index: 80; padding: 22px; transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 6px;
  /* visibility, not just transform: a transform-only hide left the close button
     and all twelve links focusable and in the accessibility tree while the
     drawer was closed — thirteen Tab stops on nothing, at every desktop width
     where the burger itself is display:none. */
  visibility: hidden;
  /* Twelve links plus a group heading run past the bottom of a short phone
     screen, and the last few destinations were simply unreachable. */
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.drawer.open { visibility: visible; }
/* Keep the close button reachable once the list scrolls. */
.drawer .drawer-top { position: sticky; top: 0; z-index: 1; background: var(--bg); }
/* visibility does not transition usefully, so honour a reduced-motion request
   by dropping the slide rather than the appearance. */
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
/* RTL: drawer sits on the left (inline-end), so hide it to the left; LTR: hide to the right */
html[dir="ltr"] .drawer { transform: translateX(100%); }
.drawer.open { transform: translateX(0) !important; }
.drawer .drawer-top { display: flex; justify-content: space-between; align-items: center;
                      margin-bottom: 14px; padding-block: 4px; flex: none; }
.drawer a { padding: 13px 14px; border-radius: 11px; font-weight: 700; color: var(--text-soft); display: flex; align-items: center; gap: 12px; }
.drawer a:hover, .drawer a.active { background: var(--surface-2); color: var(--accent); }
.drawer a svg { width: 20px; height: 20px; opacity: .8; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; padding: 60px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 520px at 85% -10%, color-mix(in srgb, var(--steel) 20%, transparent), transparent 60%),
    radial-gradient(900px 480px at 0% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--accent);
  font-weight: 700; font-size: .82rem; box-shadow: var(--shadow); margin-bottom: 20px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #35c07f; box-shadow: 0 0 0 4px rgba(53,192,127,.18); }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.hero h1 .accent { color: var(--accent); }
.hero .role { font-size: clamp(1.05rem, 2.4vw, 1.35rem); font-weight: 700; color: var(--gold); margin-top: 12px; }
.hero .lead { color: var(--text-soft); font-size: 1.06rem; margin-top: 18px; max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 13px 24px; border-radius: 12px;
  font-weight: 700; font-size: .96rem; transition: .2s; border: 1px solid transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: linear-gradient(145deg, var(--navy-600), var(--navy-900)); color: #fff; box-shadow: 0 10px 24px rgba(37,51,64,.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(37,51,64,.36); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* Hero portrait */
.hero-portrait { position: relative; justify-self: center; }
.portrait-ring {
  width: min(340px, 74vw); aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-600), var(--navy-900));
  padding: 12px; box-shadow: var(--shadow-lg); position: relative;
}
.portrait-ring::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--gold) 55%, transparent); animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.portrait-inner { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--bg-alt); position: relative; z-index: 0; }
.portrait-inner img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.portrait-inner .placeholder { position: absolute; inset: 0; z-index: 0; display: grid; place-items: center; color: var(--navy-600); }
.portrait-inner .placeholder svg { width: 55%; height: 55%; opacity: .55; }
html[data-theme="dark"] .portrait-inner .placeholder { color: var(--steel); }

.float-chip, .hero-fig {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  box-sizing: border-box;
}
.float-chip .fi, .hero-fig .fi {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.float-chip .fi svg, .hero-fig .fi svg { width: 18px; height: 18px; }

/* The number is the point of the badge, so it carries the brand green at full
   strength (8.9:1) and the label sits below it in the body tone (7.9:1). Both
   used to inherit one muted grey at 3.9:1 — the number whispered while the icon
   shouted, and the label failed WCAG AA outright. */
.float-chip .fx, .hero-fig .fx {
  min-inline-size: 0; display: flex; flex-direction: column; align-items: flex-start;
}
.float-chip b, .hero-fig b {
  font-size: 1.06rem; font-weight: 800; line-height: 1.15;
  color: var(--navy-700); font-variant-numeric: tabular-nums;
  /* Keeps digit order correct without flipping the box to LTR, which pushed the
     number to the opposite edge from its own Arabic label. */
  unicode-bidi: plaintext; text-align: start;
}
.float-chip .fx > span, .hero-fig .fx > span {
  font-size: .75rem; line-height: 1.35; color: var(--text-soft); text-align: start;
}

/* --- his figures: the primary row of the stats band --- */
.hero-figs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;                     /* the same on both axes; it was 34/14 */
}
.hero-fig {
  position: relative;
  /* A white card on a near-white band, separated by a 2.5% hairline, did not
     read as an object at all. Tinted surface + a real shadow fixes that. */
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(23,85,44,.10), 0 8px 24px rgba(23,85,44,.06);
  min-block-size: 96px; padding: 18px 20px;
  /* Content was jammed against one edge, leaving 23–61% of each card empty and
     the four content blocks ragged. Centred, they fill the box. */
  justify-content: center;
  transition: border-color .22s, box-shadow .22s, transform .22s;
}
.hero-fig:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(23,85,44,.12), 0 16px 36px rgba(23,85,44,.10); }
/* Near the scale of the numbers below, so his figures are not the quiet ones. */
.hero-fig b { font-size: 1.9rem; line-height: 1.05; }
.hero-fig .fx > span { font-size: .84rem; }
.hero-fig .fi { width: 42px; height: 42px; border-radius: 12px; }
.hero-fig .fi svg { width: 22px; height: 22px; }

/* The headline figure: two signals, not four — a tinted fill and the orange
   number. The previous version added a full orange border AND a bar that was
   absolutely positioned 6px OUTSIDE the card, where it read as a stray element. */
.hero-fig.is-lead {
  background: color-mix(in srgb, var(--gold) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--gold) 34%, var(--border));
}
.hero-fig.is-lead .fi { background: color-mix(in srgb, var(--gold) 17%, transparent); color: var(--gold-ink); }
.hero-fig.is-lead b { color: var(--gold-ink); }

/* --- the CV figures: a quieter second line in the same band --- */
/* `.stat .num` is declared further down this file with the same specificity, so
   it won this on source order and the CV figures rendered LARGER than his. One
   more class settles it. */
.stats-grid-sub { margin-top: 26px; }
.stats-grid-sub .stat .num { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
.stats-grid-sub .stat .lbl { font-size: .78rem; }

@media (max-width: 1000px) { .hero-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .hero-figs { grid-template-columns: 1fr; } .hero-fig { min-block-size: 78px; } }

@keyframes floaty { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-10px); } }

/* ============================================================
   STATS
   ============================================================ */
/* The counters need air above them: they used to sit hard against the hero's
   call-to-action buttons. */
.stats { background: var(--bg-alt); border-block: 1px solid var(--border);
         padding-block: 46px 44px; }
@media (max-width: 700px) { .stats { padding-block: 32px 30px; } }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; }
.stat { text-align: center; padding: 26px 14px; }
.stat .num { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; color: var(--accent); font-family: var(--ff-en); line-height: 1; }
.stat .num .suffix { color: var(--gold); }
.stat .lbl { margin-top: 10px; color: var(--text-soft); font-weight: 600; font-size: .95rem; }

/* ============================================================
   CARDS / GRIDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.about-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 32px; align-items: start; }
/* .is-single is kept for the case where there is genuinely one card to show. */
.about-grid.is-single { grid-template-columns: 1fr; max-inline-size: 52rem; margin-inline: auto; }

.card-title { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 800; margin-bottom: 18px; }
.card-title .ci { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, var(--navy-600), var(--navy-900)); color: #fff; }
.card-title .ci svg { width: 22px; height: 22px; }

/* Profile facts list */
.facts { display: grid; gap: 4px; }
.fact { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-bottom: 1px dashed var(--border); }
.fact:last-child { border-bottom: none; }
.fact .fi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); }
.fact .fi svg { width: 19px; height: 19px; }
.fact .fx small { display: block; color: var(--muted); font-size: .78rem; }
.fact .fx b { font-weight: 700; font-size: .98rem; }

/* Language bars */
.lang-row { margin-bottom: 18px; }
.lang-row:last-child { margin-bottom: 0; }
.lang-row .top { display: flex; justify-content: space-between; margin-bottom: 7px; font-weight: 700; }
.lang-row .top span:last-child { color: var(--muted); font-weight: 600; font-size: .85rem; }
/* The .bar percentage meter is deliberately gone. Skills and languages state a
   level in words ("إتقان تام", "اللغة الأم"); a bar filled to 85% asserts a
   measurement that was never taken and reads as filler. */

/* ============================================================
   TIMELINE (experience + education)
   ============================================================ */
.timeline { position: relative; padding-inline-start: 34px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 9px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--border), transparent); }
.tl-item { position: relative; margin-bottom: 26px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot { position: absolute; inset-inline-start: -34px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); display: grid; place-items: center; }
.tl-dot.current { border-color: var(--gold); box-shadow: 0 0 0 5px color-mix(in srgb, var(--gold) 22%, transparent); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.tl-head h3 { font-size: 1.16rem; font-weight: 800; }
.tl-period { font-size: .82rem; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.tl-period.current { color: var(--gold-ink); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.tl-org { color: var(--gold-ink); font-weight: 700; margin-top: 3px; }
.tl-intro { color: var(--text-soft); margin-top: 10px; }
.tl-points { margin-top: 12px; display: grid; gap: 8px; }
.tl-points li { position: relative; padding-inline-start: 22px; color: var(--text-soft); font-size: .96rem; }
.tl-points li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 11px; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.tl-note { margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft); font-size: .93rem; }

/* ============================================================
   SKILLS
   ============================================================ */
.skill-card .card-title .ci { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.skill { margin-bottom: 16px; }
.skill:last-child { margin-bottom: 0; }
.skill .top { display: flex; justify-content: space-between; font-weight: 600; font-size: .93rem; margin-bottom: 6px; }
.skill .top .pv { color: var(--muted); font-family: var(--ff-en); font-size: .82rem; }

/* Training chips */
.chip-list { display: flex; flex-wrap: wrap; gap: 12px; }
.chip {
  display: flex; align-items: center; gap: 11px; padding: 13px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600;
  transition: .2s;
}
.chip:hover { border-color: var(--accent); transform: translateY(-2px); }
.chip .ci { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold-ink); flex: none; }
.chip .ci svg { width: 17px; height: 17px; }

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub { display: flex; gap: 16px; align-items: flex-start; }
.pub .pn { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; font-family: var(--ff-en); font-weight: 800; color: #fff; background: linear-gradient(145deg, var(--navy-600), var(--navy-900)); }
.pub h3 { font-size: 1.02rem; font-weight: 700; line-height: 1.5; }
.pub .tag { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--accent); font-weight: 700; }
.pub .tag svg { width: 14px; height: 14px; }

/* ============================================================
   COMMUNITY
   ============================================================ */
.comm-card { text-align: center; }
.comm-card .ci { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--navy-600), var(--navy-900)); }
.comm-card .ci svg { width: 30px; height: 30px; }
.comm-card h3 { font-size: 1.12rem; font-weight: 800; }
.comm-card .org { color: var(--gold-ink); font-weight: 700; margin: 4px 0 12px; }
.comm-card p { color: var(--text-soft); font-size: .95rem; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.contact-card { display: flex; align-items: center; gap: 16px; }
.contact-card .ci { width: 54px; height: 54px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--navy-600), var(--navy-900)); }
.contact-card .ci svg { width: 26px; height: 26px; }
.contact-card small { color: var(--muted); font-size: .8rem; display: block; }
.contact-card b { font-size: 1.02rem; font-weight: 700; word-break: break-word; }
.contact-card b[dir] { unicode-bidi: plaintext; }

.cta-band {
  margin-top: 40px; border-radius: var(--radius); padding: 40px; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  position: relative; overflow: hidden;
}
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(500px 240px at 80% -20%, rgba(200,162,76,.35), transparent 60%); }
.cta-band h3 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 800; position: relative; }
.cta-band p { color: rgba(255,255,255,.82); margin: 10px auto 22px; max-width: 520px; position: relative; }
.cta-band .btn-primary { background: #fff; color: var(--navy-900); position: relative; }
.cta-band .btn-primary:hover { background: var(--gold-soft); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--navy-900); color: rgba(255,255,255,.75); padding: 44px 0 30px; margin-top: 20px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: center; }
.footer .brand .btxt { color: #fff; }
.footer .brand .btxt small { color: rgba(255,255,255,.6); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: rgba(255,255,255,.72); font-weight: 600; font-size: .92rem; }
.footer-links a:hover { color: var(--gold-soft); }
.footer-bottom { margin-top: 26px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); text-align: center; font-size: .85rem; color: rgba(255,255,255,.55); }

/* ============================================================
   ROUTING / PAGE TRANSITIONS
   ============================================================ */
.page { display: none; animation: fade .45s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Reveal on scroll */
/* Visible by DEFAULT. The hidden-then-animate state is scoped to
   html.can-reveal, which main.js adds only when it has an IntersectionObserver
   to drive it and removes again on any error or if the observer stalls. A
   missing or broken animation must never be able to blank the page — it did:
   #journey rendered as a white page with only the navbar on some Android
   browsers while desktop was fine. */
.reveal { opacity: 1; transform: none; }
html.can-reveal .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
html.can-reveal .reveal.in { opacity: 1; transform: none; }
/* Someone who has asked for less motion gets the content, not the slide. */
@media (prefers-reduced-motion: reduce) {
  html.can-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

/* Scroll-to-top */
.to-top { position: fixed; inset-inline-end: 22px; bottom: 22px; z-index: 50; opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* The header carries far more than the reading column does: brand + 10 links +
   3 action buttons. Measured need is ~1250px in English and ~1215px in Arabic,
   both wider than --maxw (1160px), so the nav gets its own wider track and
   slightly tighter links; below that it hands over to the drawer. */
.nav .container { max-width: 1360px; }
.nav-links a { padding: 8px 11px; font-size: .9rem; }

@media (max-width: 1300px) {
  .nav-links { display: none; }
  .burger { display: grid; }
}
/* …and the brand must hold one line instead of collapsing into a column
   when those extra links tighten the header. */
.nav .brand { flex: none; }
.nav .brand .btxt { white-space: nowrap; }
.nav .brand .btxt small {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 26ch;
}
@media (max-width: 1420px) {
  .nav .brand .btxt small { display: none; }
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 34px; }
  .hero .lead { margin-inline: auto; }
  .hero-cta { justify-content: center; }
  .about-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .burger { display: grid; }
  .section { padding: 56px 0; }
  .grid-2, .grid-3, .contact-grid { grid-template-columns: 1fr; }
  .hero-figs { margin-top: 24px; }
  .cta-band { padding: 30px 22px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .brand .btxt small { display: none; }
}

/* Print */
@media print {
  .nav, .to-top, .hero-cta, .drawer, .drawer-backdrop, .cta-band { display: none !important; }
  .page { display: block !important; }
  body { color: #000; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
