/* ============================================
   SAKSHAM DHUMALE — MATRIX/HACKER THEME
   ============================================ */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Matrix dark theme (default) */
  --bg-primary: #000000;
  --bg-secondary: #050505;
  --bg-tertiary: #0a0a0a;
  --bg-card: rgba(0, 255, 65, 0.03);
  --bg-glass: rgba(0, 255, 65, 0.04);

  --text-primary: #00ff41;
  --text-secondary: #00cc33;
  --text-muted: #006600;

  --accent-primary: #00ff41;
  --accent-secondary: #00cc33;
  --accent-gradient: linear-gradient(135deg, #00ff41, #00cc33);
  --accent-gradient-hover: linear-gradient(135deg, #33ff66, #00ff41);
  --accent-glow: rgba(0, 255, 65, 0.35);
  --accent-glow-secondary: rgba(0, 204, 51, 0.25);

  --border-color: rgba(0, 255, 65, 0.2);
  --border-glass: rgba(0, 255, 65, 0.1);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.95);
  --shadow-glow: 0 0 20px var(--accent-glow), 0 0 60px rgba(0, 255, 65, 0.1);

  --nav-height: 72px;
  --section-padding: 100px;
  --container-width: 1200px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  --font-heading: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'JetBrains Mono', 'Courier New', monospace;
}

