/* ==========================================================================
   PREMIUM DESIGN OVERLAY
   Aircraft Detailing Boise — $250k Design System
   Layered on top of existing Tailwind/Astro output
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. FONT UPGRADE
   Replace Inter body with Outfit (premium sans-serif with character)
   Keep Space Grotesk for headings
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

body {
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --------------------------------------------------------------------------
   2. GRAIN / NOISE OVERLAY
   Subtle film grain across the entire page for tactile depth
   Fixed, non-interactive, GPU-composited
   -------------------------------------------------------------------------- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --------------------------------------------------------------------------
   3. HEADER UPGRADE
   Enhanced glassmorphism with inner refraction border
   -------------------------------------------------------------------------- */
.header-transparent {
  background: rgba(7, 20, 36, 0.72);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid rgba(0, 218, 243, 0.06);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.header-transparent.scrolled {
  background: rgba(7, 20, 36, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3),
              inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(0, 218, 243, 0.08);
}

/* Nav dropdown upgrade */
.header-transparent nav .group > div > div {
  background: rgba(13, 31, 51, 0.95);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(0, 218, 243, 0.08);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   4. BUTTON UPGRADES
   Tactile feedback, better transitions, refined styling
   -------------------------------------------------------------------------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.2s ease,
              box-shadow 0.3s ease;
  box-shadow: 0 4px 20px -4px rgba(0, 218, 243, 0.3);
  letter-spacing: 0.12em;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px -4px rgba(0, 218, 243, 0.4);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 10px -2px rgba(0, 218, 243, 0.3);
  transition-duration: 0.08s;
}

.btn-outline {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.3s ease;
  border-color: rgba(215, 227, 250, 0.15);
}

.btn-outline:hover {
  transform: translateY(-2px);
  background-color: rgba(215, 227, 250, 0.06);
  border-color: rgba(215, 227, 250, 0.25);
  box-shadow: 0 8px 30px -8px rgba(0, 0, 0, 0.3);
}

.btn-outline:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 0.08s;
}

/* --------------------------------------------------------------------------
   5. CARD / SURFACE UPGRADES
   Tinted shadows, better elevation, refined borders
   -------------------------------------------------------------------------- */
.bg-surface-light {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease,
              border-color 0.25s ease;
}

