:root,
html[data-theme='dark'] {
  color-scheme: dark;

  /* Dark Theme Tokens */
  --bg-primary: #09090B;
  --bg-alt: rgba(13, 14, 18, 0.72);
  --bg-surface: #131419;
  --bg-elevated: #1B1D24;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.14);

  --text-primary: #F4F4F2;
  --signature-ink: #F2EFE9;
  --text-secondary: #A4A6AE;
  --text-tertiary: #848791;

  /* Brand Engineering Blue */
  --accent-500: #3DA9FC;
  --accent-hover: #5EBBFF;
  --accent-pressed: #258CE0;
  --accent-ink: #3DA9FC;
  --accent-soft: rgba(61, 169, 252, 0.12);
  --accent-border: rgba(61, 169, 252, 0.36);
  --accent-glow: rgba(61, 169, 252, 0.28);
  --on-accent: #09090B;

  /* Status & Validation */
  --accent-data: #5EEAD4;
  --data-border: rgba(94, 234, 212, 0.32);
  --error: #FF6B6B;

  /* visionOS-Inspired Glassmorphism System (Dark) */
  --glass-nav-bg: linear-gradient(
    180deg,
    rgba(24, 26, 34, 0.74) 0%,
    rgba(14, 15, 20, 0.68) 100%
  );
  --glass-nav-bg-scrolled: linear-gradient(
    180deg,
    rgba(24, 26, 35, 0.88) 0%,
    rgba(13, 14, 19, 0.84) 100%
  );
  --glass-bg: linear-gradient(
    145deg,
    rgba(26, 28, 37, 0.72) 0%,
    rgba(16, 17, 23, 0.58) 100%
  );
  --glass-bg-sub: rgba(11, 12, 16, 0.56);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-border-hover: rgba(125, 196, 255, 0.34);
  --glass-highlight: rgba(255, 255, 255, 0.14);
  --glass-shadow:
    0 24px 56px -20px rgba(0, 0, 0, 0.76),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --glass-shadow-hover:
    0 32px 68px -20px rgba(0, 0, 0, 0.84),
    0 0 36px -12px rgba(61, 169, 252, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --glass-glow-spot: rgba(61, 169, 252, 0.16);
  --glass-btn-secondary-bg: rgba(255, 255, 255, 0.05);
  --glass-btn-secondary-hover: rgba(61, 169, 252, 0.14);

  /* Ambient Orbs (Dark) */
  --orb-blue: radial-gradient(circle, rgba(61, 169, 252, 0.24) 0%, rgba(37, 99, 235, 0.10) 45%, transparent 72%);
  --orb-violet: radial-gradient(circle, rgba(139, 92, 246, 0.20) 0%, rgba(109, 40, 217, 0.08) 48%, transparent 74%);
  --orb-cyan: radial-gradient(circle, rgba(34, 211, 238, 0.16) 0%, rgba(94, 234, 212, 0.06) 46%, transparent 72%);
  --orb-deep: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(124, 58, 237, 0.06) 50%, transparent 75%);

  --shadow-card: 0 24px 56px -24px rgba(0, 0, 0, 0.72);
  --hero-grid-line: rgba(255, 255, 255, 0.045);

  /* Typography */
  --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Fluid Spacing, Safe Areas & Viewport-Aware Layout Tokens */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --container-max: 1200px;
  --container-gutter: clamp(16px, 3vw, 32px);
  --section-pad-block: clamp(44px, 7.2dvh, 96px);
  --hero-pad-top: clamp(20px, 5dvh, 60px);
  --hero-pad-bottom: clamp(32px, 7.2dvh, 88px);
  --header-height: clamp(54px, 6.4dvh, 64px);
  --header-offset: calc(var(--safe-top) + clamp(8px, 1.4dvh, 14px));
  --hairline: 1px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Motion Timing */
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spatial: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-hover: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'] {
  color-scheme: light;

  /* Light Theme Tokens */
  --bg-primary: #FAF9F6;
  --bg-alt: rgba(242, 241, 236, 0.72);
  --bg-surface: #FFFFFF;
  --bg-elevated: #ECEBE5;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-default: rgba(15, 23, 42, 0.15);

  --text-primary: #101216;
  --signature-ink: #16181D;
  --text-secondary: #484C58;
  --text-tertiary: #5B606E;

  /* Accessible Light-Mode Brand Engineering Blue */
  --accent-500: #0969DA;
  --accent-hover: #0550AE;
  --accent-pressed: #033D8B;
  --accent-ink: #0969DA;
  --accent-soft: rgba(9, 105, 218, 0.09);
  --accent-border: rgba(9, 105, 218, 0.32);
  --accent-glow: rgba(9, 105, 218, 0.22);
  --on-accent: #FFFFFF;

  /* Status & Validation */
  --accent-data: #0F766E;
  --data-border: rgba(15, 118, 110, 0.28);
  --error: #DC2626;

  /* visionOS-Inspired Glassmorphism System (Light) */
  --glass-nav-bg: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(248, 248, 252, 0.68) 100%
  );
  --glass-nav-bg-scrolled: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.90) 0%,
    rgba(248, 248, 252, 0.84) 100%
  );
  --glass-bg: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(247, 248, 252, 0.68) 100%
  );
  --glass-bg-sub: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(15, 23, 42, 0.11);
  --glass-border-hover: rgba(9, 105, 218, 0.32);
  --glass-highlight: rgba(255, 255, 255, 0.92);
  --glass-shadow:
    0 20px 48px -20px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
  --glass-shadow-hover:
    0 28px 58px -18px rgba(15, 23, 42, 0.14),
    0 0 28px -10px rgba(9, 105, 218, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  --glass-glow-spot: rgba(9, 105, 218, 0.08);
  --glass-btn-secondary-bg: rgba(255, 255, 255, 0.68);
  --glass-btn-secondary-hover: rgba(9, 105, 218, 0.08);

  /* Ambient Orbs (Light — airy atmospheric washes) */
  --orb-blue: radial-gradient(circle, rgba(59, 130, 246, 0.14) 0%, rgba(96, 165, 250, 0.06) 45%, transparent 72%);
  --orb-violet: radial-gradient(circle, rgba(139, 92, 246, 0.11) 0%, rgba(167, 139, 250, 0.05) 48%, transparent 74%);
  --orb-cyan: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, rgba(45, 212, 191, 0.05) 46%, transparent 72%);
  --orb-deep: radial-gradient(circle, rgba(99, 102, 241, 0.10) 0%, rgba(56, 189, 248, 0.04) 50%, transparent 75%);

  --shadow-card: 0 24px 48px -20px rgba(15, 23, 42, 0.09);
  --hero-grid-line: rgba(15, 23, 42, 0.045);
}

@media (min-resolution: 2dppx) {
  :root {
    --hairline: 0.5px;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--header-offset) + 24px);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(15px, 0.92rem + 0.15vw, 16px);
  font-weight: 400;
  line-height: 1.65;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

html[lang='ar'] body {
  font-family: var(--font-arabic);
  line-height: 1.8;
}

html[lang='ar'] h1,
html[lang='ar'] h2,
html[lang='ar'] h3,
html[lang='ar'] h4 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
}

html[lang='ar'] h1,
html[lang='ar'] h2,
html[lang='ar'] .hero-headline,
html[lang='ar'] .section-title,
html[lang='ar'] .project-title,
html[lang='ar'] .role-title {
  font-weight: 600;
}

