/* ==========================================================================
   Codecrafter - Modern Developer Portfolio Design System
   Jose Alberto Maldonado Lopez - Full-Stack Web Developer
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties & Design Tokens (Light Mode Default)
   -------------------------------------------------------------------------- */
:root, [data-theme="light"] {
  /* Color Palette - Clean Light Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(241, 245, 249, 1);
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-input: #f1f5f9;

  /* Accent Colors */
  --accent-primary: #4f46e5;
  --accent-secondary: #0284c7;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-glow: rgba(79, 70, 229, 0.2);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #0284c7 100%);
  --grad-text: linear-gradient(135deg, #312e81 0%, #0284c7 100%);
  --grad-card-border: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.02));
  --grad-hero-bg: radial-gradient(circle at 50% 20%, rgba(79, 70, 229, 0.1) 0%, rgba(2, 132, 199, 0.05) 35%, transparent 70%);

  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  /* Borders & Shadows */
  --border-color: rgba(0, 0, 0, 0.08);
  --border-active: rgba(79, 70, 229, 0.4);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);

  /* Typography */
  --font-main: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-code: "Fira Code", monospace;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --nav-height: 80px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(17, 24, 39, 0.65);
  --bg-input: #1f293d;

  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #06b6d4; /* Cyan */
  --accent-glow: rgba(99, 102, 241, 0.35);

  --grad-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --grad-text: linear-gradient(135deg, #a5b4fc 0%, #38bdf8 50%, #818cf8 100%);
  --grad-card-border: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  --grad-hero-bg: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.08) 35%, transparent 70%);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

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

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

button, input, textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   3. Header & Navigation (Glassmorphic Sticky Navbar)
   -------------------------------------------------------------------------- */
.navbar-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.navbar-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] .navbar-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  background: rgba(11, 15, 25, 0.85);
}

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

.brand-logo {
  display: flex;
  align-items: center;
}

.brand-logo img, .brand-logo picture img {
  height: 42px;
  width: auto;
  transition: transform var(--transition-fast);
}

.brand-logo:hover img, .brand-logo:hover picture img {
  transform: scale(1.08) rotate(-3deg);
}

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

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  padding: 0.4rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-primary);
  transition: width var(--transition-fast);
  border-radius: 2px;
}

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

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

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Control buttons (Theme & Lang) */
.icon-btn, .lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.icon-btn:hover, .lang-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.mobile-toggle {
  display: none;
  font-size: 1.4rem;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   4. Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  padding-top: calc(var(--nav-height) + 4rem);
  padding-bottom: 6rem;
  background: var(--grad-hero-bg);
  overflow: hidden;
}

/* Ambient glow blobs */
.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}
.glow-blob-1 {
  top: 10%;
  left: 15%;
  width: 350px;
  height: 350px;
  background: var(--accent-primary);
}
.glow-blob-2 {
  top: 30%;
  right: 15%;
  width: 400px;
  height: 400px;
  background: var(--accent-secondary);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--accent-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
[data-theme="dark"] .hero-badge {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

.hero-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -1px;
}

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

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(79, 70, 229, 0.5);
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  transform: translateY(-3px);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.stat-item h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-code);
}

.stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Hero Avatar Container */
.hero-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.avatar-ring {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  background: var(--grad-primary);
  padding: 6px;
  animation: morphBlob 8s ease-in-out infinite alternate;
  box-shadow: var(--shadow-glow);
}

@keyframes morphBlob {
  0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
  100% { border-radius: 40% 60% 50% 50% / 60% 40% 60% 40%; }
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background-color: var(--bg-secondary);
}

.tech-floating-tag {
  position: absolute;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-card);
  animation: float 4s ease-in-out infinite alternate;
}

.tag-1 { top: 10%; left: -5%; animation-delay: 0s; }
.tag-2 { bottom: 15%; right: -5%; animation-delay: 2s; }
.tag-3 { bottom: 0%; left: 10%; animation-delay: 1s; }

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

/* --------------------------------------------------------------------------
   5. Section Header Component
   -------------------------------------------------------------------------- */
.section {
  padding: 6rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 650px;
  margin: 0 auto 4rem auto;
}

.section-subtitle {
  font-family: var(--font-code);
  color: var(--accent-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  display: block;
}

.section-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* --------------------------------------------------------------------------
   6. About & Experience Section
   -------------------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .glass-card:hover {
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.02rem;
  line-height: 1.75;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin-top: 2rem;
}

.feature-box {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
}
[data-theme="dark"] .feature-box {
  background: rgba(255, 255, 255, 0.03);
}

.feature-box i {
  font-size: 1.4rem;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}
.feature-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.feature-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.2rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 10px var(--accent-primary);
}

.timeline-date {
  font-family: var(--font-code);
  font-size: 0.8rem;
  color: var(--accent-secondary);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.timeline-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   7. Tech Stack & Skills Section
   -------------------------------------------------------------------------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
}

.skill-category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.skill-category-title i {
  color: var(--accent-secondary);
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}
[data-theme="dark"] .skill-pill {
  background: rgba(255, 255, 255, 0.04);
}

.skill-pill:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  color: var(--accent-secondary);
  transform: translateY(-2px);
}

.skill-pill i {
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   8. Portfolio Projects Section
   -------------------------------------------------------------------------- */
.portfolio-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-thumb {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

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

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.overlay-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform var(--transition-fast);
}

.overlay-btn:hover {
  transform: scale(1.15);
  background: var(--accent-secondary);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag-badge {
  font-family: var(--font-code);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(79, 70, 229, 0.1);
  color: var(--accent-secondary);
  font-weight: 600;
}
[data-theme="dark"] .tag-badge {
  background: rgba(99, 102, 241, 0.15);
}

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

.project-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.project-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-secondary);
}

.project-footer-btn i {
  transition: transform var(--transition-fast);
}

.project-footer-btn:hover i {
  transform: translateX(4px);
}

/* Featured Project Spotlight Card */
.featured-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  box-shadow: var(--shadow-glow);
}

.featured-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   9. Modal Detail Viewer
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-card);
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

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

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.modal-body {
  padding: 2.5rem;
}

.modal-gallery {
  position: relative;
  margin-bottom: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  max-height: 420px;
}

.modal-main-img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  display: block;
}

.modal-thumbs {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  margin-bottom: 1.5rem;
}

.modal-thumb-img {
  width: 80px;
  height: 55px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.6;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.modal-thumb-img.active, .modal-thumb-img:hover {
  opacity: 1;
  border-color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   10. Contact Section & Form
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.contact-info-item:hover {
  border-color: var(--border-active);
  transform: translateX(6px);
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.contact-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.social-icon:hover {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

/* Contact Form Styling */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
  background: var(--bg-card-hover);
}

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

.map-container {
  grid-column: 1 / -1;
  width: 100%;
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  margin-top: 1rem;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  background: var(--bg-secondary);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* Toast notification */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--accent-emerald);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  z-index: 3000;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   12. Responsive Breakpoints & Mobile Logo Switch
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

  .hero-subtitle {
    margin: 0 auto 2rem auto;
  }

  .hero-stats {
    max-width: 500px;
    margin: 0 auto;
  }

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

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

@media (max-width: 768px) {
  /* Mobile Logo Display: Use logoS.png on screens <= 768px */
  .brand-logo img, .brand-logo picture img {
    content: url('./assets/imgs/index/logoS.png');
    height: 36px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    display: none;
  }

  .nav-links.active {
    display: flex;
  }

  .mobile-toggle {
    display: block;
  }

  .hero-title {
    font-size: 2.3rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .avatar-ring {
    width: 250px;
    height: 250px;
  }

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