/* ==========================================================================
   M. Tabassat - Personal Portfolio Stylesheet
   Modern, Clean, Ultra-Performant, Glassmorphism & High-Contrast Design System
   ========================================================================== */

/* --- CSS Variables & Theme Definitions --- */
:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.7);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #38bdf8;

  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #6366f1 50%, #ec4899 100%);
  --gradient-glow: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.15), transparent 70%);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  --navbar-height: 72px;
  --container-max: 1200px;
}

/* --- Light Mode Overrides --- */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.8);
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(2, 132, 199, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #0284c7;

  --gradient-glow: radial-gradient(circle at 50% 50%, rgba(2, 132, 199, 0.08), transparent 70%);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 25px rgba(2, 132, 199, 0.15);
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent-blue);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 16px;
}

/* Ambient Background Canvas */
.ambient-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  opacity: 0.7;
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.blob-1 {
  width: 480px;
  height: 480px;
  background: rgba(56, 189, 248, 0.12);
  top: -100px;
  right: -50px;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.blob-2 {
  width: 550px;
  height: 550px;
  background: rgba(99, 102, 241, 0.1);
  bottom: 10%;
  left: -100px;
  animation: floatOrb 25s infinite alternate-reverse ease-in-out;
}

.blob-3 {
  width: 350px;
  height: 350px;
  background: rgba(236, 72, 153, 0.08);
  top: 45%;
  right: 15%;
  animation: floatOrb 18s infinite alternate ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
  100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Background Grid Overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--border-subtle) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

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

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
}

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

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  color: var(--text-accent);
}

.btn-terminal {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}
.btn-terminal:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  transform: translateY(-2px);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.badge-status {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  position: relative;
}
.status-dot::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  opacity: 0.6;
  animation: pulseDot 2s infinite ease-out;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  height: var(--navbar-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: all var(--transition-normal);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
  transition: transform var(--transition-normal);
}
.logo:hover .logo-badge {
  transform: rotate(6deg) scale(1.05);
}

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

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 6px 2px;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent-cyan);
  transition: width var(--transition-normal);
  border-radius: 2px;
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

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

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.terminal-badge-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.terminal-badge-btn:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}
.terminal-badge-btn kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.72rem;
}

