/* ==========================================================================
   JAVIER CIFUENTES | WORLD-CLASS EXECUTIVE & TECH DESIGN SYSTEM
   Modern Dark-Mode Palette, Glassmorphism, Micro-Interactions & Fluid Type
   Fully Responsive (Mobile-First Architecture)
   ========================================================================== */

:root {
  /* Color Tokens */
  --bg-canvas: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-surface-hover: #27354f;
  --bg-glass: rgba(15, 23, 42, 0.85);
  --bg-glass-card: rgba(30, 41, 59, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(99, 102, 241, 0.5);

  --accent-primary: #6366f1;       /* Electric Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-cyan: #06b6d4;          /* Modern Cyan */
  --accent-emerald: #10b981;       /* Growth Emerald */
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --gradient-surface: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.18) 0%, transparent 70%);

  /* Text Hierarchy */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090d16;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Elevation & Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Core Styles */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Images & Media Safety */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Typography Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  margin-top: 0;
  overflow-wrap: break-word;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  overflow-wrap: break-word;
}

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

a:hover {
  color: #38bdf8;
}

/* Container */
.container-custom {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ==========================================================================
   NAVIGATION (Glassmorphism & Fixed Blur)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-normal);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: relative;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-badge {
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.nav-menu li {
  margin: 0;
  padding: 0;
}

.nav-link-custom {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

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

.nav-link-custom.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-weight: 600;
}

.btn-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--gradient-primary);
  color: #fff !important;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.45);
}

/* Mobile Toggle Button */
.mobile-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-normal);
  text-decoration: none;
  min-height: 48px;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.45);
  color: #fff;
}

.btn-secondary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 48px;
}

.btn-secondary-custom:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-highlight);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
}

.btn-outline-custom:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  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 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   CARDS & SURFACES
   ========================================================================== */
.card-glass {
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

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

/* Section Header Commons */
.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.5rem;
}

.section-tag {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: inline-block;
}

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

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

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: flex-start;
  gap: 3.5rem;
}

.hero-title {
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

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

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-avatar-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin-top: 2.4rem; /* Aligns top of photo with top of h1 hero */
}

.hero-avatar-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, rgba(6, 182, 212, 0.2) 50%, transparent 75%);
  filter: blur(40px);
  z-index: 1;
}

.hero-avatar-img {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 24px;
  border: 2px solid var(--border-highlight);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.hero-tech-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cta-closing-section {
  padding: 5.5rem 0;
}

.cta-closing-card {
  text-align: center;
  padding: 4rem 2rem;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.22) 0%, rgba(15, 23, 42, 0.95) 75%);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.cta-btn-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   METRICS & KPI BANNER
   ========================================================================== */
.kpi-section {
  padding: 1rem 0 3.5rem;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.kpi-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.kpi-number {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.4rem;
}

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

.kpi-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   BENTO GRID (Executive Dual Competencies)
   ========================================================================== */
.bento-section {
  padding: 4rem 0;
}

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

.bento-col-8 {
  grid-column: span 8;
}

.bento-col-4 {
  grid-column: span 4;
}

.bento-col-6 {
  grid-column: span 6;
}

.bento-card {
  position: relative;
  background: var(--gradient-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.bento-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.bento-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-cyan);
  border-radius: 12px;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.bento-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.bento-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.65;
}

.bento-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   ABOUT ME LAYOUT (Fully Responsive)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3.5rem;
  align-items: flex-start;
  margin-bottom: 4rem;
}

.credential-item {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
}

.credential-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ==========================================================================
   PROJECTS & PORTFOLIO CARDS
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.project-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.6);
}

.project-cover-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background: #111827;
  overflow: hidden;
}

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

.project-card:hover .project-cover-img {
  transform: scale(1.05);
}

.project-metric-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  z-index: 2;
}

.project-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.project-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.project-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.project-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   SERVICES (Grid & Detailed Views)
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.service-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.15);
}

.service-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 1rem;
}

.service-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.service-subtitle {
  font-size: 0.9rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.service-body {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.service-detail-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
  padding: 2.75rem;
}

.service-detail-card.no-image {
  grid-template-columns: 1fr;
}

/* ==========================================================================
   CONTACT LAYOUT (Fully Responsive)
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3rem;
  align-items: flex-start;
}

.form-group-custom {
  margin-bottom: 1.5rem;
}

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

.form-control,
.form-control-custom {
  width: 100%;
  background: rgba(15, 23, 42, 0.85) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 10px !important;
  padding: 0.85rem 1.15rem !important;
  font-family: var(--font-body) !important;
  font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
  color: var(--text-primary) !important;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: none !important;
}

.form-control:focus,
.form-control-custom:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25) !important;
  background: var(--bg-surface) !important;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: #060911;
  padding: 4rem 0 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 380px;
  margin-top: 0.75rem;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.social-pill-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.social-pill {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.social-pill:hover {
  color: #fff;
  border-color: var(--accent-primary);
  background: var(--accent-primary);
  transform: translateY(-2px);
}

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

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE-FIRST MEDIA QUERIES
   ========================================================================== */

/* Tablets & Small Desktops (max-width: 991px) */
@media (max-width: 991px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2.5rem;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-group {
    justify-content: center;
  }

  .hero-tech-badges {
    justify-content: center;
  }

  .hero-avatar-wrapper {
    order: -1; /* Avatar shows first on mobile/tablet for instant personal brand recognition */
    margin-top: 0;
    margin-bottom: 1.5rem;
  }

  .hero-avatar-img {
    max-width: 260px;
  }

  .hero-avatar-glow {
    width: 220px;
    height: 220px;
  }

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

  .bento-col-8,
  .bento-col-4,
  .bento-col-6 {
    grid-column: span 12;
  }

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

  .service-detail-card {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  /* Mobile Navigation Drawer */
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-highlight);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    flex-direction: column;
    padding: 1.5rem;
    gap: 0.5rem;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  .nav-menu.show {
    display: flex;
    animation: fadeInDown 200ms ease-out forwards;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-link-custom {
    display: block;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1.05rem;
    border-radius: 10px;
  }

  .btn-header-cta {
    display: flex;
    width: 100%;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    margin-top: 0.5rem;
    justify-content: center;
  }
}

/* Mobile Phones (max-width: 576px) */
@media (max-width: 576px) {
  .container-custom {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .hero-section {
    padding: 2.5rem 0 2.5rem;
  }

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

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

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

  .hero-cta-group a,
  .hero-cta-group button {
    width: 100%;
    justify-content: center;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .kpi-card {
    padding: 1.25rem;
  }

  .kpi-number {
    font-size: 1.9rem;
  }

  .card-glass {
    padding: 1.35rem;
    border-radius: 14px;
  }

  .bento-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

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

  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .service-detail-card {
    padding: 1.35rem;
  }

  .project-body {
    padding: 1.25rem;
  }

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

  .brand-logo span:first-child {
    font-size: 1.1rem;
  }

  .brand-badge {
    display: none; /* Hide minor badge on ultra small screens to keep header uncluttered */
  }

  .cta-closing-section {
    padding: 3.5rem 0;
  }

  .cta-closing-card {
    padding: 2.25rem 1.25rem;
  }

  .cta-btn-group {
    flex-direction: column;
    width: 100%;
  }

  .cta-btn-group a,
  .cta-btn-group button {
    width: 100%;
    justify-content: center;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
