/* ============================================
   PROFESSIONAL SMOOTH ANIMATIONS
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #fdf7f0 0%, #fff8f0 40%, #fef9f3 100%);
  background-attachment: fixed;
  color: #111827;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Custom scrollbar for a refined feel */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #fef3c7;
}
::-webkit-scrollbar-thumb {
  background: #fbbf24;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Simple fade/slide animation for sections */
.section-fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.section-fade-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reveal animations for inner elements (staggered) */
.reveal-child {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 600ms cubic-bezier(.2,.9,.2,1), transform 600ms cubic-bezier(.2,.9,.2,1);
}

.reveal-child.reveal-visible {
  opacity: 1;
  transform: none;
}

/* Directional variants */
.reveal-child[data-anim="left"] { transform: translateX(-18px); }
.reveal-child[data-anim="right"] { transform: translateX(18px); }
.reveal-child[data-anim="up"] { transform: translateY(18px); }

/* Small adjustments for reduced motion or small screens */
@media (prefers-reduced-motion: reduce) {
  .reveal-child { transition: none !important; transform: none !important; opacity: 1 !important; }
}

@media (max-width: 640px) {
  .reveal-child { transition-duration: 420ms; }
}

/* ============================================
   PARALLAX & DEPTH EFFECTS
   ============================================ */

/* Hero image parallax container */
.parallax-container {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
}

.parallax-image {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
  will-change: transform;
  display: block;
  width: 100%;
  height: auto;
}

/* Gentle zoom on load */
.parallax-image.loaded {
  animation: parallax-zoom-in 1.2s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes parallax-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Card depth & elevation on hover */
.card-hover {
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
  position: relative;
}

.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.15);
}

.card-hover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
  pointer-events: none;
}

.card-hover:hover::before {
  opacity: 1;
}

/* ============================================
   BUTTON & INTERACTIVE MICRO-INTERACTIONS
   ============================================ */

button {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Subtle scale & glow on hover */
button:hover {
  transform: scale(1.02);
}

/* Ripple/press effect on active */
button:active {
  transform: scale(0.98);
}

/* Smooth color transitions on links */
a {
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

/* ============================================
   TEXT & ELEMENT ANIMATIONS
   ============================================ */

/* Smooth text fade-in for headings */
h1, h2, h3 {
  transition: opacity 0.4s ease, color 0.3s ease;
}

/* Underline reveal on hover for links */
.link-underline {
  position: relative;
  text-decoration: none;
  transition: color 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.link-underline:hover::after {
  width: 100%;
}

/* ============================================
   PERFORMANCE & ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Optimize for lower-end devices */
@media (max-width: 480px) {
  .parallax-image { will-change: auto; }
  .card-hover { will-change: auto; }
  .reveal-child { transition-duration: 300ms; }
}

/* High refresh rate devices (120Hz+) */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ============================================
   FORM INPUT ANIMATIONS
   ============================================ */

input, select, textarea {
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.2, 1);
  position: relative;
}

input:focus, select:focus, textarea:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1) !important;
}

input::placeholder, textarea::placeholder {
  transition: color 0.3s ease;
}

input:focus::placeholder, textarea:focus::placeholder {
  color: rgba(107, 114, 128, 0.4);
}

/* ============================================
   ENHANCED BUTTON STATES
   ============================================ */

button[type="submit"] {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

button[type="submit"]:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.2);
}

button[type="submit"]:not(:disabled):active {
  transform: translateY(0);
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   HERO IMAGE ANIMATIONS (Refined)
   ============================================ */

/* Clean zoom-in on load */
.parallax-image.loaded {
  animation: hero-subtle-zoom 1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

@keyframes hero-subtle-zoom {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Minimal container glow */
.parallax-container {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  transition: box-shadow 0.4s ease;
}

.parallax-container:hover {
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.15);
}

/* Subtle parallax image */
.parallax-image {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center;
  will-change: transform;
  display: block;
  width: 100%;
  height: auto;
}

/* Elegant light overlay (minimal) */
.parallax-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 50%
  );
  border-radius: 1.5rem;
  pointer-events: none;
  z-index: 2;
}

/* Refined border accent */
.parallax-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  pointer-events: none;
  z-index: 1;
}

/* Minimal brightness shift */
.parallax-image {
  animation: subtle-brightness 6s ease-in-out infinite;
}

@keyframes subtle-brightness {
  0%, 100% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.02) saturate(1.03);
  }
}

/* Mobile optimization */
@media (max-width: 768px) {
  @keyframes hero-subtle-zoom {
    from {
      opacity: 0;
      transform: scale(0.98);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .parallax-container::before {
    opacity: 0.5;
  }

  @keyframes subtle-brightness {
    0%, 100% {
      filter: brightness(1) saturate(1);
    }
    50% {
      filter: brightness(1.01) saturate(1.02);
    }
  }
}
