/* ==========================================================================
   OMAR BIN TALIB: MODERN EDITORIAL MINIMALIST DESIGN SYSTEM
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
/* --- CSS Variables & Design Tokens (4 Black + Refined Lighter Purple Variations) --- */

/* Variation 1: Obsidian Lavender (Default) - Pure Black with Luminous Lavender */
:root, [data-theme="lavender"] {
  --bg-primary: #050507;
  --bg-secondary: #0a0a0e;
  --bg-card: #0f0f14;
  --bg-card-hover: #16151c;
  --bg-card-subtle: rgba(192, 132, 252, 0.03);
  --bg-tag: rgba(192, 132, 252, 0.07);
  --bg-tag-hover: rgba(192, 132, 252, 0.14);

  --border-subtle: rgba(192, 132, 252, 0.12);
  --border-medium: rgba(192, 132, 252, 0.24);
  --border-focus: rgba(192, 132, 252, 0.5);

  --text-primary: #f8f8fc;
  --text-secondary: #9496a1;
  --text-muted: #5e606e;
  --text-inverse: #050507;

  --accent: #c084fc;
  --accent-tint: rgba(192, 132, 252, 0.08);
  --accent-dot: #c084fc;
  --accent-glow: transparent;

  --accent-indigo: #c084fc;
  --accent-cyan: #e9d5ff;
  --accent-emerald: #c084fc;
  --accent-amber: #fbbf24;
  --accent-purple: #d8b4fe;

  --nav-bg: rgba(5, 5, 7, 0.88);
  --glass-border: rgba(192, 132, 252, 0.14);

  /* Typography */
  --font-serif: 'Newsreader', 'EB Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Layout & Spacing */
  --container-max: 1160px;
  --container-narrow: 840px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

/* Variation 2: OLED Pure Black & Electric Lilac - Maximum Contrast */
[data-theme="lilac"] {
  --bg-primary: #000000;
  --bg-secondary: #060608;
  --bg-card: #0b0b0f;
  --bg-card-hover: #121118;
  --bg-card-subtle: rgba(232, 121, 249, 0.03);
  --bg-tag: rgba(232, 121, 249, 0.07);
  --bg-tag-hover: rgba(232, 121, 249, 0.15);

  --border-subtle: rgba(232, 121, 249, 0.14);
  --border-medium: rgba(232, 121, 249, 0.28);
  --border-focus: rgba(232, 121, 249, 0.55);

  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #63636e;
  --text-inverse: #000000;

  --accent: #e879f9;
  --accent-tint: rgba(232, 121, 249, 0.08);
  --accent-dot: #e879f9;
  --accent-glow: transparent;

  --accent-indigo: #e879f9;
  --accent-cyan: #f0abfc;
  --accent-emerald: #c084fc;
  --accent-amber: #fbbf24;
  --accent-purple: #f5d0fe;

  --nav-bg: rgba(0, 0, 0, 0.9);
  --glass-border: rgba(232, 121, 249, 0.16);
}

/* Variation 3: Smoked Graphite & Frost Wisteria - Soft & Understated */
[data-theme="wisteria"] {
  --bg-primary: #08080a;
  --bg-secondary: #0d0d11;
  --bg-card: #131317;
  --bg-card-hover: #191920;
  --bg-card-subtle: rgba(196, 181, 253, 0.03);
  --bg-tag: rgba(196, 181, 253, 0.07);
  --bg-tag-hover: rgba(196, 181, 253, 0.13);

  --border-subtle: rgba(196, 181, 253, 0.12);
  --border-medium: rgba(196, 181, 253, 0.22);
  --border-focus: rgba(196, 181, 253, 0.5);

  --text-primary: #f5f5f8;
  --text-secondary: #9b9ba6;
  --text-muted: #646473;
  --text-inverse: #08080a;

  --accent: #c4b5fd;
  --accent-tint: rgba(196, 181, 253, 0.08);
  --accent-dot: #c4b5fd;
  --accent-glow: transparent;

  --accent-indigo: #c4b5fd;
  --accent-cyan: #ddd6fe;
  --accent-emerald: #c084fc;
  --accent-amber: #fbbf24;
  --accent-purple: #ede9fe;

  --nav-bg: rgba(8, 8, 10, 0.88);
  --glass-border: rgba(196, 181, 253, 0.13);
}

/* Variation 4: Stealth Jet & Cyber Amethyst - Sharp & Technical */
[data-theme="amethyst"] {
  --bg-primary: #040405;
  --bg-secondary: #09090c;
  --bg-card: #0e0e13;
  --bg-card-hover: #15151d;
  --bg-card-subtle: rgba(168, 85, 247, 0.03);
  --bg-tag: rgba(168, 85, 247, 0.08);
  --bg-tag-hover: rgba(168, 85, 247, 0.15);

  --border-subtle: rgba(168, 85, 247, 0.14);
  --border-medium: rgba(168, 85, 247, 0.26);
  --border-focus: rgba(168, 85, 247, 0.52);

  --text-primary: #fcfcfd;
  --text-secondary: #9ca3af;
  --text-muted: #606573;
  --text-inverse: #040405;

  --accent: #a855f7;
  --accent-tint: rgba(168, 85, 247, 0.08);
  --accent-dot: #a855f7;
  --accent-glow: transparent;

  --accent-indigo: #a855f7;
  --accent-cyan: #c084fc;
  --accent-emerald: #c084fc;
  --accent-amber: #fbbf24;
  --accent-purple: #e9d5ff;

  --nav-bg: rgba(4, 4, 5, 0.88);
  --glass-border: rgba(168, 85, 247, 0.15);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Floating Glow Mesh */
body::before {
  content: '';
  position: fixed;
  top: -15vw;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  max-width: 950px;
  height: 480px;
  background: radial-gradient(ellipse at center, rgba(192, 132, 252, 0.12) 0%, rgba(233, 213, 255, 0.05) 50%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  filter: blur(85px);
  border-radius: 50%;
  animation: ambientFloat 14s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -15vw;
  right: -5vw;
  width: 65vw;
  max-width: 800px;
  height: 450px;
  background: radial-gradient(ellipse at center, rgba(192, 132, 252, 0.08) 0%, rgba(192, 132, 252, 0.05) 50%, transparent 75%);
  pointer-events: none;
  z-index: 0;
  filter: blur(85px);
  border-radius: 50%;
  animation: ambientFloat 18s ease-in-out infinite alternate-reverse;
}

[data-theme="light"] body::before {
  background: radial-gradient(ellipse at center, rgba(192, 132, 252, 0.06) 0%, rgba(233, 213, 255, 0.03) 50%, transparent 75%);
}

[data-theme="light"] body::after {
  background: radial-gradient(ellipse at center, rgba(192, 132, 252, 0.05) 0%, rgba(192, 132, 252, 0.03) 50%, transparent 75%);
}

@keyframes ambientFloat {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    transform: translateX(-48%) translateY(35px) scale(1.06);
  }
}

::selection {
  background: var(--text-primary);
  color: var(--bg-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* --- Background Grid (Disabled to remove book/paper ruled lines) --- */
.bg-grid-overlay {
  display: none;
}

/* --- Hide Native Browser Scrollbar Across Browsers --- */
html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Hide top reading bar (merged into right dock navigation) */
.scroll-progress-bar {
  display: none !important;
}

/* --- Layout Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: var(--container-narrow);
}

/* --- Floating Glassmorphic Navbar --- */
.navbar {
  position: sticky;
  top: 1rem;
  z-index: 900;
  width: calc(100% - 2.5rem);
  max-width: var(--container-max);
  margin: 1rem auto 0;
  border-radius: var(--radius-full);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-color: rgba(18, 20, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background-color var(--transition-normal),
              border-color var(--transition-normal),
              box-shadow var(--transition-normal);
  will-change: transform;
}

/* Keep navbar visible always - frosted glass elevation when scrolling */
.navbar.nav-scrolled {
  background-color: rgba(14, 15, 19, 0.94);
  border-color: rgba(192, 132, 252, 0.25);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.navbar.nav-hidden {
  /* Disabled auto-hide to keep navbar permanently visible per user request */
  transform: translateY(0);
}

[data-theme="light"] .navbar {
  background-color: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
  padding: 0 1.25rem;
}

/* Brand Logo */
.nav-brand {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity var(--transition-fast);
}

.nav-brand:hover {
  opacity: 0.8;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Nav Links Pill Dock */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .nav-links {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.05);
}

.nav-link {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: color 0.35s ease, background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #e9d5ff;
  background: rgba(192, 132, 252, 0.16);
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .nav-link.active {
  color: #c084fc;
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.25);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* CV Button Pill */
.nav-cv-btn {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  font-weight: 500;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(192, 132, 252, 0.3);
  color: #e9d5ff;
  background: rgba(192, 132, 252, 0.1);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.nav-cv-btn:hover {
  background: rgba(192, 132, 252, 0.18);
  color: #e9d5ff;
  border-color: rgba(192, 132, 252, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* --- Floating Side Dock Navigation (Primary Desktop Navigation) --- */
.right-dock-nav {
  display: none;
}

@media (min-width: 769px) {
  /* Remove top dock on desktop per user request */
  .navbar {
    display: none !important;
  }

  .right-dock-nav {
    position: fixed;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    z-index: 950;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.75rem 0.55rem;
    background-color: rgba(18, 20, 24, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius-full);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    animation: dockFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
  }

  /* Glowing Capsule Perimeter Progress Border */
  .dock-perimeter-svg {
    position: absolute;
    inset: -1px;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
    pointer-events: none;
    border-radius: var(--radius-full);
    overflow: visible;
    z-index: 1;
  }

  .dock-perimeter-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 1.1;
    transition: stroke var(--transition-fast);
  }

  .right-dock-nav:hover .dock-perimeter-track {
    stroke: rgba(255, 255, 255, 0.10);
  }

  /* Calm & subtle single-color capsule perimeter stroke */
  .dock-perimeter-progress {
    fill: none;
    stroke: rgba(180, 150, 220, 0.75);
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0;
    transition: stroke-dashoffset 0.08s linear, opacity 0.25s ease;
  }

  .right-dock-nav:hover .dock-perimeter-progress {
    stroke-width: 1.7;
  }

  @keyframes dockFadeIn {
    from {
      opacity: 0;
      transform: translateY(-50%) translateX(20px);
    }
    to {
      opacity: 1;
      transform: translateY(-50%) translateX(0);
    }
  }

  .dock-brand-pill {
    position: relative;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.3);
    text-decoration: none;
    transition: all var(--transition-fast);
  }

  .dock-brand-pill:hover,
  .dock-brand-pill.active {
    transform: scale(1.06);
    background: rgba(192, 132, 252, 0.16);
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    color: #e9d5ff;
  }

  .dock-sep {
    position: relative;
    z-index: 2;
    width: 18px;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0.2rem 0;
  }

  .dock-links {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
  }

  .dock-link {
    position: relative;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
  }

  .dock-link:hover {
    color: #e9d5ff;
    background: rgba(192, 132, 252, 0.10);
    transform: scale(1.08);
  }

  .dock-link.active {
    color: #e9d5ff;
    background: rgba(192, 132, 252, 0.16);
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transform: scale(1.06);
    z-index: 5;
  }

  /* Section Tooltip Micro-Animations (Spring curve + subtle pointer) */
  .dock-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(10px) scale(0.9);
    transform-origin: right center;
    padding: 0.3rem 0.75rem;
    background: rgba(14, 16, 22, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.71875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color var(--transition-fast),
                box-shadow var(--transition-fast);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 10;
  }

  /* Micro pointer tip pointing back to the dock button */
  .dock-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -4px;
    transform: translateY(-50%) rotate(45deg);
    width: 6px;
    height: 6px;
    background: rgba(14, 16, 22, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1px;
  }

  .dock-link:hover .dock-tooltip,
  .dock-link:focus-visible .dock-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
    border-color: rgba(192, 132, 252, 0.28);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
  }

  .dock-cv-btn {
    position: relative;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(192, 132, 252, 0.1);
    border: 1px solid rgba(192, 132, 252, 0.25);
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .dock-cv-btn:hover,
  .dock-cv-btn.active {
    background: rgba(192, 132, 252, 0.16);
    border-color: rgba(192, 132, 252, 0.5);
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    color: #e9d5ff;
  }
}

/* --- Theme Palette Switcher --- */
.palette-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.2rem 0.35rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.palette-switcher:hover {
  border-color: var(--border-medium);
}

.palette-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-fast);
}

.palette-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.palette-btn:hover .palette-dot {
  transform: scale(1.35);
}

.palette-btn.active {
  background: var(--bg-tag);
  border-color: var(--border-medium);
}

.palette-btn.active .palette-dot {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 3px currentColor;
}

/* Mobile Toggle Button */
/* Mobile Toggle Hamburger Button */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  padding: 0.45rem;
  cursor: pointer;
  z-index: 950;
  position: relative;
  transition: all var(--transition-fast);
}

.nav-mobile-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-indigo);
}

.nav-mobile-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  background-color: var(--text-primary);
  border-radius: 1px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.25s ease,
              background-color var(--transition-fast);
  transform-origin: center;
}

/* Morph Hamburger to Crisp 'X' */
.nav-mobile-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-mobile-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-mobile-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Full-Screen Frosted Mobile Menu Overlay (Apple / Linear Style) */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 850;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5.5rem 1.75rem 2.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s ease;
  overflow-y: auto;
}

.mobile-palette-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.85rem;
}

