/* ==========================================================================
   MANSARD STRUCTURAL ENGINEERS - DESIGN SYSTEM & STYLES
   Engineered for high performance, responsiveness, and aesthetic precision.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary-navy: #2A303C;
  --secondary-navy: #343B48;
  --slate-dark: #404856;
  --slate-mid: #545D6D;
  --slate-light: #6C7688;
  --slate-border: #E2E8F0;
  --brand-orange: #EA580C;
  --brand-orange-light: #F97316;
  --brand-orange-hover: #C2410C;
  --brand-amber: #F59E0B;
  --brand-cyan: #0284C7;
  --brand-cyan-light: #38BDF8;
  --surface-bg: #F8FAFC;
  --surface-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-subtle: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 10px 30px -4px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 20px 40px -8px rgba(234, 88, 12, 0.15);
  --transition-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-main);
  background-color: var(--surface-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

body {
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
  line-height: 1.6;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.02em;
}

.font-mono-stat {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar - Grey Structural Theme */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #2A303C;
}
::-webkit-scrollbar-thumb {
  background: #545D6D;
  border-radius: 5px;
  border: 2px solid #2A303C;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-orange);
}

/* Engineering Blueprint Pattern */
.blueprint-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(234, 88, 12, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(234, 88, 12, 0.05) 1px, transparent 1px);
}

.blueprint-grid-dark {
  background-color: #2A303C;
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.blueprint-dots-dark {
  background-image: radial-gradient(rgba(249, 115, 22, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Glassmorphism & Header - Architectural Slate Grey */
.glass-header {
  background: rgba(42, 48, 60, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header Navbar on scroll - Compact Slate Grey */
#main-header.scrolled-header {
  padding-top: 0.45rem !important;
  padding-bottom: 0.45rem !important;
  background: rgba(42, 48, 60, 0.98) !important;
  box-shadow: 0 12px 32px -4px rgba(20, 24, 30, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

/* Collapsible Top Address Bar on Scroll */
#top-address-bar {
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.25s ease, 
              margin-bottom 0.35s ease, 
              padding-bottom 0.35s ease, 
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 48px;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
}

#top-address-bar.top-bar-hidden {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom-color: transparent !important;
  transform: translateY(-100%) !important;
  pointer-events: none !important;
}

/* Standard Website Desktop Navigation Links */
.desktop-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #CBD5E1;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  letter-spacing: -0.01em;
  text-decoration: none;
}

@media (min-width: 1280px) {
  .desktop-nav-link {
    padding: 8px 18px;
    font-size: 16px;
  }
}

.desktop-nav-link:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.12);
}

.desktop-nav-link.active {
  color: #FFFFFF !important;
  background-color: #EA580C !important;
  box-shadow: 0 4px 14px 0 rgba(234, 88, 12, 0.39);
  font-weight: 700;
}

/* Floating Scroll-To-Top Button */
#scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #EA580C 0%, #D97706 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(234, 88, 12, 0.45), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

#scroll-to-top:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 16px 32px -4px rgba(234, 88, 12, 0.55);
  background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
}

#scroll-to-top:active {
  transform: translateY(0) scale(0.95);
}


.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.glass-card-dark {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Hero Gradient & Accents */
.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.18) 0%, rgba(15, 23, 42, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
}

/* Project Cards Styling */
.project-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  will-change: transform, box-shadow;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -8px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(234, 88, 12, 0.25);
}

.project-card .img-zoom {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover .img-zoom {
  transform: scale(1.06);
}

/* Category Filter Tabs */
.filter-btn {
  transition: all 0.2s ease;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
}

.filter-btn.active {
  background-color: var(--brand-orange);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

/* Infinite Marquee Animation */
.marquee-wrapper {
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  overflow-x: clip;
  contain: paint;
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.animate-marquee {
  display: flex;
  width: max-content;
  animation: marquee 35s linear infinite;
  contain: layout;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

/* Modal Dialog */
dialog.custom-modal {
  margin: auto;
  border: none;
  background: transparent;
  padding: 0;
  max-width: 900px;
  width: 95vw;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
}

dialog.custom-modal::backdrop {
  background: rgba(42, 48, 60, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

dialog.custom-modal[open] {
  animation: modalIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Engineering Spec Badges */
.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
}

/* Orange Gradient Button */
.btn-orange-primary {
  background: linear-gradient(135deg, #EA580C 0%, #F97316 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.32);
  transition: all 0.25s ease;
}

.btn-orange-primary:hover {
  background: linear-gradient(135deg, #C2410C 0%, #EA580C 100%);
  box-shadow: 0 6px 22px rgba(234, 88, 12, 0.45);
  transform: translateY(-2px);
}

.btn-navy-outline {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-navy-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF;
  transform: translateY(-2px);
}

/* Metric Counter Box */
.stat-box {
  border-left: 3px solid var(--brand-orange);
  padding-left: 16px;
}

/* Range input styling for Structural Estimator */
input[type=range] {
  accent-color: var(--brand-orange);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-glow {
    width: 280px;
    height: 280px;
  }
}
