/* ═══════════════════════════════════════════════════════ */
/* MasTECH Innovations — Shared Styles                    */
/* ═══════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: #0a0e17; color: #e2e8f0; overflow-x: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0e17; }
::-webkit-scrollbar-thumb { background: #00f0ff33; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #00f0ff66; }

/* Hero background grid */
.hero-grid {
  background-image:
    linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Subtle grid for inner pages */
.page-grid {
  background-image:
    linear-gradient(rgba(0,240,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.015) 1px, transparent 1px);
  background-size: 80px 80px;
}

/* Radial gradient overlays */
.radial-neon {
  background: radial-gradient(ellipse 600px 400px at 20% 50%, rgba(0,240,255,0.07) 0%, transparent 70%);
}
.radial-cyber {
  background: radial-gradient(ellipse 500px 500px at 80% 30%, rgba(0,255,136,0.05) 0%, transparent 70%);
}
.radial-center {
  background: radial-gradient(ellipse 800px 500px at 50% 0%, rgba(0,240,255,0.06) 0%, transparent 70%);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #00f0ff 0%, #00ff88 50%, #00f0ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Neon border */
.neon-border {
  border: 1px solid rgba(0,240,255,0.15);
  transition: all 0.4s ease;
}
.neon-border:hover {
  border-color: rgba(0,240,255,0.5);
  box-shadow: 0 0 30px rgba(0,240,255,0.1), inset 0 0 30px rgba(0,240,255,0.03);
}

/* Card shine effect */
.card-shine {
  position: relative;
  overflow: hidden;
}
.card-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(0,240,255,0.03) 45%,
    rgba(0,240,255,0.05) 50%,
    rgba(0,240,255,0.03) 55%,
    transparent 60%
  );
  transform: translateX(-100%) translateY(-100%);
  transition: transform 0.8s ease;
}
.card-shine:hover::before {
  transform: translateX(30%) translateY(30%);
}

/* CTA Button styles */
.btn-primary {
  position: relative;
  background: linear-gradient(135deg, #00f0ff, #00cc99);
  color: #0a0e17;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 8px;
  transition: all 0.3s ease;
  overflow: hidden;
  display: inline-block;
  text-decoration: none;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #00ff88, #00f0ff);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn-primary:hover::after { opacity: 1; }
.btn-primary span { position: relative; z-index: 1; }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0,240,255,0.3);
}

.btn-secondary {
  border: 1px solid rgba(0,240,255,0.4);
  color: #00f0ff;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  display: inline-block;
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(0,240,255,0.08);
  border-color: #00f0ff;
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0,240,255,0.15);
}

.btn-ghost {
  color: #94a3b8;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-ghost:hover {
  color: #00f0ff;
  background: rgba(0,240,255,0.05);
}

/* Section reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Floating orbs */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

/* Accordion */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}
.accordion-content.open {
  max-height: 500px;
}

/* Project card image placeholder */
.project-visual {
  background: linear-gradient(135deg, #111827 0%, #1a2332 100%);
  position: relative;
  overflow: hidden;
}
.project-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,240,255,0.05) 0%, rgba(0,255,136,0.05) 100%);
}

/* Typing cursor */
.typing-cursor::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: #00f0ff;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Particle canvas */
#particles-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Nav blur */
.nav-blur {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open {
  transform: translateX(0);
}

/* Stats counter */
.stat-value {
  font-variant-numeric: tabular-nums;
}

/* Service icon container */
.icon-container {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,240,255,0.1), rgba(0,255,136,0.05));
  border: 1px solid rgba(0,240,255,0.15);
  transition: all 0.4s ease;
}
.neon-border:hover .icon-container {
  background: linear-gradient(135deg, rgba(0,240,255,0.2), rgba(0,255,136,0.1));
  border-color: rgba(0,240,255,0.4);
  box-shadow: 0 0 20px rgba(0,240,255,0.2);
}

/* Tech stack badge */
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0,240,255,0.08);
  border: 1px solid rgba(0,240,255,0.15);
  color: #00f0ff;
  transition: all 0.3s ease;
}
.tech-badge:hover {
  background: rgba(0,240,255,0.15);
  border-color: rgba(0,240,255,0.3);
}

/* CEO portrait */
.ceo-portrait {
  background: linear-gradient(135deg, #0f1623, #1a2332);
  position: relative;
  overflow: hidden;
}
.ceo-portrait::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(from 0deg, #00f0ff, #00ff88, #00f0ff, #00ff88, #00f0ff);
  border-radius: inherit;
  z-index: -1;
  animation: rotate 4s linear infinite;
}
@keyframes rotate {
  100% { transform: rotate(360deg); }
}

/* Glow line */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,240,255,0.3), transparent);
}