/* Smooth Dual-Theme Transition */
html.theme-transitioning,
html.theme-transitioning body,
html.theme-transitioning .site-header,
html.theme-transitioning .section,
html.theme-transitioning .glass-panel,
html.theme-transitioning .glass-subpanel,
html.theme-transitioning .arch-node,
html.theme-transitioning .skill-card,
html.theme-transitioning .channel-row,
html.theme-transitioning .contact-form,
html.theme-transitioning .mobile-drawer,
html.theme-transitioning .brand-mark,
html.theme-transitioning .btn {
  transition:
    background-color 260ms var(--ease-hover),
    background 260ms var(--ease-hover),
    color 260ms var(--ease-hover),
    border-color 260ms var(--ease-hover),
    box-shadow 260ms var(--ease-hover);
}

/* Visually Hidden Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Accessibility Skip Link */
.skip-link {
  position: fixed;
  top: -100px;
  inset-inline-start: 16px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: top 180ms var(--ease-hover);
}

.skip-link:focus {
  top: 16px;
}

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

/* RTL Directional Icon Mirroring (brand icons excluded) */
[dir='rtl'] .icon-directional {
  transform: scaleX(-1);
}

.icon-brand {
  flex-shrink: 0;
}

/* ==========================================================================
   0. Cinematic Handwritten Signature Intro & FLIP Reveal
   ========================================================================== */
html.is-intro-active,
html.is-intro-active body {
  overflow: hidden;
  height: 100%;
}

html.is-intro-active:not(.is-site-revealed) .ambient-canvas,
html.is-intro-active:not(.is-site-revealed) main,
html.is-intro-active:not(.is-site-revealed) .site-footer {
  opacity: 0;
  pointer-events: none;
}

html.is-intro-landing .ambient-canvas {
  transition:
    opacity 720ms var(--ease-enter),
    transform 600ms var(--ease-spatial);
}

html.is-intro-landing main,
html.is-intro-landing .site-footer {
  transition: opacity 640ms var(--ease-enter);
}

html.is-intro-active:not(.is-site-revealed) .site-header {
  opacity: 0;
  pointer-events: none;
}

html.is-intro-landing .site-header {
  transition:
    opacity 620ms var(--ease-spatial) 240ms,
    background 240ms var(--ease-hover),
    border-color 240ms var(--ease-hover),
    box-shadow 260ms var(--ease-spatial),
    transform 260ms var(--ease-spatial);
}

html.js-motion-ready.is-intro-landing .brand-mark {
  transition:
    color 220ms var(--ease-hover),
    transform 240ms var(--ease-enter);
}

html.js-motion-ready:not(.is-brand-landed) .brand-mark {
  opacity: 0;
  animation: none;
  transform: none;
}

html.js-motion-ready.is-intro-landing.is-brand-landed .brand-mark {
  opacity: 1;
  animation: none;
  transform: none;
}

.intro-overlay {
  display: none;
  position: fixed;
  inset: 0;
  height: var(--vv-h, 100dvh);
  z-index: 120;
  pointer-events: none;
  overflow: hidden;
  contain: layout style;
}

html.is-intro-active .intro-overlay,
.intro-overlay.is-running {
  display: block;
}

html.is-intro-active .intro-overlay {
  pointer-events: auto;
}

.intro-overlay[hidden] {
  display: none !important;
}

.intro-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 46%, #111623 0%, #07080B 66%, #050608 100%);
  opacity: 1;
  transition: opacity 780ms var(--ease-spatial);
  will-change: opacity;
}

.intro-spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(680px, 92vw);
  height: min(420px, 60dvh);
  transform: translate3d(-50%, -50%, 0);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(61, 169, 252, 0.14) 0%,
    rgba(139, 92, 246, 0.07) 44%,
    transparent 74%
  );
  filter: blur(42px);
  opacity: 0.72;
  transition: opacity 700ms var(--ease-spatial), transform 900ms var(--ease-spatial);
}

.intro-overlay.is-ink-settled .intro-spotlight {
  opacity: 1;
  transform: translate3d(-50%, -50%, 0) scale(1.06);
}

.intro-overlay.is-flying .intro-backdrop {
  opacity: 0;
}

.intro-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(16px + var(--safe-top))
    calc(24px + var(--safe-right))
    calc(16px + var(--safe-bottom))
    calc(24px + var(--safe-left));
}

.intro-signature {
  display: block;
  width: min(76vw, 440px, 92dvh);
  height: auto;
  color: #F2EFE9;
  transform-origin: center center;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform, color, filter, opacity;
  transition:
    transform 920ms var(--ease-spatial),
    color 680ms ease 180ms,
    filter 420ms ease,
    opacity 150ms ease;
}

.intro-overlay.is-ink-settled .intro-signature {
  filter: drop-shadow(0 0 18px rgba(61, 169, 252, 0.24));
}

.intro-overlay.is-flying .intro-signature {
  color: var(--signature-ink);
  filter: drop-shadow(0 0 0 rgba(61, 169, 252, 0));
}

.intro-overlay.is-fading-out .intro-signature {
  opacity: 0;
}

.intro-mask-stroke {
  stroke-dasharray: 1020;
  stroke-dashoffset: 1020;
  opacity: 0;
}

.intro-overlay.is-drawing .intro-mask-stroke-0 {
  opacity: 1;
  transition:
    stroke-dashoffset 500ms cubic-bezier(0.32, 0.04, 0.24, 1) 0ms,
    opacity 15ms linear 0ms;
  stroke-dashoffset: 0;
}

.intro-overlay.is-drawing .intro-mask-stroke-1 {
  opacity: 1;
  transition:
    stroke-dashoffset 560ms cubic-bezier(0.28, 0.06, 0.22, 1) 460ms,
    opacity 15ms linear 460ms;
  stroke-dashoffset: 0;
}

.intro-overlay.is-drawing .intro-mask-stroke-2 {
  opacity: 1;
  transition:
    stroke-dashoffset 510ms cubic-bezier(0.28, 0.06, 0.22, 1) 990ms,
    opacity 15ms linear 990ms;
  stroke-dashoffset: 0;
}

.intro-overlay.is-drawing .intro-mask-stroke-3 {
  opacity: 1;
  transition:
    stroke-dashoffset 450ms cubic-bezier(0.24, 0.08, 0.22, 1) 1470ms,
    opacity 15ms linear 1470ms;
  stroke-dashoffset: 0;
}

.intro-overlay.is-drawing .intro-mask-stroke-4 {
  opacity: 1;
  transition:
    stroke-dashoffset 170ms cubic-bezier(0.22, 1, 0.36, 1) 1860ms,
    opacity 15ms linear 1860ms;
  stroke-dashoffset: 0;
}

/* ==========================================================================
   2. Ambient Animated Spatial Background
   ========================================================================== */
.ambient-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100lvh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translate3d(var(--ambient-px, 0px), var(--ambient-py, 0px), 0);
  transition: transform 600ms var(--ease-spatial);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  will-change: transform;
  opacity: 0.92;
}

.ambient-orb-blue {
  top: -16%;
  inset-inline-start: -8%;
  width: clamp(340px, 52vw, 760px);
  height: clamp(340px, 52vw, 760px);
  background: var(--orb-blue);
  animation: orbFloatA 26s ease-in-out infinite alternate;
}

.ambient-orb-violet {
  top: 18%;
  inset-inline-end: -10%;
  width: clamp(320px, 46vw, 680px);
  height: clamp(320px, 46vw, 680px);
  background: var(--orb-violet);
  animation: orbFloatB 30s ease-in-out infinite alternate;
}