.mobile-palette-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-overlay-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem 0;
}

.mobile-nav-link {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(14px);
  opacity: 0;
  transition: color var(--transition-fast), transform 0.25s ease, padding-left 0.25s ease;
}

.mobile-nav-link::after {
  content: '↗';
  font-size: 1rem;
  opacity: 0;
  color: var(--accent-indigo);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--accent-indigo);
  padding-left: 0.85rem;
}

.mobile-nav-link:hover::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Staggered entrance animation when opening */
.mobile-menu-overlay.open .mobile-nav-link {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              color var(--transition-fast),
              padding-left 0.25s ease;
}

.mobile-menu-overlay.open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-overlay.open .mobile-nav-link:nth-child(2) { transition-delay: 0.09s; }
.mobile-menu-overlay.open .mobile-nav-link:nth-child(3) { transition-delay: 0.13s; }
.mobile-menu-overlay.open .mobile-nav-link:nth-child(4) { transition-delay: 0.17s; }
.mobile-menu-overlay.open .mobile-nav-link:nth-child(5) { transition-delay: 0.21s; }
.mobile-menu-overlay.open .mobile-nav-link:nth-child(6) { transition-delay: 0.25s; }
.mobile-menu-overlay.open .mobile-nav-link:nth-child(7) { transition-delay: 0.29s; }

