/* ==========================================================================
   DVR GROUP OF COMPANIES - OFFICIAL CORPORATE STYLESHEET
   Brand Colors:
     Primary Navy:    #082336
     Dark Navy:       #051927
     Light Navy:      #0E334D
     Card Navy:       #072235
     Primary Gold:    #C58927
     Gold Light:      #DF9F32
     Gold Pale:       #F3E5C8
     Gold Dark:       #A36E18
     Cream:           #F8F5EE
     Cream Dark:      #EFEAE0
     Cream Card:      #FDFBF7
   Typography:
     Headings:        'Playfair Display', Georgia, serif
     Body & UI:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif
   ========================================================================== */

:root {
  --color-navy: #082336;
  --color-navy-dark: #051927;
  --color-navy-light: #0E334D;
  --color-navy-card: #072235;
  --color-gold: #C58927;
  --color-gold-light: #DF9F32;
  --color-gold-pale: #F3E5C8;
  --color-gold-dark: #A36E18;
  --color-cream: #F8F5EE;
  --color-cream-dark: #EFEAE0;
  --color-cream-card: #FDFBF7;
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-navy);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  overflow-x: clip;
}

footer {
  overflow-x: clip;
}

/* Base Heading & UI Font Assignments */
h1, h2, h3, .font-serif, .font-display {
  font-family: var(--font-heading);
}

h4, h5, h6, nav, button, input, select, textarea, label, .font-sans {
  font-family: var(--font-body);
}

h4.font-serif {
  font-family: var(--font-heading);
}

/* Centralized Responsive Typography Scale
   Higher specificity under html ensures consistent hierarchy alongside Tailwind CDN */
html .typo-hero {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.015em;
}

html .typo-section {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.01em;
}

html .typo-subheading {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1.5vw, 1.4375rem);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.005em;
}

html .typo-lead {
  font-family: var(--font-body);
  font-size: clamp(0.96875rem, 1.1vw, 1.0625rem);
  line-height: 1.7;
  font-weight: 400;
}

html .typo-body {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1vw, 1rem);
  line-height: 1.7;
  font-weight: 400;
}

html .typo-card-body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  font-weight: 400;
}

html .typo-nav {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.005em;
}

html .typo-btn {
  font-family: var(--font-body);
  font-size: clamp(0.875rem, 0.95vw, 0.9375rem);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.005em;
}

html .typo-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html .typo-footer-heading {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html .typo-footer-body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  font-weight: 400;
}

/* Page Section Transitions */
.page-section {
  display: none;
  animation: pageFadeIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-section.active {
  display: block;
}

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

/* Navigation Links */
.nav-link {
  position: relative;
  padding-bottom: 6px;
  transition: color 0.25s ease;
  font-weight: 500;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2.5px;
  background-color: var(--color-gold);
  transition: width 0.28s ease;
  border-radius: 2px;
}

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

.nav-link.active {
  color: var(--color-navy);
  font-weight: 600;
}

/* Header Dropdown Hover Bridge & Transitions */
.nav-dropdown-wrapper {
  position: absolute;
  left: 0;
  top: 100%;
  padding-top: 0.5rem;
  width: 18.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  pointer-events: none;
  z-index: 50;
}

.group:hover .nav-dropdown-wrapper,
.group:focus-within .nav-dropdown-wrapper {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Background Gradients & Wave Accents */
.gold-wave-bg {
  background-image: radial-gradient(circle at 0% 100%, rgba(197, 137, 39, 0.18) 0%, transparent 45%),
                    radial-gradient(circle at 100% 0%, rgba(197, 137, 39, 0.14) 0%, transparent 40%);
}

/* Company Card Angled Peak Cut (Preserved from approved design) */
.company-card-peak {
  clip-path: polygon(0 14%, 50% 0, 100% 14%, 100% 100%, 0% 100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-cream);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold-dark);
}

/* Focus Visibility for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ==========================================================================
   SCROLL-BASED SLIDING REVEAL ANIMATIONS
   Progressive enhancement gated by .dvr-reveal-ready and prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  html.dvr-reveal-ready [data-reveal]:not(.is-revealed-done) {
    opacity: 0;
    will-change: opacity, transform;
    transition-property: opacity, transform;
    transition-duration: 700ms;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* 1. Headings: Slide up with fade-in */
  html.dvr-reveal-ready [data-reveal="heading"]:not(.is-revealed-done) {
    transform: translate3d(0, 20px, 0);
  }

  /* 2. Paragraphs: Slight slide from left with fade-in */
  html.dvr-reveal-ready [data-reveal="paragraph"]:not(.is-revealed-done) {
    transform: translate3d(-18px, 0, 0);
    transition-duration: 650ms;
  }

  /* 3. Images: Slide in from right with fade-in */
  html.dvr-reveal-ready [data-reveal="image"]:not(.is-revealed-done) {
    transform: translate3d(22px, 0, 0);
    transition-duration: 750ms;
  }

  /* 4. Portfolio & Content Cards: Slide up with fade-in (staggered via JS) */
  html.dvr-reveal-ready [data-reveal="card"]:not(.is-revealed-done) {
    transform: translate3d(0, 24px, 0);
    transition-duration: 700ms;
  }

  /* 5. Statistics: Subtle slide-up and fade-in */
  html.dvr-reveal-ready [data-reveal="stat"]:not(.is-revealed-done) {
    transform: translate3d(0, 16px, 0);
    transition-duration: 650ms;
  }

  /* 6. Footer Sections: Gentle slide-up animation */
  html.dvr-reveal-ready [data-reveal="footer"]:not(.is-revealed-done) {
    transform: translate3d(0, 16px, 0);
    transition-duration: 650ms;
  }

  html.dvr-reveal-ready [data-reveal].is-revealed:not(.is-revealed-done) {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.dvr-reveal-ready [data-reveal],
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
