:root {
  --bg: #0a0a0c;
  --surface: rgba(21, 21, 26, 0.78);
  --surface-solid: #15151a;
  --line: #24242c;
  --text: #f4f4f5;
  /* Running text (lead, story, bullets): near-white so it reads as text, not a caption */
  --body: #d4d4d8;
  --muted: #a1a1aa;
  --dim: #8a8a93;
  --accent: #e5383b;
  /* slightly deeper red behind white text so labels pass 4.5:1 */
  --accent-fill: #d62f32;
  --accent-fill-hover: #e5383b;
  --accent-2: #ff6b6b;
  --accent-soft: rgba(229, 56, 59, 0.14);
  --radius: 16px;
  /* Dark-mode depth: a faint top-edge highlight instead of glows */
  --edge: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  /* Thmanyah, each family in the role its guide gives it (fonts.css):
     Serif Display for headings, Serif Text for reading text, Sans for interface text */
  --font-display: "Thmanyah Serif Display", "Thmanyah Serif Text", Georgia, serif;
  --font-text: "Thmanyah Serif Text", Georgia, serif;
  --font-body: "Thmanyah Sans", system-ui, sans-serif;
  /* Motion tokens: durations 150/200/300ms, ease-out on enter */
  --motion-150: 150ms;
  --motion-200: 200ms;
  --motion-300: 300ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

/* Show only the active language */
html[lang="en"] .ar,
html[lang="ar"] .en { display: none !important; }

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.2; }

/* Background: faint grid fixed behind the content, fading out toward the bottom of the screen (owner-approved) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  pointer-events: none;
}

/* Red light that follows the mouse (enabled by main.js on mouse devices) */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 900px;
  height: 900px;
  margin: -450px 0 0 -450px;
  border-radius: 50%;
  /* long, gentle falloff so the light has no visible edge */
  background: radial-gradient(closest-side, rgba(229, 56, 59, 0.2), rgba(229, 56, 59, 0.1) 30%, rgba(229, 56, 59, 0.04) 60%, rgba(229, 56, 59, 0.01) 85%, transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-300) var(--ease-out);
  will-change: transform;
}
.cursor-glow.is-on { opacity: 1; }

img { max-width: 100%; display: block; }

/* Browser surfaces in the site's palette */
::selection { background: rgba(229, 56, 59, 0.45); color: #fff; }
html { scrollbar-color: #3a3a44 var(--bg); accent-color: var(--accent); caret-color: var(--accent-2); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3a3a44; border: 3px solid var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a56; }
a { text-underline-offset: 0.2em; }

/* Reading text (paragraphs and bullet points) */
.hero__lead, .about__body, .job__points, .empty p { font-family: var(--font-text); }
/* Avoid a lone word on the last line where browsers support it */
p, li { text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--accent-2); }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -64px;
  background: var(--accent-fill);
  color: #fff;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  z-index: 100;
}
.skip:focus { top: 12px; }

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

/* ---------- Nav ---------- */
/* Island navbar: a floating rounded bar that stays at the top while scrolling */
.nav {
  position: sticky;
  top: 12px;
  z-index: 50;
  margin-top: 12px;
}
.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding-inline: 24px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 17, 21, 0.94);
  box-shadow: var(--edge), 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: box-shadow var(--motion-200) ease, border-color var(--motion-200) ease;
}
.nav.is-scrolled .nav__inner { border-color: #2e2e38; box-shadow: var(--edge), 0 12px 32px rgba(0, 0, 0, 0.55); }

.logo { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex-shrink: 0; transition: opacity var(--motion-150) ease; }
.logo img { height: 38px; width: auto; }

.nav__links { display: flex; gap: 4px; margin-inline-start: auto; }
.nav__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  /* scales down on tablet widths so all seven links fit */
  padding: 0 clamp(8px, 1.2vw, 16px);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--motion-150) ease, background-color var(--motion-150) ease;
}
.nav__links a.is-active { color: var(--text); background: rgba(255,255,255,0.06); }

.nav__menu, .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--motion-150) ease, background-color var(--motion-150) ease;
}
.nav__menu { display: none; }
.nav__menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; overflow-x: clip; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: start;
}
.hero__text { padding-top: clamp(16px, 5vh, 56px); }

.hero__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 700;
}
html[lang="ar"] .hero__name { letter-spacing: 0; line-height: 1.15; }
html[lang="ar"] .hero__role { margin-top: 32px; }