.mobile-overlay-footer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  transform: translateY(15px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.32s,
              opacity 0.35s ease 0.32s;
}

.mobile-menu-overlay.open .mobile-overlay-footer {
  transform: translateY(0);
  opacity: 1;
}

.mobile-overlay-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.mobile-social-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.mobile-social-link:hover {
  color: var(--accent-indigo);
}

.dot-sep {
  opacity: 0.4;
}

/* --- Section Formatting --- */
.section {
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative;
  z-index: 1;
  scroll-margin-top: 5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.section-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-indigo);
  letter-spacing: 0.04em;
}

.section-subtitle {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* --- Status Pill --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  width: fit-content;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-dot);
  box-shadow: 0 0 0 2px var(--bg-card);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent-dot);
  opacity: 0.7;
  animation: pulse-ring 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  60% { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(202, 194, 220, 0.82) 0%, rgba(172, 164, 192, 0.82) 100%);
  color: #0c0d11;
  border: 1px solid rgba(255, 255, 255, 0.16);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: rotate(25deg);
  transition: left 0.75s ease;
}

.btn-primary:hover::after {
  left: 125%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(214, 206, 232, 0.90) 0%, rgba(184, 176, 204, 0.90) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-indigo);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-tag);
}

.btn svg {
  width: 0.95rem;
  height: 0.95rem;
  transition: transform var(--transition-fast);
}