.ambient-orb-cyan {
  bottom: -14%;
  inset-inline-start: 16%;
  width: clamp(300px, 44vw, 640px);
  height: clamp(300px, 44vw, 640px);
  background: var(--orb-cyan);
  animation: orbFloatC 24s ease-in-out infinite alternate;
}

.ambient-orb-deep {
  top: 52%;
  inset-inline-end: 24%;
  width: clamp(280px, 38vw, 540px);
  height: clamp(280px, 38vw, 540px);
  background: var(--orb-deep);
  animation: orbFloatB 34s ease-in-out infinite alternate-reverse;
}

.ambient-canvas.is-ambient-paused .ambient-orb {
  animation-play-state: paused;
}

@keyframes orbFloatA {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(6vw, 4vh, 0) scale(1.08);
  }
  100% {
    transform: translate3d(2vw, 8vh, 0) scale(0.96);
  }
}

@keyframes orbFloatB {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-5vw, 5vh, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-2vw, -4vh, 0) scale(0.95);
  }
}

@keyframes orbFloatC {
  0% {
    transform: translate3d(0, 0, 0) scale(0.98);
  }
  50% {
    transform: translate3d(4vw, -6vh, 0) scale(1.09);
  }
  100% {
    transform: translate3d(-3vw, -2vh, 0) scale(1);
  }
}

/* Ensure main content & footer sit cleanly above ambient canvas */
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Fluid Safe-Area Container with CSS Container Queries */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline:
    calc(var(--container-gutter) + var(--safe-left))
    calc(var(--container-gutter) + var(--safe-right));
  container-type: inline-size;
}

/* ==========================================================================
   1. Floating Glass Navigation Bar (Safe-Area & Capability Adaptive)
   ========================================================================== */
.site-header {
  position: fixed;
  inset-block-start: var(--header-offset);
  left: calc(clamp(10px, 2vw, 24px) + var(--safe-left));
  right: calc(clamp(10px, 2vw, 24px) + var(--safe-right));
  max-width: var(--container-max);
  margin-inline: auto;
  height: var(--header-height);
  z-index: 60;
  border-radius: var(--radius-lg);
  background: var(--glass-nav-bg);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: var(--hairline, 1px) solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  transition:
    background 240ms var(--ease-hover),
    border-color 240ms var(--ease-hover),
    box-shadow 260ms var(--ease-spatial),
    transform 260ms var(--ease-spatial);
}

.site-header::before {
  content: '';
  position: absolute;
  inset-inline: 12%;
  inset-block-start: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.36) 50%,
    transparent 100%
  );
  pointer-events: none;
}

html[data-theme='light'] .site-header::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.95) 50%,
    transparent 100%
  );
}

.site-header.is-scrolled {
  background: var(--glass-nav-bg-scrolled);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-hover);
}

.header-inner {
  container-type: normal;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(6px, 1.5vw, 24px);
  padding-inline: clamp(10px, 2vw, 22px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 2px;
  color: var(--signature-ink);
  text-decoration: none;
  flex-shrink: 0;
  touch-action: manipulation;
  transition:
    color 220ms var(--ease-hover),
    opacity 180ms var(--ease-hover),
    transform 240ms var(--ease-enter);
}

.brand-signature {
  display: block;
  height: clamp(22px, 4.8vw, 38px);
  width: auto;
  max-width: clamp(78px, 24vw, 180px);
}

html.js-motion-ready.is-site-revealed.is-brand-landed:not(.is-intro-landing) .brand-mark {
  animation: headerFadeIn 420ms var(--ease-enter) 40ms both;
}

.nav-links {
  position: relative;
  display: none;
  align-items: center;
  gap: clamp(4px, 0.9vw, 16px);
  height: 100%;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }

  html.is-compact-nav .nav-links {
    position: absolute;
    inset-block-start: -9999px;
    visibility: hidden;
    pointer-events: none;
    width: max-content;
  }
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding-inline: clamp(8px, 0.8vw, 11px);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: manipulation;
  transition:
    color 200ms var(--ease-hover),
    background-color 200ms var(--ease-hover),
    transform 220ms var(--ease-enter);
}

.nav-link::after {
  content: '';
  position: absolute;
  inset-inline: 10px;
  inset-block-end: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-ink);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 240ms var(--ease-enter), opacity 200ms var(--ease-hover);
}

.nav-link:focus-visible::after {
  opacity: 0.7;
  transform: scaleX(1);
}

.nav-link.is-active {
  color: var(--text-primary);
}

.nav-link.is-active::after {
  opacity: 0;
}

html.js-motion-ready:not(.is-site-revealed) .nav-link,
html.js-motion-ready:not(.is-site-revealed) .header-actions > *,
html.js-motion-ready:not(.is-site-revealed) .hero-grid-bg,
html.js-motion-ready:not(.is-site-revealed) .hero-identity,
html.js-motion-ready:not(.is-site-revealed) .hero-line,
html.js-motion-ready:not(.is-site-revealed) .hero-accent-line,
html.js-motion-ready:not(.is-site-revealed) .hero-intro,
html.js-motion-ready:not(.is-site-revealed) .hero-actions .btn,
html.js-motion-ready:not(.is-site-revealed) .hero-social-row,
html.js-motion-ready:not(.is-site-revealed) .portrait-column,
html.js-motion-ready:not(.is-site-revealed) .metric-cell {
  opacity: 0;
}

html.js-motion-ready.is-site-revealed .nav-link {
  animation: headerFadeIn 420ms var(--ease-enter) both;
}

html.js-motion-ready.is-site-revealed .nav-link:nth-child(1) { animation-delay: 140ms; }
html.js-motion-ready.is-site-revealed .nav-link:nth-child(2) { animation-delay: 170ms; }
html.js-motion-ready.is-site-revealed .nav-link:nth-child(3) { animation-delay: 200ms; }
html.js-motion-ready.is-site-revealed .nav-link:nth-child(4) { animation-delay: 230ms; }
html.js-motion-ready.is-site-revealed .nav-link:nth-child(5) { animation-delay: 260ms; }
html.js-motion-ready.is-site-revealed .nav-link:nth-child(6) { animation-delay: 290ms; }

/* Sliding Active Section Indicator with Subtle Glow */
.nav-indicator {
  position: absolute;
  left: 0;
  inset-block-end: 0;
  height: 2.5px;
  width: 0;
  border-radius: 9999px;
  background: var(--accent-500);
  box-shadow: 0 0 12px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transform-origin: left center;
  transition:
    transform 380ms var(--ease-enter),
    width 380ms var(--ease-enter),
    opacity 220ms var(--ease-hover);
}

.nav-indicator.is-visible {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  flex-shrink: 0;
}

html.js-motion-ready.is-site-revealed .header-actions > * {
  animation: headerFadeIn 420ms var(--ease-enter) 260ms both;
}

@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-btn-secondary-bg);
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  transition:
    background-color 200ms var(--ease-hover),
    border-color 200ms var(--ease-hover),
    color 200ms var(--ease-hover),
    box-shadow 220ms var(--ease-hover),
    transform 220ms var(--ease-enter);
}

.header-icon-link:active {
  transform: scale(0.95);
}

/* Animated Sun / Moon Cross-Rotate Transition */
.theme-toggle svg {
  position: absolute;
  transition:
    transform 320ms var(--ease-enter),
    opacity 220ms var(--ease-hover);
}

html[data-theme='dark'] .theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

html[data-theme='dark'] .theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.55);
  pointer-events: none;
}

html[data-theme='light'] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.55);
  pointer-events: none;
}

