/* ============================================================
   PCK PORTFOLIO — MODERN CYBER-MINIMALISM DESIGN SYSTEM
   Author: Patrick ROBSON ANDRIANARIMANGA
   Style: Dark Elegant + Glassmorphism + Neon Cyan/Violet
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
  /* — Backgrounds — */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2332;
  --bg-glass: rgba(17, 24, 39, 0.7);
  --bg-glass-strong: rgba(17, 24, 39, 0.85);
  --bg-hover: rgba(0, 240, 255, 0.05);

  /* — Accent Colors — */
  --accent-cyan: #00f0ff;
  --accent-violet: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #00f0ff, #8b5cf6);
  --accent-cyan-dim: rgba(0, 240, 255, 0.6);
  --accent-violet-dim: rgba(139, 92, 246, 0.6);

  /* — Text Colors — */
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-tertiary: #6b7280;
  --text-accent: #00f0ff;

  /* — Status Colors — */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* — Borders & Glows — */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 240, 255, 0.15);
  --border-glow-strong: rgba(0, 240, 255, 0.3);
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.15);
  --glow-cyan-strong: 0 0 30px rgba(0, 240, 255, 0.25), 0 0 60px rgba(0, 240, 255, 0.1);
  --glow-violet: 0 0 20px rgba(139, 92, 246, 0.15);

  /* — Spacing Scale — */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* — Typography — */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --text-base: 16px;
  --line-height: 1.6;

  /* — Border Radius — */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* — Transitions — */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* — Z-index Scale — */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-toast: 1500;

  /* — Navbar Height — */
  --navbar-height: 72px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: var(--text-base);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: var(--line-height);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('pdc.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.08;
  filter: grayscale(20%) contrast(1.1);
  z-index: -1;
  pointer-events: none;
}

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

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

::selection {
  background: rgba(0, 240, 255, 0.3);
  color: var(--text-primary);
}

/* ============================================================
   3. UTILITY & LAYOUT
   ============================================================ */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-4xl) 0;
  scroll-margin-top: var(--navbar-height);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: var(--space-lg) auto 0;
}

/* Scroll reveal animation base */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================================
   4. GLASSMORPHISM COMPONENTS
   ============================================================ */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}

.glass-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--glow-cyan);
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn-neon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: transparent;
  border: 1.5px solid var(--accent-cyan);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-neon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
}

.btn-neon:hover {
  color: var(--bg-primary);
  border-color: transparent;
  box-shadow: var(--glow-cyan-strong);
  transform: translateY(-2px);
}

.btn-neon:hover::before {
  opacity: 1;
}

.btn-neon:active {
  transform: translateY(0);
}

.btn-neon--violet {
  color: var(--accent-violet);
  border-color: var(--accent-violet);
}

.btn-neon--violet:hover {
  box-shadow: var(--glow-violet);
}

.btn-neon--small {
  padding: 8px 20px;
  font-size: 0.8rem;
}

/* ============================================================
   6. HEADER / NAVBAR
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--navbar-height);
  z-index: 1000;
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.header.scrolled {
  background: rgba(10, 14, 23, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.logo span {
  color: var(--accent-cyan);
}

.logo .logo-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-base);
  position: relative;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  box-shadow: 0 0 8px var(--accent-cyan);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 1001;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 23, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-xl);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.mobile-overlay.active {
  display: flex;
  opacity: 1;
}

.mobile-overlay a {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.mobile-overlay a:hover,
.mobile-overlay a.active {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

/* ============================================================
   7. HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--navbar-height);
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: var(--space-2xl) var(--space-md);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 16px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: var(--space-lg);
}

.hero-badge .status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

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

.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--accent-cyan);
  margin-bottom: var(--space-lg);
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typewriter-text {
  border-right: 2px solid var(--accent-cyan);
  animation: blink-caret 0.8s step-end infinite;
}

.hero-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  animation: float-down 2s ease-in-out infinite;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-cyan), transparent);
}

/* ============================================================
   8. ABOUT SECTION
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.about-image-wrapper {
  position: relative;
}

.about-image-wrapper img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-subtle);
  transition: border-color var(--transition-base);
}

.about-image-wrapper:hover img {
  border-color: var(--border-glow);
}

.about-image-wrapper::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: calc(var(--radius-lg) + 8px);
  background: var(--accent-gradient);
  opacity: 0.15;
  z-index: -1;
  transition: opacity var(--transition-base);
}

.about-image-wrapper:hover::before {
  opacity: 0.3;
}

.about-text h3 {
  font-size: 1.6rem;
  margin-bottom: var(--space-md);
}

.about-text h3 span {
  color: var(--accent-cyan);
}

.about-text > p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 1.02rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: rgba(0, 240, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-base), background var(--transition-base);
}

.info-item:hover {
  border-color: var(--border-glow);
  background: rgba(0, 240, 255, 0.06);
}

.info-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  font-size: 1rem;
  flex-shrink: 0;
}

.info-item h4 {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.info-item p,
.info-item a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ============================================================
   9. SKILLS SECTION
   ============================================================ */