/* ===== CYBER THEME (Purple & Blue) ===== */
[data-theme="cyber"] {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a2e;
  --bg-card: rgba(26, 26, 46, 0.6);
  --bg-glass: rgba(26, 26, 46, 0.4);

  --text-primary: #e8e8f0;
  --text-secondary: #a0a0b8;
  --text-muted: #6c6c84;

  --accent-primary: #6c63ff;
  --accent-secondary: #00d4ff;
  --accent-gradient: linear-gradient(135deg, #6c63ff, #00d4ff);
  --accent-gradient-hover: linear-gradient(135deg, #7e76ff, #33ddff);
  --accent-glow: rgba(108, 99, 255, 0.35);
  --accent-glow-secondary: rgba(0, 212, 255, 0.3);

  --border-color: rgba(108, 99, 255, 0.2);
  --border-glass: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px;
}

/* ===== SYNTHWAVE THEME (Retro Pink/Purple) ===== */
[data-theme="synthwave"] {
  --bg-primary: #0d0015;
  --bg-secondary: #130020;
  --bg-tertiary: #1a0030;
  --bg-card: rgba(50, 0, 80, 0.5);
  --bg-glass: rgba(50, 0, 80, 0.3);

  --text-primary: #f0e0ff;
  --text-secondary: #c89fe0;
  --text-muted: #7a4fa0;

  --accent-primary: #ff2d78;
  --accent-secondary: #bf5af2;
  --accent-gradient: linear-gradient(135deg, #ff2d78, #bf5af2);
  --accent-gradient-hover: linear-gradient(135deg, #ff5599, #cc77ff);
  --accent-glow: rgba(255, 45, 120, 0.4);
  --accent-glow-secondary: rgba(191, 90, 242, 0.3);

  --border-color: rgba(255, 45, 120, 0.2);
  --border-glass: rgba(255, 255, 255, 0.07);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 30px var(--accent-glow), 0 0 60px rgba(191,90,242,0.15);

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px;
}

/* ===== OCEAN THEME (Deep Teal/Navy) ===== */
[data-theme="ocean"] {
  --bg-primary: #020c18;
  --bg-secondary: #041525;
  --bg-tertiary: #071e33;
  --bg-card: rgba(4, 30, 60, 0.6);
  --bg-glass: rgba(4, 30, 60, 0.4);

  --text-primary: #d0f0ff;
  --text-secondary: #80c8e8;
  --text-muted: #3a7a9a;

  --accent-primary: #00b4d8;
  --accent-secondary: #0077b6;
  --accent-gradient: linear-gradient(135deg, #00b4d8, #0077b6);
  --accent-gradient-hover: linear-gradient(135deg, #33c6e0, #0099cc);
  --accent-glow: rgba(0, 180, 216, 0.35);
  --accent-glow-secondary: rgba(0, 119, 182, 0.3);

  --border-color: rgba(0, 180, 216, 0.2);
  --border-glass: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-sm: 8px; --radius-md: 16px; --radius-lg: 24px;
}

/* ===== LIGHT MODE (Applies to all themes when dark/light toggle is clicked) ===== */
[data-mode="light"] {
  --bg-primary: #f6f8fc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #edf1f7;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.75);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --border-color: rgba(0, 0, 0, 0.12);
  --border-glass: rgba(0, 0, 0, 0.08);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.12);
}

/* Light mode accent text & contrast adjustments for each palette */
[data-mode="light"],
[data-mode="light"][data-theme="matrix"] {
  --text-primary: #0d2b14;
  --text-secondary: #145222;
  --text-muted: #2d7a3e;
  --accent-primary: #008822;
  --accent-secondary: #00aa33;
  --accent-gradient: linear-gradient(135deg, #008822, #00bb33);
}

[data-mode="light"][data-theme="cyber"] {
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-primary: #5b46e0;
  --accent-secondary: #0088cc;
  --accent-gradient: linear-gradient(135deg, #5b46e0, #0088cc);
}

[data-mode="light"][data-theme="synthwave"] {
  --text-primary: #1a0525;
  --text-secondary: #4a1d63;
  --text-muted: #7a3e9d;
  --accent-primary: #d80056;
  --accent-secondary: #9b28d0;
  --accent-gradient: linear-gradient(135deg, #d80056, #9b28d0);
}

[data-mode="light"][data-theme="ocean"] {
  --text-primary: #031b2e;
  --text-secondary: #164e73;
  --text-muted: #387b9c;
  --accent-primary: #007799;
  --accent-secondary: #005588;
  --accent-gradient: linear-gradient(135deg, #007799, #005588);
}

/* ===== GLOBAL RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

::selection {
  background: var(--accent-primary);
  color: #fff;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

button, input, textarea, select, .theme-toggle, .theme-palette-btn, .theme-swatch, .hamburger, .btn, .filter-btn, .test-nav-btn, .test-dot, .back-to-top, .term-pill, .nav-terminal-btn {
  cursor: pointer;
}

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

/* ===== CUSTOM CURSOR (DOT & RING — PC ONLY) ===== */
.cursor-dot,
.cursor-ring {
  display: none !important;
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
  .cursor-dot {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 7px;
    height: 7px;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.15s, height 0.15s, background-color 0.15s, opacity 0.2s;
    box-shadow: 0 0 10px var(--accent-glow);
    opacity: 0;
  }

  .cursor-ring {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(108, 99, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--transition-spring),
                height 0.25s var(--transition-spring),
                border-color 0.25s,
                background-color 0.25s,
                opacity 0.2s;
    opacity: 0;
  }

  body.cursor-hover .cursor-dot {
    width: 12px;
    height: 12px;
    background: var(--accent-secondary);
  }

  body.cursor-hover .cursor-ring {
    width: 52px;
    height: 52px;
    border-color: var(--accent-secondary);
    background: rgba(0, 212, 255, 0.1);
  }
}

/* Ensure natural cursor inside the resume viewer / iframes so pointer is always available */
.resume-modal-overlay.active,
.resume-modal-overlay.active *,
.resume-iframe {
  cursor: auto !important;
}

.resume-modal-overlay.active a,
.resume-modal-overlay.active button,
.btn-resume-action,
.resume-modal-close {
  cursor: pointer !important;
}

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

.section {
  padding: var(--section-padding) 0;
  position: relative;
  scroll-margin-top: 80px;
}

.terminal-nav-icon {
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-primary);
  font-weight: 700;
  margin-right: 3px;
}

.btn-hero-terminal {
  border-color: rgba(108, 99, 255, 0.4);
}

.btn-hero-terminal:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-hero-game {
  border-color: rgba(255, 45, 120, 0.4);
  color: #ff2d78;
}

.btn-hero-game:hover {
  border-color: #ff2d78;
  background: rgba(255, 45, 120, 0.15);
  box-shadow: 0 0 20px rgba(255, 45, 120, 0.5);
  color: #fff;
}

.hero-game-icon {
  font-size: 1.1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.section-line {
  width: 60px;
  height: 4px;
  background: var(--accent-gradient);
  margin: 0 auto 60px;
  border-radius: var(--radius-full);
}

.accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== GLASSMORPHISM ===== */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: transparent;
  transition: background var(--transition-base), box-shadow var(--transition-base), height var(--transition-base);
}

.navbar.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  height: 60px;
  border-bottom: 1px solid var(--border-glass);
}

.nav-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-dot {
  color: var(--accent-primary);
  font-size: 2rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 4px 0;
  letter-spacing: 0.3px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-resume-link {
  color: var(--accent-primary) !important;
  font-weight: 600;
}

.nav-resume-link:hover {
  text-shadow: 0 0 10px var(--accent-glow);
}

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

/* Theme Toggle (Dark / Light Mode) */
.theme-toggle {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-mode="light"] .theme-toggle .icon-sun {
  display: none;
}

[data-mode="light"] .theme-toggle .icon-moon {
  display: block;
}

/* ===== THEME PALETTE PICKER ===== */
.theme-picker {
  position: relative;
}

.theme-palette-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-palette-btn:hover,
.theme-palette-btn[aria-expanded="true"] {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  z-index: 9999;
}

.theme-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-dropdown-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.theme-swatches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 100%;
}

.theme-swatch:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.theme-swatch.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255,255,255,0.2);
}

.swatch-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.theme-swatch:hover .swatch-name,
.theme-swatch.active .swatch-name {
  color: var(--text-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translateY(7px) translateX(5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-7px) translateX(5px);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero .reveal-up {
  opacity: 1;
  transform: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}

.hero-greeting {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--accent-secondary);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-name {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -2px;
}

.hero-title {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  color: var(--text-secondary);
  margin-bottom: 16px;
  min-height: 2em;
}

.typewriter-prefix {
  color: var(--text-secondary);
}

.typewriter {
  color: var(--accent-primary);
  font-weight: 600;
}

.typewriter-cursor {
  color: var(--accent-primary);
  animation: blink 1s infinite;
  font-weight: 300;
}

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

.hero-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

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

/* Scroll indicator */
.hero-scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: float 3s ease-in-out infinite;
}

.scroll-mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scroll-anim 2s ease-in-out infinite;
}

@keyframes scroll-anim {
  0% { top: 6px; opacity: 1; }
  100% { top: 22px; opacity: 0; }
}

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

/* ===== ABOUT ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 60px;
  align-items: center;
}

.avatar-frame {
  position: relative;
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  margin: 0 auto;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 4px;
}

.avatar-placeholder img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}

.avatar-orbit {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border: 2px dashed var(--accent-primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: orbit-spin 20s linear infinite;
}

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.about-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

.about-intro {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.about-text p {
  margin-bottom: 16px;
}

.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-suffix {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== SKILLS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 48px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.skill-category {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: all var(--transition-base);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.skill-category:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
  min-width: 0;
}

.skill-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.skill-category h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  min-width: 0;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}

.skill-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.skill-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 8px;
  border-radius: var(--radius-sm);
  background: rgba(108, 99, 255, 0.05);
  border: 1px solid var(--border-color);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-base);
  cursor: default;
  overflow: hidden;
}

.skill-item i {
  font-size: 2.2rem;
  color: var(--accent-secondary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.skill-item span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  display: block;
}

.skill-item:hover {
  border-color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.skill-item:hover i {
  color: var(--accent-primary);
  transform: scale(1.15);
}

/* Tech Tags */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tech-tag {
  padding: 8px 20px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: default;
}

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

/* ===== PROJECTS ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.project-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-base);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.project-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.project-card-inner {
  transition: transform var(--transition-base);
}

.project-visual {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.project-visual-bg {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-visual-bg {
  transform: scale(1.05);
}

.project-icon-large {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-info {
  padding: 28px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.project-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-primary);
}

.project-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-secondary);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.project-card:hover .project-cta {
  color: var(--accent-primary);
  transform: translateX(4px);
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ===== EXPERIENCE / TIMELINE ===== */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline-connector {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 0;
  background: var(--accent-gradient);
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item {
  position: relative;
  padding: 0 0 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.timeline-item:nth-child(odd) .timeline-card {
  grid-column: 1;
  text-align: right;
}

.timeline-item:nth-child(odd) .timeline-dot {
  grid-column: 2;
  justify-self: start;
  margin-left: -8px;
}

.timeline-item:nth-child(even) .timeline-card {
  grid-column: 2;
}

.timeline-item:nth-child(even) .timeline-dot {
  grid-column: 1;
  justify-self: end;
  margin-right: -8px;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--accent-primary);
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-primary), var(--shadow-glow);
  position: relative;
  top: 20px;
  z-index: 1;
}

.timeline-card {
  padding: 28px;
  transition: all var(--transition-base);
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.timeline-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.timeline-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-location {
  font-size: 0.85rem;
  color: var(--accent-secondary);
  margin-bottom: 10px;
}

.timeline-card p:last-child {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.timeline-item::before {
  content: attr(data-year);
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-36px);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--bg-primary);
  padding: 2px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  z-index: 2;
}

/* ===== TESTIMONIALS ===== */
.testimonial-slider {
  max-width: 700px;
  margin: 0 auto;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  padding: 40px;
  text-align: center;
}

.testimonial-quote {
  font-family: var(--font-heading);
  font-size: 4rem;
  line-height: 1;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: -12px;
}

.testimonial-card > p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 24px;
}

.testimonial-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.testimonial-author strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.testimonial-author span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.testimonial-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.test-nav-btn {
  background: none;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.test-nav-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

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

.test-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.test-dot.active {
  background: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ===== CONTACT ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact-intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.contact-detail-item {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

a.contact-detail-item:hover {
  color: var(--accent-primary);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: rgba(108, 99, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.contact-detail-item strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.contact-detail-item span {
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-link:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* Contact Form */
.contact-form {
  padding: 40px;
}

.form-group {
  position: relative;
  margin-bottom: 28px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
}

.form-group label {
  position: absolute;
  top: 14px;
  left: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all var(--transition-fast);
}

.form-group input:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:valid ~ label {
  top: -10px;
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.form-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width var(--transition-base);
}

.form-group input:focus ~ .form-line,
.form-group textarea:focus ~ .form-line {
  width: 100%;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-submit {
  width: 100%;
  justify-content: center;
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.form-status-msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font-body);
  margin-top: 12px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.form-status-msg.success {
  background: rgba(39, 201, 63, 0.15);
  border: 1px solid rgba(39, 201, 63, 0.4);
  color: #27c93f;
}

.form-status-msg.error {
  background: rgba(255, 95, 86, 0.15);
  border: 1px solid rgba(255, 95, 86, 0.4);
  color: #ff5f56;
}

/* ===== FOOTER ===== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-content {
  text-align: center;
  flex: 1;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.back-to-top {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px var(--accent-glow);
  opacity: 0;
  transform: translateY(20px);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.reveal-up { transform: translateY(32px); }
.reveal-left { transform: translateX(-32px); }
.reveal-right { transform: translateX(32px); }

.reveal-up.revealed,
.reveal-left.revealed,
.reveal-right.revealed {
  opacity: 1;
  transform: translate(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
html, body {
  overflow-x: hidden;
}

@media (max-width: 768px) {
  :root {
    --section-padding: 60px;
  }

  .container {
    padding: 0 16px;
  }

  .nav-logo {
    font-size: 1.3rem;
  }

  .nav-actions {
    gap: 8px;
  }

  .theme-toggle,
  .theme-palette-btn {
    width: 36px;
    height: 36px;
  }

  .theme-dropdown {
    right: -10px;
    min-width: 190px;
    max-width: calc(100vw - 32px);
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    transition: right var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .nav-links.open {
    right: 0;
  }

  .nav-link {
    font-size: 1.1rem;
  }

  .hero {
    padding-top: calc(var(--nav-height) + 20px);
  }

  .hero-name {
    font-size: clamp(2rem, 9vw, 3.2rem);
    letter-spacing: -1px;
    word-break: break-word;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
    margin: 32px auto 0;
  }

  .hero-cta .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-content: center;
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .skill-category {
    padding: 22px 16px;
    border-radius: var(--radius-sm);
  }

  .skill-category-header {
    gap: 10px;
    margin-bottom: 16px;
  }

  .skill-icon {
    width: 42px;
    height: 42px;
  }

  .skill-category h3 {
    font-size: 1.1rem;
  }

  .skill-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .skill-item {
    padding: 16px 6px;
    gap: 8px;
    min-width: 0;
  }

  .skill-item i {
    font-size: 1.85rem;
  }

  .skill-item span {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

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

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 36px;
  }

  .timeline-item:nth-child(odd) .timeline-card,
  .timeline-item:nth-child(even) .timeline-card {
    grid-column: 1;
    text-align: left;
  }

  .timeline-item:nth-child(odd) .timeline-dot,
  .timeline-item:nth-child(even) .timeline-dot {
    grid-column: 1;
    justify-self: start;
    position: absolute;
    left: 0;
    margin: 0;
  }

  .timeline-connector {
    left: 8px;
    transform: none;
  }

  .timeline-item::before {
    left: 0;
    transform: translateY(-36px);
  }

  .footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 48px;
  }

  .container {
    padding: 0 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .about-stats {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-number, .stat-suffix {
    font-size: 1.8rem;
  }

  .skills-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .skill-category {
    padding: 14px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .skill-category-header {
    gap: 8px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
  }

  .skill-icon {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
  }

  .skill-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  .skill-category h3 {
    font-size: 0.95rem !important;
    word-break: break-word !important;
    min-width: 0 !important;
  }

  .skill-items {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .skill-item {
    padding: 10px 2px !important;
    gap: 4px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .skill-item i {
    font-size: 1.5rem !important;
    flex-shrink: 0 !important;
  }

  .skill-item span {
    font-size: 0.68rem !important;
    letter-spacing: -0.2px !important;
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .skill-ring svg {
    width: 56px;
    height: 56px;
  }

  .skill-ring {
    width: 64px;
  }

  .project-card-header {
    padding: 16px 16px 0;
  }

  .project-card-body {
    padding: 16px;
  }

  .contact-form {
    padding: 20px 16px;
  }

  .theme-swatches {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0 6px !important;
  }

  .skill-category {
    padding: 10px 4px !important;
  }

  .skill-category-header {
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .skill-icon {
    width: 28px !important;
    height: 28px !important;
  }

  .skill-icon svg {
    width: 15px !important;
    height: 15px !important;
  }

  .skill-category h3 {
    font-size: 0.88rem !important;
  }

  .skill-items {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .skill-item {
    padding: 8px 1px !important;
    gap: 3px !important;
  }

  .skill-item i {
    font-size: 1.25rem !important;
  }

  .skill-item span {
    font-size: 0.6rem !important;
    letter-spacing: -0.3px !important;
  }
}

/* ============================================
   MATRIX / HACKER THEME ENHANCEMENTS
   (only active when body.theme-matrix is set)
   ============================================ */

/* Scanline effect overlay — Matrix only */
body.theme-matrix::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.015) 2px,
    rgba(0, 255, 65, 0.015) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* Green text glow on headings */
body.theme-matrix h1,
body.theme-matrix h2,
body.theme-matrix h3,
body.theme-matrix h4,
body.theme-matrix .nav-logo,
body.theme-matrix .hero-title {
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.2);
}

/* Terminal prompt prefix on section titles */
body.theme-matrix .section-title::before {
  content: '> ';
  color: var(--accent-primary);
  opacity: 0.6;
  font-family: 'JetBrains Mono', monospace;
}

/* Cards get a terminal box look */
body.theme-matrix .glass-card,
body.theme-matrix .skill-category,
body.theme-matrix .timeline-card,
body.theme-matrix .project-card {
  border: 1px solid rgba(0, 255, 65, 0.2) !important;
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.05), inset 0 0 30px rgba(0, 255, 65, 0.02) !important;
}

body.theme-matrix .glass-card:hover,
body.theme-matrix .skill-category:hover,
body.theme-matrix .timeline-card:hover,
body.theme-matrix .project-card:hover {
  border-color: rgba(0, 255, 65, 0.5) !important;
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.2), inset 0 0 30px rgba(0, 255, 65, 0.04) !important;
}

/* Neon glow on buttons */
body.theme-matrix .btn-primary {
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.4), 0 0 30px rgba(0, 255, 65, 0.15);
}
body.theme-matrix .btn-primary:hover {
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.6), 0 0 50px rgba(0, 255, 65, 0.25);
}

/* Project tags — terminal label style */
body.theme-matrix .project-tag,
body.theme-matrix .skill-tag,
body.theme-matrix .tech-tag {
  border: 1px solid rgba(0, 255, 65, 0.3);
  background: rgba(0, 255, 65, 0.06) !important;
  font-family: 'JetBrains Mono', monospace;
}

/* Hacker skill items */
body.theme-matrix .skill-item {
  border: 1px solid rgba(0, 255, 65, 0.2) !important;
}
body.theme-matrix .skill-item:hover {
  background: rgba(0, 255, 65, 0.08) !important;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2) !important;
}

/* Nav glow */
body.theme-matrix .nav-link.active,
body.theme-matrix .nav-link:hover {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.8);
}
body.theme-matrix .accent {
  text-shadow: 0 0 15px rgba(0, 255, 65, 0.7);
}

/* Cursor */
body.theme-matrix .cursor-dot { background: #00ff41 !important; box-shadow: 0 0 10px #00ff41 !important; }
body.theme-matrix .cursor-ring { border-color: rgba(0, 255, 65, 0.6) !important; }
body.theme-matrix .timeline-dot {
  background: #00ff41 !important;
  box-shadow: 0 0 0 3px #00ff41, 0 0 20px rgba(0, 255, 65, 0.6) !important;
}

/* Avatar ring */
body.theme-matrix .avatar-placeholder {
  background: linear-gradient(135deg, #00ff41, #00cc33) !important;
}

/* Section line */
body.theme-matrix .section-line {
  background: linear-gradient(90deg, #00ff41, #00cc33) !important;
}

/* ===== RESUME MODAL VIEWER ===== */
.resume-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 20px)) max(16px, env(safe-area-inset-right, 16px)) max(20px, env(safe-area-inset-bottom, 20px)) max(16px, env(safe-area-inset-left, 16px));
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.resume-modal-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.resume-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.resume-modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9), var(--shadow-glow);
  transform: scale(0.94) translateY(24px);
  transition: transform var(--transition-spring);
  overflow: hidden;
  box-sizing: border-box;
}

.resume-modal-overlay.active .resume-modal-container {
  transform: scale(1) translateY(0);
}

.resume-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  min-height: 52px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
  gap: 10px;
  box-sizing: border-box;
}

.resume-modal-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

.resume-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
}

