/* ==========================================================================
   Ahmed Al-Saiari | Network System Engineer Portfolio & Systems Hub
   Aesthetic: Organic, Living Glassmorphism + Interactive Particle Network
   Supports Arabic (RTL) & English (LTR), Dark & Light Themes
   ========================================================================== */

:root {
  /* Dark Mode (Default) */
  --bg-canvas: #060911;
  --bg-surface: rgba(17, 25, 42, 0.72);
  --bg-elevated: rgba(28, 39, 66, 0.85);
  --bg-glass: rgba(11, 16, 29, 0.75);

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;

  --accent-primary: #06B6D4;
  --accent-primary-hover: #22D3EE;
  --accent-secondary: #3B82F6;
  --accent-emerald: #10B981;

  --status-online: #10B981;
  --status-warning: #F59E0B;
  --status-danger: #EF4444;

  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-highlight: rgba(6, 182, 212, 0.55);
  --shadow-card: 0 20px 45px -15px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 35px -5px rgba(6, 182, 212, 0.25);

  --font-display: 'Space Grotesk', 'Tajawal', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Plus Jakarta Sans', 'Tajawal', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container-max: 1280px;
  --nav-height: 76px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

[data-theme="light"] {
  --bg-canvas: #F4F7FB;
  --bg-surface: rgba(255, 255, 255, 0.82);
  --bg-elevated: rgba(241, 245, 249, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.82);

  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;

  --accent-primary: #0284C7;
  --accent-primary-hover: #0369A1;
  --accent-secondary: #2563EB;
  --accent-emerald: #059669;

  --border-subtle: rgba(15, 23, 42, 0.1);
  --border-highlight: rgba(2, 132, 199, 0.5);
  --shadow-card: 0 18px 40px -12px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 30px -5px rgba(2, 132, 199, 0.2);
}

/* ==========================================================================
   Reset & Base Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

[dir="rtl"] body {
  font-family: 'Tajawal', 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.85;
  font-weight: 500;
}

/* ==========================================================================
   Living Ambient Background Scene (Canvas + Aurora Floating Orbs)
   ========================================================================== */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-emerald));
  z-index: 2000;
  box-shadow: 0 0 12px var(--accent-primary);
  transition: width 0.08s ease-out;
}

.ambient-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-image:
    linear-gradient(to right, rgba(6, 182, 212, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6, 182, 212, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
}

[data-theme="light"] .ambient-scene {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
}

.network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.75;
}

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

[data-theme="light"] .ambient-orb {
  opacity: 0.18;
}

.orb-cyan {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #06B6D4 0%, transparent 70%);
  top: -120px;
  left: -100px;
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-blue {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, #3B82F6 0%, transparent 70%);
  top: 30%;
  right: -160px;
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.orb-emerald {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #10B981 0%, transparent 70%);
  bottom: -140px;
  left: 25%;
  animation: floatOrb3 20s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(90px, 60px) scale(1.12); }
  100% { transform: translate(-30px, 120px) scale(0.95); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-110px, -70px) scale(1.08); }
  100% { transform: translate(-50px, 90px) scale(0.92); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(80px, -80px) scale(1.15); }
  100% { transform: translate(-70px, -30px) scale(0.96); }
}