.btn:hover svg.arrow-diag {
  transform: translate(2px, -2px);
}

.btn:hover svg.arrow-right {
  transform: translateX(4px);
}

/* --- HERO SECTION --- */
.hero {
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 4rem;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-title em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-indigo) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-role {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-role span:first-child {
  color: var(--accent-cyan);
  font-weight: 500;
}

.hero-role .divider {
  color: var(--text-muted);
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
}

.hero-desc strong {
  color: var(--text-primary);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

/* Framed Portrait Card with Subtle 3D Parallax Tilt */
.hero-portrait-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
  perspective: 1000px;
  will-change: transform;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-portrait-card.tilt-resting {
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-portrait-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(233, 213, 255, 0.08), transparent 60%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
  transition: opacity var(--transition-normal);
}

.hero-portrait-card:hover {
  border-color: rgba(192, 132, 252, 0.35);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55);
}

.hero-portrait-card:hover::after {
  opacity: 1;
}

/* Subtle Dynamic Glare Layer that follows mouse */
.portrait-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 65%);
  transition: opacity 0.35s ease;
  mix-blend-mode: overlay;
}

.hero-portrait-card:hover .portrait-glare {
  opacity: 1;
}

.portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: calc(var(--radius-lg) - 4px);
  overflow: hidden;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform var(--transition-normal);
}

.hero-portrait-card:hover .portrait-img {
  transform: scale(1.02);
}

.portrait-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.portrait-caption .name-tag {
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- INTEGRATED HERO STATS BANNER --- */
.hero-stats-wrapper {
  margin-top: 4rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  transition: border-color var(--transition-fast);
}

.hero-stats-wrapper:hover {
  border-color: var(--border-medium);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.65rem;
  background: transparent;
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.stat-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.02);
}

.stat-item:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
  padding-right: 1.5rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.35;
}