/* Service cards — subtle lift on hover */
a.group.block.bg-surface-light {
  border-radius: 2px;
  box-shadow: 0 2px 20px -8px rgba(5, 15, 28, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

a.group.block.bg-surface-light:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px -12px rgba(0, 218, 243, 0.12),
              0 4px 20px -4px rgba(5, 15, 28, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Service area cards */
a.group.bg-surface-light {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease,
              border-color 0.25s ease;
}

a.group.bg-surface-light:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px -8px rgba(5, 15, 28, 0.5);
}

/* --------------------------------------------------------------------------
   6. TYPOGRAPHY REFINEMENTS
   Better weight distribution, tighter headlines, balanced text
   -------------------------------------------------------------------------- */

/* Hero headline — massive, tight, premium */
h1.font-heading {
  text-wrap: balance;
  font-feature-settings: "ss01", "ss02";
}

/* Section headings — consistent treatment */
h2.font-heading {
  text-wrap: balance;
  font-feature-settings: "ss01";
}

/* Muted text — slightly better readability */
.text-\[\#8899b3\] {
  font-weight: 400;
}

/* Monospaced accent text — premium instrument styling */
.instrument-text {
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-feature-settings: "ss01", "ss02", "zero";
}

/* Blockquote refinement */
blockquote p {
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   7. SCROLL-REVEAL ANIMATIONS
   CSS-only staggered entry animations triggered via IntersectionObserver
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger delays for grid children */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 400ms; }

.reveal-stagger > * {
  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-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Fade-in only (no Y movement) */
.reveal-fade {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.reveal-fade.visible {
  opacity: 1;
}

/* Scale-in for hero elements */
.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --------------------------------------------------------------------------
   8. GALLERY UPGRADE
   Varied heights for a masonry-like feel, premium hover effects
   -------------------------------------------------------------------------- */
.gallery-premium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: 4px;
}

@media (max-width: 1023px) {
  .gallery-premium {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .gallery-premium {
    grid-template-columns: 1fr;
  }
}

.gallery-premium img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.5s ease;
  cursor: default;
}

.gallery-premium .gallery-item {
  overflow: hidden;
  position: relative;
  min-height: 240px;
}

.gallery-premium .gallery-item:nth-child(1) {
  grid-row: span 2;
  min-height: 488px;
}

.gallery-premium .gallery-item:nth-child(4) {
  grid-column: span 2;
  min-height: 280px;
}

.gallery-premium .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-premium .gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-premium .gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 20, 36, 0.4), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-premium .gallery-item:hover::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   9. TESTIMONIAL UPGRADE
   Larger, more impactful quotes with better visual hierarchy
   -------------------------------------------------------------------------- */
blockquote.relative {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 2rem 0 2rem 2rem;
}

blockquote.relative:hover {
  transform: translateX(4px);
}

blockquote.relative::before {
  content: none;
}

/* --------------------------------------------------------------------------
   10. SECTION DIVIDERS
   Subtle gradient transitions between sections instead of hard edges
   -------------------------------------------------------------------------- */
section + section {
  position: relative;
}

/* --------------------------------------------------------------------------
   11. STATS / NUMBERS
   Tabular figures for aligned numbers
   -------------------------------------------------------------------------- */
.text-5xl.font-heading.font-bold,
.text-3xl.font-heading.font-bold {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   12. DETAILS/FAQ UPGRADE
   Smoother disclosure animation, better visual weight
   -------------------------------------------------------------------------- */
details.group {
  transition: border-color 0.25s ease,
              box-shadow 0.25s ease;
  border-radius: 2px;
}

details.group:hover {
  border-color: rgba(0, 218, 243, 0.15);
}

details.group[open] {
  border-color: rgba(0, 218, 243, 0.2);
  box-shadow: 0 4px 20px -8px rgba(0, 218, 243, 0.08);
}

details summary {
  user-select: none;
}

/* --------------------------------------------------------------------------
   13. PROCESS STEPS
   Enhanced visual connection between steps
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   14. HERO ENHANCEMENT
   More dramatic presence
   -------------------------------------------------------------------------- */

/* Subtle animated gradient on hero background */
@keyframes heroShimmer {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.44; }
}

section:first-of-type .absolute.inset-0.z-0 img {
  animation: heroShimmer 8s ease-in-out infinite;
}

/* Hero badge — enhanced */
.inline-flex.items-center.gap-2.px-3.py-1 {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(26, 45, 66, 0.6);
}

/* --------------------------------------------------------------------------
   15. FOOTER UPGRADE
   Better hierarchy, refined spacing
   -------------------------------------------------------------------------- */
footer {
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0, 218, 243, 0.15), transparent);
}

/* --------------------------------------------------------------------------
   16. MOBILE MENU UPGRADE
   -------------------------------------------------------------------------- */
.mobile-menu {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* --------------------------------------------------------------------------
   17. SMOOTH SCROLL BEHAVIOR
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal,
  .reveal-stagger > *,
  .reveal-fade,
  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   18. SELECTION COLOR REFINEMENT
   -------------------------------------------------------------------------- */
::selection {
  background-color: rgba(0, 200, 220, 0.25);
  color: #d7e3fa;
}

/* --------------------------------------------------------------------------
   19. LINK HOVER REFINEMENT
   Consistent hover transition across all nav links
   -------------------------------------------------------------------------- */
nav a {
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

footer a {
  transition: color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   20. IMAGE TREATMENT
   Subtle refinement on all content images
   -------------------------------------------------------------------------- */
img:not([src*="logo"]) {
  image-rendering: auto;
}

/* --------------------------------------------------------------------------
   21. COPPER GLOW REFINEMENT
   More subtle, luxurious radial glow
   -------------------------------------------------------------------------- */
.bg-copper-glow {
  background: radial-gradient(
    circle at center,
    rgba(212, 163, 115, 0.1) 0%,
    rgba(212, 163, 115, 0.04) 40%,
    transparent 70%
  );
}

/* --------------------------------------------------------------------------
   22. BACK-TO-TOP BUTTON REFINEMENT
   -------------------------------------------------------------------------- */
#back-to-top {
  border-radius: 2px;
  box-shadow: 0 4px 20px -4px rgba(0, 218, 243, 0.25);
  transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease;
}

#back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px -4px rgba(0, 218, 243, 0.35);
}

#back-to-top:active {
  transform: translateY(1px) scale(0.95);
}