.site-header,
main,
.site-footer,
.flash-stack {
  position: relative;
  z-index: 1;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] .font-display {
  letter-spacing: 0;
  line-height: 1.38;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

a:hover {
  color: var(--accent-primary-hover);
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

main {
  flex: 1;
}

/* ==========================================================================
   Scroll Reveal & Stagger Animations
   ========================================================================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   Top Sticky Navigation Bar (Glassmorphic)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--text-primary);
}

.brand-logo:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.brand-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.35));
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.brand-logo:hover .brand-emblem {
  transform: rotate(8deg) scale(1.06);
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.65));
}

.brand-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-primary);
  font-weight: 500;
}

[dir="rtl"] .brand-subtitle {
  font-family: var(--font-sans);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 4px;
  position: relative;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle-btn,
.lang-toggle-btn {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-toggle-btn {
  width: 40px;
}

.lang-toggle-btn {
  padding: 0 14px;
  font-size: 0.84rem;
  font-weight: 600;
  gap: 6px;
  color: var(--text-primary);
}

.theme-toggle-btn:hover,
.lang-toggle-btn:hover {
  border-color: var(--border-highlight);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   Buttons & Badges (Interactive Shimmer & Lift)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  font-size: 0.93rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 24px -4px rgba(6, 182, 212, 0.42);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}

.btn-primary:hover::before {
  left: 140%;
}

.btn-primary:hover {
  color: #FFFFFF;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(6, 182, 212, 0.6);
}

.btn-outline {
  background: var(--bg-surface);
  backdrop-filter: blur(10px);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--border-highlight);
  color: var(--accent-primary);
  background: var(--bg-elevated);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
}

.btn-danger:hover {
  background: var(--status-danger);
  color: #FFFFFF;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 7px 15px;
  font-size: 0.83rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.14);
  color: var(--accent-primary);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

[dir="rtl"] .badge {
  font-family: var(--font-sans);
}

/* ==========================================================================
   Hero Section & Animated Terminal Simulator
   ========================================================================== */
.hero-section {
  padding: 76px 0 56px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-highlight);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 22px;
  box-shadow: var(--shadow-glow);
  animation: fadeSlideDown 0.7s ease-out both;
}

[dir="rtl"] .hero-eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2.25rem, 4vw + 0.5rem, 3.55rem);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.15;
  animation: fadeSlideUp 0.75s 0.1s ease-out both;
}

[dir="rtl"] .hero-title {
  line-height: 1.3;
}

.text-gradient {
  background: linear-gradient(90deg, #22D3EE 0%, #3B82F6 50%, #10B981 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 6s linear infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-lead {
  font-size: 1.06rem;
  color: var(--text-secondary);
  max-width: 64ch;
  margin-bottom: 32px;
  animation: fadeSlideUp 0.8s 0.2s ease-out both;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
  animation: fadeSlideUp 0.85s 0.3s ease-out both;
}

.cv-download-split {
  display: inline-flex;
  align-items: stretch;
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.cv-download-split:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.cv-split-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  border-inline-end: 1px solid var(--border-subtle);
  transition: background 0.2s ease, color 0.2s ease;
}

.cv-split-main:hover {
  background: rgba(6, 182, 212, 0.14);
  color: #22D3EE;
}

.cv-split-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-inline-end: 1px solid var(--border-subtle);
  transition: background 0.2s ease, color 0.2s ease;
}

.cv-split-lang:last-child {
  border-inline-end: none;
}

.cv-split-lang:hover,
.cv-split-lang.active {
  background: rgba(6, 182, 212, 0.2);
  color: #22D3EE;
}

.hero-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-secondary);
  animation: fadeSlideUp 0.9s 0.4s ease-out both;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s ease, color 0.25s ease;
}

.hero-meta-item:hover {
  transform: translateY(-2px);
  color: var(--text-primary);
}

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

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

/* ==========================================================================
   Orbital Gyroscope Portrait + Terminal Stack (360° Rotating Rings & Satellites)
   ========================================================================== */
.hero-visual-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fadeSlideUp 0.85s 0.15s ease-out both;
}

.portrait-orbital-stage {
  position: relative;
  width: 310px;
  height: 310px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 900px;
  margin: 6px 0;
}

.portrait-ambient-halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(6, 182, 212, 0.36) 0%,
    rgba(59, 130, 246, 0.22) 45%,
    rgba(16, 185, 129, 0.1) 68%,
    transparent 78%
  );
  filter: blur(26px);
  z-index: 0;
  animation: breatheHalo 4.5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes breatheHalo {
  0% { opacity: 0.65; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1.08); }
}

/* Concentric Rotating Orbital Rings */
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

/* Outer Ring: 304px Clockwise with Dual Glowing Satellites */
.orbit-ring-outer {
  width: 304px;
  height: 304px;
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-top-color: rgba(6, 182, 212, 0.75);
  border-bottom-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.12);
  animation: orbitSpinCW 16s linear infinite;
}

/* Middle Ring: 274px Dashed Telemetry Counter-Clockwise */
.orbit-ring-middle {
  width: 274px;
  height: 274px;
  border: 1.5px dashed rgba(59, 130, 246, 0.38);
  animation: orbitSpinCCW 22s linear infinite;
}