.stat-sub {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* --- ABOUT SECTION --- */
.about-content {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.about-content p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.about-content p.about-lead {
  font-size: 1.25rem;
  color: var(--text-primary);
  line-height: 1.75;
}

/* --- EXPERIENCE TIMELINE SECTION WITH MILESTONE CONNECTORS --- */
.experience-timeline {
  --timeline-gap: 3.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 240px 36px 1fr;
  gap: 2rem;
  padding-bottom: var(--timeline-gap);
}

.timeline-item:last-child {
  padding-bottom: 0.5rem;
}

/* Vertical Spine & Milestone Node */
.timeline-connector {
  position: relative;
  display: flex;
  justify-content: center;
  height: 100%;
}

.milestone-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary, #0c0e14);
  border: 1.5px solid rgba(192, 132, 252, 0.3);
  box-shadow: 0 0 0 3px var(--bg-primary, #0c0e14);
  margin-top: 5px;
  z-index: 3;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Inner core */
.milestone-dot::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: rgba(192, 132, 252, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Continuous Spine Line connecting milestones */
.milestone-line {
  position: absolute;
  top: 12px;
  bottom: calc(-1 * var(--timeline-gap) - 12px);
  width: 1.5px;
  background: rgba(255, 255, 255, 0.1);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  transition: background 0.35s ease;
}

.timeline-item:last-child .milestone-line {
  display: none;
}

/* Active & Hover States - Crisp, subtle, zero glow */
.timeline-item:hover .milestone-dot,
.timeline-item.milestone-active .milestone-dot {
  border-color: var(--accent);
  background: var(--bg-primary, #0c0e14);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px var(--bg-primary, #0c0e14);
}

.timeline-item:hover .milestone-dot::before,
.timeline-item.milestone-active .milestone-dot::before {
  background: var(--accent);
}

.timeline-item:hover .milestone-line,
.timeline-item.milestone-active .milestone-line {
  background: rgba(192, 132, 252, 0.5);
  box-shadow: none;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.timeline-org {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-suborg {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.timeline-role {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-indigo);
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.2);
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
  width: fit-content;
  margin-top: 0.5rem;
  font-weight: 500;
}

.timeline-type-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin-top: 0.35rem;
}

.timeline-type-badge.education {
  background: rgba(192, 132, 252, 0.12);
  color: var(--accent);
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.timeline-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-details ul {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.timeline-details li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.timeline-details li strong {
  color: var(--text-primary);
  font-weight: 500;
}

.timeline-details li::before {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.65rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-indigo);
}

/* --- PROJECTS SECTION --- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.projects-grid > .project-card {
  grid-column: span 2;
}

/* The featured card is first, so an even-numbered last card is alone on its row: centre it */
.projects-grid > .project-card:last-child:nth-child(even):not(.project-card-featured) {
  grid-column: 2 / span 2;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  min-height: 820px;
  transform-style: flat;
}

/* Featured project: full-width card, text beside media */
.projects-grid > .project-card-featured {
  grid-column: 1 / -1;
  min-height: auto;
}

.featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: stretch;
}

.featured-side {
  display: flex;
  flex-direction: column;
}

.project-card-featured .project-title {
  min-height: auto;
}

/* Screenshot fills the height of the text column beside it */
.project-card-featured .project-media-frame {
  flex: 1 1 auto;
  height: auto;
  min-height: 260px;
  margin-top: 0;
}

.project-card-featured > .details-toggle-btn {
  margin-top: 1.25rem;
}

/* Full-width footer: tags on the left, link on the right */
.project-card-featured > .project-bottom {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.project-card-featured > .project-bottom .project-tags {
  min-height: 0;
}

.project-card-featured > .project-bottom .project-links {
  border-top: none;
  padding-top: 0;
  min-height: auto;
  flex-shrink: 0;
}

.project-card:hover {
  border-color: rgba(192, 132, 252, 0.4);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.project-card::before, .edu-card::before, .cert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(400px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(192, 132, 252, 0.04), transparent 60%);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

[data-theme="light"] .project-card::before,
[data-theme="light"] .edu-card::before,
[data-theme="light"] .cert-card::before {
  background: radial-gradient(400px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(192, 132, 252, 0.02), transparent 60%);
}

.project-card:hover::before, .edu-card:hover::before, .cert-card:hover::before {
  opacity: 1;
}

.project-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
}

.project-bottom {
  position: relative;
  z-index: 1;
}

.project-card:hover .project-desc {
  color: var(--text-primary);
}

.project-card:hover .project-subtitle {
  color: #c4b5fd;
}

.project-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.project-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-tag);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.project-badge.podium {
  background: rgba(192, 132, 252, 0.08);
  border-color: rgba(192, 132, 252, 0.25);
  color: var(--accent-indigo);
  font-weight: 500;
}

.project-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  line-height: 1.35;
  min-height: 3.4rem;
  display: flex;
  align-items: flex-start;
}

.project-subtitle {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
  min-height: 2.6rem;
  display: flex;
  align-items: flex-start;
  line-height: 1.4;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  min-height: 5.6rem;
  display: flex;
  align-items: flex-start;
}

.project-desc strong {
  color: var(--text-primary);
}

.project-metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
  height: auto;
  min-height: auto;
  align-items: flex-start;
  box-sizing: border-box;
}

.metric-pair {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.metric-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-indigo);
  line-height: 1.25;
  word-break: normal;
}

.metric-desc {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.4;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Project Media Frame & Image Preview */
.project-media-frame {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  margin-top: 0.35rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.project-media-frame:hover {
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.project-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-normal);
}

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

.project-media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 15, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.project-media-frame:hover .project-media-overlay {
  opacity: 1;
}

.project-media-overlay svg {
  width: 1rem;
  height: 1rem;
}

.project-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 4.5rem;
  align-content: flex-start;
}

.tag-chip {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--bg-tag);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.tag-chip:hover {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.35);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.project-card:hover .tag-chip {
  border-color: var(--border-subtle);
}

.project-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  min-height: 3.2rem;
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast);
}

.project-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.project-link svg {
  width: 0.85rem;
  height: 0.85rem;
}

/* Expandable Project Details Accordion */
.details-toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition-fast);
  padding: 0.3rem 0;
}

.details-toggle-btn:hover {
  color: var(--text-primary);
}

.details-toggle-btn svg {
  width: 0.75rem;
  height: 0.75rem;
  transition: transform var(--transition-fast);
}

