:root {
  --dark-navy: #020617;
  --navy: #0b1120;
  --navy-soft: #111a2e;
  --emerald: #22c55e;
  --emerald-dark: #16a34a;
  --sky: #38bdf8;
  --white: #fafcff;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --max-width: 1180px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --transition: 220ms ease;
  --layout-gutter: clamp(1.25rem, 4vw, 2.75rem);
  --header-padding: clamp(0.45rem, 1.35vw, 0.85rem);
  --header-gap: clamp(1rem, 3vw, 2rem);
  --logo-max-height: clamp(52px, 7vw, 88px);
  --logo-max-width: clamp(160px, 24vw, 240px);
  --section-spacing: clamp(3rem, 6vw, 5rem);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--white);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 45%),
    linear-gradient(180deg, var(--dark-navy) 0%, #111b37 100%);
  min-height: 100vh;
}

body.theme-light {
  color: var(--slate-900);
  background: #f8fafc;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100%, var(--max-width));
  margin: 0 auto;
  padding: 0 var(--layout-gutter);
}

/* Ensure header container has proper horizontal padding */
.site-header .container {
  padding-left: clamp(1.25rem, 3.5vw, 2.5rem);
  padding-right: clamp(1.25rem, 3.5vw, 2.5rem);
}

.section-header-spacing {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(18px);
  background: rgba(2, 6, 23, 0.85);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

body.theme-light .site-header {
  background: rgba(248, 250, 252, 0.9);
  border-bottom-color: rgba(148, 163, 184, 0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--header-gap);
  padding: 0.875rem 0;
  min-height: 74px;
}

@media (min-width: 640px) {
  .header-inner {
    padding: 1rem 0;
    min-height: 78px;
  }
}

@media (min-width: 961px) {
  .header-inner {
    padding: 1.125rem 0;
    min-height: 82px;
  }
}

.brand-link {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 170px;
  flex-shrink: 0;
  object-fit: contain;
  padding: 0;
  margin-right: 1rem;
  transition: opacity 0.3s ease;
}

@media (min-width: 640px) {
  .brand-logo {
    height: 52px;
    max-width: 200px;
    margin-right: 1.5rem;
  }
}

@media (min-width: 961px) {
  .brand-logo {
    height: 56px;
    max-width: 220px;
    margin-right: 2rem;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  margin-left: auto;
  flex-shrink: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(0.875rem, 2.5vw, 1.75rem);
  list-style: none;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  position: relative;
  color: rgba(248, 250, 252, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  color: rgba(248, 250, 252, 1);
  text-decoration: none;
  background: rgba(148, 163, 184, 0.1);
}

.nav-link.active {
  color: #22c55e;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18) 0%, rgba(34, 197, 94, 0.12) 100%);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

body.theme-light .nav-link {
  color: var(--slate-700);
}

body.theme-light .nav-link:hover {
  color: var(--slate-900);
  background: rgba(148, 163, 184, 0.08);
}

body.theme-light .nav-link.active {
  color: #047857;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.06) 100%);
  border-color: rgba(34, 197, 94, 0.2);
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: rgba(248, 250, 252, 0.95);
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}

.dropdown-toggle:hover {
  color: rgba(248, 250, 252, 1);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  min-width: 220px;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(2, 6, 23, 0.97);
  box-shadow: 0 24px 45px rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  gap: 0.35rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition), transform var(--transition);
}

body.theme-light .dropdown-menu {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
}

.dropdown-menu a {
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  color: inherit;
  font-weight: 500;
}

.dropdown-menu a:hover {
  background: rgba(148, 163, 184, 0.18);
  text-decoration: none;
}

.dropdown[data-open="true"] .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: auto;
  flex-shrink: 0;
  padding-left: 1rem;
}

@media (min-width: 961px) {
  .nav-actions {
    margin-left: 1.5rem;
    padding-left: 1.5rem;
  }
}

.header-call-ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 25%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 15px 25px rgba(34, 197, 94, 0.35), 0 6px 12px rgba(4, 9, 20, 0.25);
  margin-left: 0.65rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.header-call-ring svg {
  width: 20px;
  height: 20px;
}

.header-call-ring:hover,
.header-call-ring:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(34, 197, 94, 0.45), 0 10px 18px rgba(4, 9, 20, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 961px) {
  .btn {
    padding: 0.65rem 1.6rem;
    font-size: 0.95rem;
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dark) 100%);
  color: #fff;
  box-shadow: 0 18px 28px rgba(34, 197, 94, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 36px rgba(34, 197, 94, 0.4);
}

.btn-outline {
  border-color: rgba(148, 163, 184, 0.4);
  color: inherit;
}

.btn-outline:hover {
  background: rgba(148, 163, 184, 0.14);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: inherit;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle span:nth-child(1) { transform: translateY(-6px); }
.menu-toggle span:nth-child(2) { transform: translateY(0); }
.menu-toggle span:nth-child(3) { transform: translateY(6px); }

nav[data-open="true"] { display: grid; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.mobile-panel {
  position: static;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  max-width: 320px;
  margin: 0 1.5rem;
}

.desktop-nav,
.desktop-actions {
  display: none;
}

.desktop-actions {
  margin: 0;
  padding: 0;
  margin-left: auto;
}

.menu-toggle {
  display: none;
}

@media (min-width: 961px) {
  .mobile-panel {
    display: none;
  }

  .desktop-nav,
  .desktop-actions {
    display: flex;
  }
}

@media (max-width: 960px) {
  .brand-logo {
    margin-left: 0;
  }

  .header-call-ring {
    margin-right: 0;
  }

  body.theme-light .mobile-panel {
    background: transparent;
    border: none;
  }

  .mobile-panel .nav-list {
    display: flex;
    gap: 0.15rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    padding: 0.15rem;
    border-radius: 10px;
    width: fit-content;
    border: 1px solid rgba(148, 163, 184, 0.15);
  }

  .mobile-panel .nav-link {
    text-align: center;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(226, 232, 240, 0.85);
    white-space: nowrap;
  }

  .mobile-panel .nav-link:hover {
    text-decoration: none;
    color: rgba(226, 232, 240, 1);
  }

  .mobile-panel .nav-link.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(34, 197, 94, 0.22) 100%);
    color: #22c55e;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15),
                0 1px 2px rgba(34, 197, 94, 0.15),
                0 0 0 1px rgba(34, 197, 94, 0.35);
  }

  body.theme-light .mobile-panel .nav-list {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(148, 163, 184, 0.25);
  }

  body.theme-light .mobile-panel .nav-link {
    color: var(--slate-600);
  }

  body.theme-light .mobile-panel .nav-link.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.12) 0%, rgba(34, 197, 94, 0.08) 100%);
    color: #047857;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08),
                0 1px 2px rgba(34, 197, 94, 0.08),
                0 0 0 1px rgba(34, 197, 94, 0.25);
  }

  .mobile-panel .dropdown-menu {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0.4rem 0;
    background: transparent;
    gap: 0.2rem;
  }

  .mobile-panel .dropdown-menu a {
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
  }
}