.hero__role {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.9vw, 1.375rem);
  line-height: 1.4;
  font-weight: 700;
  color: var(--accent-2);
}
.hero__role i { font-style: normal; color: var(--dim); margin-inline: 8px; }
/* Keep each title on one line; the line only breaks between titles */
.hero__role b { font-weight: inherit; white-space: nowrap; }

.hero__lead { margin: 16px 0 0; max-width: 34rem; color: var(--body); font-size: 1.125rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform var(--motion-200) var(--ease-out), background-color var(--motion-150) ease, border-color var(--motion-150) ease;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary { background: var(--accent-fill); color: #fff; }
.btn--ghost { border: 1px solid var(--line); color: var(--text); }

.hero__photo {
  position: relative;
  margin: 0;
  justify-self: end;
  width: 100%;
  max-width: 460px;
  isolation: isolate;
}
html[dir="rtl"] .hero__photo { justify-self: start; }
.hero__portrait { position: relative; width: 100%; height: auto; z-index: 2; }
/* Calligraphy logo as a red watermark behind the portrait */
.hero__mark {
  position: absolute;
  z-index: 1;
  inset: -2% -4% 30%;
  background: var(--accent);
  -webkit-mask: url(assets/logo.svg) center / contain no-repeat;
  mask: url(assets/logo.svg) center / contain no-repeat;
  opacity: 0.22;
}
/* Logo orbit: a tilted ring around the portrait. Logos on the far side sit behind the
   portrait (z-index 1), the near side in front (z-index 3); main.js sets the transforms. */
.orbit { position: absolute; inset: 0; pointer-events: none; }
.orbit__logo {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: calc(var(--lw) * 0.8);
  height: auto;
  opacity: 0;
  /* soft dark halo keeps the white logos readable when they cross the white thobe */
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 2px rgba(0, 0, 0, 0.6));
  will-change: transform, opacity;
}
.photo-tag {
  position: absolute;
  z-index: 4;
  inset-inline-start: -24px;
  bottom: 22%;
}
/* The whole card is a link to the current role in Experience */
.photo-tag a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: var(--edge), 0 20px 40px rgba(0, 0, 0, 0.4);
  transition: border-color var(--motion-150) ease;
}
.photo-tag a:focus-visible { border-radius: 12px; }
.photo-tag strong { margin-bottom: 2px; color: var(--accent-2); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.photo-tag__role { color: var(--text); font-size: 1rem; font-weight: 500; line-height: 1.4; }
.photo-tag__org { color: var(--muted); font-size: 0.875rem; }
html[lang="ar"] .photo-tag strong { letter-spacing: 0; font-size: 0.875rem; }

/* ---------- Sections ---------- */
.section { padding: 96px 0; }

.section__title {
  margin: 0 0 40px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}
html[lang="ar"] .section__title { letter-spacing: 0; }

/* About */
/* The stance spans the width; the story sits under it in the second column */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 48px; }
.about__big { grid-column: 1 / -1; }
.about__body { grid-column: 2; }
.about__big {
  margin: 0;
  font-family: var(--font-display);
  max-width: 20em;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
html[lang="ar"] .about__big { letter-spacing: 0; line-height: 1.45; }
.about__body { margin: 0; max-width: 65ch; color: var(--body); }

/* Projects: empty state until the first case study is ready */
.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--edge);
}
.empty h3 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.empty p { margin: 0 0 8px; max-width: 60ch; color: var(--muted); }

html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* Experience stack: each card sticks in the same spot and the next one slides up over it
   (oldest at the bottom, Perfect Vision on top). main.js sets --cover on covered cards and
   falls back to a plain list when a card is too tall for the screen. */
.stack {
  --stack-top: 96px;
  --stack-step: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.job {
  position: sticky;
  top: calc(var(--stack-top) + var(--i) * var(--stack-step));
  padding-bottom: 32px;
}
.job:last-child { padding-bottom: 0; }
.stack.is-flat .job { position: static; }
.job__card {
  --cover: 0;
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  box-shadow: var(--edge), 0 -16px 40px -24px rgba(0, 0, 0, 0.9);
  transform-origin: 50% 0;
  transform: scale(calc(1 - var(--cover) * 0.04));
  will-change: transform;
}
/* A covered card darkens and keeps only its edge visible, like a deck (opacity only) */
.job__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #000;
  opacity: calc(var(--cover) * 0.5);
  pointer-events: none;
}
.job__card > * { opacity: calc(1 - var(--cover) * 0.85); }
.job--current .job__card { border-color: rgba(229, 56, 59, 0.45); }
.job__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 16px; }
/* Logos are sized by shape (width set per logo in the HTML) so they carry the same visual weight */
.job__logo { width: var(--lw); height: auto; flex-shrink: 0; opacity: 0.9; }