.details-toggle-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.project-expanded-content {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 0 1.15rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.35s ease, 
              padding 0.35s ease, 
              margin 0.35s ease;
  pointer-events: none;
}

.project-expanded-content.active {
  max-height: 900px;
  opacity: 1;
  margin-top: 0.85rem;
  padding: 1rem 1.15rem;
  pointer-events: auto;
}

.project-expanded-content li {
  position: relative;
  padding-left: 1.2rem;
  line-height: 1.5;
}

.project-expanded-content li::before {
  content: '•';
  position: absolute;
  left: 0.2rem;
  color: var(--text-muted);
}

/* Full Width Featured Project */
.project-card.featured-full {
  grid-column: span 2;
}

/* --- EDUCATION & SPECIALIZATIONS SECTION --- */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color var(--transition-fast);
}

.edu-card:hover {
  border-color: var(--border-medium);
}

.edu-institution {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.edu-degree {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.edu-period {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.edu-highlights {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edu-badge-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-indigo);
  background: rgba(192, 132, 252, 0.08);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(192, 132, 252, 0.25);
  width: fit-content;
}

.edu-badge-highlight strong {
  color: var(--text-primary);
}

.edu-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- CERTIFICATIONS SECTION --- */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.certs-grid > .cert-card {
  grid-column: span 2;
}

/* A lone last certificate sits centred on its row */
.certs-grid > .cert-card:last-child:nth-child(odd) {
  grid-column: 2 / span 2;
}

.cert-media-frame {
  height: 200px;
  margin-top: 0;
  flex-shrink: 0;
  background: #ffffff;
}

.cert-media-frame .project-media-img {
  object-fit: contain;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  transition: all var(--transition-normal);
  position: relative;
  min-height: auto;
}

.cert-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.cert-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.cert-badge-count {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  padding: 0.25rem 0.65rem;
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.25);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-weight: 500;
}

.cert-issuer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cert-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-top: 0.35rem;
}

.cert-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Expandable Certificate Toggle & Sublist */
.cert-toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.78125rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-tag);
  border: 1px solid var(--border-subtle);
  margin-top: 0.85rem;
  cursor: pointer;
}

.cert-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-tag-hover);
}

.cert-toggle-btn svg {
  width: 0.75rem;
  height: 0.75rem;
  transition: transform var(--transition-fast);
}

.cert-toggle-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.cert-sublist {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease,
              margin-top 0.35s ease,
              padding-top 0.35s ease,
              border-color 0.35s ease;
  pointer-events: none;
}

.cert-sublist.active {
  max-height: 600px;
  opacity: 1;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top-color: var(--border-subtle);
  pointer-events: auto;
}

.cert-subitem {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cert-subitem-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.925rem;
  color: var(--text-primary);
}

.cert-subitem-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-dot);
  flex-shrink: 0;
}

.cert-subitem-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 0.85rem;
}

.cert-view-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  text-decoration: underline;
  margin-top: 0.25rem;
  padding-left: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: opacity var(--transition-fast);
}

.cert-view-link:hover {
  opacity: 0.75;
}

.cert-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- SKILLS & ARSENAL SECTION (Linear / Vercel Clean Rows) --- */
.skills-rows-wrap {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.skill-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  padding: 1.75rem 2.25rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.skill-row:last-child {
  border-bottom: none;
}

.skill-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.skill-row-header {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 1.5rem;
}

.skill-row-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.skill-row-category {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.skill-chips-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.skill-tag {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-tag);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  background: rgba(192, 132, 252, 0.1);
  border-color: rgba(192, 132, 252, 0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* --- CONTACT SECTION --- */
.contact-section {
  padding-bottom: 8rem;
}

.contact-card-main {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 4rem 3.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.contact-card-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(192, 132, 252, 0.7), rgba(233, 213, 255, 0.7), transparent);
}

.contact-header {
  max-width: 620px;
  margin-bottom: 3rem;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.contact-title em {
  font-style: italic;
}

.contact-lead {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-item-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-item-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.contact-item-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.contact-item-value a {
  word-break: break-all;
  overflow-wrap: anywhere;
  color: inherit;
  transition: color var(--transition-fast);
}

.contact-item-value a:hover {
  color: var(--accent-indigo);
}

.contact-item-value span {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-tag);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: rgba(192, 132, 252, 0.16);
  color: var(--accent);
  border-color: rgba(192, 132, 252, 0.4);
}

.contact-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.5rem;
}

/* Contact Form Panel */
.contact-form-panel {
  display: flex;
  flex-direction: column;
}

.contact-form {
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.15);
  background: var(--bg-card-hover);
}

.field.invalid input,
.field.invalid textarea {
  border-color: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.2);
}

.field-error {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: #f87171;
  margin-top: 0.2rem;
}

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

.form-status {
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  border: 1px solid var(--border-medium);
}

.form-status.form-success {
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.08);
  color: var(--accent);
}

.form-status.form-error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
  color: #f87171;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 0.95rem 1.5rem;
  font-size: 0.9rem;
}