.skills-filter {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
}

.filter-btn.active {
  color: var(--bg-primary);
  background: var(--accent-gradient);
  border-color: transparent;
  font-weight: 600;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.skill-card {
  padding: var(--space-lg);
  opacity: 1;
  transform: scale(1);
  transition: opacity var(--transition-slow), transform var(--transition-slow), border-color var(--transition-base), box-shadow var(--transition-base);
}

.skill-card.hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

.skill-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.skill-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
}

.skill-card-icon.cyan {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
}

.skill-card-icon.violet {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-violet);
}

.skill-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.skill-tag {
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.skill-tag.cyan {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.06);
}

.skill-tag.cyan:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--border-glow);
}

.skill-tag.violet {
  color: var(--accent-violet);
  background: rgba(139, 92, 246, 0.06);
}

.skill-tag.violet:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}

/* ============================================================
   10. FLOATING TERMINAL (FAB + Popup)
   ============================================================ */

/* --- FAB Button (bottom-right bubble) --- */
.terminal-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: none;
  color: var(--bg-primary);
  font-size: 1.35rem;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 4px 24px rgba(0, 240, 255, 0.35), 0 0 0 0 rgba(0, 240, 255, 0.2);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.terminal-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 32px rgba(0, 240, 255, 0.5), 0 0 0 0 rgba(0, 240, 255, 0.3);
}

.terminal-fab:active {
  transform: scale(0.95);
}

.terminal-fab[aria-expanded="true"] {
  background: var(--danger);
  box-shadow: 0 4px 24px rgba(239, 68, 68, 0.35);
}

.terminal-fab[aria-expanded="true"] i::before {
  content: "\f00d"; /* fa-times */
}

/* Pulse ring around the FAB */
.terminal-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  opacity: 0;
  animation: fab-ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.terminal-fab[aria-expanded="true"] .terminal-fab-pulse {
  animation: none;
  opacity: 0;
}

@keyframes fab-ping {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* --- Popup Container --- */
.terminal-popup {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: min(460px, calc(100vw - 32px));
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.terminal-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* --- Terminal component (reused inside popup) --- */
.terminal {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glow);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 240, 255, 0.1);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

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

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #22c55e; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.terminal-popup-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-base);
}

.terminal-popup-close:hover {
  color: var(--danger);
}

.terminal-body {
  background: var(--bg-primary);
  padding: var(--space-lg);
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

.terminal-output .line {
  margin-bottom: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-output .line.prompt {
  color: var(--accent-cyan);
}

.terminal-output .line.response {
  color: var(--text-secondary);
}

.terminal-output .line.accent {
  color: var(--accent-violet);
}

.terminal-output .line.success {
  color: var(--success);
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.terminal-prompt {
  color: var(--accent-cyan);
  font-weight: 600;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  caret-color: var(--accent-cyan);
}

/* ============================================================
   11. PROJECTS SECTION
   ============================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-lg);
}

.project-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.project-card:hover {
  transform: none;
}

.project-image {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-card:hover .project-image img {
  transform: scale(1.08);
}

.project-badge {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  z-index: 2;
}

.project-badge.cyan {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid var(--border-glow);
}

.project-badge.violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.project-badge.green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.project-body {
  padding: var(--space-lg);
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: var(--space-sm);
}

.project-body p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.project-tag {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.project-links {
  display: flex;
  gap: var(--space-md);
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.project-links a:hover {
  color: var(--accent-cyan);
}

/* ============================================================
   12. PROJECT MODAL
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  justify-content: center;
  align-items: center;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-base);
  z-index: 2;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

.modal-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-body {
  padding: var(--space-xl);
}

.modal-body h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.modal-body .modal-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.7;
}

.modal-section {
  margin-bottom: var(--space-lg);
}

.modal-section h4 {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.modal-section p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ============================================================
   13. GALLERY SECTION & LIGHTBOX
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.gallery-item {
  position: relative;
  height: 240px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow-strong);
  box-shadow: var(--glow-cyan-strong);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-caption {
  position: absolute;
  inset: 0;
  padding: var(--space-lg);
  background: linear-gradient(to top, rgba(10, 14, 23, 0.95) 0%, rgba(10, 14, 23, 0.4) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus .gallery-caption {
  opacity: 1;
}

.gallery-caption h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.gallery-caption p {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  line-height: 1.4;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* --- Lightbox Modal --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: rgba(6, 9, 15, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  width: min(1200px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 23, 0.94);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.2);
  position: relative;
  z-index: 10002;
}

.lightbox-img-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 68vh;
  max-height: 76vh;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-xs);
  cursor: zoom-in;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lightbox-info {
  padding: var(--space-md) var(--space-xl);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
}

.lightbox-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 4px;
}

#lightbox-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-violet);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

#lightbox-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Lightbox Controls Bar */
.lightbox-controls {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: 10005;
}

.lightbox-ctrl-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.lightbox-ctrl-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: var(--danger) !important;
  color: var(--danger) !important;
}

.lightbox-zoom-hint {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  background: rgba(10, 14, 23, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-base);
  backdrop-filter: blur(8px);
}

.lightbox-img-wrapper:hover .lightbox-zoom-hint {
  opacity: 1;
}

/* Fullscreen Mode: Image fills screen with translucent legend banner at bottom */
.lightbox.fullscreen-mode .lightbox-container {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: none;
  border-radius: 0;
  background: #000;
}

.lightbox.fullscreen-mode .lightbox-img-wrapper {
  min-height: 84vh;
  max-height: 88vh;
  padding: 0;
  cursor: zoom-out;
}

.lightbox.fullscreen-mode .lightbox-img {
  max-height: 88vh;
  border-radius: 0;
}

.lightbox.fullscreen-mode .lightbox-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 14, 23, 0.88);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.modal-image {
  cursor: zoom-in;
  transition: transform var(--transition-base);
}

.modal-image:hover {
  transform: scale(1.015);
  box-shadow: var(--glow-cyan);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid var(--border-glow);
  color: var(--accent-cyan);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10005;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.lightbox-prev {
  left: 28px;
}

.lightbox-next {
  right: 28px;
}

.lightbox-nav:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
  border-color: transparent;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.4);
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.lightbox-caption {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
}

/* ============================================================
   14. CONTACT SECTION
   ============================================================ */
.contact-single {
  width: 100%;
}

.contact-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg) var(--space-xl);
}

