/* ============================================================
   PREMIUM DESIGN SYSTEM — GemStar Car Detailing
   Luxury dark aesthetic override layer
   Loads AFTER Tailwind CSS
   ============================================================ */

/* ============================================================
   1. FONT IMPORT + TYPOGRAPHY OVERRIDES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6,
body h1, body h2, body h3, body h4, body h5, body h6,
.font-heading,
body .font-heading {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.04em;
}

body h1 {
  font-size: clamp(2.75rem, 5vw + 1rem, 4.5rem);
}

body h2 {
  font-size: clamp(2rem, 3vw + 0.5rem, 3.25rem);
}

body h3 {
  font-size: clamp(1.5rem, 2vw + 0.25rem, 2rem);
}

.prose p,
.prose-dark p,
body .prose p,
body .prose-dark p {
  max-width: 65ch;
  line-height: 1.8;
}

.premium-eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  font-weight: 500;
  color: var(--gold);
}

/* ============================================================
   2. CSS CUSTOM PROPERTIES
   ============================================================ */

:root {
  --gold: #d4a853;
  --gold-light: #e8c97a;
  --gold-dark: #b8923f;
  --gold-glow: rgba(212, 168, 83, 0.15);
  --gold-glow-strong: rgba(212, 168, 83, 0.3);
  --bg-deep: #0c0a0f;
  --bg-surface: #13111a;
  --bg-card: #1a1725;
  --bg-card-hover: #211e2e;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.1);
  --border-gold: rgba(212, 168, 83, 0.2);
  --shadow-warm: rgba(212, 168, 83, 0.08);
  --shadow-deep: rgba(0, 0, 0, 0.4);
  --ease-premium: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   3. BACKGROUND & SURFACE OVERRIDES
   ============================================================ */

body {
  background-color: var(--bg-deep);
}

body .section-dark,
.section-dark {
  background-color: var(--bg-deep);
}

body .section-surface,
.section-surface {
  background-color: var(--bg-surface);
}

/* Card — Double-Bezel Architecture */
body .card-dark,
.card-dark {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
  transition: all 500ms var(--ease-premium);
}

body .card-dark:hover,
.card-dark:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.06),
    0 8px 32px var(--shadow-warm),
    0 0 60px var(--gold-glow);
}

/* Glass Card — Enhanced Glass */
body .glass-card,
.glass-card {
  -webkit-backdrop-filter: blur(48px);
  backdrop-filter: blur(48px);
  background: rgba(20, 17, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.06);
  border-radius: 1.25rem;
}

/* ============================================================
   4. BUTTON OVERRIDES
   ============================================================ */

body .btn-primary,
.btn-primary {
  border-radius: 9999px;
  padding: 1rem 2.5rem;
  background: var(--gold);
  color: #0c0a0f;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: none;
  box-shadow:
    0 0 30px var(--gold-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 500ms var(--ease-premium);
}

body .btn-primary:hover,
.btn-primary:hover {
  background: var(--gold-light);
  transform: scale(1.03);
  box-shadow:
    0 0 40px var(--gold-glow-strong),
    0 0 80px var(--gold-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

body .btn-primary:active,
.btn-primary:active {
  transform: scale(0.98);
  transition: all 100ms;
}

body .btn-secondary,
.btn-secondary {
  border-radius: 9999px;
  border-color: var(--border-gold);
  color: var(--gold);
  transition: all 500ms var(--ease-premium);
}

body .btn-secondary:hover,
.btn-secondary:hover {
  background: rgba(212, 168, 83, 0.08);
  border-color: var(--gold);
}

body .btn-ghost,
.btn-ghost {
  color: var(--gold);
  transition: all 500ms var(--ease-premium);
}

body .btn-ghost:hover,
.btn-ghost:hover {
  color: var(--gold-light);
}

/* ============================================================
   5. NAVIGATION — FLOATING GLASS ISLAND
   ============================================================ */

#site-header {
  transition: all 600ms var(--ease-premium);
}

#site-header.header-scrolled {
  margin: 1rem 1.5rem;
  border-radius: 9999px;
  background: rgba(12, 10, 15, 0.85);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-gold);
  box-shadow:
    0 8px 32px var(--shadow-deep),
    0 0 60px var(--shadow-warm);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1023px) {
  #site-header.header-scrolled {
    border-radius: 0;
    margin: 0;
    max-width: none;
  }
}

/* ============================================================
   6. SCROLL REVEAL ANIMATIONS
   ============================================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(4px);
  transition:
    opacity 800ms var(--ease-premium),
    transform 800ms var(--ease-premium),
    filter 800ms var(--ease-premium);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

[data-reveal-delay="1"] { transition-delay: 100ms; }
[data-reveal-delay="2"] { transition-delay: 200ms; }
[data-reveal-delay="3"] { transition-delay: 300ms; }
[data-reveal-delay="4"] { transition-delay: 400ms; }
[data-reveal-delay="5"] { transition-delay: 500ms; }
[data-reveal-delay="6"] { transition-delay: 600ms; }

/* ============================================================
   7. NOISE / GRAIN OVERLAY
   ============================================================ */

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  animation: grain 8s steps(10) infinite;
}