.resume-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resume-modal-title svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

.resume-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-resume-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  flex-shrink: 0;
}

.btn-resume-action svg {
  flex-shrink: 0;
  display: block;
}

.btn-resume-action:hover {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-1px);
}

.resume-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-sizing: border-box;
  flex-shrink: 0;
}

.resume-modal-close svg {
  flex-shrink: 0;
  display: block;
}

.resume-modal-close:hover {
  background: rgba(255, 60, 60, 0.2);
  border-color: #ff4d4d;
  color: #ff4d4d;
  transform: rotate(90deg);
}

.resume-modal-body {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #111;
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.resume-pdf-container {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  box-sizing: border-box;
}

.resume-page-canvas {
  width: 100%;
  max-width: 820px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  background: #fff;
  display: block;
}

.resume-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--accent-primary);
  font-family: var(--font-heading);
  font-size: 0.9rem;
}

.resume-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 255, 65, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.resume-iframe {
  width: 100%;
  height: 100%;
  min-height: 70vh;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .resume-modal-overlay {
    padding: max(14px, env(safe-area-inset-top, 14px)) 10px max(14px, env(safe-area-inset-bottom, 14px)) 10px;
  }
  .resume-modal-container {
    height: calc(100vh - 28px);
    height: calc(100dvh - 28px);
    max-height: 94vh;
    border-radius: var(--radius-md);
  }
  .resume-modal-header {
    padding: 8px 12px;
    min-height: 48px;
    gap: 8px;
  }
  .resume-title-text {
    font-size: 0.82rem;
    max-width: 160px;
  }
  .btn-resume-action {
    padding: 5px 10px;
    height: 34px;
    font-size: 0.78rem;
  }
  .resume-modal-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
}

