/* =========================================
   LAVR AGENCY - PREMIUM B2B DESIGN SYSTEM
   ========================================= */

/* --- Variables (Tokens) --- */
:root {
  /* Colors */
  --bg-primary: #FFFFFF; /* Pure white for trust and cleanliness */
  --bg-secondary: #F8F9FA; /* Very light gray for section separation */
  --bg-tertiary: #F1F3F5; /* For cards or soft backgrounds */
  
  --text-primary: #1A1A1A; /* Deep charcoal for high contrast */
  --text-secondary: #6C757D; /* Slate gray for readable subtext */
  
  --accent-primary: #0047AB; /* Deep Corporate Cobalt Blue */
  --accent-hover: #003380; 
  
  --cta-primary: #FF6B00; /* Vibrant Orange for high conversion */
  --cta-hover: #E65A00;
  
  --border-color: #E9ECEF;
  
  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Inter', sans-serif; /* Unified for clean corporate look */
  
  /* Layout */
  --container-width: 1200px;
  --spacing-section: 100px;
  
  /* Effects */
  --transition: 0.3s ease-in-out;
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.08);
  --radius-card: 12px;
  --radius-btn: 6px; /* B2B styled buttons (not fully rounded) */
}

/* --- Reset & Global --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}

@media (max-width: 480px) {
  h1 {
    font-size: clamp(2.2rem, 8vw, 2.8rem) !important;
    letter-spacing: -1px !important;
  }
}

h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 40px;
  letter-spacing: -1px;
  text-align: center;
}

h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

/* --- Utilities --- */
.gradient-text {
  color: var(--accent-primary);
  /* Removed gradient for a more solid corporate look */
}

.text-center {
  text-align: center;
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border-radius: var(--radius-btn);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--cta-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.2);
}

.btn-primary:hover {
  background-color: var(--cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
}

/* --- Navigation --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo .gradient-text {
  color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 1001;
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
}
.mobile-menu-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--text-primary);
  border-radius: 3px;
  transition: all 0.3s ease;
}
.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--accent-primary);
}

/* --- Mega Menu Dropdown --- */
.nav-item-dropdown {
  position: relative;
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-primary);
  width: 380px;
  border-radius: var(--radius-card);
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  pointer-events: none;
  z-index: 1000;
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(15px);
  pointer-events: auto;
}

.nav-item-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 30px;
}

.dropdown-item {
  display: flex !important;
  align-items: center;
  padding: 15px;
  border-radius: 8px;
  text-decoration: none;
  gap: 15px;
  transition: none !important;
}

.dropdown-item:hover {
  background-color: var(--bg-secondary);
}

.dropdown-item .icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 0;
}

.dropdown-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-item-title {
  color: var(--text-primary) !important;
  font-weight: 600;
  font-size: 1rem;
}

.dropdown-item:hover .dropdown-item-title {
  color: var(--accent-primary) !important;
}

.dropdown-item-desc {
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  font-weight: 400 !important;
}

/* --- Hero Section --- */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 140px 0 100px 0; 
  background-color: #F8FAFC;
  color: #0F172A;
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero__content {
  flex: 1;
  text-align: left;
}