/* ============================================================
   8. MESH GRADIENT AMBIENT BACKGROUNDS
   ============================================================ */

.mesh-gradient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.mesh-gradient::before,
.mesh-gradient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}

.mesh-gradient::before {
  width: 60%;
  height: 60%;
  top: -10%;
  left: -10%;
  background: radial-gradient(
    circle,
    rgba(212, 168, 83, 0.25) 0%,
    transparent 70%
  );
  animation: meshDrift1 20s ease-in-out infinite;
}

.mesh-gradient::after {
  width: 50%;
  height: 50%;
  bottom: -10%;
  right: -10%;
  background: radial-gradient(
    circle,
    rgba(212, 168, 83, 0.2) 0%,
    transparent 70%
  );
  animation: meshDrift2 20s ease-in-out infinite;
}

/* ============================================================
   9. SPOTLIGHT CARD EFFECT
   ============================================================ */

[data-spotlight] {
  --spotlight-x: 50%;
  --spotlight-y: 50%;
  position: relative;
  overflow: hidden;
}

[data-spotlight]::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--spotlight-x) var(--spotlight-y),
    var(--gold-glow),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 400ms var(--ease-premium);
  pointer-events: none;
  z-index: 1;
}

[data-spotlight]:hover::before {
  opacity: 1;
}

/* ============================================================
   10. SECTION SPACING OVERRIDES
   ============================================================ */

body .section-padding,
.section-padding {
  padding-top: 7rem;
  padding-bottom: 7rem;
}

@media (min-width: 768px) {
  body .section-padding,
  .section-padding {
    padding-top: 10rem;
    padding-bottom: 10rem;
  }
}

body section + section {
  margin-top: 2rem;
}

body .hero,
body [data-hero],
.hero,
[data-hero] {
  min-height: 100dvh;
}

/* Hero section — cinematic upgrade */
body .relative.min-h-screen,
.relative.min-h-screen {
  min-height: 100dvh;
}

/* Hero overlay — more dramatic gradient */
body .hero-overlay,
.hero-overlay {
  background: linear-gradient(
    to bottom,
    rgba(12, 10, 15, 0.4) 0%,
    rgba(12, 10, 15, 0.3) 30%,
    rgba(12, 10, 15, 0.6) 60%,
    rgba(12, 10, 15, 0.95) 85%,
    #0c0a0f 100%
  );
}