html[data-theme='light'] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* EN/AR Pill Glass Toggle */
.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-btn-secondary-bg);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 200ms var(--ease-hover),
    border-color 200ms var(--ease-hover),
    color 200ms var(--ease-hover),
    box-shadow 220ms var(--ease-hover),
    transform 220ms var(--ease-enter);
}

.lang-pill:active {
  transform: scale(0.96);
}

.lang-pill-opt {
  color: var(--text-tertiary);
  transition: color 180ms var(--ease-hover);
}

.lang-pill-opt.is-current {
  color: var(--text-primary);
}

.lang-pill-sep {
  color: var(--text-tertiary);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-btn-secondary-bg);
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 180ms var(--ease-hover),
    border-color 180ms var(--ease-hover),
    transform 200ms var(--ease-enter);
}

.menu-toggle:active {
  transform: scale(0.95);
}

@media (min-width: 768px) {
  html:not(.is-compact-nav) .menu-toggle {
    display: none;
  }
}

/* Comfortable Touch Targets Driven by Input Capabilities (Even on Wide Touch Tablets) */
@media (pointer: coarse), (hover: none) {
  .header-icon-link {
    width: 44px;
    height: 44px;
  }

  .lang-pill {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
  }

  .filter-tab,
  .copy-btn,
  .social-link-inline,
  .footer-link {
    min-width: 44px;
    min-height: 44px;
  }
}

html[data-input='touch'] .header-icon-link,
html[data-input='hybrid'] .header-icon-link {
  width: 44px;
  height: 44px;
}

html[data-input='touch'] .lang-pill,
html[data-input='hybrid'] .lang-pill {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 12px;
}

html[data-input='touch'] .filter-tab,
html[data-input='touch'] .copy-btn,
html[data-input='touch'] .social-link-inline,
html[data-input='touch'] .footer-link {
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 479px) {
  .lang-pill {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 359px) {
  .header-inner {
    padding-inline: 8px;
    gap: 4px;
  }

  .header-actions {
    gap: 4px;
  }

  .lang-pill {
    padding-inline: 8px;
  }
}

@media (max-width: 339px) {
  .header-actions a.header-icon-link {
    display: none;
  }
}

/* Mobile & Compact-Nav Floating Glass Drawer (Safe-Area & Dynamic Viewport Height Aware) */
.mobile-drawer {
  position: fixed;
  inset-block-start: calc(var(--header-offset) + var(--header-height) + 8px);
  left: calc(clamp(10px, 2vw, 24px) + var(--safe-left));
  right: calc(clamp(10px, 2vw, 24px) + var(--safe-right));
  max-width: 460px;
  margin-inline-start: auto;
  max-height: calc(var(--vv-h, 100dvh) - var(--header-offset) - var(--header-height) - 20px - var(--safe-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 55;
  border-radius: var(--radius-lg);
  background: rgba(14, 15, 21, 0.94);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-hover);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 240ms var(--ease-enter),
    transform 240ms var(--ease-enter);
}

@media (max-width: 639px) {
  .mobile-drawer {
    max-width: none;
  }
}

html[data-theme='light'] .mobile-drawer {
  background: rgba(255, 255, 255, 0.95);
}

.mobile-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  touch-action: manipulation;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 220ms var(--ease-enter),
    transform 240ms var(--ease-enter),
    background-color 160ms var(--ease-hover),
    color 160ms var(--ease-hover);
}

.mobile-drawer.is-open .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
  transition-delay: calc(var(--mobile-idx, 0) * 40ms), calc(var(--mobile-idx, 0) * 40ms), 0ms, 0ms;
}

.mobile-nav-link.is-active,
.mobile-nav-link:active {
  background: var(--accent-soft);
  color: var(--text-primary);
}

/* ==========================================================================
   4. Reusable Glassmorphism System
   ========================================================================== */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: var(--hairline, 1px) solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-subpanel {
  background: var(--glass-bg-sub);
  border: var(--hairline, 1px) solid var(--border-subtle);
}

.glass-interactive {
  position: relative;
  overflow: hidden;
  transition:
    border-color 240ms var(--ease-hover),
    box-shadow 320ms var(--ease-spatial),
    transform 320ms var(--ease-enter);
}

.glass-interactive::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--glow-x, 50%) var(--glow-y, 20%),
    var(--glass-glow-spot) 0%,
    transparent 65%
  );
  opacity: 0;
  transition: opacity 260ms var(--ease-hover);
}

/* Main Content & 300ms Language Crossfade */
main {
  padding-block-start: calc(var(--header-offset) + var(--header-height));
  transition: opacity 150ms var(--ease-hover);
}

main.is-lang-fading {
  opacity: 0;
}

/* Sections & Fluid Vertical Rhythm */
.section {
  position: relative;
  padding-block: var(--section-pad-block);
  border-top: var(--hairline, 1px) solid var(--border-subtle);
}

.section-alt {
  background: var(--bg-alt);
}

.section-hero {
  border-top: none;
  padding-block: var(--hero-pad-top) var(--hero-pad-bottom);
  overflow: hidden;
}

/* Hero Ambient Glow & Architectural Grid */
.hero-ambient-glow {
  position: absolute;
  top: -12%;
  inset-inline-start: 10%;
  width: min(820px, 90vw);
  height: min(600px, 78vh);
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(61, 169, 252, 0.14) 0%,
    rgba(139, 92, 246, 0.08) 40%,
    rgba(34, 211, 238, 0.05) 60%,
    transparent 76%
  );
  filter: blur(44px);
  animation: heroAmbientDrift 16s ease-in-out infinite alternate;
}

html[data-theme='light'] .hero-ambient-glow {
  background: radial-gradient(
    ellipse at center,
    rgba(9, 105, 218, 0.09) 0%,
    rgba(139, 92, 246, 0.05) 42%,
    rgba(15, 118, 110, 0.03) 62%,
    transparent 76%
  );
}

@keyframes heroAmbientDrift {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
    opacity: 0.78;
  }
  100% {
    transform: translate3d(4%, 5%, 0) scale(1.08);
    opacity: 1;
  }
}

.hero-grid-bg {
  position: absolute;
  inset: -64px;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--hero-grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hero-grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 72% 62% at 50% 34%, #000 32%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 34%, #000 32%, transparent 100%);
  animation: heroGridDrift 28s linear infinite;
}

html.js-motion-ready.is-site-revealed .hero-grid-bg {
  animation:
    heroGridReveal 900ms var(--ease-enter) both,
    heroGridDrift 28s linear infinite;
}

@keyframes heroGridReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes heroGridDrift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(64px, 64px, 0);
  }
}

.section-hero.is-ambient-paused .hero-ambient-glow,
.section-hero.is-ambient-paused .hero-grid-bg {
  animation-play-state: paused;
}

.hero-container {
  position: relative;
  z-index: 1;
}

.section-header {
  max-width: 720px;
  margin-bottom: var(--space-6);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  font-variant-numeric: tabular-nums;
}

html[lang='ar'] .eyebrow {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  line-height: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0 0 16px;
  text-wrap: balance;
}

html[lang='ar'] .section-title {
  line-height: 1.32;
}

.section-subtitle {
  font-size: 17px;
  line-height: 28px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 64ch;
}

html[lang='ar'] .section-subtitle {
  line-height: 31px;
  max-width: 55ch;
}

/* ==========================================================================
   3. Hero Section & Device-Aware Container + Height Adaptation
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3.6vw, 48px);
  align-items: center;
}

.hero-copy {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.portrait-column {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
}

@container (min-width: 820px) {
  .hero-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(28px, 4cqi, 48px);
  }

  .hero-copy {
    grid-column: 1 / span 7;
  }

  .portrait-column {
    grid-column: 8 / span 5;
  }
}

/* Compact/short landscape viewports (e.g. mobile landscape 844x390 or small netbook):
   preserve side-by-side balance and keep primary copy + portrait harmoniously framed */
