/* ==========================================================================
   Pallethandel VKS - Custom Stylesheet
   Works alongside Tailwind CSS for brand-specific styling & animations
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (Brand Tokens)
   -------------------------------------------------------------------------- */
:root {
  --navy: #1B2D4F;
  --navy-light: #2A4470;
  --navy-dark: #0F1923;
  --amber: #D4923A;
  --amber-light: #E8B05A;
  --cream: #F0EAE0;
  --cream-light: #FAF7F2;
  --text: #2C2C2C;
  --border: #E0DCD6;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Base / Reset Enhancements
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(212, 146, 58, 0.3);
}

::-moz-selection {
  background: rgba(212, 146, 58, 0.3);
}

/* --------------------------------------------------------------------------
   Noise / Grain Texture Overlay
   -------------------------------------------------------------------------- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* --------------------------------------------------------------------------
   Custom Scrollbar
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--cream-light);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--navy-light);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--navy) var(--cream-light);
}

/* --------------------------------------------------------------------------
   Scroll Reveal Animations
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s var(--ease-out-expo);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: all 0.8s var(--ease-out-expo);
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   Staggered Children Animation
   -------------------------------------------------------------------------- */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s var(--ease-out-expo);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-parallax {
  will-change: transform;
}

.hero-overlay {
  background: linear-gradient(
    135deg,
    rgba(15, 25, 35, 0.85) 0%,
    rgba(27, 45, 79, 0.6) 50%,
    rgba(212, 146, 58, 0.15) 100%
  );
}

/* --------------------------------------------------------------------------
   Image Hover Zoom
   -------------------------------------------------------------------------- */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.6s var(--ease-out-expo);
}

.img-zoom:hover img {
  transform: scale(1.08);
}

/* --------------------------------------------------------------------------
   Card Hover Lift
   -------------------------------------------------------------------------- */
.card-hover {
  transition: all 0.4s var(--ease-out-expo);
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(27, 45, 79, 0.12);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav-link {
  position: relative;
}

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

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

/* Navigation background transition on scroll */
.nav-scrolled {
  background: rgba(15, 25, 35, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Mobile Menu
   -------------------------------------------------------------------------- */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out-expo);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* Hamburger animation */
.hamburger-line {
  transition: all 0.3s ease;
}

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

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

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* --------------------------------------------------------------------------
   Section Dividers
   -------------------------------------------------------------------------- */
.diagonal-top {
  clip-path: polygon(0 5%, 100% 0, 100% 100%, 0 100%);
}

.diagonal-bottom {
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
}

.wave-top {
  clip-path: ellipse(75% 100% at 50% 100%);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-amber {
  background: var(--amber);
  color: white;
  padding: 14px 32px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  text-decoration: none;
}

.btn-amber:hover {
  background: var(--amber-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 146, 58, 0.3);
}

.btn-amber:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(212, 146, 58, 0.2);
}

.btn-outline {
  border: 2px solid white;
  color: white;
  padding: 12px 30px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  text-decoration: none;
}

.btn-outline:hover {
  background: white;
  color: var(--navy);
}

.btn-outline-navy {
  border: 2px solid var(--navy);
  color: var(--navy);
  padding: 12px 30px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  text-decoration: none;
}

.btn-outline-navy:hover {
  background: var(--navy);
  color: white;
}

.btn-navy {
  background: var(--navy);
  color: white;
  padding: 14px 32px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-navy:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(27, 45, 79, 0.2);
}

.btn-navy:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Line Accent Decoration
   -------------------------------------------------------------------------- */
.line-accent::before {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--amber);
  margin-bottom: 16px;
}

.line-accent-center::before {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--amber);
  margin: 0 auto 16px auto;
}

/* --------------------------------------------------------------------------
   Form Styling
   -------------------------------------------------------------------------- */
.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  color: var(--text);
}

.form-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(212, 146, 58, 0.15);
}

.form-input::placeholder {
  color: #A0A0A0;
}

textarea.form-input {
  resize: vertical;
  min-height: 140px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-error {
  color: #DC2626;
  font-size: 13px;
  margin-top: 4px;
}

.form-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
  padding: 16px 20px;
  border-radius: 4px;
  font-weight: 500;
}

.form-error-banner {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
  padding: 16px 20px;
  border-radius: 4px;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.text-balance {
  text-wrap: balance;
}

.heading-xl {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.heading-lg {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Stats / Counter Numbers
   -------------------------------------------------------------------------- */
.stat-number {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 3rem;
  color: var(--amber);
  line-height: 1;
}

.stat-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy-light);
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-light) 50%, var(--amber) 100%);
}

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

.scroll-indicator {
  animation: bounce 2s ease-in-out infinite;
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
}

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

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.6s var(--ease-out-expo) forwards;
}

@keyframes pulse-amber {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 146, 58, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(212, 146, 58, 0);
  }
}

.pulse-amber {
  animation: pulse-amber 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

/* Gradient text */
.text-gradient-amber {
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Backdrop blur for overlays */
.backdrop-blur-nav {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Aspect ratio containers */
.aspect-pallet {
  aspect-ratio: 4 / 3;
}

/* Truncate multi-line */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .stat-number {
    font-size: 2.25rem;
  }

  .diagonal-top {
    clip-path: polygon(0 2%, 100% 0, 100% 100%, 0 100%);
  }

  .diagonal-bottom {
    clip-path: polygon(0 0, 100% 0, 100% 98%, 0 100%);
  }
}

@media (max-width: 480px) {
  .btn-amber,
  .btn-outline,
  .btn-outline-navy,
  .btn-navy {
    padding: 12px 24px;
    font-size: 15px;
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
  body::before {
    display: none;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }

  .nav-link::after {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Reduced Motion Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-children > *,
  .card-hover,
  .img-zoom img,
  .mobile-menu,
  .nav-link::after {
    transition: none !important;
  }

  .scroll-indicator,
  .loading-spinner,
  .pulse-amber {
    animation: none !important;
  }

  .animate-fade-in-up,
  .animate-fade-in,
  .animate-slide-in-right {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