/* --- V12 Hero UI --- */
.soft-shadow {
  background: #FFFFFF;
  box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.soft-shadow:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
}
.hero-badge { display: inline-block; padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; color: #0047AB; margin-bottom: 24px; pointer-events: none; }
.text-gradient {
  background: linear-gradient(135deg, #0047AB, #005CE6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__subtitle { font-size: 1.1rem; color: #52525B; margin-bottom: 40px; max-width: 500px; line-height: 1.6; }
.hero__content h1 { font-size: clamp(3rem, 5vw, 4.25rem); font-weight: 800; line-height: 1.1; margin-bottom: 24px; letter-spacing: -2px; color: #09090B; }
.hero__actions { display: flex; gap: 16px; margin-top: 20px; }

/* Buttons from V12 */
.btn--primary { background: #FF6B00; color: #FFF; border-radius: 8px; border: none; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; transition: all 0.3s ease; text-decoration: none;}
.btn--primary:hover { background: #E65A00; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(255, 107, 0, 0.3); }
.btn--secondary { background: #FFF; color: #09090B; border: 1px solid #E2E8F0; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; transition: all 0.3s ease; text-decoration: none;}
.btn--secondary:hover { background: #F8FAFC; border-color: #CBD5E1; }
.btn--large { height: 56px; padding: 0 32px; font-size: 1.05rem; }

/* Hero Graphic (SaaS Style from V12) */
.hero__graphic { flex: 1; position: relative; }
.graphic-card { background: #FFFFFF; border-radius: 24px; padding: 24px; position: relative; z-index: 2; }
.main-card { width: 100%; border: 1px solid #E2E8F0; }
.graphic-card__header { display: flex; gap: 8px; margin-bottom: 24px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #EF4444; }
.dot.yellow { background: #F59E0B; }
.dot.green { background: #10B981; }
.chart-bar { height: 24px; background: #F1F5F9; border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.chart-fill { height: 100%; background: linear-gradient(90deg, #0047AB, #005CE6); border-radius: 4px; width: 0%; }
.mini-card { position: absolute; padding: 16px 24px; font-weight: 700; color: #0047AB; z-index: 3; }
.card-1 { top: -20px; right: -20px; animation: float 5s ease-in-out infinite; }
.card-2 { bottom: 20px; left: -40px; animation: float 6s ease-in-out infinite alternate; }

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
  100% { transform: translateY(0); }
}

@media (max-width: 900px) {
  .hero__inner { flex-direction: column; text-align: center; }
  .hero__content { text-align: center; }
  .hero__actions { justify-content: center; }
  .hero__subtitle { margin: 0 auto 40px; }
}

@media (max-width: 480px) {
  .hero__content h1 {
    font-size: clamp(2.2rem, 8vw, 3rem);
    letter-spacing: -1px;
  }
}

/* --- Trust Bar --- */
.trust-bar {
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  background-color: #FFFFFF;
  padding: 32px 0;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
}
.trust-bar__track {
  display: flex;
  width: max-content;
  flex-shrink: 0;
  animation: marquee 30s linear infinite;
}
.trust-bar__logos {
  display: flex;
  flex-shrink: 0;
  gap: 64px;
  padding-right: 64px;
}
.trust-bar__logos span {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.25rem;
  color: #64748B;
  opacity: 0.5;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.trust-bar__logos span:hover {
  opacity: 1;
  color: #0F172A;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Services Section --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.service-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 40px 30px;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.6s ease-out !important;
  /* box-shadow: var(--shadow-card); */
}

.service-card:hover,
.service-card.animate-on-scroll.visible:hover {
  transform: translateY(-10px);
  /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08); */
  border-color: #0047AB;
}

.service-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(0, 71, 171, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  margin-bottom: 24px;
  transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(0, 71, 171, 0.15);
}



/* --- About/Advantages Section --- */
.about {
  background-color: var(--bg-secondary);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text h2 {
  text-align: left;
}

.about-text p {
  margin-bottom: 25px;
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.about-stats .stat-item:last-child {
  grid-column: 1 / -1;
}

@media (max-width: 480px) {
  .about-stats {
    grid-template-columns: 1fr;
  }
  .about-stats .stat-item:last-child {
    grid-column: auto;
  }
}

.stat-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 40px 30px;
  border-radius: var(--radius-card);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-number {
  font-size: 3.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 10px;
  letter-spacing: -2px;
}

.stat-item p {
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}

/* --- Cases Carousel --- */
.carousel-wrapper {
  position: relative;
  padding: 0 10px;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  left: -45px;
  right: -45px;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through the container */
}

.carousel-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto; /* Enable clicks on the buttons */
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.carousel-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 8px 16px rgba(0,71,171,0.2);
}

.carousel-container {
  overflow-x: clip;
  overflow-y: visible;
  margin: 0 -20px;
  padding: 0 20px;
}

.carousel-track {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 40px 20px;
  margin: -40px -20px;
  scroll-padding-left: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track .service-card {
  flex: 0 0 calc(50% - 15px);
  scroll-snap-align: start;
}

.carousel-track--3-col .service-card {
  flex: 0 0 calc(33.333% - 20px);
}

.carousel-track--4-col .service-card {
  flex: 0 0 calc(25% - 22.5px);
}

@media (max-width: 992px) {
  .carousel-track--3-col .service-card,
  .carousel-track--4-col .service-card {
    flex: 0 0 calc(50% - 15px);
  }
}

@media (max-width: 768px) {
  .carousel-track .service-card {
    flex: 0 0 100%;
  }
  .carousel-track .bento-card {
    flex: 0 0 100% !important;
    min-width: 100% !important;
  }
  .carousel-nav {
    left: -15px;
    right: -15px;
  }
}

/* --- Pricing Cards --- */
.pricing-card {
  text-align: center;
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.pricing-card--featured {
  border-color: var(--accent-primary);
  /* box-shadow: var(--shadow-hover); */
}

.pricing-badge {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cta-primary) !important;
  color: white !important;
  border-radius: 0 0 8px 8px !important;
  margin-bottom: 0 !important;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 20px 0 auto;
  color: var(--text-secondary);
  text-align: left;
  font-size: 0.95rem;
}

.pricing-features li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features .check {
  color: #10B981;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* --- Audit Banner --- */
.audit-banner {
  margin-top: 60px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--cta-primary);
  border-radius: var(--radius-card);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  box-shadow: var(--shadow-card);
}

.audit-banner__content {
  flex: 1;
}

.audit-banner__content h3 {
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.audit-banner__content p {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.audit-banner__action {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .audit-banner {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
    border-left: 1px solid var(--border-color);
    border-top: 4px solid var(--cta-primary);
  }
  .audit-banner__action, .audit-banner__action .btn {
    width: 100%;
  }
}

/* --- Startup Teaser (LeadGen) --- */
.startup-teaser {
  position: relative;
  background-color: var(--bg-primary);
}

.teaser-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 80px 40px;
  text-align: center;
}

.teaser-card--dark {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  border-color: rgba(255,255,255,0.1);
}

.badge {
  background: rgba(0, 71, 171, 0.1);
  color: var(--accent-primary);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 20px;
}

.waitlist-form {
  display: flex;
  max-width: 500px;
  margin: 40px auto 0;
  gap: 12px;
}

.input-field {
  flex: 1;
  padding: 16px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid #CED4DA;
  background: #FFF;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.input-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.15);
}

/* --- Contact Section --- */
.contact {
  background-color: var(--bg-primary);
}

.contact-container {
  max-width: 700px;
  margin: 0 auto;
}

.contact-form {
  display: grid;
  gap: 24px;
  background: var(--bg-secondary);
  padding: 50px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

textarea.input-field {
  resize: vertical;
  min-height: 140px;
}

.privacy-notice {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 15px;
}

.privacy-notice a {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* --- FAQ Section --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.faq-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.faq-item:hover {
  border-color: var(--accent-primary);
}

.faq-item.active {
  border-color: var(--accent-primary);
  /* box-shadow: 0 4px 20px rgba(0,71,171,0.05); */
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 24px 30px;
  background: transparent;
  border: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent-primary);
  transition: transform 0.3s;
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 30px;
}

.faq-answer p {
  padding-bottom: 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

/* --- Footer --- */
footer {
  padding: 50px 0 30px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 20px 0;
}

.social-links a {
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}

.social-links a:hover {
  color: var(--accent-primary);
}

/* --- Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Modal Popup --- */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  transition: visibility 0.4s;
  pointer-events: none;
}
.modal.active {
  visibility: visible;
  transition: visibility 0s; /* Visible instantly when opening */
  pointer-events: auto;
}
.modal-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
  transform: translateZ(0); /* Force GPU acceleration */
}
.modal.active .modal-overlay {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-content {
  position: relative;
  background: var(--bg-primary);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 30px;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  /* Fast disappear when closing without delay */
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1001;
}
.modal.active .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
  /* Wait 0.2s for blur, then pop up snappily */
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) 0.2s, opacity 0.3s ease 0.2s;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}
.modal-close:hover {
  color: var(--text-primary);
}

/* ==========================================================================
   AI Leadgen Page Specific Styles
   ========================================================================== */

.dark-theme {
  --bg-primary: #0F172A;
  --bg-secondary: #0B0F19;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --border-color: rgba(255, 255, 255, 0.1);
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.header--dark {
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gradient-text--ai {
  background: linear-gradient(135deg, #FF6B00 0%, #8A2BE2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-ai {
  background: linear-gradient(135deg, #FF6B00 0%, #8A2BE2 100%);
  border: none;
  box-shadow: 0 10px 30px rgba(255, 107, 0, 0.3);
}

.btn-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(255, 107, 0, 0.4);
}

.ai-hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
  text-align: center;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.ai-hero__content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.ai-badge {
  background: rgba(138, 43, 226, 0.15);
  color: #DDA0DD;
  border: 1px solid rgba(138, 43, 226, 0.3);
}

.ai-hero__title {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 25px;
}

.ai-hero__subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
}

.ai-grid-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
}

/* Funnel Grid */
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 50px;
}

.funnel-step {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 30px 20px;
  border-radius: var(--radius-card);
  text-align: center;
  position: relative;
}

.funnel-step__icon {
  font-size: 2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: rgba(255, 107, 0, 0.2);
  margin-bottom: 15px;
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-top: 50px;
}

.bento-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 40px;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.bento-card:hover {
  transform: translateY(-5px);
  border-color: rgba(138, 43, 226, 0.5);
}

.bento-card--large {
  grid-column: 1 / -1;
}

.bento-card__content h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.bento-card__content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Security Flex */
.security-flex {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 50px;
  position: relative;
  overflow: hidden;
}
.security-flex::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 5px;
  background: linear-gradient(90deg, #FF6B00, #8A2BE2);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-text h2 {
    text-align: center;
  }
  .about-text p {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero__graphic {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }

  /* The overlay is fixed to the viewport, scrollable vertically */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.99);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 90px 20px 40px; /* top padding for close button */
    gap: 0;
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: flex;
  }
  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  /* Each top-level nav item takes full width */
  .nav-links > li {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
  }
  .nav-links > li:last-child {
    border-bottom: none;
    margin-top: 20px;
  }

  /* Top-level links */
  .nav-links > li > a {
    display: block;
    font-size: 1.3rem;
    padding: 18px 0;
    font-weight: 600;
    color: var(--text-primary);
  }

  /* Услуги dropdown toggle — pointer-events enabled */
  .nav-item-dropdown > a {
    pointer-events: auto;
    cursor: pointer;
    width: 100%;
  }

  /* nav-item-dropdown: static, full-width column */
  .nav-item-dropdown {
    position: static;
    width: 100%;
    display: block;
  }

  /* Dropdown panel: hidden by default, static flow */
  .dropdown-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: none;
    flex-direction: column;
    width: 100%;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding: 10px 0;
    background: var(--bg-secondary);
    margin: 0;
  }

  /* Open on active class */
  .nav-item-dropdown.active .dropdown-menu {
    display: flex !important;
  }

  /* Disable desktop hover trigger on mobile */
  .nav-item-dropdown:hover .dropdown-menu {
    display: none;
  }
  .nav-item-dropdown.active:hover .dropdown-menu {
    display: flex !important;
  }

  /* Dropdown items: smaller and left-aligned */
  .dropdown-item {
    padding: 12px 20px;
    font-size: 0.95rem;
    text-align: left;
  }
  .dropdown-item-content {
    text-align: left;
  }
  .dropdown-item .icon {
    font-size: 1.2rem;
    flex-shrink: 0;
  }
  .dropdown-item-title {
    font-size: 0.95rem !important;
    text-align: left;
  }
  .dropdown-item-desc {
    font-size: 0.8rem !important;
    text-align: left;
  }

  .nav-links .btn {
    margin-left: 0 !important;
    display: inline-block;
  }

  /* Disable desktop pseudo-element that creates a hover trap */
  .nav-item-dropdown::after {
    display: none;
  }
  
  .hero-cta {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  .waitlist-form {
    flex-direction: column;
  }
  
  .waitlist-form .btn {
    width: 100%;
  }
  
  .contact-form {
    padding: 30px 20px;
  }
  
  .ai-hero__title {
    font-size: 2.5rem;
  }
  
  .funnel-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-card--large {
    grid-column: auto;
  }
  
  .security-flex {
    padding: 30px 20px;
  }
}

/* --- Trust Logos Marquee --- */
.trust-logos {
  background: var(--bg-primary);
}

.marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee__inner {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 30s linear infinite;
}

.trust-logo {
  display: inline-block;
  margin: 0 40px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-secondary);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: opacity 0.3s ease, color 0.3s ease;
}

.trust-logo:hover {
  opacity: 1;
  color: var(--accent-primary);
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- FAQ Section --- */
.faq-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.faq-question {
  padding: 24px 30px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  transition: background 0.3s ease;
}

.faq-item:hover {
  border-color: rgba(138, 43, 226, 0.3);
}

.faq-question h3 {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.faq-icon {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent-primary);
  transition: transform 0.3s ease;
  font-weight: 300;
  margin-left: 20px;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg-secondary);
}

.faq-answer p {
  margin: 0;
  padding: 0 30px 24px 30px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.faq-item.active {
  border-color: var(--accent-primary);
  box-shadow: 0 8px 20px rgba(0, 71, 171, 0.08);
}

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

.faq-item.active .faq-answer {
  max-height: 400px;
}

.faq-item.active .faq-answer p {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}


/* --- sites.html specific styles --- */
.funnel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 992px) {
  .funnel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .funnel-grid {
    grid-template-columns: 1fr;
  }
}

.carousel-track--4-col {
  display: flex;
  gap: 30px;
}

@media (max-width: 768px) {
  .carousel-track--4-col {
    flex-direction: column;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .carousel-track--4-col .service-card {
    min-width: auto;
    width: 100%;
    margin-bottom: 0;
  }
}

/* --- Multi-Action FAB Button --- */
.fab-container {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fab-menu {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab-container.active .fab-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-action {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  text-decoration: none;
}

.fab-action:hover {
  transform: scale(1.1);
}

.fab-phone { background: #10B981; }
.fab-tg { background: #0088cc; }

.fab-action svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.fab-toggle {
  width: 65px;
  height: 65px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 71, 171, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-animation 2s infinite;
  transition: transform 0.3s;
}

.fab-container.active .fab-toggle {
  animation: none;
  transform: rotate(90deg);
  background: #EF4444; /* Red for close */
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.fab-icon-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
}

.fab-icon-wrapper svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  fill: currentColor;
  transition: opacity 0.3s, transform 0.3s;
}

.fab-icon-close { 
  opacity: 0; 
  transform: scale(0.5) rotate(-45deg); 
}
.fab-icon-phone { 
  opacity: 1; 
  transform: scale(1) rotate(0); 
  animation: fab-swap-1 6s infinite; 
}
.fab-icon-tg { 
  opacity: 0; 
  transform: scale(0.5) rotate(45deg); 
  animation: fab-swap-2 6s infinite; 
}

.fab-container.active .fab-icon-phone,
.fab-container.active .fab-icon-tg {
  opacity: 0 !important;
  animation: none !important;
}

.fab-container.active .fab-icon-close {
  opacity: 1;
  transform: scale(1) rotate(0);
}

@keyframes fab-swap-1 {
  0%, 45% { opacity: 1; transform: scale(1) rotate(0); }
  50%, 95% { opacity: 0; transform: scale(0.5) rotate(-45deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes fab-swap-2 {
  0%, 45% { opacity: 0; transform: scale(0.5) rotate(45deg); }
  50%, 95% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(0.5) rotate(45deg); }
}

@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0 rgba(0, 71, 171, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(0, 71, 171, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 71, 171, 0); }
}

/* Article Table Styles */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 40px 0;
    font-size: 1.05rem;
    text-align: left;
    background: var(--bg-primary);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}
.article-table th {
    background: var(--bg-secondary);
    padding: 20px;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-primary);
}
.article-table td {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: top;
}
.article-table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    /* Base Article Containers */
    .article-hero {
        padding: 60px 20px 30px !important;
    }
    .article-content-wrapper {
        padding: 40px 0 !important;
        overflow: hidden !important; /* Prevent any rogue child from expanding the wrapper */
    }
    .article-body {
        padding: 0 20px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important; /* Critical fix: prevents flex item from expanding to intrinsic content width */
        max-width: 100% !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }

    /* Meta Info (Flexbox fix) */
    .article-meta-top {
        flex-wrap: wrap !important;
    }

    /* Typography & Links */
    .article-body h1, 
    .article-body h2, 
    .article-body h3, 
    .article-body p, 
    .article-body li, 
    .article-body blockquote {
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        max-width: 100% !important;
    }
    .article-body a {
        word-break: break-all !important;
    }

    /* Media & Code */
    .article-body img, 
    .article-body video, 
    .article-body iframe {
        max-width: 100% !important;
        height: auto !important;
    }
    .article-body pre, 
    .article-body code {
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-x: auto !important;
    }

    /* Table Fix */
    .article-table {
        display: block !important;
        width: 100% !important;
        margin: 20px 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        /* Remove white-space: nowrap to let normal text wrap, only keeping scroll for unbreakable content */
        white-space: normal !important; 
    }
    .article-table th, 
    .article-table td {
        min-width: 120px !important; /* Ensure table cells don't shrink to 0 if we wrap */
    }
}