/* Page hero (inner pages) */
.page-hero {
  position: relative;
  padding-top: 8rem;
  padding-bottom: 4rem;
  overflow: hidden;
}
@media (min-width: 1024px) {
  .page-hero {
    padding-top: 10rem;
    padding-bottom: 5rem;
  }
}

/* Breadcrumb */
.breadcrumb-link {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.875rem;
}
.breadcrumb-link:hover {
  color: #00f0ff;
}

/* Active nav */
.nav-active {
  color: #00f0ff !important;
  background: rgba(0,240,255,0.05);
}

/* Fade-in animations */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  0% { opacity: 0; transform: translateX(-40px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  0% { opacity: 0; transform: translateX(40px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}
@keyframes pulseNeon {
  0%, 100% { box-shadow: 0 0 5px #00f0ff, 0 0 20px rgba(0,240,255,0.3); }
  50% { box-shadow: 0 0 20px #00f0ff, 0 0 60px rgba(0,240,255,0.5); }
}

.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.8s ease-out forwards; }
.animate-fade-in-right { animation: fadeInRight 0.8s ease-out forwards; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-pulse-neon { animation: pulseNeon 2s ease-in-out infinite; }

/* Process step connector */
.step-connector {
  position: absolute;
  top: 32px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(0,240,255,0.3), rgba(0,255,136,0.1));
}

/* Pricing tier highlight */
.tier-popular {
  border-color: rgba(0,240,255,0.4) !important;
  box-shadow: 0 0 40px rgba(0,240,255,0.1);
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10,14,23,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: white;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}
.form-input::placeholder { color: #4b5563; }
.form-input:focus {
  outline: none;
  border-color: rgba(0,240,255,0.5);
  box-shadow: 0 0 0 3px rgba(0,240,255,0.1);
}

/* Timeline */
.timeline-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(0,240,255,0.3), rgba(0,255,136,0.1), transparent);
}
.timeline-dot {
  position: absolute;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0a0e17;
  border: 2px solid #00f0ff;
  z-index: 1;
}


/* ═══════════════════════════════════════════════════════ */
/* MOBILE OPTIMIZATIONS                                   */
/* ═══════════════════════════════════════════════════════ */

/* Prevent horizontal overflow everywhere */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Mobile nav improvements */
@media (max-width: 1023px) {
  /* Mobile menu - full overlay style */
  .mobile-menu {
    width: 100% !important;
    max-width: 320px;
  }

  /* Larger touch targets */
  .mobile-nav-link {
    padding: 14px 16px !important;
    font-size: 1rem !important;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  /* Better overlay */
  #mobile-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(4px);
  }
}

/* Small screens */
@media (max-width: 640px) {
  /* Hero text scaling */
  h1 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
    line-height: 1.15 !important;
  }

  /* Page hero headings */
  .page-hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
  }

  /* Section headings */
  h2 {
    font-size: clamp(1.5rem, 6vw, 2.25rem) !important;
  }

  /* Body text */
  p {
    font-size: 0.9375rem;
    line-height: 1.7;
  }

  /* Cards - tighter padding */
  .neon-border {
    padding: 1.25rem !important;
  }

  /* Buttons full width on mobile */
  .btn-primary, .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 14px 24px !important;
    font-size: 0.9375rem !important;
  }

  /* Form inputs - bigger touch targets */
  .form-input {
    padding: 14px 16px !important;
    font-size: 16px !important; /* prevents iOS zoom */
    min-height: 48px;
  }

  /* Select elements */
  select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px !important;
  }

  /* Terminal code block */
  pre, code {
    font-size: 0.7rem !important;
    line-height: 1.5 !important;
  }

  /* CEO portrait */
  .ceo-portrait, [class*="ceo-portrait"] {
    width: 220px !important;
    height: 220px !important;
  }

  /* Accordion touch targets */
  .accordion-trigger {
    padding: 16px 20px !important;
    min-height: 56px;
  }

  /* Tech badges */
  .tech-badge {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  /* Footer grid */
  footer .grid {
    gap: 2rem !important;
  }

  /* Stats */
  .stat-value {
    font-size: 1.75rem !important;
  }

  /* Icon containers */
  .icon-container {
    width: 52px !important;
    height: 52px !important;
    border-radius: 12px !important;
  }
  .icon-container svg {
    width: 24px !important;
    height: 24px !important;
  }
}

/* Extra small screens */
@media (max-width: 380px) {
  h1 {
    font-size: 1.75rem !important;
  }

  .page-hero {
    padding-top: 6rem !important;
  }

  /* Tighter everything */
  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
}