.menu-toggle {
  display: none;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-text {
  max-width: 640px;
}

.hero-eyebrow {
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-subtitle-wrapper {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  min-height: 2.2em;
}

.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background-color: var(--accent-cyan);
  margin-left: 4px;
  animation: blink 0.9s infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

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

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.hero-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}
.social-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.social-links {
  display: flex;
  gap: 10px;
}
.social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.social-link:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

/* Hero Visual / Interactive Code Card */
.hero-visual {
  position: relative;
}

.code-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  transition: transform var(--transition-normal);
}
.code-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.code-header {
  background: rgba(15, 23, 42, 0.4);
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-dots {
  display: flex;
  gap: 6px;
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.code-file {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.code-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.code-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  overflow-x: auto;
}

.code-keyword { color: #f43f5e; font-weight: 600; }
.code-entity { color: #38bdf8; }
.code-property { color: #818cf8; }
.code-string { color: #34d399; }
.code-number { color: #fbbf24; }
.code-comment { color: var(--text-muted); font-style: italic; }

/* Stats Bar */
.stats-section {
  padding: 20px 0 60px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-feature-settings: "tnum";
}

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

/* ==========================================================================
   Section Headers & Common Layout
   ========================================================================== */
.section {
  padding: 90px 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   About & Core Services Section
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 64px;
}

.about-text p {
  margin-bottom: 18px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
}
.feature-pill svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: transform var(--transition-fast);
}
.service-card:hover .service-icon {
  transform: scale(1.1) rotate(4deg);
  background: var(--accent-cyan);
  color: #0b0f19;
}

.service-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.service-description {
  font-size: 0.94rem;
  line-height: 1.6;
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-filter-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.filter-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 16px;
}
.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.skill-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.skill-info {
  flex-grow: 1;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.skill-name {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
}

.skill-percentage {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  transition: width 1s ease-in-out;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.project-banner {
  height: 170px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}
.project-banner-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.4;
}

.project-banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.project-icon-badge {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin: 0 auto 8px;
}

.project-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.project-badge {
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
}

.project-subtitle {
  font-size: 0.88rem;
  color: var(--accent-indigo);
  font-weight: 600;
  margin-bottom: 12px;
}

.project-desc {
  font-size: 0.93rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

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

.tag {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.project-actions {
  display: flex;
  gap: 8px;
}

.action-icon-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.action-icon-link:hover {
  color: var(--accent-cyan);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Experience & Timeline Section
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: var(--border-subtle);
}

.timeline-item {
  position: relative;
  padding-left: 54px;
  margin-bottom: 44px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-node {
  position: absolute;
  left: 12px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  z-index: 1;
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(8px);
  transition: all var(--transition-normal);
}
.timeline-card:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
  background: var(--bg-card-hover);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.timeline-company {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-indigo);
  margin-bottom: 14px;
}

.timeline-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.timeline-achievements {
  list-style: none;
  margin-bottom: 18px;
}

.timeline-achievements li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.timeline-achievements li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent-cyan);
  font-weight: bold;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all var(--transition-normal);
}
.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}
.copy-btn:hover {
  color: var(--accent-cyan);
}

/* Contact Form */
.contact-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
  backdrop-filter: blur(10px);
}

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

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

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background: var(--bg-primary);
}

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

/* ==========================================================================
   Interactive Terminal Drawer / Modal
   ========================================================================== */
.terminal-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.terminal-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.terminal-window {
  width: 100%;
  max-width: 820px;
  height: 520px;
  background: #0d1117;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}
.terminal-modal.open .terminal-window {
  transform: scale(1);
}

.terminal-titlebar {
  background: #161b22;
  padding: 12px 18px;
  border-bottom: 1px solid #30363d;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.terminal-btn-close {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ff5f56;
  border: none;
  cursor: pointer;
}
.terminal-btn-minimize {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffbd2e;
  border: none;
}
.terminal-btn-maximize {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #27c93f;
  border: none;
}

.terminal-tab-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #8b949e;
}

.terminal-screen {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #c9d1d9;
  line-height: 1.6;
}

.terminal-welcome {
  color: var(--accent-cyan);
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.terminal-output {
  margin-bottom: 12px;
}

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

.terminal-prompt-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-prompt {
  color: var(--accent-emerald);
  font-weight: 600;
  user-select: none;
}

.terminal-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #f0f6fc;
}

/* ==========================================================================
   Project Detail Deep Dive Modal
   ========================================================================== */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}
.project-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.project-modal-content {
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
  padding: 36px;
  position: relative;
}
.project-modal.open .project-modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.modal-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.modal-header {
  margin-bottom: 24px;
  padding-right: 48px;
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 1rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.modal-section {
  margin-bottom: 24px;
}
.modal-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-arch-list {
  list-style: none;
}
.modal-arch-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  font-size: 0.94rem;
  color: var(--text-secondary);
}
.modal-arch-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--accent-emerald);
}

.modal-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideToast 0.3s ease-out forwards;
}
@keyframes slideToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Back To Top Button
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  transform: translateY(-4px);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 48px 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.footer-links {
  display: flex;
  gap: 24px;
}
.footer-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.footer-link:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-text {
    margin: 0 auto;
  }
  .hero-subtitle-wrapper {
    justify-content: center;
  }
  .hero-cta-group {
    justify-content: center;
  }
  .hero-socials {
    justify-content: center;
  }
  .hero-visual {
    max-width: 540px;
    margin: 0 auto;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
  }
  .nav-links {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 24px;
    gap: 18px;
    display: none;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.active {
    display: flex;
  }
  .menu-toggle {
    display: flex;
  }
  .terminal-badge-btn {
    display: none;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Print Stylesheet (Clean Resume Mode)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .navbar, .hero-cta-group, .hero-visual, .stats-section, .terminal-modal,
  .project-modal, .toast-container, .back-to-top, .footer, .ambient-mesh,
  .grid-overlay, .skills-filter-container {
    display: none !important;
  }
  .section {
    padding: 20px 0 !important;
  }
  .timeline-card, .service-card, .project-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: transparent !important;
    page-break-inside: avoid;
  }
}

