/* ==========================================================================
   ApexDev Studio - Mobile Responsive & Glassmorphism Stylesheet
   Created for: Mohamed Nurdin Mgaza
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(139, 92, 246, 0.45);

  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Typography */
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-code: 'Fira Code', monospace;

  /* Shadows & Glassmorphism */
  --backdrop-blur: blur(20px);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Cursor Glow */
.cursor-glow {
  position: fixed;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(6, 182, 212, 0.04) 50%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out;
}

/* Top System Bar */
.top-system-bar {
  background: rgba(5, 7, 12, 0.95);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.4rem 0;
  font-family: var(--font-code);
  font-size: 0.78rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1001;
}

.ticker-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.ticker-highlight {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.18;
  color: #ffffff;
  word-break: break-word;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-purple) 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.gradient-text-emerald {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

.section {
  padding: 5rem 0;
  position: relative;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px -10px rgba(139, 92, 246, 0.3);
}

/* Navigation Header */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(7, 9, 14, 0.92);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-glass);
  height: 70px;
  display: flex;
  align-items: center;
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.brand-badge {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: #fff;
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
}

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

.nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

/* Primary Button Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 20px var(--accent-purple-glow);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition-normal);
  white-space: nowrap;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0891b2 100%);
  box-shadow: 0 4px 20px var(--accent-cyan-glow);
}

/* Mobile Hamburger Button & Drawer */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1002;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #ffffff;
  margin: 5px 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu-drawer {
  display: none;
  position: absolute;
  top: 70px;
  left: 0;
  right: 0;
  background: rgba(7, 9, 14, 0.98);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-glow);
  padding: 1.8rem 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 999;
}

.mobile-menu-drawer.active {
  display: block;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.mobile-nav-link {
  font-size: 1.05rem;
  font-weight: 600;
  color: #e2e8f0;
  display: block;
  padding: 0.4rem 0;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  padding-top: 110px;
  padding-bottom: 60px;
  display: flex;
  align-items: center;
  position: relative;
  box-sizing: border-box;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--accent-emerald);
  margin-bottom: 1.2rem;
  max-width: 100%;
}

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

@keyframes pulse-glow {
  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.5rem;
  letter-spacing: -1.2px;
  margin-bottom: 1rem;
}

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

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.2rem;
}

.hero-metrics {
  display: flex;
  gap: 2rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1.5rem;
}

.metric-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tech Badges Grid */
.tech-badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}

.tech-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-family: var(--font-code);
}

/* Services Grid */
.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 2.3rem;
  margin-bottom: 0.7rem;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

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

.service-icon {
  width: 56px;
  height: 56px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-purple);
  margin-bottom: 1.2rem;
}

.service-title {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.service-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
}

/* AI Simulator Playground Widget */
.simulator-container {
  background: #0d111a;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  width: 100%;
}

.simulator-header {
  background: #161b26;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
}

.window-dots {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

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

.simulator-body {
  padding: 1.4rem;
  min-height: 260px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  max-width: 88%;
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble.bot {
  align-self: flex-start;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #f1f5f9;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #fff;
}

.simulator-controls {
  padding: 0.9rem 1.1rem;
  background: #121722;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 0.6rem;
}

.simulator-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.1rem;
  color: #fff;
  font-family: var(--font-body);
  outline: none;
  font-size: 0.88rem;
}

.preset-chips-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.1rem;
  background: #101522;
  border-bottom: 1px solid var(--border-glass);
}

.chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--accent-cyan);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-family: var(--font-code);
  cursor: pointer;
}

/* Terminal Window */
.terminal-window {
  background: #090c12;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-md);
  font-family: var(--font-code);
  font-size: 0.82rem;
  padding: 1.2rem;
  color: #38bdf8;
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
}

.term-line {
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.term-prompt { color: var(--accent-emerald); }
.term-cmd { color: #f8fafc; }
.term-output { color: var(--text-muted); }

/* Portfolio Filter Grid */
.portfolio-filter-nav {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: #ffffff;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.8rem;
}

.portfolio-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
}

.portfolio-thumb-wrapper {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: #111827;
}

.portfolio-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-info {
  padding: 1.4rem;
}

.portfolio-cat {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.portfolio-item-title {
  font-size: 1.18rem;
  margin-bottom: 0.5rem;
}

/* Command Dock */
.command-dock {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 998;
  background: rgba(13, 19, 32, 0.92);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-glow);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.dock-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-glass);
  padding: 4rem 0 6.5rem;
  background: rgba(5, 7, 12, 0.95);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1.2fr 1.5fr;
  gap: 2.2rem;
  margin-bottom: 3rem;
}

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

/* Lightbox Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 7, 12, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #0e1422;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 100%;
  padding: 2rem;
  position: relative;
  box-sizing: border-box;
}

.modal-close-btn {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  background: rgba(255, 255, 255, 0.08);
  border: none; color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 992px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

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

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

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

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

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

  .top-system-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links-wrapper, .nav-actions {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero-section {
    padding-top: 95px;
    padding-bottom: 40px;
  }

  .hero-title {
    font-size: 2.1rem;
    letter-spacing: -0.5px;
  }

  .hero-subtitle {
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
  }

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

  .hero-cta-group .btn-primary,
  .hero-cta-group .btn-secondary {
    width: 100%;
  }

  .hero-metrics {
    gap: 1rem;
    justify-content: space-around;
  }

  .metric-number {
    font-size: 1.4rem;
  }

  .metric-label {
    font-size: 0.7rem;
  }

  .section {
    padding: 3.5rem 0;
  }

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

  .section-desc {
    font-size: 0.95rem;
  }

  .services-grid, .portfolio-grid {
    grid-template-columns: 1fr;
  }

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

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

  .command-dock {
    width: 92%;
    padding: 0.45rem 0.8rem;
    gap: 0.8rem;
    font-size: 0.75rem;
  }

  .cursor-glow {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.15rem;
  }

  .brand-badge {
    font-size: 0.58rem;
    padding: 0.15rem 0.4rem;
  }

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

  .glass-card {
    padding: 1.3rem;
  }
}
