/* Premium Theme Setup & Reset */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800&display=swap');

:root {
  /* Dynamic Light Theme */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --brand-primary: #3b82f6;
  --brand-secondary: #8b5cf6;
  --brand-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  --nav-bg: rgba(255, 255, 255, 0.75);
  --card-bg: rgba(255, 255, 255, 0.6);
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --glow: 0 0 20px rgba(59, 130, 246, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dynamic Dark Theme */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --brand-primary: #60a5fa;
    --brand-secondary: #c084fc;
    --nav-bg: rgba(15, 23, 42, 0.75);
    --card-bg: rgba(30, 41, 59, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --glow: 0 0 20px rgba(96, 165, 250, 0.2);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

a {
  text-decoration: none;
  color: var(--brand-primary);
  transition: all 0.3s ease;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Typography Helpers */
.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Glassmorphism Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo img {
  height: 48px;
  width: auto;
  transition: transform 0.3s ease;
}

/* Dark mode handling for logo - assuming white version or text CSS if needed, since it's an image. You mentioned before there's a logo logic */
@media (prefers-color-scheme: dark) {
  .logo img {
    filter: brightness(0) invert(1);
  }
}

.logo:hover img {
  transform: scale(1.05);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 1rem;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--brand-gradient);
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.btn-primary {
  display: inline-block;
  background: var(--brand-gradient);
  color: #fff !important;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow), var(--shadow-lg);
}

/* Mobile Menu Button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Main Content Padding for Fixed Header */
main {
  padding-top: 80px;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

/* Reveal Animations */
.reveal, .reveal-left, .reveal-right, .reveal-scale {
  opacity: 0;
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal {
  transform: translateY(40px);
}

.reveal-left {
  transform: translateX(-50px);
}

.reveal-right {
  transform: translateX(50px);
}

.reveal-scale {
  transform: scale(0.9);
}

.reveal.active, .reveal-left.active, .reveal-right.active, .reveal-scale.active {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Stagger for groups */
.stagger-group > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-group.active > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-group.active > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-group.active > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-group.active > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-group.active > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.stagger-group.active > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }

/* Page Transition Overlay */
#page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

#page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Service Zig-Zag Layout */
.service-section-alt {
  display: flex;
  align-items: center;
  gap: 4rem;
  padding: 6rem 0;
  border-bottom: 1px solid var(--border-color);
}

.service-section-alt:last-child {
  border-bottom: none;
}

.service-section-alt.reverse {
  flex-direction: row-reverse;
}

.service-image-wrapper {
  flex: 1;
  position: relative;
}

.service-image-wrapper img {
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  position: relative;
  z-index: 2;
  transition: transform 0.5s ease;
}

.service-image-wrapper:hover img {
  transform: translateY(-5px) scale(1.02);
}

.service-image-wrapper::after {
  content: "";
  position: absolute;
  top: 15px;
  left: -15px;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: var(--brand-gradient);
  z-index: 1;
  opacity: 0.2;
}

.service-section-alt.reverse .service-image-wrapper::after {
  left: auto;
  right: -15px;
}

.service-content-wrapper {
  flex: 1;
}

.service-content-wrapper h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.service-content-wrapper p.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.service-features-list {
  list-style: none;
  margin-bottom: 2rem;
}

.service-features-list li {
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.service-features-list li i {
  color: var(--brand-primary);
  margin-top: 5px;
  flex-shrink: 0;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul a {
  color: var(--text-secondary);
}

.footer-col ul a:hover {
  color: var(--brand-primary);
  padding-left: 5px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: left 0.3s ease;
  }
  
  .nav-links.active {
    left: 0;
  }
}
