@import url('variables.css');

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-height);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-white);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin-top: 0; }

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--accent-cyan); }

img { max-width: 100%; height: auto; display: block; }

.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}

.section-light { background: var(--bg-light); }

.section-gradient {
  background: var(--gradient-hero);
  color: var(--text-on-dark);
}

.section-label {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
}

.section-title { margin-bottom: 1rem; }

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
}

.section-dark .section-subtitle,
.section-gradient .section-subtitle { color: var(--text-light); }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loader */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, visibility 0.5s;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Scroll progress */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-primary);
  z-index: 10001;
  transition: width 0.1s linear;
}

/* Navbar */
.navbar-ecs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: background var(--transition), padding var(--transition), box-shadow var(--transition);
}

.navbar-ecs.scrolled {
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.6rem 0;
  box-shadow: var(--shadow-md);
}

.navbar-ecs .navbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-on-dark) !important;
  letter-spacing: -0.02em;
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-ecs .navbar-brand span { color: var(--accent-cyan); }

.navbar-brand-logo {
  background: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  line-height: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.navbar-brand-logo .brand-logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 56px;
  max-width: min(280px, 58vw);
  object-fit: contain;
  object-position: left center;
}

@media (min-width: 768px) {
  .navbar-brand-logo .brand-logo {
    max-height: 72px;
    max-width: 320px;
  }

  .navbar-brand-logo {
    padding: 0.55rem 1.15rem;
  }
}

@media (min-width: 1200px) {
  .navbar-brand-logo .brand-logo {
    max-height: 80px;
    max-width: 360px;
  }
}

.navbar-ecs.scrolled .navbar-brand-logo .brand-logo {
  max-height: 64px;
  max-width: 300px;
}

.footer-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 280px;
  max-height: 110px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .footer-logo {
    max-width: 320px;
    max-height: 120px;
  }
}

.footer-tagline {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.navbar-ecs .nav-link {
  color: rgba(248, 250, 252, 0.85) !important;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 1rem !important;
  position: relative;
}

.navbar-ecs .nav-link:hover,
.navbar-ecs .nav-link.active { color: var(--accent-cyan) !important; }

.navbar-ecs .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.navbar-toggler {
  border-color: rgba(255,255,255,0.3) !important;
}

.navbar-toggler-icon {
  filter: invert(1);
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: var(--navbar-height);
  background: var(--gradient-hero);
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  font-size: 0.875rem;
  color: var(--accent-cyan);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(10px);
}

.hero h1 {
  color: var(--text-on-dark);
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: 1.25rem;
  color: var(--text-light);
  max-width: 540px;
  margin-bottom: 2rem;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-visual {
  position: relative;
  z-index: 2;
}

.hero-illustration {
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  aspect-ratio: 1;
  background: var(--gradient-glass);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.floating-icon {
  position: absolute;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 1.25rem;
  animation: float 4s ease-in-out infinite;
}

.floating-icon:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-icon:nth-child(2) { top: 20%; right: 15%; animation-delay: 0.5s; }
.floating-icon:nth-child(3) { bottom: 30%; left: 5%; animation-delay: 1s; }
.floating-icon:nth-child(4) { bottom: 15%; right: 10%; animation-delay: 1.5s; }
.floating-icon:nth-child(5) { top: 50%; right: 5%; animation-delay: 2s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Page hero (inner pages) */
.page-hero {
  padding: calc(var(--navbar-height) + 4rem) 0 4rem;
  background: var(--gradient-hero);
  color: var(--text-on-dark);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-hero .container { position: relative; z-index: 1; }

.breadcrumb-ecs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  color: var(--text-light);
}

.breadcrumb-ecs a { color: var(--accent-cyan); }

/* Wave divider */
.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  line-height: 0;
  transform: translateY(1px);
}

.wave-divider svg { width: 100%; height: 80px; }

/* Footer */
.footer {
  background: var(--primary);
  color: var(--text-light);
  padding: 4rem 0 0;
}

.footer h5 {
  color: var(--text-on-dark);
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.footer a {
  color: var(--text-light);
  display: block;
  padding: 0.35rem 0;
  font-size: 0.9375rem;
}

.footer a:hover { color: var(--accent-cyan); }

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-on-dark);
  margin-bottom: 1rem;
}

.footer-brand span { color: var(--accent-cyan); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.875rem;
}

.social-links a {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  margin-right: 0.5rem;
  transition: background var(--transition), transform var(--transition);
}

.social-links a:hover {
  background: var(--accent-blue);
  transform: translateY(-2px);
  color: white !important;
}

/* Newsletter popup */
#newsletter-popup {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 380px;
  z-index: 9998;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#newsletter-popup.visible { transform: translateY(0); }

.newsletter-popup-inner {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

@media (max-width: 991.98px) {
  .hero-visual { margin-top: 3rem; }
  .hero-illustration { margin: 0 auto; }
}

@media (min-width: 1400px) {
  .container { max-width: 1320px; }
}

@media (min-width: 1920px) {
  .container-xxl-wide { max-width: 1600px; }
}