.contact-info-card {
  padding: var(--space-xl);
}

.contact-info-card h3 {
  font-size: 1.3rem;
  margin-bottom: var(--space-lg);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.contact-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-text h4 {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.contact-text p,
.contact-text a {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.contact-text a:hover {
  color: var(--accent-cyan);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--success);
  margin-bottom: var(--space-lg);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.1);
}

.status-badge .status-pulse {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.social-links {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-base);
}

.social-link:hover {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
  background: rgba(0, 240, 255, 0.12);
  transform: translateY(-3px);
  box-shadow: var(--glow-cyan);
}

/* Engagements & Services (replaces PGP) */
.services-engagement {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
}

.services-engagement h4 {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.engagement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.engagement-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.engagement-item:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.engagement-item i {
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.engagement-item span {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
}



/* PGP Easter Egg */
.pgp-section {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-md);
}

.pgp-section summary {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-violet);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.pgp-section pre {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  overflow-x: auto;
  line-height: 1.5;
}

/* ============================================================
   15. FOOTER
   ============================================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-2xl) 0 var(--space-xl);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-md);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
}

.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-tertiary);
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: var(--space-md);
}

.footer-copyright span {
  color: var(--accent-cyan);
}

/* ============================================================
   16. KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes blink-caret {
  0%, 100% { border-color: var(--accent-cyan); }
  50% { border-color: transparent; }
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
}

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

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ============================================================
   17. RESPONSIVE DESIGN (Mobile-First)
   ============================================================ */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 250px 1fr;
    gap: var(--space-xl);
  }

  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

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

@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
  }

  .section {
    padding: var(--space-3xl) 0;
  }

  /* Navbar */
  .nav-links {
    display: none;
  }

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

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-image-wrapper {
    max-width: 250px;
    margin: 0 auto;
  }

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

  .info-item {
    justify-content: flex-start;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }

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

  /* Gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .gallery-item {
    height: 240px;
  }

  /* Contact Items */
  .contact-items-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .contact-text a,
  .contact-text p {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Hero */
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .hero-cta .btn-neon {
    width: 100%;
    max-width: 280px;
  }

  /* Floating Terminal on mobile/tablet */
  .terminal-fab {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
    font-size: 1.25rem;
  }

  .terminal-popup {
    bottom: 80px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .terminal-body {
    min-height: 220px;
    max-height: 340px;
    font-size: 0.8rem;
    padding: var(--space-md);
  }

  /* Section header */
  .section-header {
    margin-bottom: var(--space-2xl);
  }

  /* Modal */
  .modal-content {
    max-height: 85vh;
    border-radius: var(--radius-lg);
  }

  .modal-image {
    height: 180px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}

@media (max-width: 480px) {
  .container {
    width: 94%;
    padding: 0 var(--space-sm);
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero-role {
    font-size: 0.9rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .gallery-item {
    height: 220px;
  }

  .skills-filter {
    gap: var(--space-xs);
  }

  .filter-btn {
    padding: 10px 16px;
    font-size: 0.8rem;
    min-height: 44px;
  }

  .footer-links {
    flex-direction: column;
    gap: var(--space-md);
  }
}

/* Ultra-wide */
@media (min-width: 1440px) {
  .container {
    max-width: 1300px;
  }

  .hero-content {
    max-width: 900px;
  }
}

/* ============================================================
   18. ACCESSIBILITY
   ============================================================ */

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-cyan);
  color: var(--bg-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .typewriter-text {
    animation: none;
    border-right: none;
  }

  #hero-canvas {
    display: none;
  }
}

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