/* amb92.me — static portfolio styles. No build step; fonts are self-hosted (SIL OFL, see fonts/OFL.txt). */

/* ---------- Fonts ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/inter-latin-300-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 300; font-display: swap; src: url("fonts/inter-latin-300-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/space-grotesk-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-300-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ---------- Tokens ---------- */
/* PantherIQ colours; ratios are on the intended background */
:root {
  --bg: #07070C;
  --surface: #10101A; /* cards, raised panes */
  --surface-2: #161624; /* hovered */
  --text: #EDEDF5; /* 17.3:1 on --bg */
  --text-2: #B4B4C8; /* running text: 9.9:1 */
  --muted: #9A9AB0; /* 7.3:1 on --bg, 6.9:1 on --surface */
  --dim: #80809A; /* 5.2:1 on --bg, 4.9:1 on --surface */
  --line: rgba(237, 237, 245, 0.12);
  --line-strong: rgba(237, 237, 245, 0.28);
  --blue: #2E6BFF; /* strokes, fills, large text only (4.46:1 on --bg) */
  --on-accent: #FFFFFF; /* on --blue-deep: 6.1:1 */
  --blue-text: #5C8BFF; /* small text on dark: 6.3:1 */
  --blue-deep: #1F56E0; /* hover fills; text on light: 5.3:1 */
  --purple: #8B00FF; /* glows, gradients, borders; never small text on dark */
  --purple-text: #B26BFF; /* 6.2:1 on --bg */
  --grad-angle: 90deg;
  --grad: linear-gradient(var(--grad-angle), var(--blue), var(--purple));
  --glow-blue: rgba(46, 107, 255, 0.18);
  --glow-purple: rgba(139, 0, 255, 0.14);
  --focus: #5C8BFF;
  --focus-halo: rgba(139, 0, 255, 0.30);
  /* light sections: cool off-white */
  --light-bg: #EEF0F7;
  --light-surface: #F7F8FC;
  --light-text: #0B0B14;
  --light-text-2: #3A3A50; /* 9.7:1 */
  --light-muted: #5A5C70; /* labels: 5.8:1 */
  --light-line: rgba(11, 11, 20, 0.12);
  --light-accent: #1F56E0; /* links, labels, focus: 5.3:1 */
  --font-body: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --font-head: "Space Grotesk", "IBM Plex Sans Arabic", "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Sans Arabic", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* Type scale */
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --step-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  --step-3: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem);
  --step-4: clamp(2.25rem, 1.5rem + 3.2vw, 4.5rem);
  --step-5: clamp(3rem, 2rem + 4.5vw, 5.5rem);
  /* Space */
  --space-2xs: 0.5rem; --space-xs: 0.75rem; --space-s: 1rem; --space-m: 1.5rem;
  --space-l: 2rem; --space-xl: 3rem; --space-2xl: 4rem;
  --section-pad: clamp(5rem, 3rem + 6vw, 8.5rem);
  --head-gap: clamp(2.5rem, 2rem + 2vw, 4rem);
  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease: var(--ease-out);
  --dur-s: 0.4s; --dur-m: 0.6s; --dur-l: 0.8s;
  --stagger: 60ms;
  --dir: 1;
  --rise: 24px;
  color-scheme: dark;
}
/* --grad-angle stays on html, where --grad is computed */
html[dir="rtl"] { --dir: -1; --grad-angle: 270deg; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } main { overflow-x: clip; } }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
bdi { unicode-bidi: isolate; }
html[lang="ar"] bdi:not(.wrap) { white-space: nowrap; }
[hidden] { display: none !important; }

:focus { outline: none; }
/* Ring + halo. Card hover shadows use :hover only, so focus keeps its halo */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 6px var(--focus-halo); }
.light :focus-visible { outline-color: var(--light-accent); box-shadow: 0 0 0 6px rgba(31, 86, 224, 0.25); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 200;
  background: var(--blue-deep); color: var(--on-accent); padding: 0.75rem 1rem; font-weight: 500; text-decoration: none;
}
.skip:focus { top: 1rem; }

.container { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 768px) { .container { padding-inline: 2rem; } }
@media (min-width: 1200px) { .container { padding-inline: 3rem; } }

.head { font-family: var(--font-head); }
.mono { font-family: var(--font-mono); }
.label {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.section-title {
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: var(--step-4); line-height: 1.05;
}
html[lang="ar"] .label, html[lang="ar"] .section-title, html[lang="ar"] .caps { letter-spacing: 0; text-transform: none; }
html[lang="ar"] .label { font-size: 0.875rem; } /* 14px: Arabic mono-fallback labels need the extra size */
html[lang="ar"] .section-title { line-height: 1.25; }

/* Section head: "// 0N" index + hairline, then the title row */
.section-head { margin-bottom: var(--head-gap); }
.section-head__index { display: flex; align-items: center; gap: var(--space-s); color: var(--blue-text); margin-bottom: var(--space-m); }
.section-head__index > span:first-child { flex: none; }
/* Hairline with a 6rem gradient head at the inline start */
.section-head__rule { flex: 1; height: 1px; background: var(--grad) no-repeat 0 0 / 6rem 100%, var(--line); transform-origin: left center; }
html[dir="rtl"] .section-head__rule { transform-origin: right center; background-position: 100% 0; }
.light .section-head__index { color: var(--light-accent); }
.light .section-head__rule { background: var(--grad) no-repeat 0 0 / 6rem 100%, var(--light-line); }
.section-head__label { margin-bottom: 0; }
.section-head__label > span:nth-child(2) { flex: none; }
.section-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-xs) var(--space-l); }
.mask { display: block; overflow: hidden; padding-block: 0.06em 0.1em; margin-block: -0.06em -0.1em; }
/* Masks clip vertically only, so glyph overhang at the inline end is never cut. */
@supports (overflow: clip) { .mask { overflow: visible; overflow-y: clip; } }
.mask__in { display: block; }
.slashes { display: inline-block; }

