/* ================================================================
   CXNCH DESIGN SYSTEM — cxnch.css
   Shared styles for all pages: tokens, reset, nav, footer, 
   buttons, typography, section primitives, and responsive rules.
   ================================================================ */

/* ========== DESIGN TOKENS ========== */
:root {
  /* Primary palette — #023C4D dominant */
  --primary: #023C4D;
  --primary-light: #065266;
  --primary-dark: #012D3A;
  --primary-deepest: #011F28;
  --teal-accent: #0D4848;
  --navy: #071932;
  --navy-mid: #082540;
  --slate: #032D39;

  /* Surfaces built from primary */
  --surface-hero: #023C4D;
  --surface-alt: #023545;
  --surface-card: rgba(2, 45, 58, 0.6);
  --surface-card-hover: rgba(6, 60, 77, 0.75);
  --surface-elevated: rgba(6, 82, 102, 0.12);

  /* Secondary & typography */
  --secondary: #E6ECED;
  --white: #E6ECED;
  --white-pure: #FFFFFF;
  --cream: #D8E2E4;
  --text-secondary: #A3BCC5;
  --text-muted: #7196A3;
  --accent: #E6ECED;
  --accent-bright: #FFFFFF;
  --accent-dim: rgba(230, 236, 237, 0.08);
  --accent-glow: rgba(230, 236, 237, 0.18);
  --highlight: #5BB8C9;
  --highlight-dim: rgba(91, 184, 201, 0.12);
  --highlight-glow: rgba(91, 184, 201, 0.25);

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  /* Layout */
  --max-width: 1100px;
  --max-width-wide: 1280px;
  --page-padding: 4rem;
  --page-padding-mobile: 1.25rem;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 20px;
  --radius-full: 100px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.25s;
  --transition-base: 0.35s;
  --transition-slow: 0.5s;
}


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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--primary);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }


/* ========== GRAIN TEXTURE OVERLAY ========== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.035'/%3E%3C/svg%3E");
}


/* ========== TYPOGRAPHY ========== */
.heading-serif {
  font-family: 'Libre Baskerville', serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.text-highlight { color: var(--highlight); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }


/* ========== NAVIGATION ========== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0.8rem var(--page-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-deepest);
  transition: all var(--transition-slow) var(--ease-out);
}

.site-nav.scrolled {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  background: var(--primary-deepest);
  backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid rgba(230, 236, 237, 0.06);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 2.4rem;
  color: var(--white-pure);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.logo-mark {
  color: var(--highlight);
  font-size: 2.4rem;
  line-height: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--highlight);
  transition: width 0.3s;
}

.nav-links a:hover { color: var(--white-pure); }
.nav-links a:hover::after { width: 100%; }

/* Active page indicator */
.nav-links a.active {
  color: var(--white-pure);
}
.nav-links a.active::after {
  width: 100%;
  opacity: 0.5;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
  border-radius: 2px;
  transition: 0.3s;
}

/* Mobile nav open state (toggled via JS) */
.nav-links.open {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--primary-deepest);
  padding: 1.5rem;
  backdrop-filter: blur(24px);
  gap: 1.25rem;
  border-bottom: 1px solid rgba(230, 236, 237, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}


/* ========== DROPDOWN SUBMENUS ========== */
.has-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.dd-chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.3s var(--ease-out);
  opacity: 0.6;
}

.has-dropdown:hover .dd-chevron,
.has-dropdown.dd-open .dd-chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--highlight);
}

/* Desktop dropdown panel */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 280px;
  background: var(--primary-deepest);
  border: 1px solid rgba(230, 236, 237, 0.08);
  border-radius: var(--radius-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out), visibility 0.25s;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(91, 184, 201, 0.04);
  z-index: 100;
}

/* Invisible bridge so hover doesn't break between trigger and panel */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.has-dropdown:hover .nav-dropdown,
.has-dropdown.dd-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Dropdown items */
.dd-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.2s;
}

.dd-item:hover {
  background: rgba(91, 184, 201, 0.06);
}

/* Override parent a::after underline for dropdown items */
.nav-dropdown .dd-item::after {
  display: none !important;
}

.dd-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dd-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--white-pure);
  letter-spacing: -0.005em;
}

.dd-item:hover .dd-title {
  color: var(--highlight);
}

.dd-desc {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.4;
}


/* ========== BUTTONS ========== */
.btn-nav {
  padding: 0.5rem 1.2rem;
  background: var(--highlight);
  color: #011F28;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
}

.nav-links a.btn-nav {
  color: #011F28;
}