/* Tablet improvements */
@media (min-width: 641px) and (max-width: 1023px) {
  h1 {
    font-size: clamp(2.25rem, 5vw, 3.5rem) !important;
  }

  .btn-primary, .btn-secondary {
    width: auto;
  }
}

/* Safe area insets for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-menu {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
  }
}

/* Smooth transitions for responsive changes */
* {
  -webkit-tap-highlight-color: rgba(0, 240, 255, 0.1);
}

/* Fix for iOS input zoom */
@supports (-webkit-touch-callout: none) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ═══ Additional mobile layout fixes ═══ */
@media (max-width: 640px) {
  /* Page hero tighter padding */
  .page-hero {
    padding-top: 5.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  /* Breadcrumb */
  .page-hero nav {
    margin-bottom: 1.25rem !important;
  }

  /* Page hero text */
  .page-hero p {
    font-size: 1rem !important;
  }

  /* Section padding */
  section {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  /* Footer columns */
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  footer .sm\:col-span-2 {
    grid-column: span 1 !important;
  }

  /* Footer bottom bar */
  footer .border-t {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.5rem !important;
  }

  /* Grid overrides for single column on mobile */
  .grid.grid-cols-2 {
    gap: 1rem !important;
  }

  /* Project cards */
  .project-visual {
    height: 180px !important;
  }

  /* Hide scroll indicator on mobile */
  .animate-bounce {
    display: none !important;
  }

  /* Stats grid */
  .grid.grid-cols-2.lg\:grid-cols-4 {
    gap: 1.5rem !important;
  }

  /* Service detail sections */
  .grid.lg\:grid-cols-2 {
    gap: 2rem !important;
  }

  /* CEO quote */
  blockquote {
    font-size: 1.25rem !important;
    line-height: 1.5 !important;
  }

  /* Contact info cards */
  .space-y-4 > * {
    margin-bottom: 0 !important;
  }

  /* Location card */
  .neon-border.rounded-2xl {
    padding: 1.5rem !important;
  }
}

/* Tablet grid fixes */
@media (min-width: 641px) and (max-width: 767px) {
  .page-hero {
    padding-top: 7rem !important;
    padding-bottom: 3rem !important;
  }
}

/* Fix for code blocks on mobile */
@media (max-width: 768px) {
  pre {
    white-space: pre-wrap !important;
    word-break: break-word !important;
    padding: 1rem !important;
  }
}

/* Better card spacing on mobile */
@media (max-width: 640px) {
  .card-shine::before {
    display: none; /* disable shine effect on mobile for performance */
  }

  /* Hero section - tighter spacing on mobile */
  #home.min-h-screen, section#home {
    min-height: auto !important;
    padding-top: 5rem !important;
    padding-bottom: 3rem !important;
  }

  /* Hero badge text */
  .text-xs.font-medium.text-neon {
    font-size: 0.65rem !important;
  }

  /* CTA banner */
  .max-w-4xl h2 {
    font-size: 1.75rem !important;
  }

  /* Service grid 2-col on mobile */
  .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  .grid.md\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  .grid.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* "How It Works" steps */
  .grid.md\:grid-cols-4 > div {
    text-align: left !important;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
  }
  .grid.md\:grid-cols-4 > div > div:first-child {
    margin: 0 !important;
    flex-shrink: 0;
    width: 44px !important;
    height: 44px !important;
    font-size: 1rem !important;
  }
  .grid.md\:grid-cols-4 > div > h4 {
    margin-bottom: 0.25rem !important;
    font-size: 0.875rem !important;
  }
  .grid.md\:grid-cols-4 > div > p {
    font-size: 0.8125rem !important;
  }

  /* Accordion - prevent text overflow */
  .accordion-trigger span {
    font-size: 0.8125rem !important;
    line-height: 1.4 !important;
  }

  /* Contact page - stack social buttons */
  .flex.items-center.gap-3:not(.social-row) {
    /* keep inline */
  }

  /* Glow line shorter */
  .glow-line {
    max-width: 80% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Nav logo */
  .text-lg.font-bold {
    font-size: 1rem !important;
  }
}

/* Improve horizontal scrolling code blocks */
@media (max-width: 768px) {
  pre {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,240,255,0.2) transparent;
  }
  pre::-webkit-scrollbar {
    height: 4px;
  }
  pre::-webkit-scrollbar-track {
    background: transparent;
  }
  pre::-webkit-scrollbar-thumb {
    background: rgba(0,240,255,0.2);
    border-radius: 2px;
  }
}
