/* ============================================
   The Capital Warehouse — Design System
   Aesthetic: Luxury Industrial
   ============================================ */

/* CSS Custom Properties */
:root {
  --color-primary: #2F3A3E;
  --color-secondary: #1C1D32;
  --color-tertiary: #182642;
  --color-accent: #C47A2E;
  --color-accent-light: #DA9A55;
  --color-warm-sand: #F2E1CA;
  --color-light: #F5F2EF;
  --color-gray: #6b7280;
  --color-border: #e5e7eb;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================
   Base
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-secondary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--color-accent);
  color: white;
}

/* ============================================
   Noise / Grain Texture Overlay
   Used on hero, page-header, dark CTAs
   ============================================ */

.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  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.9' 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;
}

/* ============================================
   Navigation
   ============================================ */

#main-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#main-header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  z-index: 50;
  padding: 0.5rem;
  opacity: 0;
  animation: dropdownIn 0.2s ease forwards;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.nav-item:hover .nav-dropdown,
.nav-item.active .nav-dropdown {
  display: block;
}

.nav-dropdown a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s, color 0.15s;
}

.nav-dropdown a:hover {
  background-color: var(--color-warm-sand);
  color: var(--color-primary);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
}

.mobile-menu.open {
  display: block;
}

/* ============================================
   Scroll Reveal Animation
   ============================================ */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.95, 0.35, 1), transform 0.7s cubic-bezier(0.25, 0.95, 0.35, 1);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children for grouped reveals */
.reveal-on-scroll:nth-child(2) { transition-delay: 0.12s; }
.reveal-on-scroll:nth-child(3) { transition-delay: 0.24s; }
.reveal-on-scroll:nth-child(4) { transition-delay: 0.36s; }
.reveal-on-scroll:nth-child(5) { transition-delay: 0.48s; }

/* ============================================
   Modal Overlay
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(22, 33, 62, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 1.25rem;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  position: relative;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.4s cubic-bezier(0.25, 0.95, 0.35, 1);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--color-light);
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--color-gray);
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
  background-color: var(--color-accent);
  color: white;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-tertiary) 60%, #1f3350 100%);
  min-height: 580px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  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.9' 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;
}

/* Subtle radial glow behind heading */
.hero::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(196, 122, 46, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-clip {
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
  padding-bottom: 5rem;
}

.hero h1 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.hero p {
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

.hero a {
  position: relative;
  z-index: 1;
}

/* ============================================
   Page Header (interior pages)
   ============================================ */

.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-tertiary) 100%);
  padding: 7rem 1rem 3.5rem;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  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.9' 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;
}

.page-header h1 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.page-header p {
  position: relative;
  z-index: 1;
}

/* Decorative accent line under page header */
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ============================================
   Cards & Sections
   ============================================ */

.team-card {
  transition: transform 0.4s cubic-bezier(0.25, 0.95, 0.35, 1), box-shadow 0.4s cubic-bezier(0.25, 0.95, 0.35, 1);
  text-decoration: none;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
}

.team-card img {
  transition: transform 0.6s cubic-bezier(0.25, 0.95, 0.35, 1);
}

.team-card:hover img {
  transform: scale(1.04);
}

.service-card {
  transition: transform 0.4s cubic-bezier(0.25, 0.95, 0.35, 1), box-shadow 0.4s cubic-bezier(0.25, 0.95, 0.35, 1);
  text-decoration: none;
  border: 1px solid transparent;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
  border-color: var(--color-accent);
}

.service-card img {
  transition: transform 0.6s cubic-bezier(0.25, 0.95, 0.35, 1);
}

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

/* "Learn More" arrow animation */
.service-card span {
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-block;
}

.service-card:hover span {
  transform: translateX(4px);
  color: var(--color-accent);
}

/* ============================================
   Infographic Icons
   ============================================ */

.infographic-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  margin: 0 auto 0.75rem;
  transition: transform 0.3s cubic-bezier(0.25, 0.95, 0.35, 1), background-color 0.3s ease, box-shadow 0.3s ease;
}

.infographic-icon:hover,
.group:hover .infographic-icon {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(196, 122, 46, 0.3);
}

/* ============================================
   Accent Utilities
   ============================================ */

.accent-border-left {
  border-left: 4px solid var(--color-accent);
  padding-left: 1.5rem;
}

/* Decorative thin rule */
.accent-rule {
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ============================================
   Footer
   ============================================ */

footer {
  position: relative;
}

footer h4 {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

footer a {
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--color-accent-light);
}

/* ============================================
   Form Styles
   ============================================ */

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  background: var(--color-light);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-input:focus {
  outline: none;
  background: white;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(196, 122, 46, 0.12);
}

.form-input::placeholder {
  color: #9ca3af;
  font-weight: 300;
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
  background: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 58, 62, 0.2);
}

.btn-outline {
  display: inline-block;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.8rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 58, 62, 0.15);
}

/* ============================================
   CTA Banners (mission / dark sections)
   ============================================ */

.cta-banner {
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  pointer-events: none;
  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.9' 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;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .hero {
    min-height: 440px;
    padding: 2rem 1rem;
  }

  .hero-clip {
    clip-path: polygon(0 0, 100% 0, 100% 94%, 0 100%);
    padding-bottom: 3rem;
  }

  .page-header {
    padding: 5.5rem 1rem 2.5rem;
  }

  .page-header::after {
    width: 50px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2.25rem;
  }
}