/* Inner Ring: 246px Fast Conic Energy Sweep */
.orbit-ring-inner {
  width: 246px;
  height: 246px;
  border: 2px solid transparent;
  border-left-color: rgba(16, 185, 129, 0.75);
  border-right-color: rgba(34, 211, 238, 0.85);
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.55));
  animation: orbitSpinCW 10s linear infinite;
}

/* Glowing Satellite Nodes Riding the Rings */
.orbit-satellite {
  position: absolute;
  border-radius: 50%;
}

.sat-cyan {
  width: 11px;
  height: 11px;
  top: -5.5px;
  left: calc(50% - 5.5px);
  background: #22D3EE;
  box-shadow: 0 0 14px 3px #06B6D4, 0 0 26px 6px rgba(6, 182, 212, 0.6);
}

.sat-blue {
  width: 9px;
  height: 9px;
  bottom: -4.5px;
  left: calc(50% - 4.5px);
  background: #60A5FA;
  box-shadow: 0 0 12px 3px #3B82F6;
}

.sat-emerald {
  width: 10px;
  height: 10px;
  top: calc(50% - 5px);
  right: -5px;
  background: #34D399;
  box-shadow: 0 0 14px 3px #10B981;
}

@keyframes orbitSpinCW {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orbitSpinCCW {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

/* Floating Micro Tech Badges around Portrait */
.floating-orbit-badge {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(11, 16, 29, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #22D3EE;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65), 0 0 15px rgba(6, 182, 212, 0.25);
  pointer-events: none;
}

.badge-pos-1 {
  top: 18px;
  right: -6px;
  animation: floatBadge1 4s ease-in-out infinite alternate;
}

.badge-pos-2 {
  bottom: 22px;
  left: -10px;
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.5);
  animation: floatBadge2 4.6s ease-in-out infinite alternate;
}

@keyframes floatBadge1 {
  0% { transform: translateY(0px) rotate(-2deg); }
  100% { transform: translateY(-9px) rotate(3deg); }
}

@keyframes floatBadge2 {
  0% { transform: translateY(0px) rotate(2deg); }
  100% { transform: translateY(8px) rotate(-3deg); }
}

/* Sculpted Portrait Frame Inside the Gyroscope */
.portrait-arch-frame {
  position: relative;
  z-index: 2;
  width: 206px;
  height: 226px;
  border-radius: 105px 105px 38px 38px;
  padding: 4px;
  background: linear-gradient(135deg, #22D3EE 0%, #3B82F6 50%, #10B981 100%);
  background-size: 200% 200%;
  animation: gradientFlow 5s ease infinite;
  box-shadow:
    0 22px 50px -10px rgba(0, 0, 0, 0.85),
    0 0 35px -4px rgba(6, 182, 212, 0.42),
    inset 0 1px 2px rgba(255, 255, 255, 0.45);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.portrait-shimmer-sweep {
  position: absolute;
  inset: -60%;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 255, 255, 0.26) 50%,
    transparent 58%
  );
  z-index: 3;
  pointer-events: none;
  animation: portraitSweep 6.5s ease-in-out infinite;
}

@keyframes portraitSweep {
  0%, 35% { transform: translateX(-120%) rotate(15deg); }
  65%, 100% { transform: translateX(120%) rotate(15deg); }
}

.portrait-arch-frame::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 101px 101px 34px 34px;
  box-shadow: inset 0 0 24px rgba(6, 9, 17, 0.6);
  pointer-events: none;
  z-index: 2;
}

.portrait-orbital-stage:hover .portrait-arch-frame {
  transform: scale(1.04);
  box-shadow:
    0 28px 60px -10px rgba(0, 0, 0, 0.9),
    0 0 50px 0px rgba(6, 182, 212, 0.62);
}

.portrait-orbital-stage:hover .orbit-ring-outer {
  animation-duration: 7s;
  border-top-color: #22D3EE;
}

.portrait-orbital-stage:hover .orbit-ring-inner {
  animation-duration: 4.5s;
}

.portrait-arch-img {
  width: 100%;
  height: 100%;
  border-radius: 101px 101px 34px 34px;
  object-fit: cover;
  object-position: 50% 22%;
  display: block;
  background: #0B111E;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.portrait-orbital-stage:hover .portrait-arch-img {
  transform: scale(1.05);
}

/* Terminal Card with Floating Animation */
.terminal-window {
  width: 100%;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  overflow: hidden;
  direction: ltr;
  text-align: left;
  animation: terminalFloat 6s ease-in-out infinite alternate;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@keyframes terminalFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-6px); }
}