@media (max-width: 480px) {
  .resume-modal-overlay {
    padding: max(16px, env(safe-area-inset-top, 16px)) 8px max(16px, env(safe-area-inset-bottom, 16px)) 8px;
  }
  .resume-modal-container {
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: 94vh;
    border-radius: var(--radius-md);
  }
  .resume-modal-header {
    padding: 6px 8px;
    min-height: 46px;
    gap: 6px;
  }
  .resume-modal-title {
    display: flex;
    font-size: 0.82rem;
  }
  .resume-title-text {
    max-width: 130px;
  }
  .resume-modal-actions {
    gap: 6px;
  }
  .btn-resume-action {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 0.76rem;
  }
  .btn-resume-action span {
    display: none;
  }
  .resume-modal-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
  .resume-pdf-container {
    padding: 8px 6px;
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .resume-modal-overlay {
    padding: max(12px, env(safe-area-inset-top, 12px)) 4px max(12px, env(safe-area-inset-bottom, 12px)) 4px;
  }
  .resume-modal-container {
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    max-height: 95vh;
  }
  .resume-modal-header {
    padding: 4px 6px;
    min-height: 42px;
    gap: 4px;
  }
  .resume-modal-title {
    display: flex;
    font-size: 0.78rem;
  }
  .resume-title-text {
    max-width: 100px;
  }
  .resume-modal-actions {
    gap: 4px;
  }
  .btn-resume-action {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
  .resume-modal-close {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }
}

/* ============================================
   DEVELOPER TERMINAL POPUP MODAL
   ============================================ */

.nav-terminal-btn {
  background: none;
  border: 1px solid rgba(108, 99, 255, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-terminal-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-glow);
  transform: translateY(-1px);
}

.terminal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.terminal-modal-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.terminal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.terminal-modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.94) translateY(20px);
  transition: transform var(--transition-spring);
  box-sizing: border-box;
}

