/* Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

/* Selection */
::selection {
  background: #E06C5C;
  color: #fff;
}

/* Navigation */
#nav.scrolled {
  box-shadow: 0 1px 0 rgba(44, 44, 44, 0.06);
}

/* Mobile menu */
#mobile-menu.open {
  opacity: 1 !important;
  pointer-events: all !important;
}

#mobile-menu.open .mobile-link {
  animation: fadeUp 0.4s ease forwards;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }

.menu-line {
  display: block;
}

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

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

.menu-toggle.active .menu-line:nth-child(3) {
  transform: rotate(-45deg) translate(3px, -3px);
  width: 1.25rem;
}

/* Hero animations */
.hero-tag {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-headline {
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.hero-sub {
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-btn {
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-image-wrapper {
  animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.floating-card {
  animation: floatUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

/* Scroll reveal */
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left {
  transform: translateX(-30px);
}

.reveal-right {
  transform: translateX(30px);
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0, 0);
}

.reveal-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fallback: if JS is disabled, everything is visible */
.no-js .reveal-up,
.no-js .reveal-left,
.no-js .reveal-right,
.no-js .reveal-card {
  opacity: 1;
  transform: none;
}

/* Keyframes */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Specialty items */
.specialty-item {
  animation: slideRight 0.5s ease forwards;
  opacity: 0;
}

.specialty-item:nth-child(1) { animation-delay: 0.1s; }
.specialty-item:nth-child(2) { animation-delay: 0.2s; }
.specialty-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
  
  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-card {
    opacity: 1;
    transform: none;
  }
}

/* Smooth image loading */
img {
  background-color: #F2EDE8;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #E06C5C;
  outline-offset: 2px;
  border-radius: 2px;
}