.terminal-window:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 28px 60px -12px rgba(6, 182, 212, 0.42);
}

.terminal-header {
  background: rgba(17, 24, 39, 0.95);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-dots {
  display: flex;
  gap: 8px;
}

.terminal-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red { background: #EF4444; }
.dot-amber { background: #F59E0B; }
.dot-green { background: #10B981; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94A3B8;
}

.terminal-body {
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #E2E8F0;
}

.cmd-line {
  color: #38BDF8;
  margin-bottom: 5px;
}

.cmd-prompt {
  color: #10B981;
  margin-right: 8px;
}

.cmd-output {
  color: #CBD5E1;
  margin-bottom: 14px;
  padding-left: 14px;
  border-left: 2px solid rgba(56, 189, 248, 0.35);
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #10B981;
  vertical-align: middle;
  margin-left: 6px;
  animation: blinkCursor 1s step-end infinite;
}

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

/* ==========================================================================
   Interactive Spotlight Glass Cards (Metrics, Skills, Timeline, Forms)
   ========================================================================== */
.metric-card,
.skill-card,
.timeline-item,
.form-card,
.sidebar-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.32s ease,
    box-shadow 0.32s ease;
}

/* Interactive Mouse Spotlight Glow inside Cards */
.metric-card::after,
.skill-card::after,
.timeline-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(6, 182, 212, 0.13),
    transparent 45%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.metric-card:hover::after,
.skill-card:hover::after,
.timeline-item:hover::after {
  opacity: 1;
}

.metric-card:hover,
.skill-card:hover,
.timeline-item:hover {
  border-color: var(--border-highlight);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 32px 0 64px;
}

.metric-card {
  padding: 24px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.section-block {
  padding: 72px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 8px;
  display: block;
}

[dir="rtl"] .section-eyebrow {
  font-family: var(--font-sans);
  letter-spacing: 0;
  font-weight: 600;
}

.section-title {
  font-size: clamp(1.7rem, 2.5vw, 2.35rem);
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), transparent);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

[dir="rtl"] .section-title::after {
  background: linear-gradient(270deg, var(--accent-primary), var(--accent-secondary), transparent);
}

/* ==========================================================================
   Skills Grid & Certifications Grid
   ========================================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.skill-card {
  padding: 26px;
}

.skill-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-card:hover .skill-icon {
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.35);
}

.skill-card h3 {
  font-size: 1.14rem;
  margin-bottom: 14px;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.skill-tags li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 5px 11px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  transition: all 0.22s ease;
}

[dir="rtl"] .skill-tags li {
  font-family: var(--font-sans);
}

.skill-tags li:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Projects / Certifications Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* Progressive Reveal for Certifications (3 Clear + 3 Half-Visible + Expand All) */
.certs-showcase-wrap {
  position: relative;
}

.certs-showcase-wrap.is-collapsed .cert-half-preview {
  max-height: 118px;
  opacity: 0.48;
  filter: blur(0.6px);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 25%, rgba(0, 0, 0, 0.08) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 25%, rgba(0, 0, 0, 0.08) 100%);
  pointer-events: none;
  transition: all 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.certs-showcase-wrap.is-collapsed .cert-extra-hidden {
  display: none;
}

.certs-showcase-wrap.is-expanded .cert-half-preview {
  max-height: 500px;
  opacity: 1;
  filter: none;
  mask-image: none;
  -webkit-mask-image: none;
  pointer-events: auto;
}

.certs-showcase-wrap.is-expanded .cert-extra-hidden {
  display: block;
  animation: certPopIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes certPopIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.certs-fade-overlay {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: -54px;
  padding-top: 68px;
  padding-bottom: 8px;
  position: relative;
  z-index: 5;
  background: linear-gradient(to bottom, transparent 0%, rgba(10, 15, 28, 0.92) 65%);
  transition: margin-top 0.45s ease, padding-top 0.45s ease, background 0.45s ease;
}

.certs-showcase-wrap.is-expanded .certs-fade-overlay {
  margin-top: 28px;
  padding-top: 0;
  background: transparent;
}

.certs-toggle-btn .chevron-icon {
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.certs-showcase-wrap.is-expanded .certs-toggle-btn .chevron-icon {
  transform: rotate(180deg);
}

/* Admin Section Tabs & Drag-and-Drop Reorder Controls */
.admin-tabs-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.admin-tab-btn {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(6, 9, 17, 0.45);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.admin-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
}

.admin-tab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.24), rgba(59, 130, 246, 0.24));
  border-color: var(--border-highlight);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
}

.admin-tab-panel {
  display: none;
  animation: fadeSlideUp 0.35s ease-out both;
}

.admin-tab-panel.active {
  display: block;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.drag-order-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.drag-handle:hover {
  color: var(--accent-primary);
  border-color: var(--border-highlight);
  background: rgba(6, 182, 212, 0.16);
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-row {
  user-select: none;
  -webkit-user-select: none;
}

.sortable-row.is-dragging {
  opacity: 0.92;
  background: rgba(6, 182, 212, 0.22) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--accent-primary);
  position: relative;
  z-index: 20;
}

.order-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 28px;
}

.order-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.arrow-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.62rem;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.arrow-btn:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

.sortable-row {
  transition: background 0.2s ease, transform 0.2s ease;
}

.sortable-row.is-dragging {
  opacity: 0.45;
  background: rgba(6, 182, 212, 0.18) !important;
}

.sortable-row.drag-over-top {
  border-top: 2px solid var(--accent-primary);
}

.sortable-row.drag-over-bottom {
  border-bottom: 2px solid var(--accent-primary);
}

/* ==========================================================================
   Education & Career Timeline (Animated Glowing Node Line)
   ========================================================================== */
.timeline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.timeline-column h3 {
  font-size: 1.28rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-list {
  border-left: 2px solid rgba(6, 182, 212, 0.3);
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
}

[dir="rtl"] .timeline-list {
  border-left: none;
  padding-left: 0;
  border-right: 2px solid rgba(6, 182, 212, 0.3);
  padding-right: 26px;
}

.timeline-item {
  padding: 22px 24px;
  overflow: visible;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 26px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-canvas);
  box-shadow: 0 0 14px var(--accent-primary);
  transition: transform 0.3s ease, background-color 0.3s ease;
}

[dir="rtl"] .timeline-item::before {
  left: auto;
  right: -34px;
}

.timeline-item:hover::before {
  transform: scale(1.35);
  background: var(--status-online);
  box-shadow: 0 0 18px var(--status-online);
}

.timeline-period {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.28);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

[dir="rtl"] .timeline-period {
  font-family: var(--font-sans);
}

.timeline-role {
  font-size: 1.06rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.timeline-org {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ==========================================================================
   Project Detail & Contact Layout
   ========================================================================== */
.project-detail-layout {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 40px;
  align-items: start;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  padding: 26px;
}

.sidebar-card h3 {
  font-size: 1.08rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.meta-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 0.9rem;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.meta-key {
  color: var(--text-muted);
}

.meta-val {
  font-family: var(--font-mono);
  color: var(--text-primary);
  text-align: right;
}

[dir="rtl"] .meta-val {
  text-align: left;
}

/* ==========================================================================
   Forms (Contact & Admin CRUD)
   ========================================================================== */
.form-card {
  padding: 34px;
  box-shadow: var(--shadow-card);
}

.form-group {
  margin-bottom: 20px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-label {
  display: block;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  background: rgba(6, 9, 17, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

[data-theme="light"] .form-control {
  background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.16);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==========================================================================
   Admin Dashboard Layout & Tables
   ========================================================================== */
.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--nav-height));
}

.admin-sidebar {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

[dir="rtl"] .admin-sidebar {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

.admin-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.22s ease;
}

.admin-nav-list a:hover,
.admin-nav-list a.active {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-primary);
  transform: translateX(4px);
}

[dir="rtl"] .admin-nav-list a:hover,
[dir="rtl"] .admin-nav-list a.active {
  transform: translateX(-4px);
}

.admin-content {
  padding: 36px 40px;
}

.table-responsive {
  overflow-x: auto;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

[dir="rtl"] .data-table {
  text-align: right;
}

.data-table th,
.data-table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.18);
}

[dir="rtl"] .data-table th {
  font-family: var(--font-sans);
}

.data-table tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.05);
}

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

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Flash Messages / Toast Alerts
   ========================================================================== */
.flash-stack {
  margin: 20px auto 0;
  max-width: var(--container-max);
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 500;
  animation: fadeSlideDown 0.35s ease-out;
}

.alert-success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34D399;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #F87171;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #FBBF24;
}