.job__meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.job__date { color: var(--dim); font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; }
/* The current role's end date is the "now" marker, in place of a separate tag */
.job__now { color: var(--accent-2); font-weight: 700; }
.job__role {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.job__org { margin: 4px 0 0; color: var(--accent-2); font-weight: 500; }
.job__points { margin: 0; max-width: 70ch; padding-inline-start: 20px; color: var(--body); }
.job__points li { margin-bottom: 8px; }
.job__points li:last-child { margin-bottom: 0; }
.job__points li::marker { color: var(--dim); }
/* Proof points: full white on the bullets, with a faint ember underline so a quick scan finds them */
.job__points strong {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(229, 56, 59, 0.55);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  text-decoration-skip-ink: none;
}

/* Skills: bulleted lists with ember markers, separated by space, no pills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--edge);
}
.skill-card h3 { margin: 0 0 16px; font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; }
.skill-list { list-style: disc; margin: 0; padding: 0; padding-inline-start: 20px; }
.skill-list li::marker { color: var(--accent); }
.skill-list li {
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--body);
}
.skill-list li:first-child { padding-top: 0; }

/* Education */
.edu {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--edge);
}
.edu__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.edu__icon img { width: 32px; height: auto; }
.edu h3 { margin: 0; font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; }
.edu__org { margin: 4px 0 0; color: var(--muted); }
.edu__date { margin: 0; color: var(--dim); font-size: 0.875rem; white-space: nowrap; }

/* Certificate reel: two rows of certificate images sliding in opposite directions.
   A row pauses only while the mouse is on one of its certificates (or keyboard focus is on
   one). Reduced motion gets still rows that scroll by hand. */
.section__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 40px; }
.section__head .section__title { margin-bottom: 0; }

.cert-reel {
  display: grid;
  gap: 24px;
  /* laid out left-to-right in both languages so each strip starts at the left edge */
  direction: ltr;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.cert-reel__row { overflow: hidden; }
.cert-reel__track {
  display: flex;
  gap: 24px;
  width: max-content;
  padding: 8px 0;
  animation: cert-reel var(--reel-duration, 70s) linear infinite;
}
.cert-reel__row--reverse .cert-reel__track { animation-direction: reverse; }
.cert-reel__track:has(.cert-reel__item:hover),
.cert-reel__track:has(.cert-reel__item:focus-visible),
.cert-reel.is-paused .cert-reel__track,
.cert-reel.is-stopped .cert-reel__track { animation-play-state: paused; }
/* one full set plus one gap, so the repeated set lands exactly where the first began */
@keyframes cert-reel { to { transform: translateX(calc(-50% - 12px)); } }
.cert-reel__item {
  flex: 0 0 auto;
  display: flex;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
  flex-direction: column;
  transition: transform var(--motion-200) var(--ease-out);
}
.cert-reel__item img { height: 200px; width: auto; }

/* Certificate preview (same tab) */
.viewer {
  width: min(1200px, 100vw - 32px);
  max-height: calc(100vh - 32px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--edge), 0 24px 64px rgba(0, 0, 0, 0.6);
}
.viewer[open] { display: flex; flex-direction: column; gap: 12px; animation: viewer-in var(--motion-200) var(--ease-out); }
.viewer::backdrop { background: rgba(5, 5, 7, 0.82); }
@keyframes viewer-in { from { opacity: 0; transform: translateY(8px); } }
.viewer__bar, .viewer__nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.viewer__caption { margin: 0; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.viewer__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 200px);
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.viewer__count { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.viewer__btn, .reel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color var(--motion-150) ease, background-color var(--motion-150) ease;
}
.viewer__btn svg, .reel-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html.viewer-open { overflow: hidden; }

/* Contact */
.contact__card {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6vw, 64px);
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--edge);
}
.contact__big {
  margin: 0 0 32px;
  max-width: 40rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}
html[lang="ar"] .contact__big { letter-spacing: 0; line-height: 1.4; }
/* Even line lengths, and the closing call never splits across lines */
.contact__big { text-wrap: balance; }
.contact__big em { white-space: nowrap; }

