:root, [data-bs-theme=dark] {
  --bs-primary: #4a90e2;
  --bs-primary-rgb: 74,144,226;
  --bs-primary-text-emphasis: #6ba3f0;
  --bs-primary-bg-subtle: #1e3a52;
  --bs-primary-border-subtle: #2d4a6b;
  --bs-secondary: #aa90ff;
  --bs-secondary-rgb: 170,144,255;
  --bs-dark: #1a202c;
  --bs-dark-rgb: 26,32,44;
  --bs-dark-text-emphasis: #2d3748;
  --bs-dark-bg-subtle: #2d3748;
  --bs-dark-border-subtle: #4a5568;
  --bs-accent-pink: #aa90ff;
  --bs-accent-pink-rgb: 170,144,255;
  --bs-accent-pink-light: #c5b3ff;
  --bs-accent-blue-light: #63b3ed;
  --bs-soft-gray: #2d3748;
  --bs-text-muted: #a0aec0;
  --bs-body-bg: #1a202c;
  --bs-body-color: #e2e8f0;
  --bs-text-light: #f7fafc;
  --bs-dark-gradient: linear-gradient(135deg, #1a202c 0%, #2d3748 50%, #4a5568 100%);
  --bs-primary-gradient: linear-gradient(135deg, #4a90e2 0%, #aa90ff 100%);
}

.btn-primary {
  --bs-btn-color: #1a202c;
  --bs-btn-bg: #4a90e2;
  --bs-btn-border-color: #4a90e2;
  --bs-btn-hover-color: #1a202c;
  --bs-btn-hover-bg: #6ba3f0;
  --bs-btn-hover-border-color: #6ba3f0;
  --bs-btn-focus-shadow-rgb: 74,144,226;
  --bs-btn-active-color: #1a202c;
  --bs-btn-active-bg: #3182ce;
  --bs-btn-active-border-color: #3182ce;
  --bs-btn-disabled-color: #1a202c;
  --bs-btn-disabled-bg: #4a90e2;
  --bs-btn-disabled-border-color: #4a90e2;
}

.btn-outline-primary {
  --bs-btn-color: #4a90e2;
  --bs-btn-border-color: #4a90e2;
  --bs-btn-focus-shadow-rgb: 74,144,226;
  --bs-btn-hover-color: #1a202c;
  --bs-btn-hover-bg: #4a90e2;
  --bs-btn-hover-border-color: #4a90e2;
  --bs-btn-active-color: #1a202c;
  --bs-btn-active-bg: #4a90e2;
  --bs-btn-active-border-color: #4a90e2;
  --bs-btn-disabled-color: #4a90e2;
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: #4a90e2;
}

.btn-dark {
  --bs-btn-color: #e2e8f0;
  --bs-btn-bg: #2d3748;
  --bs-btn-border-color: #2d3748;
  --bs-btn-hover-color: #e2e8f0;
  --bs-btn-hover-bg: #4a5568;
  --bs-btn-hover-border-color: #4a5568;
  --bs-btn-focus-shadow-rgb: 45,55,72;
  --bs-btn-active-color: #e2e8f0;
  --bs-btn-active-bg: #1a202c;
  --bs-btn-active-border-color: #1a202c;
  --bs-btn-disabled-color: #e2e8f0;
  --bs-btn-disabled-bg: #2d3748;
  --bs-btn-disabled-border-color: #2d3748;
}

.btn-outline-dark {
  --bs-btn-color: #1a365d;
  --bs-btn-border-color: #1a365d;
  --bs-btn-focus-shadow-rgb: 26,54,93;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #1a365d;
  --bs-btn-hover-border-color: #1a365d;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #1a365d;
  --bs-btn-active-border-color: #1a365d;
  --bs-btn-disabled-color: #1a365d;
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: #1a365d;
}

/* New pink accent button */
.btn-pink {
  --bs-btn-color: #1a202c;
  --bs-btn-bg: #aa90ff;
  --bs-btn-border-color: #aa90ff;
  --bs-btn-hover-color: #1a202c;
  --bs-btn-hover-bg: #c5b3ff;
  --bs-btn-hover-border-color: #c5b3ff;
  --bs-btn-focus-shadow-rgb: 170,144,255;
  --bs-btn-active-color: #1a202c;
  --bs-btn-active-bg: #9575ff;
  --bs-btn-active-border-color: #9575ff;
  --bs-btn-disabled-color: #1a202c;
  --bs-btn-disabled-bg: #aa90ff;
  --bs-btn-disabled-border-color: #aa90ff;
}

/* Modern dark styling improvements */
body {
  background: var(--bs-dark-gradient);
  color: #f7fafc;
  min-height: 100vh;
}


.card {
  border: none;
  border-radius: 20px;
  background: rgba(45, 55, 72, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(74, 144, 226, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  overflow: hidden;
  color: #f7fafc;
  min-height: 320px;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-color: rgba(244, 143, 177, 0.3);
  background: rgba(45, 55, 72, 0.8);
}

.bs-icon {
  background: linear-gradient(135deg, var(--bs-accent-pink) 0%, var(--bs-primary) 100%);
}

/* Enhanced dark navbar */
.navbar {
  backdrop-filter: blur(20px);
  background: rgba(26, 32, 44, 0.5);
  border: 1px solid rgba(74, 144, 226, 0.25);
  border-radius: 0.5rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
  z-index: 1030;
  position: relative;
  padding: 1rem 0;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0));
  mask-image: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,1) 10%, rgba(0,0,0,1) 90%, rgba(0,0,0,0));
}