.alert-info {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.45);
  color: var(--accent-primary);
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 52px 0 28px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 14px;
}

[dir="rtl"] .footer-heading {
  font-family: var(--font-sans);
  font-weight: 700;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

.footer-links a:hover {
  transform: translateX(4px);
  display: inline-block;
}

[dir="rtl"] .footer-links a:hover {
  transform: translateX(-4px);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Mobile Menu Button & Responsive Breakpoints (Phones & Tablets)
   ========================================================================== */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  transition: all 0.25s ease;
}

.mobile-menu-btn:hover {
  border-color: var(--border-highlight);
}

.hamburger-bar {
  width: 18px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-btn.is-open .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.is-open .hamburger-bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.is-open .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Subtle Top Rim Lighting on Glass Cards */
.metric-card::before,
.skill-card::before,
.timeline-item::before {
  pointer-events: none;
}

.metric-card,
.skill-card,
.form-card,
.sidebar-card {
  box-shadow:
    0 16px 38px -14px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@media (max-width: 1024px) {
  .hero-grid,
  .project-detail-layout,
  .timeline-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .skills-grid,
  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 20px;
  }
  .admin-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-tabs-bar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 68px;
  }

  .container {
    padding: 0 18px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 14px;
    right: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px;
    background: rgba(11, 16, 29, 0.96);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--border-highlight);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.85);
    z-index: 1100;
    animation: fadeSlideDown 0.25s ease-out both;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li a {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }

  .nav-links li a:hover,
  .nav-links li a.active {
    background: rgba(6, 182, 212, 0.14);
  }

  .nav-links a::after {
    display: none;
  }

  .hero-section {
    padding: 40px 0 36px;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6vw, 2.3rem);
  }

  .hero-lead {
    font-size: 0.98rem;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta-group .btn,
  .hero-cta-group .cv-download-split {
    width: 100%;
  }

  .hero-cta-group .cv-split-main {
    flex: 1;
    justify-content: center;
  }

  .hero-meta-strip {
    flex-direction: column;
    gap: 12px;
  }

  .portrait-orbital-stage {
    width: 266px;
    height: 266px;
  }

  .orbit-ring-outer {
    width: 262px;
    height: 262px;
  }

  .orbit-ring-middle {
    width: 236px;
    height: 236px;
  }

  .orbit-ring-inner {
    width: 210px;
    height: 210px;
  }

  .portrait-arch-frame {
    width: 176px;
    height: 196px;
  }

  .terminal-body {
    padding: 16px;
    font-size: 0.76rem;
    overflow-x: auto;
  }

  .projects-grid,
  .skills-grid,
  .metrics-bar,
  .form-row-2,
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .section-block {
    padding: 48px 0;
  }

  .timeline-list {
    padding-left: 18px;
  }

  [dir="rtl"] .timeline-list {
    padding-right: 18px;
  }

  .timeline-item {
    padding: 18px;
  }

  .timeline-item::before {
    left: -26px;
  }

  [dir="rtl"] .timeline-item::before {
    right: -26px;
  }

  .form-card {
    padding: 22px 18px;
  }

  .admin-content {
    padding: 20px 14px;
  }

  .admin-panel-header {
    padding: 14px 16px;
  }
}

@media (max-width: 420px) {
  .brand-meta span:first-child {
    font-size: 0.95rem;
  }
  .brand-subtitle {
    font-size: 0.68rem;
  }
  .nav-admin-btn {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .lang-toggle-btn {
    padding: 0 10px;
    font-size: 0.76rem;
  }
}
