/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
  /* Colors */
  --color-primary: #d9534f;
  --color-primary-dark: #c9443f;
  --color-text: #222;
  --color-text-light: #555;
  --color-text-lighter: #666;
  --color-bg: #ffffff;
  --color-border: #ddd;
  --color-border-light: #eee;
  
  /* Spacing (fluid using clamp) */
  --space-xs: clamp(0.25rem, 0.5vh, 0.5rem);
  --space-sm: clamp(0.5rem, 1vh, 1rem);
  --space-md: clamp(1rem, 2vh, 2rem);
  --space-lg: clamp(1.5rem, 3vh, 3rem);
  
  /* Typography (fluid) */
  --font-size-xs: clamp(0.65rem, 0.7vw + 0.4rem, 0.85rem);
  --font-size-sm: clamp(0.75rem, 0.8vw + 0.45rem, 1rem);
  --font-size-base: clamp(0.9rem, 1vw + 0.5rem, 1.2rem);
  --font-size-lg: clamp(1.1rem, 1.2vw + 0.6rem, 1.5rem);
  --font-size-xl: clamp(1.3rem, 1.5vw + 0.7rem, 2rem);
  
  /* Font stacks - Modern system fonts */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', Consolas, 'Courier New', monospace;
  
  /* Shadows (layered for depth) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 4px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-hover: 
    0 8px 12px rgba(0, 0, 0, 0.08),
    0 16px 24px rgba(0, 0, 0, 0.12);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Border radius */
  --radius-sm: 0.5vh;
  --radius-md: 1vh;
  
  /* Marquee animation speed */
  --marquee-speed: 40s;
}

/* ============================================
   MODERN CSS RESET
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  width: 100vw;
  overflow: hidden;
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
}

/* Remove default link styles */
a {
  color: inherit;
  text-decoration: none;
}

/* Better focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Hide scrollbars completely */
::-webkit-scrollbar {
  display: none;
}

* {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  animation: fadeIn var(--transition-slow) ease-in;
}

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

/* ============================================
   MARQUEE SECTION
   ============================================ */
.marquee {
  flex: 0 0 auto;
  width: 100%;
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-sm) 0;
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.marquee-inner {
  width: 100%;
  overflow: hidden;
}

.marquee-content {
  display: flex;
  width: max-content;
  animation: marqueeScroll var(--marquee-speed) linear infinite;
  will-change: transform;
}

.marquee-content span {
  font-size: var(--font-size-base);
  font-weight: 600;
  padding: 0 2vw;
  white-space: nowrap;
  position: relative;
}

.marquee-content span::after {
  content: '|';
  position: absolute;
  right: 0;
  opacity: 0.5;
}

.marquee-content span:last-child::after {
  display: none;
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Pause marquee on hover/focus for accessibility */
.marquee:hover .marquee-content,
.marquee:focus-within .marquee-content {
  animation-play-state: paused;
}

/* ============================================
   ABOUT SECTION (Logo)
   ============================================ */
.about {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  height: clamp(10vh, 15vh, 20vh);
}

.about img {
  height: clamp(8vh, 12vh, 16vh);
  width: auto;
  max-width: 85vw;
  object-fit: contain;
  filter: drop-shadow(var(--shadow-sm));
}

/* ============================================
   SERVICES SECTION
   ============================================ */
.services {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  min-height: 0;
}

.service-grid {
  display: grid;
  width: 100%;
  height: 100%;
  max-width: 100%;
  gap: clamp(1vh, 2vh, 3vh);
  align-content: center;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

/* ============================================
   SERVICE CARDS
   ============================================ */
.service {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5vh, 2vh, 3vh) clamp(3vw, 4vw, 5vw);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-base);
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay on hover */
.service::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(217, 83, 79, 0.03) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.service:hover::before,
.service:focus::before {
  opacity: 1;
}

.service:hover,
.service:focus {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.service:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.service h3 {
  font-size: var(--font-size-lg);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  font-weight: 700;
  transition: color var(--transition-fast);
}

.service:hover h3,
.service:focus h3 {
  color: var(--color-primary);
}

.service p {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   VIDEO SHOWCASE SECTION
   ============================================ */
.video-showcase {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--color-bg);
  min-height: 0;
}

.video-container {
  width: 100%;
  max-width: clamp(300px, 90vw, 900px);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
  transition: box-shadow var(--transition-base);
}

.video-container:hover {
  box-shadow: var(--shadow-hover);
}

.video-container video {
  width: 100%;
  height: auto;
  display: block;
  max-height: 60vh;
  object-fit: contain;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
.contact {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: var(--color-bg);
  gap: var(--space-xs);
}

.contact h2 {
  font-size: var(--font-size-xl);
  color: var(--color-primary);
  margin: 0;
  font-weight: 800;
}

.contact .phone-link {
  color: var(--color-primary);
  transition: all var(--transition-fast);
  display: inline-block;
}

.contact .phone-link:hover,
.contact .phone-link:focus {
  color: var(--color-primary-dark);
  transform: scale(1.05);
}

.contact p {
  font-size: var(--font-size-sm);
  text-align: center;
  margin: 0;
  line-height: 1.6;
}

.contact strong {
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.contact a:not(.phone-link) {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
  border-bottom: 1px solid transparent;
}

.contact a:not(.phone-link):hover,
.contact a:not(.phone-link):focus {
  color: var(--color-primary-dark);
  border-bottom-color: var(--color-primary-dark);
}

/* Monospace styling */
.monospace {
  font-family: var(--font-mono);
  color: var(--color-primary);
  font-weight: 700;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  flex: 0 0 auto;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-size-xs);
  color: var(--color-text-lighter);
  text-align: center;
}

.footer p, 
.footer address {
  margin: var(--space-xs) 0;
  font-style: normal;
  line-height: 1.4;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Mobile Landscape */
@media (max-height: 500px) and (orientation: landscape) {
  .about {
    height: 15vh;
  }
  
  .about img {
    height: 12vh;
  }
  
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    gap: 2vw;
  }
  
  .marquee-content span {
    font-size: var(--font-size-sm);
    padding: 0 1.5vw;
  }
  
  .contact {
    padding: var(--space-sm);
  }
  
  .footer {
    padding: var(--space-xs) var(--space-sm);
  }
  
  .footer p, 
  .footer address {
    display: inline;
    margin: 0 1vw;
  }
}

/* Tablet Portrait */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    max-width: 700px;
  }
  
  .about {
    height: 18vh;
  }
  
  .about img {
    height: 14vh;
  }
}

/* Tablet and Desktop */
@media (min-width: 768px) {
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    max-width: 900px;
    gap: clamp(2vh, 3vh, 4vh);
  }
  
  .service {
    border-width: 2px;
  }
  
  .footer {
    border-top-width: 2px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .about {
    height: 22vh;
  }
  
  .about img {
    height: 18vh;
  }
  
  .services {
    padding: var(--space-lg) var(--space-md);
  }
  
  .service-grid {
    max-width: 1000px;
  }
  
  /* Enhanced hover effects for desktop */
  .service:hover {
    transform: translateY(-4px) scale(1.02);
  }
}

/* Large Desktop */
@media (min-width: 1440px) {
  .service-grid {
    max-width: 1200px;
    gap: 4vh;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .marquee-content {
    animation: none;
  }
  
  .service:hover,
  .service:focus {
    transform: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .marquee {
    display: none;
  }
  
  body {
    overflow: visible;
    height: auto;
  }
  
  main {
    overflow: visible;
  }
  
  .service {
    page-break-inside: avoid;
  }
}
