/* === CUSTOM PROPERTIES === */
:root {
  --midnight-50: #f0f4f8;
  --midnight-100: #d9e2ec;
  --midnight-200: #bcccdc;
  --midnight-300: #9fb5cc;
  --midnight-400: #829fbc;
  --midnight-500: #6281a2;
  --midnight-600: #4f6d8c;
  --midnight-700: #3d5876;
  --midnight-800: #2d4559;
  --midnight-900: #1b3040;

  --mint-50: #f0faf5;
  --mint-100: #d1f2e4;
  --mint-200: #a8e6cf;
  --mint-300: #7dcebc;
  --mint-400: #5dbb9a;
  --mint-500: #3d9e7e;
  --mint-600: #2d8265;
  --mint-700: #246b53;
  --mint-800: #1c5743;
  --mint-900: #144233;

  --stone-50: #fafaf9;
  --stone-100: #f5f5f4;
  --stone-200: #e7e5e4;
  --stone-300: #d6d3d1;
}

/* === TAILWIND CONFIG === */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Override Tailwind colors with our custom palette */
@layer theme {
  :root {
    --color-midnight-50: #f0f4f8;
    --color-midnight-100: #d9e2ec;
    --color-midnight-200: #bcccdc;
    --color-midnight-300: #9fb5cc;
    --color-midnight-400: #829fbc;
    --color-midnight-500: #6281a2;
    --color-midnight-600: #4f6d8c;
    --color-midnight-700: #3d5876;
    --color-midnight-800: #2d4559;
    --color-midnight-900: #1b3040;
    --color-mint-50: #f0faf5;
    --color-mint-100: #d1f2e4;
    --color-mint-200: #a8e6cf;
    --color-mint-300: #7dcebc;
    --color-mint-400: #5dbb9a;
    --color-mint-500: #3d9e7e;
    --color-mint-600: #2d8265;
    --color-mint-700: #246b53;
    --color-mint-800: #1c5743;
    --color-mint-900: #144233;
  }
}

/* === BASE === */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
}

::selection {
  background: color-mix(in srgb, var(--mint-400) 30%, transparent);
  color: var(--midnight-800);
}

/* === NAVBAR === */
#site-header {
  background: transparent;
}

#site-header.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(27, 48, 64, 0.06), 0 4px 24px rgba(27, 48, 64, 0.04);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--mint-400);
  border-radius: 1px;
  transition: width 0.3s ease;
}

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

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

#mobile-menu.open .mobile-link {
  animation: fadeDown 0.3s ease forwards;
  opacity: 0;
}

#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; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hamburger animation */
#menu-btn.active .line1 {
  transform: translateY(5.5px) rotate(45deg);
}

#menu-btn.active .line2 {
  opacity: 0;
  transform: scaleX(0);
}

#menu-btn.active .line3 {
  transform: translateY(-5.5px) rotate(-45deg);
  width: 5rem;
}

/* === REVEAL ANIMATIONS === */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Default visible state for progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 1;
    transform: translateY(0);
  }
}

/* When JS is enabled and animation is desired, add hidden state */
@media (prefers-reduced-motion: no-preference) {
  .reveal[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  }
}

/* === SERVICE CARDS === */
.service-card {
  border: 1px solid color-mix(in srgb, var(--midnight-200) 40%, transparent);
}

/* === BACK TO TOP === */
#back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

/* === FORM STYLES === */
input:focus, select:focus, textarea:focus {
  outline: none;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--stone-100);
}

::-webkit-scrollbar-thumb {
  background: var(--midnight-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--midnight-400);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 72px;
  }

  .font-serif {
    font-family: 'Playfair Display', Georgia, serif;
  }
}