.section {
  padding: var(--section-spacing) 0;
}

.section-title {
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: rgba(226, 232, 240, 0.78);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  max-width: 60ch;
}

body.theme-light .section-subtitle {
  color: var(--slate-600);
}

footer {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(2rem, 4vw, 3.5rem) 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(0, 12, 36, 0.65);
}

body.theme-light footer {
  background: rgba(241, 245, 249, 0.85);
  border-top-color: rgba(148, 163, 184, 0.35);
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.footer-logo {
  height: 90px;
  width: auto;
  margin-bottom: 0.85rem;
}

/* Theme-based footer logo color inversion */
body.theme-dark .footer-logo {
  filter: brightness(0) invert(1);
}

.footer-list {
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

/* Footer theme toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  padding: 0.35rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
}

.theme-toggle:hover {
  opacity: 0.7;
  border-color: rgba(148, 163, 184, 0.4);
}

body.theme-light .theme-toggle {
  border-color: rgba(100, 116, 139, 0.3);
}

body.theme-light .theme-toggle:hover {
  border-color: rgba(100, 116, 139, 0.5);
}

.theme-icon {
  width: 16px;
  height: 16px;
  color: rgba(226, 232, 240, 0.8);
}

body.theme-light .theme-icon {
  color: rgba(51, 65, 85, 0.7);
}

/* Show/hide theme icons based on current theme */
body.theme-light .theme-icon-light {
  display: none;
}

body.theme-dark .theme-icon-dark {
  display: none;
}

body.theme-light .theme-icon-dark {
  display: block;
}

body.theme-dark .theme-icon-light {
  display: block;
}

.tagline {
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: rgba(148, 197, 255, 0.85);
}

body.theme-light .tagline {
  color: var(--slate-500);
}