/* Grain overlay (same technique as the live site) */
.grain { position: relative; isolation: isolate; }
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}
.grain > * { position: relative; z-index: 2; }

/* Drawn underline. Anchored to the content box, so extra hit-area padding (in-text links on
   mobile) never moves it off the text. On a 44px tap box it sits on an inner label instead. */
.u-link {
  text-decoration: none; padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% + 2px) / 0 1px; background-origin: content-box;
  transition: background-size 0.4s var(--ease);
}
.u-link:is(:hover, :focus-visible), a:is(:hover, :focus-visible) > .u-link { background-size: 100% 1px; }
html[dir="rtl"] .u-link { background-position: 100% calc(100% + 2px); }

/* ---------- Nav ---------- */
.nav { position: fixed; top: 0; inset-inline: 0; z-index: 50; transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease); border-bottom: 1px solid transparent; }
.nav.is-scrolled, .nav.is-open { background: rgba(7, 7, 12, 0.94); border-bottom-color: var(--line); }
@supports (backdrop-filter: blur(8px)) { .nav.is-scrolled { backdrop-filter: blur(12px); background: rgba(7, 7, 12, 0.94); } }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; gap: 1rem; }
@media (min-width: 768px) { .nav__inner { height: 5rem; } }
.nav__logo { font-family: var(--font-head); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; text-decoration: none; transition: color 0.2s; }
.nav__logo:is(:hover, :focus-visible) { color: var(--blue-text); }
.nav__desktop { display: none; align-items: center; gap: 2rem; }
.nav__desktop ul { display: flex; gap: 2rem; }
.nav a.nav__item, .nav button.nav__item { font-size: 0.875rem; color: var(--muted); text-decoration: none; transition: color 0.2s; }
.nav a.nav__item:is(:hover, :focus-visible), .nav button.nav__item:is(:hover, :focus-visible) { color: var(--text); }
/* Active section (site.js): a gradient hairline drawn from the inline start */
.nav a.nav__item { position: relative; }
.nav a.nav__item.is-active { color: var(--text); }
.nav a.nav__item::after { content: ""; position: absolute; inset-inline: 0; bottom: -6px; height: 1px; background: var(--grad); transform: scaleX(0); transform-origin: left center; }
html[dir="rtl"] .nav a.nav__item::after { transform-origin: right center; }
.nav a.nav__item.is-active::after { transform: scaleX(1); }
.nav__mobile a.nav__item::after { bottom: -3px; inset-inline-end: auto; width: 2rem; }
/* The one Arabic word on English pages ("العربية") uses system Arabic, so no web font is fetched for it */
[data-lang-toggle][lang="ar"] { font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; }
.nav__sep { width: 1px; height: 1.25rem; background: var(--line-strong); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; text-decoration: none;
  border: 1px solid var(--line-strong); padding: 0.5rem 1rem; transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn-outline:is(:hover, :focus-visible) { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--on-accent); }
.nav__burger { display: inline-flex; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; margin-inline-end: -0.5rem; }
.nav__burger svg { width: 1.5rem; height: 1.5rem; }
.nav__burger .i-close { display: none; }
.nav.is-open .nav__burger .i-open { display: none; }
.nav.is-open .nav__burger .i-close { display: block; }
.nav__mobile { border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; }
.nav__mobile ul { display: flex; flex-direction: column; gap: 1rem; }
.nav__mobile .nav__item { font-size: 1.125rem !important; }
/* The open menu is solid: the hero must not show through the links */
.nav.is-open { background: var(--bg); }
.nav__mobile .btn-outline { white-space: nowrap; }
.nav__mobile .btn-outline svg { width: 1rem; height: 1rem; flex: none; }
.nav__mobile .nav__extra { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 1024px) {
  .nav__desktop { display: flex; }
  .nav__burger, .nav__mobile { display: none !important; }
}

/* ---------- Tap targets (mobile): 44px ----------
   Standalone links and buttons grow to a 44px box. Links inside running text keep their line
   and get a padded inline box instead (vertical padding on an inline box never moves layout). */
@media (max-width: 767.98px) {
  .nav__logo, .nav__mobile .nav__item, .nav__mobile .btn-outline, .news__link, .contact__item a, .contact__cv a { min-block-size: 44px; display: inline-flex; align-items: center; }
  .nav__mobile ul { gap: 0; }
  .nav__mobile .nav__item { display: flex; }
  .nav__mobile a.nav__item::after { bottom: 0.55rem; }
  .news__link { margin-top: 0.2rem; }
  .contact__cv a { gap: 0.5rem; }
  :is(.hero__title, .contact__intro, .career-card__company) a { padding-block: calc((46px - 1.2em) / 2); margin-block: calc((46px - 1.2em) / -2); }
}
.article-bar a, .article-bar button { min-block-size: 44px; }

