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

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

body {
  overflow-x: hidden;
}

::selection {
  background: #4ECDC4;
  color: #091420;
}

/* ── Navbar ── */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(13, 27, 42, 0.06);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #4ECDC4;
  transition: width 0.3s ease;
}

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

/* ── Mobile Menu ── */
.menu-line {
  transition: all 0.3s ease;
}

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

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

#menuBtn.active .menu-line:nth-child(3) {
  width: 1.5rem;
  transform: rotate(-45deg) translate(5px, -5px);
}

#mobileMenu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-link {
  transition: all 0.3s ease;
}

.mobile-link:hover {
  transform: scale(1.05);
}

/* ── Hero Animations ── */
.hero-tagline {
  animation: slideUp 0.8s ease forwards 0.2s;
}

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

.hero-line:nth-child(2) {
  animation-delay: 0.35s;
}

.hero-fade {
  animation: fadeIn 0.8s ease forwards 0.7s;
  opacity: 0;
}

.hero-img-main {
  animation: scaleIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.4s;
  transform: scale(0.9);
  opacity: 0;
}

.hero-img-accent {
  animation: slideRight 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.6s;
  transform: translateX(-40px);
  opacity: 0;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* ── Marquee ── */
.marquee-track {
  animation: marquee 30s linear infinite;
}

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

/* ── Section Reveal ── */
.section-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}

.section-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.section-card:nth-child(1) { transition-delay: 0s; }
.section-card:nth-child(2) { transition-delay: 0.1s; }
.section-card:nth-child(3) { transition-delay: 0.2s; }
.section-card:nth-child(4) { transition-delay: 0.3s; }
.section-card:nth-child(5) { transition-delay: 0.4s; }
.section-card:nth-child(6) { transition-delay: 0.5s; }

.section-reveal:nth-child(1) { transition-delay: 0s; }
.section-reveal:nth-child(2) { transition-delay: 0.1s; }
.section-reveal:nth-child(3) { transition-delay: 0.2s; }
.section-reveal:nth-child(4) { transition-delay: 0.3s; }

/* ── About Image ── */
.about-img {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-img.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ── Button Hover Effects ── */
a, button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #4ECDC4;
  outline-offset: 2px;
}

/* ── Smooth Scroll Offset ── */
section[id] {
  scroll-margin-top: 80px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-tagline {
    font-size: 0.7rem;
  }

  .hero-img-accent {
    display: none;
  }

  .hero-img-main {
    width: 100%;
    height: 60%;
  }

  #contact {
    scroll-margin-top: 60px;
  }
}

@media (max-width: 640px) {
  .grid-cols-2 > * {
    grid-column: span 1;
  }
}

/* ── Accessibility: 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;
  }

  .section-reveal,
  .section-card,
  .about-img {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }
}