.navbar .nav-link {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  font-weight: 500;
}

.navbar-brand {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* Dark theme typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #4a90e2;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }

.lead {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--bs-text-muted);
}

.text-muted {
  color: #cbd5e0 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

p, .lead {
  color: #e2e8f0 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.card-text {
  color: #f7fafc !important;
  text-shadow: none;
}

.card-title {
  color: #aa90ff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

.card-subtitle {
  color: #cbd5e0 !important;
}

/* Service section text */
#palvelut p {
  color: #f0f4f8 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Modern gradient backgrounds */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-accent-pink) 100%);
}

.bg-gradient-soft {
  background: linear-gradient(135deg, var(--bs-accent-blue-light) 0%, var(--bs-accent-pink-light) 100%);
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Enhanced animations */
.hero-logo {
  transition: transform 0.3s ease;
}

.hero-logo:hover {
  transform: scale(1.05);
}

/* Link hover effects */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::before {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 50%;
  background: var(--bs-accent-pink);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 80%;
}

/* Form enhancements */
.form-control {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 16px;
  transition: all 0.3s ease;
  background-color: #ffffff;
}

.form-control:focus {
  border-color: var(--bs-accent-pink);
  box-shadow: 0 0 0 3px rgba(248, 180, 217, 0.1);
  background-color: #ffffff;
}

/* Button enhancements */
.btn {
  border-radius: 12px;
  font-weight: 500;
  padding: 12px 24px;
  transition: all 0.3s ease;
  letter-spacing: 0.025em;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(26, 54, 93, 0.15);
}

/* Card link hover effects */
.card-footer a {
  color: var(--bs-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.card-footer a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background: var(--bs-accent-pink);
  transition: width 0.3s ease;
}

.card-footer a:hover::after {
  width: 100%;
}

.card-footer a:hover {
  color: var(--bs-accent-pink);
}

/* Fade in animation for sections */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

/* Enhanced service images */
.service-image {
  transition: transform 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.service-image:hover {
  transform: scale(1.02);
}

/* Footer improvements */
footer {
  color: #f7fafc !important;
}

footer a {
  color: #e2e8f0 !important;
  transition: color 0.3s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

footer a:hover {
  color: var(--bs-accent-pink) !important;
}

footer .text-white {
  color: #f7fafc !important;
}

footer .text-muted {
  color: #cbd5e0 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Mobile responsiveness improvements */
@media (max-width: 768px) {
  .navbar-nav.flex-row {
    flex-direction: column !important;
    gap: 1rem !important;
    align-items: stretch !important;
    margin-top: 1rem !important;
  }
  
  .navbar-nav .btn {
    text-align: center !important;
    width: 100% !important;
  }
  
  .hero-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }
  
  .hero-buttons .btn {
    width: 200px !important;
    margin: 0 !important;
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
  }
  .hero-section {
    height: auto !important;
    min-height: 650px !important;
    margin-top: 0 !important;
    padding-top: 60px !important;
    padding-bottom: 120px !important;
  }
  
  #hero-video {
    object-fit: cover !important;
    object-position: center center !important;
  }
  
  .hero-logo {
    max-width: 280px !important;
  }
  
  .hero-title {
    font-size: 2.2rem !important;
  }
  
  .hero-content .lead {
    font-size: 1.1rem !important;
  }
  
  .hero-buttons .btn {
    font-size: 0.95rem !important;
    padding: 10px 20px !important;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  
  .lead {
    font-size: 1rem;
  }
  
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .card-body {
    padding: 1.5rem 1rem;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .navbar {
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 576px) {
  .hero-section {
    height: auto !important;
    min-height: 600px !important;
    padding-top: 60px !important;
    padding-bottom: 110px !important;
  }
  
  #hero-video {
    object-fit: cover !important;
    object-position: center center !important;
  }
  
  .hero-logo {
    max-width: 240px !important;
    margin-bottom: 1.5rem !important;
  }
  
  .hero-title {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
  }
  
  .hero-content .lead {
    font-size: 1rem !important;
    padding: 0 1rem !important;
  }
  
  .hero-buttons .btn {
    font-size: 0.9rem !important;
    padding: 8px 16px !important;
    margin-bottom: 0.5rem !important;
  }
  
  .lead {
    font-size: 0.95rem;
    padding: 0 1rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h4 { font-size: 1.1rem; }
  
  .service-image {
    height: 300px !important;
  }
  
  .py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  .mb-5 {
    margin-bottom: 2rem !important;
  }
}

/* Landscape mobile optimization (iPhone SE 667x375 and similar) */
@media (max-height: 450px) and (orientation: landscape) {
  /* No wrapper div padding needed in landscape */
  
  .hero-section {
    height: auto !important;
    min-height: calc(125vh - 80px) !important;
    padding-top: 0px !important;
    padding-bottom: 15px !important;
    margin-top: -65px !important;
  }
  
  .hero-logo {
    max-width: 160px !important;
    margin-bottom: 0.25rem !important;
  }
  
  .hero-title {
    font-size: 1.2rem !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.1 !important;
  }
  
  .hero-content .lead {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
    padding: 0 0.5rem !important;
  }
  
  .hero-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem !important;
    justify-content: center !important;
  }
  
  .hero-buttons .btn {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    margin-bottom: 0 !important;
    width: 140px !important;
  }
  
  .navbar {
    padding: 0.25rem 0 !important;
  }
}

/* Advanced dark theme enhancements */
.bg-body-tertiary {
  background-color: rgba(45, 55, 72, 0.8) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(74, 144, 226, 0.1);
}

/* Enhanced form styling */
.form-control {
  background-color: rgba(45, 55, 72, 0.8);
  border: 2px solid rgba(74, 144, 226, 0.3);
  color: var(--bs-text-light);
}

.form-control::placeholder {
  color: var(--bs-text-muted);
}

.form-control:focus {
  background-color: rgba(45, 55, 72, 0.9);
  border-color: var(--bs-accent-pink);
  box-shadow: 0 0 0 3px rgba(244, 143, 177, 0.15);
  color: var(--bs-text-light);
}

/* Scroll indicator */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #4a90e2 0%, #aa90ff 100%);
  z-index: 9999;
  transition: width 0.3s ease;
}

/* Section transitions */
section, div[id] {
  scroll-margin-top: 80px;
}

/* Enhanced animations */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.hero-logo {
  transition: transform 0.3s ease;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero-title {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* Accessibility improvements */
/* Enhanced focus indicators */
*:focus {
  outline: 3px solid #aa90ff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(244, 143, 177, 0.3) !important;
  border-radius: 4px;
  transition: all 0.2s ease !important;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #4a90e2;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  z-index: 10000;
  transition: all 0.3s ease;
}

.skip-to-content:focus {
  top: 6px;
  outline: 3px solid #aa90ff;
  outline-offset: 2px;
  color: white;
  text-decoration: none;
}

/* Button focus improvements */
.btn:focus {
  outline: 3px solid #aa90ff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(244, 143, 177, 0.3) !important;
}

/* Form control focus improvements */
.form-control:focus {
  outline: 3px solid #aa90ff !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(244, 143, 177, 0.3), 0 0 0 3px rgba(244, 143, 177, 0.15) !important;
}

/* Navigation link focus */
.nav-link:focus {
  background-color: rgba(244, 143, 177, 0.2) !important;
  color: #aa90ff !important;
  outline: 3px solid #aa90ff !important;
  outline-offset: 2px !important;
  border-radius: 6px;
}

/* Link focus improvements */
a:focus {
  outline: 3px solid #aa90ff !important;
  outline-offset: 2px !important;
  background-color: rgba(244, 143, 177, 0.1) !important;
  border-radius: 4px;
  padding: 2px 4px;
}

/* Remove focus from images */
img:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Loading spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Founder image hover effect */
.founder-image {
  opacity: 0.9;
  filter: saturate(85%);
  transition: all 0.3s ease-in-out;
}

.founder-image:hover {
  opacity: 1;
  filter: saturate(100%);
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