/* ---------- Hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.hero__grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; align-content: center; padding-top: 6rem; padding-bottom: 2.5rem; }
@media (min-width: 768px) { .hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; padding-top: 7rem; padding-bottom: 2rem; } }
.hero__name {
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: -0.05em;
  line-height: 0.95; font-size: clamp(2.75rem, 12vw, 3.75rem); overflow-wrap: normal;
}
@media (min-width: 768px) { .hero__name { font-size: clamp(2.5rem, 7vw, 7.5rem); } }
.hero__name .line { display: block; overflow: hidden; padding-block: 0.04em 0.1em; margin-block: -0.04em -0.1em; white-space: nowrap; }
.hero__name .line__in { display: block; }
@supports (overflow: clip) { .hero__name .line { overflow: visible; overflow-y: clip; } }
html[dir="rtl"] .hero__name .line { text-align: right; }
.hero__title {
  margin-top: 1.5rem; color: var(--muted); text-transform: uppercase; font-weight: 300;
  letter-spacing: 0.14em; font-size: clamp(0.95rem, 1.4vw, 1.15rem); line-height: 1.6; max-width: 46rem;
}
.nowrap { white-space: nowrap; }
.hero__title a { color: var(--blue-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; text-decoration-color: rgba(92, 139, 255, 0.45); transition: text-decoration-color 0.2s; }
.hero__title a:is(:hover, :focus-visible) { text-decoration-color: currentColor; }
.hero__role, .hero__when { display: block; }
.hero__sep { display: none; }
.hero__when { white-space: nowrap; margin-top: 0.15em; }
/* "Riyadh · Mar 2026 – Present" is ~290px at 390; only very narrow screens may wrap it */
@media (max-width: 359.98px) { .hero__when { white-space: normal; } }
.hero__sub { margin-top: 0.75rem; color: var(--dim); font-size: clamp(0.85rem, 1.2vw, 1rem); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 400; }
html[lang="ar"] .hero__title, html[lang="ar"] .hero__sub { letter-spacing: 0; text-transform: none; }
html[lang="ar"] .hero__title { font-size: clamp(1.05rem, 1.6vw, 1.3rem); font-weight: 400; }
.hero__foot { padding-bottom: 2rem; }
@media (min-width: 768px) { .hero__foot { padding-bottom: 2.5rem; } }
.hero__scroll { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; color: var(--dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.2em; text-decoration: none; }
html[lang="ar"] .hero__scroll { letter-spacing: 0; font-size: var(--step--1); }
.hero__scroll svg { width: 1rem; height: 1rem; }
/* Sized to the frame so the halo sits behind the portrait (the frame is clip-path'd by the wipe) */
.hero__photo { position: relative; width: min(280px, 100%); justify-self: center; }
@media (min-width: 768px) { .hero__photo { width: min(380px, 100%); justify-self: end; } }
.hero__photo::before {
  content: ""; position: absolute; inset: -18% -22%; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 55% at 35% 30%, var(--glow-blue), transparent 70%), radial-gradient(55% 50% at 70% 75%, var(--glow-purple), transparent 70%);
}
.hero__frame { position: relative; z-index: 1; width: min(380px, 100%); aspect-ratio: 380 / 520; overflow: hidden; }
.hero__frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15); }
.hero__frame::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); pointer-events: none; }
.hero__rule { position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--grad); box-shadow: 0 0 24px var(--glow-purple); }

/* ---------- Motion ----------
   Every start state below is gated by .js AND prefers-reduced-motion: no-preference.
   No JS, reduced motion and print show everything, static. */