/* Hero text — larger, more dramatic */
body .text-5xl.md\:text-6xl.lg\:text-7xl {
  font-size: clamp(3rem, 6vw + 1rem, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Hero paragraph styling */
body .relative.z-10 .text-lg {
  font-weight: 300;
  letter-spacing: 0.01em;
}

/* Hero trust line (pricing, stars, experience) */
body .relative.z-10 .text-primary-400.font-bold {
  color: var(--gold);
  letter-spacing: 0.05em;
}

/* CTA button container in hero — more breathing room */
body .relative.z-10 .flex.flex-col {
  margin-top: 3rem;
}

/* Service card icons — gold tint */
body .card-dark .bg-primary-500\/10 {
  background-color: var(--gold-glow);
}

body .card-dark .text-primary-400 svg {
  color: var(--gold);
}

body .card-dark .group-hover\:text-primary-400 {
  color: var(--gold-light);
}

/* Horizontal rule / dividers */
body .border-white\/5 {
  border-color: var(--border-subtle);
}

body .border-white\/10 {
  border-color: var(--border-medium);
}

/* Section surface background tint adjustment */
body .section-surface.py-8 {
  background-color: var(--bg-surface);
  border-color: var(--border-gold);
}

/* Image treatment — subtle rounded corners with warm shadow */
body main img:not([class*="rounded-none"]):not(header img) {
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   11. PRICING CARD UPGRADES
   ============================================================ */

body .pricing-featured,
.pricing-featured {
  border: 2px solid var(--gold);
  box-shadow:
    0 0 40px var(--gold-glow),
    0 20px 40px var(--shadow-deep);
  position: relative;
}

body .pricing-featured::after,
.pricing-featured::after {
  content: 'Most Popular';
  position: absolute;
  top: -0.875rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #0c0a0f;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 1.25rem;
  border-radius: 9999px;
  white-space: nowrap;
}

/* ============================================================
   12. FOOTER UPGRADES
   ============================================================ */

body footer,
footer {
  border-top: 1px solid var(--border-gold);
}

body footer a,
footer a {
  color: #94a3b8;
  transition: color 400ms var(--ease-premium);
}

body footer a:hover,
footer a:hover {
  color: var(--gold);
}

body footer .footer-brand,
footer .footer-brand {
  color: var(--gold);
}

body footer .footer-column,
footer .footer-column {
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  body footer .footer-columns,
  footer .footer-columns {
    gap: 4rem;
  }
}

/* ============================================================
   13. BADGE / LABEL UPGRADES
   ============================================================ */

body .badge-primary,
.badge-primary {
  color: var(--gold);
  border-color: var(--border-gold);
}

body .section-label,
.section-label {
  color: var(--gold) !important;
  letter-spacing: 0.3em;
}

/* Override CSS custom property that the existing section-label uses */
:root {
  --color-primary: #d4a853;
  --color-primary-light: #e8c97a;
  --color-primary-dark: #b8923f;
  --color-accent: #d4a853;
}

/* Keep red for primary CTA backgrounds where gold text is used */
body .bg-primary-500,
.bg-primary-500 {
  background-color: var(--gold);
}

body .bg-primary-600,
.bg-primary-600 {
  background-color: var(--gold-dark);
}

body .bg-primary-500\/10,
body [class*="bg-primary-500/10"] {
  background-color: var(--gold-glow);
}

body .bg-primary-500\/20,
body [class*="bg-primary-500/20"] {
  background-color: rgba(212, 168, 83, 0.12);
}

/* Gold text accents */
body .text-primary-400,
.text-primary-400 {
  color: var(--gold);
}

body .text-primary-500,
.text-primary-500 {
  color: var(--gold);
}

body .hover\:text-primary-400:hover {
  color: var(--gold-light);
}

body .hover\:text-primary-300:hover {
  color: var(--gold-light);
}

/* Gold borders */
body .border-primary-500\/30,
body [class*="border-primary-500/30"] {
  border-color: var(--border-gold);
}

body .border-primary-500\/50,
body [class*="border-primary-500/50"] {
  border-color: rgba(212, 168, 83, 0.35);
}

body .hover\:border-primary-500\/30:hover {
  border-color: var(--border-gold);
}

body .hover\:border-primary-500\/50:hover {
  border-color: rgba(212, 168, 83, 0.4);
}

/* Gold ring/focus colors */
body .ring-primary-500\/20 {
  --tw-ring-color: rgba(212, 168, 83, 0.2);
}

body .focus\:border-primary-500:focus {
  border-color: var(--gold);
}

body .focus\:ring-primary-500:focus {
  --tw-ring-color: var(--gold);
}

body .focus\:ring-primary-500\/30:focus {
  --tw-ring-color: rgba(212, 168, 83, 0.3);
}

/* Shadow glow */
body .shadow-primary-500\/30 {
  --tw-shadow-color: rgba(212, 168, 83, 0.2);
}

/* Badge primary override */
body .badge-primary {
  background-color: rgba(212, 168, 83, 0.15);
  color: var(--gold);
}

/* ============================================================
   14. TRUST BAR / STATS AREA
   ============================================================ */

body .trust-stars svg,
body .trust-stars .star,
body .star-icon,
.trust-stars svg,
.trust-stars .star,
.star-icon {
  color: var(--gold);
  fill: var(--gold);
}

/* Override star SVGs in trust/rating bars — they use text-primary-400 + fill=currentColor */
body .text-primary-400 svg[fill="currentColor"],
body div.flex.text-primary-400 {
  color: var(--gold);
}

body .stat-number,
body .counter-number,
.stat-number,
.counter-number {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   15. PROSE / CONTENT AREA
   ============================================================ */

body .prose-dark a,
.prose-dark a {
  color: var(--gold);
  transition: color 400ms var(--ease-premium);
}

body .prose-dark a:hover,
.prose-dark a:hover {
  color: var(--gold-light);
}

body .prose-dark blockquote,
.prose-dark blockquote {
  border-left-color: var(--gold);
}

body .prose-dark strong,
.prose-dark strong {
  color: #ffffff;
}

/* ============================================================
   16. MOBILE MENU OVERLAY
   ============================================================ */

body .mobile-menu-overlay,
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(12, 10, 15, 0.95);
  -webkit-backdrop-filter: blur(64px);
  backdrop-filter: blur(64px);
}

body .mobile-menu-overlay a,
.mobile-menu-overlay a {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 500ms var(--ease-premium) forwards;
}

body .mobile-menu-overlay a:nth-child(1) { animation-delay: 100ms; }
body .mobile-menu-overlay a:nth-child(2) { animation-delay: 150ms; }
body .mobile-menu-overlay a:nth-child(3) { animation-delay: 200ms; }
body .mobile-menu-overlay a:nth-child(4) { animation-delay: 250ms; }
body .mobile-menu-overlay a:nth-child(5) { animation-delay: 300ms; }
body .mobile-menu-overlay a:nth-child(6) { animation-delay: 350ms; }
body .mobile-menu-overlay a:nth-child(7) { animation-delay: 400ms; }
body .mobile-menu-overlay a:nth-child(8) { animation-delay: 450ms; }

/* ============================================================
   17. KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5%, -10%); }
  30% { transform: translate(3%, -15%); }
  50% { transform: translate(-10%, 5%); }
  70% { transform: translate(7%, -5%); }
  90% { transform: translate(-3%, 10%); }
}

@keyframes meshDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.1); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

@keyframes meshDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 25px) scale(1.05); }
  66% { transform: translate(15px, -30px) scale(1.1); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ============================================================
   18. SCROLL PROGRESS INDICATOR
   ============================================================ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--gold);
  z-index: 9999;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  pointer-events: none;
}