.terminal-modal-overlay.active .terminal-modal-container {
  transform: scale(1) translateY(0);
}

.terminal-card {
  background: #0a0e17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(108, 99, 255, 0.2);
  overflow: hidden;
  font-family: 'JetBrains Mono', 'Space Grotesk', monospace;
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(560px, 86vh);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.terminal-header {
  background: #111726;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  flex-shrink: 0;
}

.terminal-traffic-lights {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: inline-block;
  cursor: pointer;
}

.traffic-light.red { background: #ff5f56; box-shadow: 0 0 6px rgba(255, 95, 86, 0.4); }
.traffic-light.yellow { background: #ffbd2e; box-shadow: 0 0 6px rgba(255, 189, 46, 0.4); cursor: default; }
.traffic-light.green { background: #27c93f; box-shadow: 0 0 6px rgba(39, 201, 63, 0.4); cursor: default; }

.terminal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #8b949e;
  font-weight: 500;
  letter-spacing: 0.5px;
  min-width: 0;
}

.terminal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.terminal-live-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #3fb950;
  background: rgba(63, 185, 80, 0.12);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(63, 185, 80, 0.3);
}

.term-modal-close-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.term-modal-close-btn:hover {
  color: #ff5f56;
  background: rgba(255, 95, 86, 0.15);
}

.terminal-matrix-canvas {
  position: absolute;
  top: 45px;
  left: 0;
  width: 100%;
  height: 250px;
  pointer-events: none;
  z-index: 10;
  display: none;
  background: rgba(10, 14, 23, 0.9);
}

.terminal-body {
  flex: 1 1 auto;
  padding: 18px 20px;
  min-height: 140px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e6edf3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  word-break: break-word;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}
.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.term-welcome {
  color: #8b949e;
  margin-bottom: 6px;
  line-height: 1.5;
}

.term-entry {
  margin-top: 4px;
  word-break: break-word;
}

.term-user {
  color: #58a6ff;
  font-weight: 600;
}

.term-path {
  color: #7ee787;
  font-weight: 600;
}

.term-cmd-text {
  color: #f0883e;
  font-weight: 500;
}

.term-result {
  margin-bottom: 4px;
  animation: fadeIn 0.15s ease;
}

.term-res-header {
  font-weight: 600;
  color: #58a6ff;
  margin-bottom: 6px;
}

.term-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
}

.term-table td {
  padding: 4px 8px 4px 0;
  vertical-align: top;
  font-size: 0.85rem;
}

.term-table td:first-child {
  width: 140px;
  white-space: nowrap;
}

.cmd-highlight {
  color: #79c0ff;
  font-weight: 600;
  background: rgba(88, 166, 255, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(88, 166, 255, 0.25);
  display: inline-block;
}

.term-hint {
  font-size: 0.8rem;
  color: #8b949e;
  margin-top: 6px;
}

.term-hint kbd {
  background: #21262d;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
  color: #c9d1d9;
}

.term-green { color: #3fb950; font-weight: 600; }
.term-cyan { color: #58a6ff; font-weight: 600; }
.term-pink { color: #ff7b72; font-weight: 600; }
.term-blue { color: #79c0ff; font-weight: 600; }
.term-accent { color: #d2a8ff; font-weight: 600; }
.term-dim { color: #8b949e; }

.term-skill-cat {
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.term-proj-item {
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 2px solid rgba(88, 166, 255, 0.4);
}

.term-proj-title {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.term-badge {
  background: rgba(63, 185, 80, 0.15);
  color: #3fb950;
  border: 1px solid rgba(63, 185, 80, 0.3);
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.term-proj-desc {
  font-size: 0.82rem;
  color: #8b949e;
  margin-bottom: 2px;
}

.term-proj-link a {
  color: #58a6ff;
  font-size: 0.82rem;
  text-decoration: underline;
}

.term-quote {
  font-style: italic;
  color: #e6edf3;
  padding: 6px 12px;
  border-left: 3px solid #f0883e;
  background: rgba(240, 136, 62, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.term-code {
  background: #161b22;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #79c0ff;
  overflow-x: auto;
}

.term-error {
  color: #ff7b72;
  background: rgba(255, 123, 114, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 3px solid #ff7b72;
}

.terminal-prompt-line {
  background: #111726;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  caret-color: #58a6ff;
}

.terminal-input::placeholder {
  color: #484f58;
  font-size: 0.82rem;
}

.terminal-quick-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 18px;
  background: #0d1117;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pills-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.term-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.term-pill:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  transition: background var(--transition-fast);
}

.term-pill:hover .pill-dot {
  background: #fff;
}

@media (max-width: 768px) {
  .terminal-modal-overlay {
    padding: 8px;
    align-items: center;
  }
  .terminal-modal-container {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
  }
  .terminal-card {
    height: min(540px, 88vh);
    max-height: 88vh;
  }
  .terminal-header {
    padding: 10px 12px;
  }
  .terminal-title {
    font-size: 0.74rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .terminal-body {
    font-size: 0.82rem;
    padding: 12px 12px;
  }
  .terminal-prompt-line {
    padding: 10px 12px;
    font-size: 0.82rem;
  }
  .terminal-input {
    font-size: 0.85rem;
    min-width: 0;
  }
  .terminal-quick-pills {
    padding: 8px 12px;
    gap: 6px;
    max-height: 90px;
    overflow-y: auto;
  }
  .term-pill {
    padding: 4px 8px;
    font-size: 0.74rem;
  }
  .term-table td:first-child {
    width: 85px;
    min-width: 85px;
  }
}

@media (max-width: 480px) {
  .terminal-modal-overlay {
    padding: 6px;
  }
  .terminal-modal-container {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
  }
  .terminal-card {
    height: min(520px, 90vh);
    max-height: 90vh;
    border-radius: var(--radius-md);
  }
  .terminal-header {
    padding: 8px 10px;
  }
  .terminal-traffic-lights {
    gap: 5px;
  }
  .traffic-light {
    width: 10px;
    height: 10px;
  }
  .terminal-title {
    font-size: 0.68rem;
    max-width: 130px;
  }
  .terminal-title svg {
    width: 12px;
    height: 12px;
  }
  .terminal-header-actions {
    gap: 6px;
  }
  .terminal-live-text {
    font-size: 0.6rem;
    padding: 1px 5px;
  }
  .term-modal-close-btn {
    font-size: 1.1rem;
    padding: 2px 8px;
  }
  .terminal-body {
    font-size: 0.78rem;
    padding: 10px 8px;
    gap: 8px;
  }
  .terminal-prompt-line {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
  .term-user {
    font-size: 0.75rem;
  }
  .terminal-input {
    font-size: 16px; /* Prevents mobile browser auto-zoom */
    transform: scale(0.85);
    transform-origin: left center;
    width: 115%;
    min-width: 0;
  }
  .terminal-quick-pills {
    padding: 6px 8px;
    gap: 4px;
    max-height: 82px;
    overflow-y: auto;
  }
  .pills-label {
    font-size: 0.66rem;
    margin-right: 2px;
    align-self: center;
  }
  .term-pill {
    padding: 4px 7px;
    font-size: 0.7rem;
    gap: 4px;
  }
  .pill-dot {
    width: 4px;
    height: 4px;
  }
  .term-table td {
    font-size: 0.74rem;
    padding: 2px 4px 2px 0;
  }
  .term-table td:first-child {
    width: 68px;
    min-width: 68px;
  }
  .term-code {
    font-size: 0.72rem;
    padding: 6px;
  }
}

@media (max-width: 360px) {
  .terminal-modal-overlay {
    padding: 4px;
  }
  .terminal-card {
    height: 92vh;
  }
  .terminal-title {
    font-size: 0.62rem;
    max-width: 100px;
  }
  .terminal-body {
    font-size: 0.74rem;
    padding: 8px 6px;
  }
  .terminal-prompt-line {
    padding: 6px 8px;
    font-size: 0.72rem;
  }
  .terminal-quick-pills {
    padding: 4px 6px;
    gap: 3px;
  }
  .term-pill {
    padding: 3px 6px;
    font-size: 0.66rem;
  }
  .term-table td:first-child {
    width: 58px;
    min-width: 58px;
  }
}

/* ============================================
   CYBER SPACE ARCADE GAME MODAL STYLES
   ============================================ */

.nav-game-btn {
  background: rgba(255, 45, 120, 0.1);
  border: 1px solid rgba(255, 45, 120, 0.35);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ff2d78;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-game-btn:hover {
  background: #ff2d78;
  color: #fff;
  border-color: #ff2d78;
  box-shadow: 0 0 16px rgba(255, 45, 120, 0.6);
  transform: translateY(-1px);
}

.game-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 160000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.game-modal-overlay.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.game-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.game-modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 720px;
  transform: scale(0.92) translateY(20px);
  transition: transform var(--transition-spring);
}

.game-modal-overlay.active .game-modal-container {
  transform: scale(1) translateY(0);
}

.game-card {
  background: #080c14;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 212, 255, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.game-header {
  background: #0f172a;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.arcade-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 3px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.arcade-tab-btn {
  background: transparent;
  border: none;
  color: #8b949e;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.arcade-tab-btn:hover {
  color: #fff;
}

.arcade-tab-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(108, 99, 255, 0.5);
}

.game-hud {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.hud-label {
  color: #8b949e;
  font-size: 0.72rem;
}

.hud-val {
  color: #00ff41;
  font-weight: 700;
}

.hud-lives {
  letter-spacing: 2px;
  font-size: 0.85rem;
}

.game-modal-close-btn {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.game-modal-close-btn:hover {
  color: #ff5f56;
  background: rgba(255, 95, 86, 0.15);
}

.game-canvas-wrapper {
  position: relative;
  background: #02040a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#arcadeCanvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair !important;
}

.game-overlay-screen {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  animation: fadeIn 0.2s ease;
}

.game-over-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #ff2d78;
  text-shadow: 0 0 20px rgba(255, 45, 120, 0.8);
  letter-spacing: 2px;
}

.game-over-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: #00d4ff;
}

.btn-restart {
  margin-top: 8px;
  cursor: pointer !important;
}

.game-controls-bar {
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-instructions {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: #8b949e;
}

.game-instructions strong {
  color: #00d4ff;
}

.game-touch-controls {
  display: none;
  gap: 12px;
}

.touch-btn {
  padding: 8px 20px;
  height: 42px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  cursor: pointer;
}

.touch-btn.fire {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

@media (max-width: 768px) {
  .game-modal-overlay {
    padding: 8px;
  }
  .game-touch-controls {
    display: flex;
  }
  .game-instructions {
    display: none;
  }
}

@media (max-width: 480px) {
  .game-modal-overlay {
    padding: 6px;
  }
  .game-header {
    padding: 8px 10px;
    gap: 8px;
  }
  .arcade-tabs {
    padding: 2px 4px;
    gap: 3px;
  }
  .arcade-tab-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }
  .game-hud {
    gap: 8px;
    font-size: 0.74rem;
  }
  .game-controls-bar {
    padding: 8px 10px;
  }
  .touch-btn {
    padding: 6px 12px;
    height: 38px;
    font-size: 0.78rem;
  }
}

