:root {
  --navy-50: #f0f4f8;
  --navy-100: #d9e2ec;
  --navy-200: #bcccdc;
  --navy-300: #9fb3c8;
  --navy-400: #829ab1;
  --navy-500: #627d98;
  --navy-600: #486581;
  --navy-700: #334e68;
  --navy-800: #243b53;
  --navy-900: #102a43;
  --navy-950: #0a1929;
  --brand-blue: #3A7BD5;
  --brand-light: #6BB8E8;
  --brand-orange: #F5A623;
  --brand-orange-dark: #E0911A;
  --brand-orange-light: #FFC85C;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: var(--brand-blue);
  color: white;
}

/* Hero */
.hero-gradient {
  background: linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 40%, #1e4a7a 70%, var(--brand-blue) 100%);
}

.hero-pattern {
  background-image:
    radial-gradient(circle at 25% 35%, rgba(255,255,255,0.06) 1px, transparent 1px),
    radial-gradient(circle at 75% 65%, rgba(255,255,255,0.04) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0.5px, transparent 0.5px);
  background-size: 50px 50px, 70px 70px, 30px 30px;
  animation: patternFloat 25s ease-in-out infinite;
}

.hero-glow {
  background:
    radial-gradient(ellipse 600px 400px at 20% 80%, rgba(245, 166, 35, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 500px 500px at 80% 30%, rgba(107, 184, 232, 0.12) 0%, transparent 70%);
}

@keyframes patternFloat {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(8px, -6px); }
  50% { transform: translate(-4px, 8px); }
  75% { transform: translate(6px, 4px); }
}

/* CTA section */
.cta-gradient {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--brand-blue) 100%);
}

.hero-pattern-dark {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Header */
#header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#header.scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 20px rgba(16, 42, 67, 0.08);
}

/* Navigation */
.nav-link {
  position: relative;
  color: var(--navy-700);
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-light));
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--brand-blue);
}

.nav-link:hover::after {
  width: 100%;
}

/* Mobile menu */
.mobile-nav-link {
  transition: color 0.3s ease;
}

.mobile-nav-link:hover {
  color: var(--brand-blue);
}

/* Menu toggle animation */
#menu-toggle.active .menu-bar:nth-child(1) {
  transform: rotate(45deg) translate(3px, 3px);
}

#menu-toggle.active .menu-bar:nth-child(2) {
  opacity: 0;
}

#menu-toggle.active .menu-bar:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
}

/* Service cards */
.service-card {
  box-shadow: 0 1px 3px rgba(16, 42, 67, 0.06);
  border: 1px solid rgba(16, 42, 67, 0.04);
}

.service-card:hover {
  box-shadow: 0 12px 40px rgba(16, 42, 67, 0.1);
  transform: translateY(-3px);
  border-color: rgba(58, 123, 213, 0.12);
}

/* Reveal animations */
.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up:nth-child(2) { transition-delay: 0.1s; }
.reveal-up:nth-child(3) { transition-delay: 0.15s; }
.reveal-up:nth-child(4) { transition-delay: 0.2s; }

/* FAQ */
.faq-toggle:hover {
  background-color: rgba(58, 123, 213, 0.03);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-item.active .faq-content {
  max-height: 300px;
}

/* Gallery */
.gallery-item {
  position: relative;
  box-shadow: 0 2px 8px rgba(16, 42, 67, 0.08);
}

.gallery-item:hover {
  box-shadow: 0 8px 25px rgba(16, 42, 67, 0.15);
}

/* Lightbox */
#lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Chat widget pulse */
.chat-pulse {
  animation: chatPulse 2.5s ease-in-out infinite;
}

@keyframes chatPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.85;
  }
}

.chat-pulse:hover {
  animation: none;
}

#chat-panel.active {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Chat messages */
.chat-msg-user {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-light));
  color: white;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem 0.75rem 0 0.75rem;
  margin-left: auto;
  max-width: 85%;
  width: fit-content;
  word-wrap: break-word;
}

.chat-msg-assistant {
  background-color: var(--navy-50);
  color: var(--navy-900);
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem 0.75rem 0.75rem 0;
  max-width: 85%;
  width: fit-content;
  word-wrap: break-word;
}

.chat-msg-assistant a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-msg-assistant a:hover {
  color: var(--navy-800);
}

.chat-typing {
  display: flex;
  gap: 5px;
  padding: 0.625rem 0.875rem;
  background-color: var(--navy-50);
  border-radius: 0.75rem;
  width: fit-content;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  background-color: var(--brand-blue);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Scrollbar */
#chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: var(--navy-200);
  border-radius: 2px;
}

/* Select styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233A7BD5' stroke-width='2'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2.75rem;
    line-height: 1.1;
  }
}

@media (max-width: 640px) {
  #chat-panel {
    width: calc(100vw - 3rem);
    right: -0.5rem;
  }
}