@media (orientation: landscape) and (max-height: 560px) and (min-width: 600px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
    gap: clamp(18px, 3vw, 32px);
    align-items: center;
  }

  .hero-copy {
    grid-column: 1 / 2;
  }

  .portrait-column {
    grid-column: 2 / 3;
  }
}

.hero-identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

html.js-motion-ready.is-site-revealed .hero-identity {
  animation: heroFadeSlideUp 520ms var(--ease-enter) 80ms both;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0;
}

html[lang='ar'] .hero-name {
  font-family: var(--font-arabic);
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 22px;
}

/* Hero Role Typing Animation + Blinking Cursor */
.hero-typing-line {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  color: var(--text-primary);
}

html[lang='ar'] .hero-typing-line {
  font-family: var(--font-arabic);
  min-height: 32px;
  line-height: 32px;
}

.hero-typed-role {
  display: inline;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-inline-start: 4px;
  background: var(--accent-500);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: cursorBlink 0.9s steps(2, start) infinite;
}

@keyframes cursorBlink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.hero-kicker {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-tertiary);
  margin: 0;
}

html[lang='ar'] .hero-kicker {
  line-height: 26px;
}

/* Dual-axis Fluid Hero Display Headline (scales by width AND height) */
.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(28px, min(4.6vw, 6.4dvh), 66px);
  font-weight: 700;
  line-height: 1.09;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 clamp(16px, 2.6dvh, 24px);
}

html[lang='ar'] .hero-headline {
  font-size: clamp(26px, min(4vw, 5.8dvh), 56px);
  line-height: 1.3;
  letter-spacing: 0;
}

/* Line-by-line Hero Clipping Reveal (85ms stagger) */
.hero-line-wrap {
  display: block;
  overflow: hidden;
  padding-block: 0.16em;
  margin-block: -0.16em;
}

html[lang='ar'] .hero-line-wrap {
  padding-block: 0.28em;
  margin-block: -0.28em;
}

.hero-line {
  display: block;
}

html.is-site-revealed .hero-line {
  animation: heroLineReveal 600ms var(--ease-enter) both;
  animation-delay: calc(100ms + var(--line-idx, 0) * 75ms);
}

html.is-hero-settled .hero-line,
html.is-hero-settled .metric-cell {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}

@keyframes heroLineReveal {
  from {
    opacity: 0;
    transform: translateY(105%);
    clip-path: inset(0 0 100% 0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    clip-path: inset(0 0 0 0);
  }
}

@keyframes heroFadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroRuleExpand {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.hero-accent-line {
  width: 56px;
  height: 2px;
  background: var(--accent-500);
  box-shadow: 0 0 12px var(--accent-glow);
  margin: 0 0 clamp(14px, 2.4dvh, 24px);
  transform-origin: left center;
}

[dir='rtl'] .hero-accent-line {
  transform-origin: right center;
}

html.js-motion-ready.is-site-revealed .hero-accent-line {
  animation: heroRuleExpand 500ms var(--ease-enter) 360ms both;
}

.hero-intro {
  font-size: clamp(15.5px, 1.02rem + 0.15vw, 18px);
  line-height: 1.62;
  color: var(--text-secondary);
  max-width: 58ch;
  margin: 0 0 clamp(20px, 3.2dvh, 32px);
}

html.js-motion-ready.is-site-revealed .hero-intro {
  animation: heroFadeSlideUp 520ms var(--ease-enter) 410ms both;
}

html[lang='ar'] .hero-intro {
  line-height: 32px;
  max-width: 52ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

html.js-motion-ready.is-site-revealed .hero-actions .btn:first-child {
  animation: heroFadeSlideUp 480ms var(--ease-enter) 470ms both;
}

html.js-motion-ready.is-site-revealed .hero-actions .btn:nth-child(2) {
  animation: heroFadeSlideUp 480ms var(--ease-enter) 540ms both;
}

.hero-social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}

html.js-motion-ready.is-site-revealed .hero-social-row {
  animation: heroFadeSlideUp 480ms var(--ease-enter) 590ms both;
}

.social-link-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding-inline: 6px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  touch-action: manipulation;
  transition: color 180ms var(--ease-hover), transform 220ms var(--ease-enter);
}

.social-link-inline .icon-brand {
  transition: transform 240ms var(--ease-enter);
}

/* ==========================================================================
   6. Premium Pill-Shaped Glass Buttons
   ========================================================================== */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px clamp(20px, 2.4vw, 26px);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  border: 1px solid transparent;
  transition:
    background-color 220ms var(--ease-hover),
    border-color 220ms var(--ease-hover),
    color 220ms var(--ease-hover),
    box-shadow 280ms var(--ease-spatial),
    transform 260ms var(--ease-enter);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 75%;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  transition: left 520ms var(--ease-enter);
}

.btn .icon-directional {
  transition: transform 240ms var(--ease-enter);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-500);
  color: var(--on-accent);
  box-shadow:
    0 12px 28px -10px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:active {
  background: var(--accent-pressed);
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--glass-btn-secondary-bg);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  color: var(--accent-ink);
  border-color: var(--accent-border);
  box-shadow:
    0 10px 24px -14px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 var(--glass-highlight);
}

.btn-secondary:active {
  color: var(--accent-pressed);
  border-color: var(--accent-pressed);
  transform: scale(0.98);
}

/* ==========================================================================
   Floating Portrait Frame + Ambient Halo + 3D Perspective
   ========================================================================== */
.portrait-ambient-halo {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(61, 169, 252, 0.22) 0%,
    rgba(139, 92, 246, 0.14) 48%,
    transparent 74%
  );
  filter: blur(42px);
  pointer-events: none;
  z-index: 0;
  animation: portraitHaloPulse 8s ease-in-out infinite alternate;
}

html[data-theme='light'] .portrait-ambient-halo {
  background: radial-gradient(
    circle,
    rgba(9, 105, 218, 0.14) 0%,
    rgba(139, 92, 246, 0.09) 48%,
    transparent 74%
  );
}

@keyframes portraitHaloPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.06);
    opacity: 1;
  }
}