/* --- FOOTER --- */
.footer {
  padding: 3.5rem 0 2.5rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.footer-back-top {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-medium);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.footer-back-top:hover {
  color: var(--text-primary);
  border-color: var(--accent-indigo);
  background: rgba(192, 132, 252, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.footer-name {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.footer-social-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.footer-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.footer-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

/* --- SCROLL DOWN INDICATOR --- */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  animation: scrollBounce 2s ease-in-out infinite;
  transition: opacity 0.5s ease;
}

.scroll-indicator:hover {
  opacity: 1;
  color: var(--text-primary);
  border-color: var(--border-focus);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* Project cards stay completely flat and stable for maximum reading clarity */
.project-card {
  transform-style: flat;
}

/* Lightbox Modal */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.cert-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(10px);
}

.cert-modal-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.94);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-modal.active .cert-modal-content {
  transform: scale(1);
}

.cert-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cert-modal-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
}

.cert-modal-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.cert-modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.cert-modal-body {
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #090a0f;
}

.cert-full-img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.35);
}

.cert-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cert-modal-download {
  color: var(--text-primary);
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}

.cert-modal-download:hover {
  opacity: 0.75;
}

/* --- TOAST NOTIFICATION --- */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.75rem 1.25rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notice.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- SCROLL REVEAL ANIMATIONS --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-portrait-card {
    max-width: 320px;
    margin: 0 auto;
    justify-self: center;
  }

  .hero-stats-wrapper {
    margin-top: 3rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .stat-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .stat-item:not(:last-child) {
    border-right: none;
    padding-right: 0;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .project-card.featured-full {
    grid-column: span 1;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid > .project-card,
  .projects-grid > .project-card:last-child:nth-child(even):not(.project-card-featured) {
    grid-column: auto;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .project-card-featured .project-media-frame {
    flex: none;
    height: 200px;
    min-height: 0;
    margin-top: 0.5rem;
  }

  .project-card-featured > .project-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-card {
    min-height: auto;
    height: auto;
  }

  .project-title,
  .project-subtitle,
  .project-desc,
  .project-tags {
    min-height: auto;
  }

  .certs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .navbar {
    width: calc(100% - 1.5rem);
    margin: 0.75rem auto 0;
  }

  .nav-inner {
    height: 3.5rem;
    padding: 0 1rem;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .experience-timeline {
    --timeline-gap: 2.5rem;
  }

  .timeline-item {
    grid-template-columns: 24px 1fr;
    gap: 0.85rem 1.25rem;
    padding-bottom: var(--timeline-gap);
  }

  .timeline-connector {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .timeline-meta {
    grid-column: 2;
  }

  .timeline-details {
    grid-column: 2;
  }

  .edu-grid {
    grid-template-columns: 1fr;
  }

  .certs-grid {
    grid-template-columns: 1fr;
  }

  .certs-grid > .cert-card,
  .certs-grid > .cert-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .cert-card {
    min-height: auto;
  }

  .skill-row {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem 1.25rem;
  }

  .skill-row-header {
    padding-right: 0;
  }

  .contact-card-main {
    padding: 2.5rem 1.75rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .back-to-top {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
}

@media (max-width: 600px) {
  .project-metrics-strip {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
  }

  .metric-pair {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .metric-pair:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }

  .metric-num {
    font-size: 1rem;
    white-space: nowrap;
    order: 1;
  }

  .metric-desc {
    font-size: 0.75rem;
    text-align: right;
    order: 2;
  }

  .contact-section {
    padding-bottom: 5rem;
  }

  .contact-card-main {
    padding: 2rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .contact-header {
    margin-bottom: 2rem;
  }

  .contact-title {
    font-size: 2rem;
  }

  .contact-lead {
    font-size: 0.9375rem;
    line-height: 1.6;
  }

  .contact-form {
    padding: 1.5rem 1.15rem;
    border-radius: var(--radius-md);
  }

  .contact-social-links .btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    font-size: 0.8125rem;
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .contact-card-main {
    padding: 1.5rem 1rem;
  }

  .contact-form {
    padding: 1.25rem 0.85rem;
    gap: 1rem;
  }

  .contact-item-value {
    font-size: 0.9375rem;
  }

  .contact-social-links {
    flex-direction: column;
    gap: 0.65rem;
  }

  .contact-social-links .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-item-row .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ==================== LIGHT MODE OVERRIDES AND CONTRAST FIXES ==================== */

/* Hero Name Italic Gradient */
[data-theme="light"] .hero-title em {
  background: linear-gradient(135deg, #121316 35%, #9333ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stat Numbers in Banner */
[data-theme="light"] .stat-value {
  background: linear-gradient(135deg, #121316 25%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .stat-item:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* Primary Action Buttons */
[data-theme="light"] .btn-primary {
  background: #121316;
  color: #ffffff;
  border-color: #121316;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn-primary:hover {
  background: #2b2927;
  color: #ffffff;
  border-color: #2b2927;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .btn-primary::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

/* Navbar Links and CV Button */
[data-theme="light"] .nav-link:hover {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-cv-btn {
  color: #9333ea;
  background: rgba(67, 56, 202, 0.08);
  border-color: rgba(67, 56, 202, 0.25);
}

[data-theme="light"] .nav-cv-btn:hover {
  background: rgba(67, 56, 202, 0.16);
  color: #7e22ce;
  border-color: rgba(67, 56, 202, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* Accordion and Details Toggles */
[data-theme="light"] .details-toggle-btn {
  color: var(--text-secondary);
}

[data-theme="light"] .details-toggle-btn:hover {
  color: var(--text-primary);
}

[data-theme="light"] .cert-toggle-btn {
  color: var(--text-secondary);
  border-color: var(--border-medium);
  background: var(--bg-tag);
}

[data-theme="light"] .cert-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: var(--bg-tag-hover);
}

/* Copy Buttons */
[data-theme="light"] .copy-btn:hover {
  background: #121316;
  color: #ffffff;
  border-color: #121316;
}

/* Contact Cards and Form */
[data-theme="light"] .contact-card-main {
  background: #ffffff;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .contact-form {
  background: #fdfcfa;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* Toast Notice */
[data-theme="light"] .toast-notice {
  background: #121316;
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Footer Icons */
[data-theme="light"] .footer-icon:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
}


/* --- PROJECT DETAIL PAGES & 404 (projects/*.html, 404.html) --- */
.pp-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pp-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(8, 8, 11, 0.7);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.pp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 60px;
}

.pp-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.pp-nav a,
.pp-breadcrumb a,
.pp-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.pp-nav a:hover,
.pp-breadcrumb a:hover,
.pp-footer a:hover {
  color: var(--text-primary);
}

.pp-main {
  flex: 1;
  max-width: 880px;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.pp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.pp-title {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}

.pp-sub {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  margin-bottom: 1.25rem;
}

.pp-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.pp-metrics {
  margin: 1.75rem 0 1.25rem;
}

.pp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 0.5rem;
}

.pp-figure {
  margin: 2rem 0 0;
}

.pp-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.pp-figure figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.pp-section {
  margin-top: 2.75rem;
}

.pp-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.9rem;
}

.pp-section p,
.pp-section li {
  color: var(--text-secondary);
  line-height: 1.75;
}

.pp-section p + p,
.pp-section ul + p,
.pp-section ol + p {
  margin-top: 0.9rem;
}

.pp-section ul,
.pp-section ol {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pp-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

.pp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.pp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.pp-table th,
.pp-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.55;
}

.pp-table tr:last-child th,
.pp-table tr:last-child td {
  border-bottom: none;
}

.pp-table thead th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.pp-table tbody th {
  color: var(--text-primary);
  font-weight: 500;
  width: 45%;
}

.pp-table td {
  color: var(--text-secondary);
}

.pp-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.pp-more-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.pp-more-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
}

.pp-more-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.pp-more-desc {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.pp-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 0;
  font-size: 0.8125rem;
}

.pp-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.pp-404-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}

@media (max-width: 600px) {
  .pp-nav {
    gap: 0.9rem;
    font-size: 0.8125rem;
  }

  .pp-nav a[href="/#experience"] {
    display: none;
  }

  .pp-more-grid {
    grid-template-columns: 1fr;
  }

  .pp-table tbody th {
    width: auto;
  }
}

/* Cards with three links wrap whole links instead of breaking their labels */
.project-links {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.project-link {
  white-space: nowrap;
}

/* --- Mobile hardening ---
   Grid items default to min-width:auto, so one long unbreakable line inside any
   card used to widen the shared single column past the screen. */
.projects-grid > .project-card,
.certs-grid > .cert-card {
  min-width: 0;
}

.project-header-row {
  flex-wrap: wrap;
  row-gap: 0.5rem;
}

.project-header-row .timeline-period {
  margin-left: auto;
  text-align: right;
}

.section-num {
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Tablets: two certificates per row, a lone last one spans the row */
  .certs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .certs-grid > .cert-card {
    grid-column: auto;
  }

  .certs-grid > .cert-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .certs-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

@media (max-width: 600px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .project-header-row .timeline-period {
    margin-left: 0;
    text-align: left;
  }
}

/* Project pages: wider tables and short notes */
.pp-table-wide tbody th {
  width: auto;
}

.pp-table-wide td:not(:last-child) {
  white-space: nowrap;
}

.pp-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .pp-table th,
  .pp-table td {
    padding: 0.7rem 0.75rem;
    font-size: 0.8125rem;
  }

  .pp-table-wide td:not(:last-child) {
    white-space: normal;
  }

  /* Hero: centre the text so it lines up with the centred buttons and portrait */
  .hero-content {
    align-items: center;
    text-align: center;
  }

  .hero-role {
    justify-content: center;
  }

  .status-pill {
    text-align: left;
  }
}