.btn-nav:hover,
.nav-links a.btn-nav:hover {
  background: #7CCAD7;
  color: #011F28;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--highlight-glow);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.2rem;
  background: var(--accent);
  color: var(--primary-deepest);
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-base) var(--ease-out);
  text-decoration: none;
  letter-spacing: 0.005em;
}

.btn-primary:hover {
  background: var(--accent-bright);
  transform: translateY(-2px);
  box-shadow: 0 10px 36px var(--accent-glow);
}

.btn-primary svg { transition: transform 0.3s; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(230, 236, 237, 0.15);
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-outline:hover {
  border-color: var(--highlight);
  color: var(--highlight);
  background: var(--highlight-dim);
}

/* Arrow icon used in buttons */
.icon-arrow {
  width: 16px;
  height: 16px;
}


/* ========== SECTION PRIMITIVES ========== */
.section {
  padding: var(--space-xl) var(--page-padding);
  position: relative;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--highlight);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-eyebrow::before {
  content: '';
  width: 20px;
  height: 1.5px;
  background: var(--highlight);
  opacity: 0.4;
}

/* Centered variant — use on parent: style="text-align:center" won't work for flex.
   Instead add .section-eyebrow--center */
.section-eyebrow--center {
  justify-content: center;
}
.section-eyebrow--center::before {
  display: none;
}

.section-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--white-pure);
  margin-bottom: 1.25rem;
  max-width: 580px;
}

.section-title--center {
  text-align: center;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.section-desc {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 3.5rem;
  font-weight: 300;
}

.section-desc--center {
  text-align: center;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}


/* ========== CARD PRIMITIVES ========== */
.card {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(230, 236, 237, 0.04);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  transition: all 0.4s var(--ease-out);
  position: relative;
}

.card:hover {
  background: var(--surface-card-hover);
  border-color: rgba(230, 236, 237, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--highlight-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.card-icon svg {
  width: 22px;
  height: 22px;
  color: var(--highlight);
}

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white-pure);
  margin-bottom: 0.4rem;
}

.card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 300;
}


/* ========== CTA SECTION ========== */
.cta-section {
  padding: 8rem var(--page-padding);
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 45% 55% at 50% 50%, rgba(6, 82, 102, 0.3) 0%, transparent 70%),
    var(--primary);
}

.cta-inner {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 0 auto;
}

.cta-inner .section-eyebrow { justify-content: center; }
.cta-inner .section-eyebrow::before { display: none; }
.cta-inner .section-title { max-width: 100%; margin-left: auto; margin-right: auto; }
.cta-inner .section-desc { max-width: 100%; margin-left: auto; margin-right: auto; }

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}


/* ========== FOOTER ========== */
.site-footer {
  padding: 2.5rem var(--page-padding);
  border-top: 1px solid rgba(230, 236, 237, 0.04);
  background: var(--primary-deepest);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--highlight); }

.footer-location {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.5;
}


/* ========== SCROLL REVEAL ANIMATION ========== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: all 0.65s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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


/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }


/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  :root {
    --page-padding: 2rem;
  }

  .section { padding: 5rem var(--page-padding); }
  .cta-section { padding: 6rem var(--page-padding); }
}

@media (max-width: 768px) {
  :root {
    --page-padding: 1.25rem;
  }

  .site-nav { padding: 0.75rem var(--page-padding); }
  .site-nav.scrolled { padding: 0.6rem var(--page-padding); }

  .nav-links { display: none; }
  .mobile-toggle { display: block; }

  /* Mobile dropdown overrides */
  .nav-dropdown {
    position: static;
    transform: none;
    min-width: 0;
    background: rgba(1, 25, 32, 0.5);
    border: none;
    border-left: 2px solid rgba(91, 184, 201, 0.15);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 6px 0 6px 8px;
    margin-top: 8px;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease-out);
  }

  .nav-dropdown::before { display: none; }

  .has-dropdown.dd-open .nav-dropdown {
    max-height: 400px;
    transform: none;
  }

  /* Don't show on hover on mobile */
  .has-dropdown:hover .nav-dropdown {
    max-height: 0;
    opacity: 1;
    visibility: visible;
  }
  .has-dropdown:hover.dd-open .nav-dropdown {
    max-height: 400px;
  }

  .dd-item { padding: 8px 12px; }
  .dd-title { font-size: 0.82rem; }
  .dd-desc { font-size: 0.66rem; }

  .section { padding: 4rem var(--page-padding); }
  .cta-section { padding: 5rem var(--page-padding); }

  .cta-actions { flex-direction: column; }

  .site-footer { padding: 2rem var(--page-padding); }
  .footer-inner {
    flex-direction: column;
    gap: 1.25rem;
    text-align: center;
  }
  .footer-left {
    flex-direction: column;
    gap: 0.75rem;
  }
}