.portrait-frame {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  aspect-ratio: 4 / 5;
  max-height: clamp(250px, 52dvh, 520px);
  width: min(100%, 420px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition:
    transform 280ms var(--ease-spatial),
    border-color 240ms var(--ease-hover),
    box-shadow 320ms var(--ease-spatial);
  will-change: transform;
}

@container (min-width: 820px) {
  .portrait-frame {
    width: 100%;
    margin: 0;
    max-height: clamp(280px, 58dvh, 520px);
  }
}

@media (max-width: 479px) {
  .portrait-caption {
    inset-block-end: 10px;
    inset-inline: 10px;
    padding: 10px 14px;
  }

  .portrait-caption-name {
    font-size: 15px;
    line-height: 20px;
  }

  .portrait-caption-role {
    font-size: 12px;
    line-height: 16px;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (min-width: 600px) {
  .portrait-frame {
    width: min(100%, 268px);
    aspect-ratio: 4 / 4.3;
    max-height: clamp(220px, 68dvh, 320px);
    margin: 0 auto;
  }

  .portrait-img {
    object-position: 46% 32%;
  }

  .portrait-caption {
    inset-block-end: 8px;
    inset-inline: 8px;
    padding: 7px 11px;
    border-radius: 10px;
  }

  .portrait-caption-name {
    font-size: 13px;
    line-height: 17px;
    margin-bottom: 1px;
  }

  .portrait-caption-role {
    font-size: 11px;
    line-height: 14px;
  }
}

html.js-motion-ready.is-site-revealed .portrait-column {
  animation:
    heroPortraitIn 680ms var(--ease-enter) 190ms both,
    portraitFloat 6.5s ease-in-out 900ms infinite;
}

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

@keyframes heroPortraitIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroPortraitImgSettle {
  from {
    transform: scale(1.07);
  }
  to {
    transform: scale(1);
  }
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 24%;
  display: block;
  transition: transform 640ms var(--ease-enter);
}

html.js-motion-ready.is-site-revealed .portrait-img {
  animation: heroPortraitImgSettle 900ms var(--ease-enter) 190ms both;
}

.spatial-emblem-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 50% 38%, rgba(61, 169, 252, 0.14) 0%, transparent 62%),
    var(--glass-bg);
  transition: transform 640ms var(--ease-enter);
}

.spatial-emblem-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Measured contrast scrim ensures caption legibility over photography in both themes */
.portrait-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(9, 9, 11, 0.78) 0%,
    rgba(9, 9, 11, 0.22) 34%,
    transparent 62%
  );
  pointer-events: none;
}

html[data-theme='light'] .portrait-scrim {
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.42) 0%,
    rgba(15, 23, 42, 0.12) 32%,
    transparent 60%
  );
}

.portrait-caption {
  position: absolute;
  inset-block-end: 14px;
  inset-inline: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(12, 13, 18, 0.66);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

html[data-theme='light'] .portrait-caption {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.12);
}

.portrait-caption-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  color: #F4F4F2;
  margin: 0 0 2px;
}

html[data-theme='light'] .portrait-caption-name {
  color: #101216;
}

.portrait-caption-role {
  font-size: 13px;
  line-height: 18px;
  color: #D2D4DC;
  margin: 0;
}

html[data-theme='light'] .portrait-caption-role {
  color: #484C58;
}

.portrait-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

/* Glass Hero Specification Strip (CSS Container Query Driven) */
.hero-metrics {
  container-type: inline-size;
  margin-top: clamp(24px, 4.5dvh, 48px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.metric-cell {
  padding: clamp(14px, 2cqi, 22px) clamp(14px, 2.2cqi, 24px);
  border-bottom: 1px solid var(--border-subtle);
  border-inline-end: 1px solid var(--border-subtle);
  transition: background-color 200ms var(--ease-hover);
}

html.js-motion-ready.is-site-revealed .metric-cell {
  animation: heroFadeSlideUp 480ms var(--ease-enter) both;
  animation-delay: calc(580ms + var(--stagger-idx, 0) * 60ms);
}

@container (max-width: 340px) {
  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .metric-cell {
    border-inline-end: none;
  }

  .metric-cell:last-child {
    border-bottom: none;
  }
}

@container (min-width: 341px) and (max-width: 699px) {
  .metric-cell:nth-child(2n) {
    border-inline-end: none;
  }

  .metric-cell:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

@container (min-width: 700px) {
  .hero-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metric-cell {
    border-bottom: none;
  }

  .metric-cell:nth-child(2n) {
    border-inline-end: 1px solid var(--border-subtle);
  }

  .metric-cell:last-child {
    border-inline-end: none;
  }
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: var(--text-tertiary);
  margin: 0 0 4px;
}

.metric-value {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

/* ==========================================================================
   Section 01: About (Editorial Narrative + Open Ledger)
   ========================================================================== */
.about-grid {
  display: grid;
  gap: clamp(28px, 4cqi, 56px);
  align-items: start;
}

@container (min-width: 780px) {
  .about-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(32px, 5cqi, 64px);
  }
}

.about-prose {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 27px;
  max-width: 60ch;
}

.about-prose .about-lead {
  font-size: 18px;
  line-height: 30px;
  color: var(--text-primary);
  font-weight: 500;
}

html[lang='ar'] .about-prose {
  line-height: 30px;
  max-width: 55ch;
}

html[lang='ar'] .about-prose .about-lead {
  font-size: 18px;
  line-height: 32px;
}

.about-prose p {
  margin: 0;
}

.ledger-panel {
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  padding-block: 24px;
}

.ledger-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 12px;
}

html[lang='ar'] .ledger-title {
  font-family: var(--font-arabic);
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  line-height: 24px;
}

.ledger-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ledger-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: 14px;
  border-top: 1px solid var(--border-subtle);
}

.ledger-row:first-child {
  border-top: none;
}

.ledger-row:last-child {
  padding-block-end: 0;
}

.ledger-key {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-tertiary);
}

.ledger-val {
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
  color: var(--text-primary);
}

/* ==========================================================================
   Sections 02 & 03: Experience & Education Editorial Split-Rail Layout
   ========================================================================== */
.split-record {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3cqi, 32px);
  padding-top: clamp(24px, 4cqi, 48px);
  border-top: var(--hairline, 1px) solid var(--border-default);
}

.record-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.record-body {
  min-width: 0;
}

@container (min-width: 780px) {
  .split-record {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(28px, 4cqi, 48px);
    padding-top: var(--space-6);
  }

  .record-meta {
    grid-column: 1 / span 4;
  }

  .record-body {
    grid-column: 5 / span 8;
  }
}

.record-period {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
}

html[lang='ar'] .record-period {
  font-family: var(--font-arabic);
  line-height: 22px;
}

.record-org {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text-primary);
  margin: 4px 0 0;
}

.record-location {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-tertiary);
  margin: 0;
}

.role-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 20px;
}

html[lang='ar'] .role-title {
  line-height: 1.4;
}

.highlights-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.highlights-list li {
  position: relative;
  padding-block: 12px;
  padding-inline-start: 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 26px;
  max-width: 65ch;
}

.highlights-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 23px;
  width: 6px;
  height: 1.5px;
  background: var(--accent-500);
}

.highlights-list li:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

html[lang='ar'] .highlights-list li {
  line-height: 30px;
  max-width: 55ch;
}

html[lang='ar'] .highlights-list li::before {
  top: 25px;
}

.education-desc {
  font-size: 16px;
  line-height: 27px;
  color: var(--text-secondary);
  max-width: 62ch;
  margin: 0 0 24px;
}

html[lang='ar'] .education-desc {
  line-height: 30px;
  max-width: 55ch;
}

.inline-spec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  font-size: 14px;
  line-height: 22px;
}

.inline-spec-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.inline-spec-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* ==========================================================================
   Section 04: Featured Case Study (Signature Glass Showcase)
   ========================================================================== */
.case-study-showcase {
  container-type: inline-size;
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4cqi, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3.5cqi, 48px);
}

.case-study-top {
  padding-bottom: clamp(18px, 3cqi, 24px);
  border-bottom: 1px solid var(--border-subtle);
}

.case-study-top-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-scope-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--accent-ink);
  margin: 0;
}

html[lang='ar'] .case-scope-meta {
  font-family: var(--font-arabic);
  line-height: 22px;
}

.project-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.5vw, 32px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}

html[lang='ar'] .project-title {
  line-height: 1.38;
}

.project-summary {
  font-size: clamp(15.5px, 1.05rem, 17px);
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  max-width: 65ch;
}

html[lang='ar'] .project-summary {
  line-height: 31px;
  max-width: 55ch;
}

.case-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 3cqi, 40px);
}

@container (min-width: 620px) {
  .case-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, 4cqi, 48px);
  }
}