.socials { display: flex; flex-wrap: wrap; gap: 8px; }
/* Wide screens: the question on the reading side, the links opposite it, so the card is filled edge to edge */
@media (min-width: 1024px) {
  .contact__card { display: grid; grid-template-columns: minmax(0, 40rem) auto; justify-content: space-between; align-items: center; gap: 48px; }
  .contact__big { margin: 0; }
  .socials { display: grid; grid-template-columns: repeat(2, auto); }
  .socials a { justify-content: center; }
}
.socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10,10,12,0.4);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color var(--motion-150) ease, background-color var(--motion-150) ease;
}
/* Email is the main contact, so its capsule carries the accent */
.socials .socials__mail { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; font-weight: 700; }
.socials svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.socials svg .fill { fill: currentColor; stroke: none; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--dim); font-size: 0.875rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.footer p { margin: 0; }
.footer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; transition: color var(--motion-150) ease; }

/* Hover is an extra, only for devices that can hover */
@media (hover: hover) {
  .logo:hover { opacity: 0.85; }
  .nav__links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
  .nav__menu:hover, .lang-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
  .btn--primary:hover { background: var(--accent-fill-hover); transform: translateY(-2px); }
  .btn--ghost:hover { border-color: var(--muted); transform: translateY(-2px); }
  .socials a:hover { border-color: var(--accent); background: var(--accent-soft); }
  .photo-tag a:hover { border-color: rgba(229, 56, 59, 0.45); }
  .socials .socials__mail:hover { background: var(--accent-fill-hover); }
  .footer a:hover { color: var(--text); }
  .cert-reel__item:hover { transform: translateY(-4px); }
  .viewer__btn:hover, .reel-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .cursor-glow { display: none; }
  .cert-reel { -webkit-mask-image: none; mask-image: none; }
  .cert-reel__row { overflow-x: auto; }
  .cert-reel__track { animation: none; }
  .viewer[open] { animation: none; }
  .cert-reel__item[aria-hidden="true"] { display: none; }
  /* Covered cards still darken (opacity), but nothing scales */
  .job__card { transform: none; }
}

/* ---------- Narrow (phones, below 768px) ---------- */
@media (max-width: 767.98px) {
  .nav__menu { display: inline-flex; margin-inline-start: auto; }
  .nav__links {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-solid);
    box-shadow: var(--edge), 0 12px 32px rgba(0, 0, 0, 0.55);
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__links a { justify-content: flex-start; border-radius: 12px; padding: 0 16px; }
  .nav__inner { padding-inline: 20px 8px; gap: 8px; }
  .logo img { height: 34px; }
  .hero { padding: 40px 0 64px; }
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__photo, html[dir="rtl"] .hero__photo { justify-self: center; max-width: 380px; }
  .photo-tag { inset-inline-start: 12px; }
  .orbit__logo { width: calc(var(--lw) * 0.55); }
  .section { padding: 64px 0; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .about__body { grid-column: auto; }
  /* A statement, not a headline: 24px on phones keeps it to a short paragraph */
  .about__big { font-size: 1.5rem; }
  .empty { padding: 32px 24px; }
  .stack { --stack-top: 88px; --stack-step: 8px; }
  .job__card { padding: 20px; }
  .job__head { flex-direction: column; gap: 12px; }
  .job__logo { width: calc(var(--lw) * 0.82); }
  .skills { grid-template-columns: 1fr; }
  .cert-reel { gap: 16px; }
  .cert-reel__item img { height: 150px; }
  .viewer { padding: 12px; }
  .viewer__count { display: none; }
  .edu { grid-template-columns: auto 1fr; padding: 24px; gap: 16px; }
  .edu__date { grid-column: 1 / -1; }
  .edu__icon { width: 48px; height: 48px; }
  .footer__inner { flex-direction: column; }
}

/* ---------- Certificate titles and reel control ---------- */
.cert-reel__title {
  flex: 1 1 auto;
  width: 0;
  min-width: 100%;
  padding: 10px 12px;
  background: var(--surface-solid);
  line-height: 1.4;
}
.cert-reel__title > span { display: flex; flex-direction: column; gap: 2px; }
/* Clamp sits on the name itself, so no third line peeks into the padding */
.cert-reel__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}
.cert-reel__issuer {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.875rem;
}
html[dir="rtl"] .cert-reel__title { direction: rtl; }
.reel-toggle__play, .reel-toggle__off { display: none; }
.reel-toggle[aria-pressed="true"] .reel-toggle__pause,
.reel-toggle[aria-pressed="true"] .reel-toggle__on { display: none; }
.reel-toggle[aria-pressed="true"] .reel-toggle__play { display: block; }
.reel-toggle[aria-pressed="true"] .reel-toggle__off { display: inline; }
.reel-toggle__play path { fill: currentColor; stroke: none; }


@media (prefers-reduced-motion: reduce) {
  .reel-toggle { display: none; }
}
