/* ================================================================
   CONNEX Advisory — Design System
   ================================================================ */

:root {
  /* Color tokens */
  --bg-primary: #0A1628;
  --bg-secondary: #0F1F35;
  --bg-elevated: #15263F;
  --accent: #D4A574;
  --accent-subtle: rgba(212, 165, 116, 0.10);
  --accent-strong: #E6B989;
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --success: #22C55E;
  --danger: #ef4444;

  /* Type scale (desktop) */
  --h1: 72px;
  --h2: 48px;
  --h3: 28px;
  --body-large: 19px;
  --body: 17px;
  --small: 14px;
  --eyebrow: 13px;

  /* Spacing */
  --s-8: 8px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;
  --s-128: 128px;
  --s-192: 192px;

  /* Radii */
  --r-btn: 12px;
  --r-card: 16px;
  --r-large: 24px;

  /* Layout */
  --content-w: 1200px;
  --hero-w: 1280px;
  --prose-w: 680px;
}

@media (max-width: 768px) {
  :root {
    --h1: 44px;
    --h2: 32px;
    --h3: 22px;
    --body-large: 17px;
    --body: 16px;
  }
}

/* ----------------------------------------------------------------
   Reset
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }

/* ----------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */
.font-display { font-family: 'Fraunces', Georgia, serif; font-optical-sizing: auto; }
.font-mono { font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace; }

h1, h2, h3, h4, h5, h6 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 500; font-optical-sizing: auto; }
p { margin: 0; }

h1, .h1 {
  font-size: var(--h1);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
}
h2, .h2 {
  font-size: var(--h2);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 500;
}
h3, .h3 {
  font-size: var(--h3);
  line-height: 1.3;
  font-weight: 500;
}

.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: var(--eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
}

.body-large { font-size: var(--body-large); line-height: 1.65; }
.body { font-size: var(--body); line-height: 1.65; }
.small { font-size: var(--small); line-height: 1.5; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

.pull-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 32px;
  line-height: 1.35;
  color: var(--accent);
  font-weight: 400;
}

@media (max-width: 768px) {
  .pull-quote { font-size: 24px; }
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 16px;
  padding: 16px 24px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  transition: all 200ms ease-out;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #1A1208;
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(212, 165, 116, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-secondary:hover {
  background: var(--accent-subtle);
}

.btn-small {
  font-size: 14px;
  padding: 12px 20px;
}

.btn-large {
  font-size: 18px;
  padding: 18px 32px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 500;
  transition: gap 200ms ease-out;
}
.link-arrow:hover { gap: 10px; }

/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(10, 22, 40, 0.78);
  transition: border-color 200ms ease-out, background 200ms ease-out;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(10, 22, 40, 0.92);
  border-bottom-color: var(--border);
}
.site-header__inner {
  max-width: var(--hero-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
}
.wordmark__icon {
  display: inline-flex;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--text-primary);
}
.wordmark__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.wordmark__icon .wm-arc {
  transition: stroke 200ms ease-out;
}
.wordmark__icon .wm-dest {
  transition: transform 200ms ease-out, fill 200ms ease-out;
  transform-origin: 24px 16px;
}
.wordmark:hover .wm-dest {
  transform: scale(1.15);
}
.wordmark:hover .wm-arc {
  stroke: var(--accent);
}

.nav-center {
  display: flex;
  gap: 40px;
  justify-content: center;
}
.nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 200ms ease-out;
  letter-spacing: 0.02em;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link--has-menu {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.nav-link.active {
  color: var(--text-primary);
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.nav-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.hamburger svg { width: 22px; height: 22px; }

@media (max-width: 768px) {
  .site-header { height: 68px; }
  .site-header__inner { padding: 0 20px; grid-template-columns: 1fr auto; }
  .nav-center, .nav-right .btn { display: none; }
  .hamburger { display: inline-flex; }
  .wordmark { font-size: 17px; }
  .wordmark__icon { width: 26px; height: 26px; }
}

main { padding-top: 80px; }
@media (max-width: 768px) { main { padding-top: 68px; } }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 86vw);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  padding: 88px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateX(100%);
  transition: transform 240ms ease-out;
}
.mobile-menu.open .mobile-menu__panel { transform: translateX(0); }
.mobile-menu .nav-link { font-size: 22px; color: var(--text-primary); }
.mobile-menu .btn { margin-top: 16px; align-self: flex-start; }
.mobile-menu__close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 8px;
}

/* ----------------------------------------------------------------
   Sections
   ---------------------------------------------------------------- */
.container {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 32px;
}
.container-hero { max-width: var(--hero-w); margin: 0 auto; padding: 0 32px; }
.container-prose { max-width: var(--prose-w); margin: 0 auto; padding: 0 24px; }

@media (max-width: 768px) {
  .container, .container-hero { padding: 0 20px; }
}

.section {
  padding: var(--s-128) 0;
}
.section-bg-secondary {
  background: var(--bg-secondary);
}
@media (max-width: 768px) {
  .section { padding: var(--s-64) 0; }
}

/* ----------------------------------------------------------------
   Cards
   ---------------------------------------------------------------- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 32px;
}
@media (max-width: 768px) {
  .card { padding: 24px; }
}
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 32px;
}

/* ----------------------------------------------------------------
   Motion
   ---------------------------------------------------------------- */
.fade-in {
  opacity: 1;
}
.fade-in.pending {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.fade-in.pending.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.site-footer {
  padding-top: var(--s-96);
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: var(--s-96);
}
@media (max-width: 1024px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: var(--s-48);
  }
}
.footer-col h4 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  color: var(--text-secondary);
  font-size: 15px;
  transition: color 200ms ease-out;
}
.footer-col a:hover { color: var(--text-primary); }
.footer-tagline { color: var(--text-secondary); font-size: 15px; max-width: 280px; margin-top: 16px; }
.footer-social { margin-top: 20px; display: flex; gap: 12px; }
.footer-social a {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color 200ms, background 200ms;
}
.footer-social a:hover { border-color: var(--accent); background: var(--accent-subtle); }
.footer-social svg { width: 16px; height: 16px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ----------------------------------------------------------------
   Forms
   ---------------------------------------------------------------- */
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.form-field label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.form-input, .form-textarea, .form-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 15px;
  width: 100%;
  transition: border-color 200ms ease-out, background 200ms;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ----------------------------------------------------------------
   Utilities
   ---------------------------------------------------------------- */
.dot-gold { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.dot-green {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse-green 1.5s ease-in-out infinite;
}
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* Image placeholder */
.img-placeholder {
  background:
    repeating-linear-gradient(
      135deg,
      var(--bg-elevated),
      var(--bg-elevated) 12px,
      var(--bg-secondary) 12px,
      var(--bg-secondary) 24px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 16px;
  border: 1px solid var(--border);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(5, 12, 22, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease-out;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-large);
  padding: 48px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  transform: translateY(8px);
  transition: transform 240ms ease-out;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 24px; margin-bottom: 12px; }
.modal p { color: var(--text-secondary); margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 24px; right: 24px;
  background: none; border: none; color: var(--text-primary); padding: 8px;
}


/* a11y — replicated best practices (wheretoemigrate.io) */
.skip-link{position:absolute;left:-9999px;top:0;background:#0A1628;color:#fff;padding:10px 16px;z-index:1000;border:2px solid #D4A574}
.skip-link:focus{left:0}
:focus-visible{outline:2px solid #D4A574;outline-offset:2px}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