.case-column {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.case-block-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.case-block-text {
  font-size: 15px;
  line-height: 25px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 65ch;
}

html[lang='ar'] .case-block-text {
  line-height: 29px;
  max-width: 55ch;
}

/* Container-Adaptive Labeled System Architecture Schematic */
.arch-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arch-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.arch-caption {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-tertiary);
  margin: 0;
}

.arch-schematic {
  container-type: inline-size;
  position: relative;
  border-radius: var(--radius-md);
  padding: clamp(16px, 3cqi, 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

@container (min-width: 760px) {
  .arch-schematic {
    min-height: clamp(320px, 42cqi, 480px);
  }
}

.arch-svg-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: var(--border-subtle);
}

.arch-pipeline {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-block: auto;
}

@container (min-width: 460px) and (max-width: 759px) {
  .arch-pipeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container (min-width: 760px) {
  .arch-pipeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.arch-node {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition:
    border-color 220ms var(--ease-hover),
    background 220ms var(--ease-hover),
    box-shadow 260ms var(--ease-spatial),
    transform 260ms var(--ease-enter);
}

.arch-node.is-highlighted {
  border-color: var(--accent-500);
  box-shadow: 0 12px 28px -12px var(--accent-glow);
  transform: translateY(-4px);
}

@container (min-width: 760px) {
  .arch-node {
    min-height: 176px;
  }
}

.arch-connector {
  display: none;
}

@container (min-width: 760px) {
  .arch-connector {
    position: absolute;
    right: -14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    z-index: 2;
    pointer-events: none;
    transition: color 200ms var(--ease-hover), transform 220ms var(--ease-enter);
  }

  .arch-node.is-highlighted .arch-connector {
    color: var(--accent-ink);
    transform: translateY(-50%) translateX(2px);
  }
}

.arch-node-code {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  color: var(--text-tertiary);
}

.arch-node-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text-primary);
  margin: 0;
}

.arch-node-detail {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
  margin: 0;
}

.arch-bus-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
  color: var(--text-tertiary);
}

/* Simulation Results Table */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
}

.verified-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--accent-data);
  flex-shrink: 0;
  animation: verifiedPulse 3.2s ease-in-out infinite;
}