@media (prefers-reduced-motion: no-preference) {
  /* Hero choreography: everything settles by ~1.05 s */
  .js .nav { animation: nav-in var(--dur-s) var(--ease-out) both; }
  .js .hero__name .line__in { animation: line-up var(--dur-l) var(--ease-out) 100ms both; }
  .js .hero__name .line + .line .line__in { animation-delay: 180ms; }
  .js .hero__frame { animation: wipe var(--dur-l) var(--ease-inout) 150ms both; }
  .js .hero__photo::before { animation: fade var(--dur-s) var(--ease-out) 150ms both; }
  .js .hero__frame img { animation: settle 900ms var(--ease-out) 150ms both; }
  .js .hero__rule { animation: grow var(--dur-l) var(--ease-inout) 250ms both; transform-origin: left center; }
  html[dir="rtl"].js .hero__rule { transform-origin: right center; }
  .js .hero__title { animation: lift var(--dur-m) var(--ease-out) 380ms both; }
  .js .hero__sub { animation: lift var(--dur-m) var(--ease-out) 440ms both; }
  .js .hero__foot { animation: fade var(--dur-s) var(--ease-out) 600ms both; }
  .js .hero__scroll svg { animation: bob 1.6s var(--ease-inout) infinite; }

  /* Reveal v2: a .reveal animates itself, or (with data-group) its [data-reveal] children,
     staggered by --i (set in site.js). Inline variant mirrors via --dir. */
  .js .reveal:not([data-group]), .js .reveal[data-group] [data-reveal] {
    opacity: 0; transform: translate3d(0, var(--rise), 0);
    transition: opacity var(--dur-m) var(--ease-out), transform var(--dur-m) var(--ease-out);
    transition-delay: calc(var(--i, 0) * var(--stagger));
  }
  .js .reveal [data-reveal="x"] { transform: translate3d(calc(var(--dir) * 32px), 0, 0); }
  .js .reveal [data-reveal="fade"] { transform: none; }
  .js .reveal.from-above { --rise: -24px; }
  .js .reveal.is-in, .js .reveal.is-in [data-reveal] { opacity: 1; transform: none; }
  .js .reveal.no-tr, .js .reveal.no-tr * { transition: none !important; }

  /* Section transition beat: rule draws, index fades, title rises out of its mask */
  .js .section-head.reveal .section-head__rule { transform: scaleX(0); transition: transform var(--dur-l) var(--ease-inout); }
  .js .section-head.reveal .mask__in { transform: translate3d(0, calc(105% + 0.3em), 0); transition: transform 700ms var(--ease-out) 80ms; }
  .js .section-head.reveal .mask + .mask .mask__in { transition-delay: 160ms; }
  .js .section-head.reveal.is-in .section-head__rule, .js .section-head.reveal.is-in .mask__in { transform: none; }

  /* Hover/focus motion (transforms only here; colours/borders are ungated above) */
  .js .writing-card, .js .writing__featured { transition: transform 250ms var(--ease-out), border-color 0.3s, background-color 0.3s, box-shadow 0.3s; }
  .js .writing-card:is(:hover, :focus-visible), .js .writing__featured:is(:hover, :focus-visible) { transform: translate3d(0, -4px, 0); }
  .js .card-cta .i-arrow { transition: transform 250ms var(--ease-out); }
  .js :is(.writing-card, .writing__featured):is(:hover, :focus-visible) .i-arrow { transform: scaleX(var(--dir)) translateX(4px); }
  .js .nav a.nav__item::after { transition: transform 300ms var(--ease-out); }
  .js .career__hint { transition: color 300ms var(--ease-out); }

  /* One-shot accents (finite; they end at rest) */
  .js .news__date.is-latest::after { content: ""; position: absolute; width: 0.5rem; height: 0.5rem; border-radius: 50%; border: 1px solid var(--blue); opacity: 0; pointer-events: none; }
  .js .reveal.is-in .news__date.is-latest::after { animation: pulse 900ms var(--ease-out) 300ms 2 both; }
  .js .reveal.is-in .certs__cursor { animation: blink 1s step-end 400ms 4; }
}
@keyframes nav-in { from { opacity: 0; transform: translate3d(0, -8px, 0); } to { opacity: 1; transform: none; } }
@keyframes line-up { from { transform: translate3d(0, 105%, 0); } to { transform: none; } }
@keyframes wipe { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes settle { from { transform: scale(1.08); } to { transform: none; } }
@keyframes lift { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse { from { opacity: 0.6; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
@media print {
  .reveal, [data-reveal], .mask__in, .line__in, .section-head__rule, .hero__frame, .hero__frame img, .hero__title, .hero__sub, .hero__foot, .hero__rule, .nav {
    opacity: 1 !important; transform: none !important; clip-path: none !important; animation: none !important; transition: none !important;
  }
}

/* ---------- Sections: dark ground, a raised surface, two light beats ---------- */
.light { background: var(--light-bg); color: var(--light-text); color-scheme: light; }
.surface { background: var(--surface); }
.section { padding-block: var(--section-pad); }

/* About */
.about__grid { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 768px) { .about__grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
/* Gradient text: `color` stays the real blue; only the fill goes transparent */
.about__years { display: block; font-family: var(--font-head); font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-size: clamp(2.75rem, 6vw, 5.5rem); color: var(--blue); }
.about__years .count { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* Proportional figures in the Space Grotesk years (its tabular "1" collides with the "0");
   the mono stats are fixed-width anyway. site.js locks the width while counting. */
.count { display: inline-block; }
.stat__value .count { font-variant-numeric: tabular-nums; }
.about__years-label { display: block; margin-top: 0.5rem; color: var(--light-muted); text-transform: uppercase; letter-spacing: 0.16em; font-weight: 300; font-size: 1.05rem; }
html[lang="ar"] .about__years-label { letter-spacing: 0; font-weight: 400; }
.about__body { display: flex; flex-direction: column; gap: var(--space-m); }
.about__lead { font-size: var(--step-2); font-weight: 500; line-height: 1.4; color: var(--light-text); max-width: 40rem; }
html[lang="ar"] .about__lead { line-height: 1.75; }
.about__text { font-size: var(--step-1); line-height: 1.7; color: var(--light-text-2); max-width: 46rem; }
html[lang="ar"] .about__text { line-height: 1.95; }
.stats { display: grid; gap: 1.5rem; margin-top: var(--space-2xl); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat { background: var(--light-surface); border: 1px solid var(--light-line); padding: 2rem; }
.stat__value { display: block; font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.02em; font-size: clamp(2.25rem, 4vw, 3rem); line-height: 1.1; }
/* Static unit words beside a counted figure ("SAR", "أكثر من … ملايين ريال"): smaller, same baseline */
.stat__unit { font-size: 0.5em; font-weight: 500; letter-spacing: 0.04em; white-space: pre; }
html[lang="ar"] .stat__unit { font-family: var(--font-body); font-size: 0.55em; font-weight: 500; letter-spacing: 0; }
.stat__label { display: block; margin-top: 0.5rem; font-size: 0.8125rem; color: var(--light-muted); text-transform: uppercase; letter-spacing: 0.08em; }
html[lang="ar"] .stat__label { letter-spacing: 0; font-size: 0.9rem; text-transform: none; }

/* News */
.news__sub { color: var(--blue-text); }
.light .news__sub { color: var(--light-accent); }
.news__list { border-top: 1px solid var(--line); }
.news__item { display: grid; gap: 0.5rem 2rem; padding-block: 1.75rem; border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .news__item { grid-template-columns: 12rem minmax(0, 1fr); padding-block: 2rem; } }
.news__date { color: var(--muted); padding-top: 0.3rem; }
.news__date.is-latest { color: var(--text); position: relative; display: flex; align-items: center; align-self: start; }
.news__date.is-latest::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--blue); margin-inline-end: 0.6rem; }
.news__title { font-family: var(--font-head); font-weight: 700; font-size: var(--step-2); line-height: 1.25; }
.news__body { margin-top: 0.4rem; color: var(--text-2); line-height: 1.6; }
.news__link { display: inline-block; margin-top: 0.6rem; font-size: 0.875rem; color: var(--text); text-decoration: none; transition: color 0.2s; }
.news__link:is(:hover, :focus-visible) { color: var(--blue-text); }

/* Career */
.career { background: var(--bg); padding-block: var(--section-pad); overflow: hidden; }
/* The arrows need site.js; without it the track still scrolls natively (C5) */
.career__nav { display: none; gap: 0.5rem; }
@media (min-width: 768px) { .js .career__nav { display: flex; } }
.career__nav button { width: 3rem; height: 3rem; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
.career__nav button:is(:hover, :focus-visible) { background: var(--blue-deep); border-color: var(--blue-deep); color: var(--on-accent); }
.career__nav button[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.career__nav button[aria-disabled="true"]:is(:hover, :focus-visible) { background: none; border-color: var(--line-strong); color: inherit; }
.career .section-head { margin-bottom: var(--space-m); }
.career__hint { color: var(--muted); margin-bottom: var(--head-gap); }
/* Quieter once scrolled: a colour step, not opacity, so it stays AA */
.career__hint.is-dim { color: var(--dim); }
.career__progress { display: none; position: relative; height: 1px; margin-top: var(--space-l); background: var(--line); }
.js .career__progress { display: block; }
.career__progress span { position: absolute; inset: 0; background: var(--grad); transform: scaleX(0); transform-origin: left center; }
html[dir="rtl"] .career__progress span { transform-origin: right center; }
.career__nav svg { width: 1.1rem; height: 1.1rem; }
html[dir="rtl"] .career__nav svg { transform: scaleX(-1); }
/* A horizontal row at every width; the track scrolls inside itself, never the page. */
.career__track {
  display: flex; flex-direction: row; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding-inline: 1.5rem; scroll-padding-inline: 1.5rem; padding-bottom: 1rem;
  scrollbar-width: thin; scrollbar-color: rgba(46, 107, 255, 0.5) transparent;
}
.career__track:focus-visible { outline-offset: -2px; box-shadow: none; } /* .career clips overflow */
.career__group { display: flex; flex-direction: column; gap: 1rem; flex: none; }
.career__group-label { color: var(--muted); min-height: 1.2em; }
.career__cards { display: flex; flex-direction: row; align-items: flex-start; gap: 1rem; }
@media (max-width: 767.98px) { .career-card { flex: none; width: min(80vw, 340px); scroll-snap-align: start; } }
@media (min-width: 768px) {
  .career__track {
    gap: 2rem; scroll-snap-type: x proximity;
    --track-pad: 2rem;
    padding-inline: var(--track-pad); scroll-padding-inline: var(--track-pad); padding-bottom: 1.5rem;
  }
  .career__cards { gap: 2rem; align-items: stretch; }
  .career__track::-webkit-scrollbar { height: 6px; }
  .career__track::-webkit-scrollbar-thumb { background: rgba(46, 107, 255, 0.5); }
}
@media (min-width: 1200px) {
  .career__track { --track-pad: max(3rem, calc((100vw - 1400px) / 2 + 3rem)); }
}
.career-card {
  position: relative; border: 1px solid var(--line); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem;
  background: var(--surface);
}
/* Current roles: gradient border (square corners) */
.career-card.is-current { border: 1px solid transparent; border-image: var(--grad) 1; }
@media (min-width: 768px) { .career-card { width: 420px; flex: none; min-height: 360px; padding: 2rem; scroll-snap-align: start; } }
.career-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.career-card__period { color: var(--muted); font-size: 0.75rem; }
.career-card__company { margin-top: 0.25rem; color: var(--muted); font-size: 0.875rem; }
.career-card__company a { color: var(--text); transition: color 0.2s; }
.career-card__company a:is(:hover, :focus-visible) { color: var(--blue-text); }
.career-card__title { font-family: var(--font-head); font-weight: 700; font-size: var(--step-2); line-height: 1.25; }
.career-card ul { display: flex; flex-direction: column; gap: 0.75rem; }
.career-card li { display: flex; gap: 0.75rem; font-size: 0.875rem; line-height: 1.6; color: var(--text-2); }
.career-card li::before { content: "—"; color: var(--dim); flex: none; }
html[lang="ar"] .career-card li { font-size: 0.9375rem; line-height: 1.8; }
.logo-tile {
  flex: none; width: 3.5rem; height: 3.5rem; border-radius: 1rem; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(237, 237, 245, 0.06); border: 1px solid var(--line);
  box-shadow: 0 8px 32px rgba(7, 7, 12, 0.5), inset 0 1px 0 rgba(237, 237, 245, 0.08);
}
.logo-tile img { width: 2rem; height: 2rem; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.85; }
.logo-tile__mono { font-family: var(--font-head); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.02em; }

/* Projects */
.projects__grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .project--lead { grid-column: 1 / -1; } }
.project { position: relative; background: var(--surface); border: 1px solid var(--line); padding: 2rem; display: flex; flex-direction: column; gap: 1rem; transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.project__body { flex: 1; display: flex; flex-direction: column; gap: 1.5rem; }
.project__body .chips { margin-top: auto; }
@media (min-width: 768px) { .project { padding: 2.5rem; } }
/* Card hover: blue hairline, faint purple halo; no inversion */
.project:hover { border-color: rgba(46, 107, 255, 0.5); box-shadow: 0 0 0 1px rgba(139, 0, 255, 0.18), 0 0 40px rgba(139, 0, 255, 0.08); }
.project__cat { color: var(--muted); padding-inline-end: 2.5rem; }
.project .project__n { position: absolute; top: 2rem; inset-inline-end: 2rem; color: var(--muted); }
@media (min-width: 768px) { .project .project__n { top: 2.5rem; inset-inline-end: 2.5rem; } }
.project__title { margin-top: 0.75rem; font-family: var(--font-head); font-weight: 700; line-height: 1.2; font-size: var(--step-2); }
.project__desc { font-size: 0.9375rem; line-height: 1.65; color: var(--text-2); }
/* Lead project: gradient border, corner glows (swapped in RTL) */
.project--lead {
  --lead-a: 100% 0%; --lead-b: 0% 100%;
  background: radial-gradient(120% 90% at var(--lead-a), var(--glow-purple), transparent 55%), radial-gradient(90% 70% at var(--lead-b), var(--glow-blue), transparent 60%), var(--surface);
  border: 1px solid transparent; border-image: var(--grad) 1;
}
html[dir="rtl"] .project--lead { --lead-a: 0% 0%; --lead-b: 100% 100%; }
.project--lead:hover { background-color: var(--surface-2); }
.project--lead .project__title { font-size: var(--step-3); }
.project--lead .project__cat { color: var(--blue-text); }
.project--lead .project__n { color: var(--muted); }
.project--lead .project__desc { color: var(--text-2); font-size: var(--step-1); max-width: 36rem; }
@media (min-width: 768px) {
  .project--lead { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-xl); align-items: end; }
  .project--lead .project__body { flex: none; padding-top: 2rem; } /* first line clears the index */
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font-family: var(--font-mono); font-size: 0.75rem; padding: 0.25rem 0.75rem; border: 1px solid var(--line-strong); color: var(--muted); }
.light .chip { border-color: rgba(11, 11, 20, 0.18); color: var(--light-muted); }
/* Chips inside a dark card on a light section keep the dark colours */
.light .chip--dark { border-color: var(--line-strong); color: var(--muted); }

/* Skills: certifications (ground) + competencies (raised) */
.skills { display: grid; }
@media (min-width: 768px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.skills__pane { padding: var(--section-pad) 1.5rem; display: flex; flex-direction: column; justify-content: flex-start; }
@media (min-width: 768px) { .skills__pane { padding-inline: 3rem; } }
@media (min-width: 1200px) { .skills__pane { padding-inline: 4rem; } }
.skills__dark { background: var(--bg); }
.skills__raised { background: var(--surface); color: var(--text); }
.skills h2, .skills h3 { color: var(--muted); font-weight: 400; margin-bottom: 2rem; }
.certs { display: flex; flex-direction: column; gap: 1rem; }
.certs li { display: flex; align-items: center; gap: 1rem; font-family: var(--font-mono); font-size: 0.875rem; }
.certs__n { color: var(--dim); font-size: 0.75rem; flex: none; }
.certs__rule { width: 2rem; height: 1px; background: var(--line-strong); flex: none; }
.certs__cursor { color: var(--blue-text); font-family: var(--font-mono); margin-top: 0.5rem; }
.edu { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); display: grid; gap: 2.25rem; }
.edu h3 { margin-bottom: 0.9rem; }
.edu p { color: var(--text-2); font-size: 0.9375rem; line-height: 1.7; max-width: 40rem; }
.comp { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 0.5rem; }
.comp li { font-family: var(--font-head); padding: 0.25rem 0.75rem; line-height: 1.2; }
.comp .s3 { font-size: clamp(1.5rem, 2.2vw, 1.875rem); font-weight: 700; }
.comp .s2 { font-size: clamp(1.125rem, 1.5vw, 1.25rem); font-weight: 600; }
.comp .s1 { font-size: clamp(0.875rem, 1.1vw, 1rem); font-weight: 500; color: var(--muted); }
/* Arabic: no Plex 600 download; the size steps carry the hierarchy (700 / 500 / 500) */
html[lang="ar"] .comp .s2 { font-weight: 500; }

/* Writing */
.writing__item { display: flex; }
.writing__item > a { flex: 1; min-width: 0; }
/* Featured article: dark on light, gradient border */
.writing__featured {
  display: block; background: var(--bg); color: var(--text); padding: 2rem; text-decoration: none;
  border: 1px solid transparent; border-image: var(--grad) 1; transition: background-color 0.3s;
}
@media (min-width: 768px) { .writing__featured { padding: 3rem; } }
.writing__featured:is(:hover, :focus-visible) { background-color: var(--surface); }
.writing__featured .chips { margin-bottom: 1rem; }
.writing__featured h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; font-size: var(--step-3); margin-bottom: 1rem; }
.writing__featured:is(:hover, :focus-visible) h3, .writing-card:is(:hover, :focus-visible) h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.writing__featured p { color: var(--muted); max-width: 48rem; margin-bottom: 1.5rem; font-size: 0.9375rem; line-height: 1.65; }
.writing__grid { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
@media (min-width: 768px) { .writing__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.writing-card { display: flex; flex-direction: column; background: var(--light-surface); color: var(--light-text); padding: 1.5rem; border: 1px solid var(--light-line); text-decoration: none; transition: border-color 0.3s, box-shadow 0.3s; }
@media (min-width: 768px) { .writing-card { padding: 2rem; } }
.writing-card:is(:hover, :focus-visible) { border-color: rgba(31, 86, 224, 0.6); }
.writing-card:hover { box-shadow: 0 0 0 1px rgba(139, 0, 255, 0.12); }
.writing-card .chips { margin-bottom: 0.75rem; }
.writing-card .chip { font-size: 0.6875rem; padding: 0.125rem 0.5rem; border-color: rgba(11, 11, 20, 0.14); }
.writing-card h3 { font-family: var(--font-head); font-weight: 700; font-size: var(--step-2); line-height: 1.3; margin-bottom: 0.75rem; }
.writing-card .card-summary { font-size: 0.875rem; color: var(--light-muted); line-height: 1.6; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--light-muted); margin-top: auto; }
.writing__featured .meta-row { color: var(--muted); }
.meta-row svg { width: 0.8rem; height: 0.8rem; vertical-align: -0.1em; margin-inline-end: 0.3rem; }
.card-cta { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1.25rem; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--light-accent); }
html[lang="ar"] .card-cta { font-family: var(--font-body); font-size: var(--step--1); letter-spacing: 0; text-transform: none; }
.writing__featured .card-cta { color: var(--text); }
.i-arrow { width: 1rem; height: 1rem; flex: none; }
html[dir="rtl"] .i-arrow { transform: scaleX(-1); }
/* External-link arrow points up-and-away from the reading direction */
html[dir="rtl"] .i-ext { transform: scaleX(-1); }

/* Testimonial */
/* Raised band, faint purple centre glow */
.quote { background: radial-gradient(50% 60% at 50% 40%, rgba(139, 0, 255, 0.10), transparent 70%), var(--surface); padding-block: var(--section-pad); text-align: center; }
.quote .container { max-width: 58rem; }
.quote blockquote p { font-weight: 300; font-style: italic; font-size: clamp(1.35rem, 2.6vw, 2.1rem); line-height: 1.55; }
html[lang="ar"] .quote blockquote p { font-style: normal; font-weight: 400; line-height: 1.9; font-size: clamp(1.25rem, 2.3vw, 1.85rem); }
.quote figcaption { margin-top: 3rem; }
.quote__name { font-family: var(--font-head); font-weight: 600; font-size: 1.125rem; }
html[lang="ar"] .quote__name { font-weight: 700; }
.quote__role { margin-top: 0.25rem; color: var(--muted); font-size: 0.875rem; }
.quote__rel { margin-top: 0.25rem; color: var(--dim); font-size: 0.75rem; }

/* Contact */
.contact__grid { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 768px) { .contact__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; } }
.contact__title { font-family: var(--font-head); font-weight: 700; text-transform: uppercase; letter-spacing: -0.05em; line-height: 0.95; font-size: var(--step-5); }
.contact__grid .section-head { margin-bottom: 0; }
html[lang="ar"] .contact__title { letter-spacing: 0; line-height: 1.2; }
.contact__intro { font-size: var(--step-1); line-height: 1.65; color: var(--text-2); margin-bottom: 2rem; max-width: 34rem; }
.contact__intro a { color: var(--blue-text); }
.contact__list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 2.5rem; }
@media (min-width: 640px) { .contact__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.contact__item dt { color: var(--muted); margin-bottom: 0.25rem; }
.contact__item dd { margin: 0; font-size: 1.0625rem; color: var(--text); overflow-wrap: anywhere; }
.contact__item a { color: var(--text); text-decoration: none; transition: color 0.2s; }
.contact__item a:is(:hover, :focus-visible) { color: var(--blue-text); }
.contact__cv { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.contact__cv a { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; color: var(--text); text-decoration: none; transition: color 0.2s; }
.contact__cv a:is(:hover, :focus-visible) { color: var(--blue-text); }
.contact__cv svg { width: 1rem; height: 1rem; }

/* Footer */
.footer { background: var(--bg); border-top: 1px solid var(--line); padding-block: 1.5rem; text-align: center; font-family: var(--font-mono); font-size: 0.75rem; color: var(--dim); }

/* ---------- Article pages ---------- */
.article-bar { position: sticky; top: 0; z-index: 50; background: rgba(7, 7, 12, 0.85); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(8px)) { .article-bar { backdrop-filter: blur(12px); background: rgba(7, 7, 12, 0.75); } }
.article-bar__inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; gap: 1rem; }
.article-bar__start, .article-bar__end { display: flex; align-items: center; gap: 1.25rem; }
@media (max-width: 479.98px) { .article-bar__start, .article-bar__end { gap: 0.875rem; } }
.article-bar a, .article-bar button { font-size: 0.875rem; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; transition: color 0.2s; }
.article-bar a:is(:hover, :focus-visible), .article-bar button:is(:hover, :focus-visible) { color: var(--text); }
.article-bar svg { width: 1.1rem; height: 1.1rem; }
html[dir="rtl"] .article-bar .i-back { transform: scaleX(-1); }
.icon-btn { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid var(--line) !important; justify-content: center; transition: color 0.2s, border-color 0.2s; }
.icon-btn:is(:hover, :focus-visible) { border-color: rgba(46, 107, 255, 0.6) !important; }
.article-bar a.article-bar__logo { font-family: var(--font-head); font-weight: 700; font-size: 1.125rem; letter-spacing: -0.02em; color: var(--text); }
.article-bar a.article-bar__logo:is(:hover, :focus-visible) { color: var(--blue-text); }
/* Article column on the shared scale: h1 = Home section titles (--step-4), h2 = card titles. */
.article { max-width: 48rem; margin-inline: auto; padding: var(--space-2xl) 1.5rem var(--section-pad); }
@media (min-width: 768px) { .article { padding-inline: 2rem; } }
.article .meta-row { color: var(--muted); font-size: var(--step--1); margin-bottom: var(--space-m); }
.article h1 { font-family: var(--font-head); font-weight: 700; line-height: 1.12; font-size: var(--step-4); margin-bottom: var(--space-m); letter-spacing: -0.02em; }
html[lang="ar"] .article h1 { line-height: 1.3; letter-spacing: 0; }
.article .chips { margin-bottom: var(--space-xl); }
.article__rule { height: 1px; background: var(--grad) no-repeat 0 0 / 6rem 100%, var(--line); margin-bottom: var(--space-xl); }
html[dir="rtl"] .article__rule { background-position: 100% 0; }
.article-body h2 { font-family: var(--font-head); font-weight: 700; font-size: var(--step-2); margin: var(--space-xl) 0 var(--space-s); line-height: 1.3; }
.article-body p { color: var(--text-2); font-size: var(--step-1); line-height: 1.8; margin-bottom: var(--space-m); }
html[lang="ar"] .article-body p { line-height: 2; }
.more-writing .writing__grid { margin-top: 0; }
.byline { margin-top: var(--space-2xl); padding-top: var(--space-l); border-top: 1px solid var(--line); display: flex; align-items: center; gap: var(--space-s); }
/* Circle: the purple ring is a 1px shadow */
.byline__avatar { width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px rgba(139, 0, 255, 0.45); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; flex: none; }
.byline__name { font-family: var(--font-head); font-weight: 700; font-size: 1.125rem; }
.byline__role { color: var(--muted); font-size: var(--step--1); margin-top: 0.15rem; }
.byline__text { flex: 1; min-width: 0; }
.toast { position: fixed; bottom: 1.5rem; inset-inline-start: 50%; transform: translateX(-50%); background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); padding: 0.6rem 1rem; font-size: 0.875rem; z-index: 100; }
html[dir="rtl"] .toast { transform: translateX(50%); }

/* ---------- Print ----------
   Ink on white, every fact on paper, no screen-only controls. The career row stops scrolling
   and prints two cards per row so all roles reach paper. Screen rendering is untouched. */
@media print {
  @page { size: A4; margin: 12mm; }
  *, *::before, *::after { color: #000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  *, *::before, *::after { border-color: #999 !important; }
  /* Gradient text prints in ink; gradient borders print as hairlines */
  *, *::before, *::after { -webkit-text-fill-color: currentcolor !important; border-image: none !important; }
  html, body { background: #fff !important; }
  body, main, .hero, .career, .skills, .quote { overflow: visible !important; }
  .grain::after, .hero__photo::before { display: none !important; }
  .label, .meta-row, .news__date, .news__sub, .career-card__period, .career-card__company, .career__group-label, .project__cat, .project__n,
  .chip, .stat__label, .about__years-label, .quote__role, .quote__rel, .byline__role, .certs__n, .section-head__index, .footer, .skills h2, .skills h3,
  .career-card li::before { color: #444 !important; }

  /* Screen-only */
  .nav, .skip, .hero__foot, .hero__rule, .career__nav, .career__hint, .career__progress, .card-cta, [data-lang-toggle], [data-share],
  .certs__cursor, .article-bar, .section-head__rule, .certs__rule, .more-writing, .news__date.is-latest::before { display: none !important; }

  /* Rhythm: compact sections */
  .section, .career, .quote, .skills__pane { padding-block: 7mm !important; }
  .container, .skills__pane, .career__track { padding-inline: 0 !important; }
  .section-head { margin-bottom: 5mm !important; }
  .section-head__index { margin-bottom: 2mm !important; }
  .section-title { font-size: 22pt !important; }
  .contact__title { font-size: 24pt !important; }

  /* Hero: name + headline beside a small portrait */
  .hero { min-height: auto !important; }
  .hero__grid { grid-template-columns: minmax(0, 1fr) 45mm !important; gap: 8mm !important; padding: 0 0 4mm !important; }
  .hero__name { font-size: 30pt !important; }
  .hero__photo { justify-content: flex-end !important; }
  .hero__frame { width: 45mm !important; }
  .hero__frame::after { display: none !important; }

  /* About / news */
  .about__grid { grid-template-columns: 3fr 9fr !important; gap: 6mm !important; }
  .stats { display: block !important; font-size: 0; margin-top: 6mm !important; }
  .stat { display: inline-block; vertical-align: top; font-size: 1rem; width: calc((100% - 8mm) / 3); margin-inline-end: 4mm; padding: 4mm !important; }
  .stat:last-child { margin-inline-end: 0; }
  .news__item { grid-template-columns: 30mm minmax(0, 1fr) !important; padding-block: 3mm !important; }

  /* Grids print as rows of inline blocks: Chromium keeps each inline block whole and breaks
     pages only between rows (print grids either split cards or jump to the next page whole).
     font-size: 0 removes the whitespace between the blocks; each block resets it. */
  .career__track { display: block !important; overflow: visible !important; }
  .career__group { display: block !important; }
  .career__cards { display: block !important; font-size: 0; }
  .career__group-label { margin: 2mm 0 !important; }
  .career-card { display: inline-flex !important; vertical-align: top; font-size: 1rem; width: calc(50% - 2mm) !important; min-height: 0 !important; padding: 4mm !important; gap: 2mm !important; margin: 0 0 4mm; }
  .career-card:nth-child(odd) { margin-inline-end: 4mm; }
  .logo-tile { display: none !important; } /* decorative; lazy logos are not fetched for print */

  /* Projects, skills, writing, contact */
  .projects__grid { display: block !important; font-size: 0; }
  .project { display: inline-block !important; vertical-align: top; font-size: 1rem; width: calc(50% - 2mm); margin: 0 0 4mm; padding: 5mm !important; }
  .project:nth-child(even) { margin-inline-end: 4mm; }
  .project--lead { display: block !important; width: auto; }
  .project__body { display: block !important; }
  .project__body .chips { margin-top: 3mm; }
  .skills { grid-template-columns: minmax(0, 1fr) !important; }
  .edu { margin-top: 5mm !important; padding-top: 5mm !important; }
  .writing__grid { display: block !important; font-size: 0; margin-top: 4mm !important; }
  .writing__item { font-size: 1rem; }
  .writing__grid .writing__item { display: inline-block !important; vertical-align: top; width: calc((100% - 8mm) / 3); margin-inline-end: 4mm; }
  .writing__grid .writing__item:nth-child(3n) { margin-inline-end: 0; }
  .writing-card { display: block !important; }
  .writing__featured, .writing-card { padding: 5mm !important; }
  .quote blockquote p { font-size: 13pt !important; }
  .quote figcaption { margin-top: 4mm !important; }
  .contact__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8mm !important; }
  .article { padding: 0 !important; max-width: none !important; }
  .article-body p { color: #000 !important; }

  /* A company link prints its address; links whose text is already the address don't */
  .career-card__company a[href^="http"]::after { content: " · " attr(href); }

  /* Never split a card */
  .career-card, .project, .news__item, .writing-card, .writing__featured, .stat, .certs li, .contact__item, figure, .byline { break-inside: avoid; }
  .section-head, .skills__dark > .reveal { break-inside: avoid; }
  .section-head, .section-head__index, .career__group-label, .skills h2, .skills h3, .article-body h2 { break-after: avoid; }
  .writing-card .card-summary { display: block !important; -webkit-line-clamp: unset !important; overflow: visible !important; }
}