/* --------------------------------------------------------------------------
   23. CALL BUTTON (MOBILE) REFINEMENT
   -------------------------------------------------------------------------- */
a[aria-label="Call us"] {
  border-radius: 2px;
  box-shadow: 0 4px 20px -4px rgba(212, 163, 115, 0.35);
}

/* --------------------------------------------------------------------------
   24. FORM STYLING (contact page)
   -------------------------------------------------------------------------- */
input, select, textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 218, 243, 0.1);
}

/* --------------------------------------------------------------------------
   25. PARALLAX CTA SECTION REFINEMENT
   The "Delivery-Day" midpage CTA
   -------------------------------------------------------------------------- */
section.relative.h-\[80vh\] {
  min-height: 80dvh;
  height: auto;
}

/* --------------------------------------------------------------------------
   26. BENTO GRID SECTION UPGRADE
   The "Maximize Resale Value" section — elevated surfaces
   -------------------------------------------------------------------------- */
.bg-surface-light.p-12.relative.group.overflow-hidden {
  border-radius: 4px;
  box-shadow: 0 8px 40px -12px rgba(5, 15, 28, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.bg-surface-light.p-8.flex.flex-col.justify-between.border-t-4.border-primary-500 {
  border-radius: 4px;
  box-shadow: 0 4px 30px -8px rgba(0, 218, 243, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bg-surface-dark.p-8.space-y-6.border.border-primary-500\/10 {
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Progress bar refinement */
.h-1.bg-background .h-full.bg-primary-500 {
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(0, 218, 243, 0.3);
}

/* --------------------------------------------------------------------------
   27. CONTENT IMAGE HOVER
   Subtle zoom on content images within cards/containers
   -------------------------------------------------------------------------- */
.bg-surface-dark img:not([src*="logo"]) {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s ease;
}

.bg-surface-dark:hover img:not([src*="logo"]) {
  transform: scale(1.03);
  filter: grayscale(0.6);
}

/* --------------------------------------------------------------------------
   28. PROCESS STEP NUMBERS
   Premium oversized number styling
   -------------------------------------------------------------------------- */
.text-5xl.font-heading.font-bold.text-primary-500\/20 {
  background: linear-gradient(180deg, rgba(0, 218, 243, 0.15), rgba(0, 218, 243, 0.04));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   29. HERO MIN-HEIGHT FIX
   Use 100dvh instead of 100vh to prevent mobile viewport issues
   -------------------------------------------------------------------------- */
section.relative.min-h-screen {
  min-height: 100dvh;
}

/* --------------------------------------------------------------------------
   30. LINK UNDERLINE ANIMATION
   Premium animated underline on nav hover
   -------------------------------------------------------------------------- */
header nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

header nav a:hover::after {
  width: 100%;
  left: 0;
}

/* --------------------------------------------------------------------------
   31. CARD BORDER-TOP GRADIENT
   Replace flat border-top with gradient for service cards
   -------------------------------------------------------------------------- */
a.group.block.bg-surface-light::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right,
    rgba(0, 218, 243, 0.1),
    rgba(0, 218, 243, 0.4),
    rgba(0, 218, 243, 0.1)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

a.group.block.bg-surface-light:hover::before {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   32. RESPONSIVE REFINEMENTS
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  h1.font-heading {
    font-size: 2.5rem;
    line-height: 0.95;
  }

  .py-32 {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  blockquote.relative {
    padding: 1.5rem 0 1.5rem 1.5rem;
  }
}

@media (max-width: 639px) {
  .gallery-premium .gallery-item:nth-child(1) { grid-row: span 1; }
  .gallery-premium .gallery-item:nth-child(4) { grid-column: span 1; }
}