@keyframes verifiedPulse {
  0%, 100% {
    opacity: 0.72;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.results-summary-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
  color: var(--text-primary);
  margin: 0;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
  font-size: 14px;
  line-height: 22px;
}

.results-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.results-table td {
  padding: 14px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.results-table tbody tr {
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 180ms var(--ease-hover);
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.results-table tbody tr.is-selected {
  background: var(--accent-soft);
}

.results-table td.scenario-code-cell {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.results-table td.scenario-name-cell {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.status-chip[data-status='nominal'] {
  color: var(--accent-data);
  border-color: var(--data-border);
}

.status-chip[data-status='warning'] {
  color: var(--text-primary);
  border-color: var(--border-default);
}

.status-chip[data-status='fault'] {
  color: var(--error);
  border-color: var(--border-default);
}

.case-limitations {
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.case-tech-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.case-tech-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.case-tech-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition:
    color 200ms var(--ease-hover),
    background-color 200ms var(--ease-hover),
    transform 220ms var(--ease-enter);
}

.tech-sep {
  color: var(--text-tertiary);
}

/* ==========================================================================
   Section 05: Technical Skills Precision Matrix + Fluid Container Grid
   ========================================================================== */
.skills-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-md);
  width: fit-content;
  max-width: 100%;
  margin-bottom: clamp(20px, 3.5cqi, 32px);
}

@container (min-width: 720px) {
  .skills-toolbar {
    border-radius: var(--radius-pill);
    gap: 4px;
    padding: 5px;
  }
}

.filter-tab {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 200ms var(--ease-hover),
    border-color 200ms var(--ease-hover),
    color 200ms var(--ease-hover),
    box-shadow 220ms var(--ease-hover),
    transform 180ms var(--ease-enter);
}

.filter-tab:active {
  transform: scale(0.97);
}

.filter-tab.is-active {
  background: var(--accent-500);
  color: var(--on-accent);
  font-weight: 600;
  box-shadow: 0 6px 16px -6px var(--accent-glow);
}

.skills-grid {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1px;
  background: var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skill-card {
  background: var(--glass-bg);
  padding: clamp(18px, 2.4cqi, 24px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition:
    background-color 220ms var(--ease-hover),
    box-shadow 260ms var(--ease-spatial),
    transform 260ms var(--ease-enter);
}

.skill-card.is-filter-entering {
  animation: skillFilterIn 360ms var(--ease-enter) both;
  animation-delay: calc(var(--stagger-idx, 0) * 45ms);
}

@keyframes skillFilterIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skill-domain {
  font-size: 12px;
  line-height: 18px;
  color: var(--accent-ink);
  font-weight: 600;
}

.skill-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
  color: var(--text-primary);
  margin: 0;
}

.skill-context {
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
  margin: 0;
}

/* ==========================================================================
   Section 06: Contact (Container Query Adaptive)
   ========================================================================== */
.contact-grid {
  display: grid;
  gap: clamp(20px, 3cqi, 32px);
  align-items: start;
}

@container (min-width: 780px) {
  .contact-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(24px, 3.5cqi, 36px);
  }
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.channel-row {
  container-type: inline-size;
  border-radius: var(--radius-md);
  padding: clamp(14px, 2.5vw, 20px) clamp(16px, 3vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

@container (max-width: 340px) {
  .channel-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.channel-info {
  min-width: 0;
}

.channel-label {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-tertiary);
  margin: 0 0 4px;
}

.channel-value {
  font-size: clamp(14px, 0.9rem + 0.25vw, 16px);
  font-weight: 500;
  line-height: 24px;
  color: var(--text-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.copy-btn {
  min-height: 38px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: var(--glass-btn-secondary-bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 180ms var(--ease-hover),
    color 180ms var(--ease-hover),
    border-color 180ms var(--ease-hover),
    transform 180ms var(--ease-enter);
}

.copy-btn:active {
  transform: scale(0.96);
}

.copy-btn.is-copied {
  color: var(--accent-data);
  border-color: var(--data-border);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

.contact-form {
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3.5cqi, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.form-subtitle {
  font-size: 15px;
  line-height: 24px;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--glass-bg-sub);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  transition: border-color 180ms var(--ease-hover), box-shadow 180ms var(--ease-hover);
}

.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-input[aria-invalid='true'],
.field-textarea[aria-invalid='true'] {
  border-color: var(--error);
}

.field-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  font-size: 14px;
  line-height: 20px;
  color: var(--error);
  margin: 0;
  min-height: 20px;
}

/* Footer (Safe-Area Bottom Aware) */
.site-footer {
  border-top: var(--hairline, 1px) solid var(--border-subtle);
  padding-block: 32px calc(32px + var(--safe-bottom));
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-tertiary);
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  touch-action: manipulation;
  transition: color 180ms var(--ease-hover), transform 220ms var(--ease-enter);
}

.footer-link .icon-brand {
  transition: transform 220ms var(--ease-enter);
}

/* ==========================================================================
   Capability-Gated Fine Pointer Hover Effects (Mouse / Trackpad Only)
   Prevents sticky hover lift/glow on touch-first environments
   ========================================================================== */
@media (hover: hover) and (pointer: fine) {
  .brand-mark:hover {
    opacity: 0.88;
    transform: translateY(-1px);
  }

  .nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
  }

  .nav-link:hover::after {
    opacity: 0.7;
    transform: scaleX(1);
  }

  .header-icon-link:hover {
    background: var(--glass-btn-secondary-hover);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
    box-shadow: 0 6px 18px -6px var(--accent-glow);
    transform: translateY(-1px) scale(1.04);
  }

  .lang-pill:hover {
    background: var(--glass-btn-secondary-hover);
    border-color: var(--glass-border-hover);
    box-shadow: 0 6px 18px -6px var(--accent-glow);
    transform: translateY(-1px);
  }

  .menu-toggle:hover {
    background: var(--glass-btn-secondary-hover);
    border-color: var(--glass-border-hover);
  }

  .mobile-nav-link:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
  }

  .glass-interactive:hover::after {
    opacity: 1;
  }

  .glass-interactive:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--glass-shadow-hover);
  }

  .social-link-inline:hover,
  .footer-link:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
  }

  .social-link-inline:hover .icon-brand,
  .footer-link:hover .icon-brand {
    transform: translateY(-2px) scale(1.08);
  }

  .btn:hover::before {
    left: 135%;
  }

  .btn:hover .icon-directional {
    transform: translateX(4px);
  }

  [dir='rtl'] .btn:hover .icon-directional {
    transform: scaleX(-1) translateX(4px);
  }

  .btn-primary:hover {
    background: var(--accent-hover);
    box-shadow:
      0 16px 34px -8px var(--accent-glow),
      inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transform: translateY(-2px) scale(1.02);
  }

  .btn-secondary:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    background: var(--glass-btn-secondary-hover);
    box-shadow:
      0 14px 30px -10px var(--accent-glow),
      inset 0 1px 0 var(--glass-highlight);
    transform: translateY(-2px) scale(1.02);
  }

  .portrait-frame:hover .portrait-img {
    transform: scale(1.03);
  }

  .metric-cell:hover {
    background: var(--accent-soft);
  }

  .case-study-showcase:hover {
    transform: translateY(-2px);
  }

  .arch-node:hover {
    border-color: var(--accent-500);
    box-shadow: 0 12px 28px -12px var(--accent-glow);
    transform: translateY(-4px);
  }

  .arch-node:hover .arch-connector {
    color: var(--accent-ink);
    transform: translateY(-50%) translateX(2px);
  }

  .results-table tbody tr:hover {
    background: var(--accent-soft);
  }

  .tech-tag:hover {
    color: var(--accent-ink);
    background: var(--accent-soft);
    transform: translateY(-2px);
  }

  .filter-tab:hover {
    color: var(--text-primary);
    background: var(--accent-soft);
  }

  .skill-card:hover {
    background: var(--bg-elevated);
    transform: translateY(-4px);
    z-index: 1;
  }

  .channel-row:hover {
    transform: translateY(-3px);
  }

  .channel-value:hover {
    color: var(--accent-ink);
  }

  .copy-btn:hover {
    background: var(--glass-btn-secondary-hover);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
  }
}

/* ==========================================================================
   5. AOS-Style Scroll & Staggered Motion
   ========================================================================== */
.reveal,
[data-aos] {
  opacity: 1;
  transform: none;
  transition:
    opacity 580ms var(--ease-enter),
    transform 620ms var(--ease-enter);
}

.js-reveal-ready .reveal,
.js-reveal-ready [data-aos='fade-up'] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
}

.js-reveal-ready [data-aos='fade-left'] {
  opacity: 0;
  transform: translate3d(28px, 0, 0);
}

.js-reveal-ready [data-aos='fade-right'] {
  opacity: 0;
  transform: translate3d(-28px, 0, 0);
}

.js-reveal-ready [data-aos='zoom-in'] {
  opacity: 0;
  transform: scale(0.96) translate3d(0, 16px, 0);
}

.js-reveal-ready .reveal.is-visible,
.js-reveal-ready [data-aos].is-visible,
.js-reveal-ready [data-aos].aos-animate {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.js-reveal-ready .reveal .reveal-child {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 480ms var(--ease-enter),
    transform 520ms var(--ease-enter);
  transition-delay: calc(var(--stagger-idx, 0) * 70ms);
}

.js-reveal-ready .reveal.is-visible .reveal-child {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ==========================================================================
   Reduced Motion Compliance (opacity-only <= 100ms, zero transforms/ambient motion)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .intro-overlay {
    display: none !important;
  }

  .ambient-canvas,
  .ambient-orb,
  .portrait-ambient-halo,
  .hero-ambient-glow,
  .hero-grid-bg,
  html.js-motion-ready .hero-grid-bg,
  .verified-dot,
  .typing-cursor,
  html.js-motion-ready .brand-mark,
  html.js-motion-ready .nav-link,
  html.js-motion-ready .header-actions > *,
  html.js-motion-ready .hero-identity,
  html.js-motion-ready .hero-accent-line,
  html.js-motion-ready .hero-intro,
  html.js-motion-ready .hero-actions .btn,
  html.js-motion-ready .hero-social-row,
  html.js-motion-ready .portrait-column,
  html.js-motion-ready .portrait-frame,
  html.js-motion-ready .portrait-img,
  html.js-motion-ready .metric-cell,
  .skill-card.is-filter-entering {
    animation: none !important;
    transform: none !important;
    clip-path: none !important;
    opacity: 1 !important;
  }

  .typing-cursor {
    display: none;
  }

  .hero-line {
    animation: heroOpacityFade 100ms linear both !important;
    animation-delay: 0ms !important;
    transform: none !important;
    clip-path: none !important;
  }

  @keyframes heroOpacityFade {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .reveal,
  [data-aos],
  .js-reveal-ready .reveal,
  .js-reveal-ready [data-aos],
  .js-reveal-ready .reveal .reveal-child {
    transform: none !important;
    transition: opacity 100ms linear !important;
    transition-delay: 0ms !important;
  }

  .js-reveal-ready .reveal:not(.is-visible),
  .js-reveal-ready [data-aos]:not(.is-visible),
  .js-reveal-ready .reveal:not(.is-visible) .reveal-child {
    opacity: 0;
    transform: none !important;
  }

  .js-reveal-ready .reveal.is-visible,
  .js-reveal-ready [data-aos].is-visible,
  .js-reveal-ready .reveal.is-visible .reveal-child {
    opacity: 1;
    transform: none !important;
  }

  .portrait-frame,
  .portrait-frame:hover .portrait-img,
  .portrait-frame:hover .spatial-emblem-stage,
  .skill-card:hover,
  .arch-node:hover,
  .arch-node.is-highlighted,
  .case-study-showcase:hover,
  .channel-row:hover,
  .tech-tag:hover,
  .header-icon-link:hover,
  .header-icon-link:active,
  .lang-pill:hover,
  .brand-mark:hover,
  .btn:hover,
  .btn:hover .icon-directional,
  .btn:active,
  .btn::before,
  .social-link-inline:hover,
  .social-link-inline:hover .icon-brand,
  .footer-link:hover,
  .footer-link:hover .icon-brand,
  .mobile-nav-link {
    transform: none !important;
  }

  .btn::before {
    display: none !important;
  }

  [dir='rtl'] .icon-directional,
  [dir='rtl'] .btn:hover .icon-directional {
    transform: scaleX(-1) !important;
  }

  .nav-link::after,
  .theme-toggle svg {
    transition: opacity 100ms linear !important;
    transform: none !important;
  }

  .btn,
  .nav-indicator,
  .mobile-drawer,
  .mobile-nav-link,
  main,
  html.theme-transitioning,
  html.theme-transitioning * {
    transition-duration: 100ms !important;
    transition-property: opacity, background-color, border-color, color !important;
    transition-delay: 0ms !important;
  }
}
