/* ==========================================================================
   ConnectDeep AI — main.css
   Design tokens, base styles, typography, header, hero, dashboard mockup.
   Sections (trusted-by, footer): css/sections.css
   Breakpoints, drawer, marquee, motion guards: css/responsive.css
   ========================================================================== */

/* —— 1. RESET ——————————————————————————————————————————————————————————— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* —— 2. DESIGN TOKENS ——————————————————————————————————————————————————— */
:root {
  /* Color palette */
  --color-ink:       #EEF1F7;
  --color-ink-soft:  #AEB6CC;
  --color-mute:      #6F7A96;
  --color-navy:      #070B1A;
  --color-navy-2:    #0C1330;
  --color-panel:     #0E1733;
  --color-gold:      #D9A441;
  --color-gold-hi:   #F0C668;
  --color-gold-deep: #B8862F;
  --color-live:      #3ECF8E;

  /* Derived lines / fills */
  --color-line:      rgba(174, 182, 204, 0.12);
  --color-line-gold: rgba(217, 164, 65, 0.22);

  /* Font families */
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --font-body:    'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  /* Fluid type scale (clamp: min, preferred, max) */
  --text-xs:   clamp(12px, 0.30vw + 11px, 13px);
  --text-sm:   clamp(14px, 0.35vw + 12px, 15px);
  --text-base: clamp(15px, 0.50vw + 13px, 17px);
  --text-lg:   clamp(17px, 0.80vw + 14px, 20px);
  --text-xl:   clamp(22px, 1.60vw + 16px, 28px);
  --text-2xl:  clamp(32px, 2.60vw + 22px, 44px);
  --text-3xl:  clamp(42px, 4.00vw + 26px, 64px);
  --text-4xl:  clamp(48px, 8vw, 96px);

  /* Radius scale */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  /* 8px spacing scale */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
}

/* —— 3. BASE ———————————————————————————————————————————————————————————— */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--color-navy);
  color: var(--color-ink-soft);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  letter-spacing: 0;
  overflow-x: hidden;
}

::selection { background: var(--color-gold-deep); color: var(--color-navy); }
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--color-navy); }
::-webkit-scrollbar-thumb { background: #1b2547; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #2a3a72; }

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; font-size: inherit; color: inherit; }

/* —— 4. TYPOGRAPHY —————————————————————————————————————————————————————— */
h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }

a { color: var(--color-gold); text-decoration: none; }
a:not(.btn):not(.nav-link):not(.brand):not(.skip-link):not(.footer-brand):not(.social-link) {
  position: relative;
}
a:not(.btn):not(.nav-link):not(.brand):not(.skip-link):not(.footer-brand):not(.social-link)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
a:not(.btn):not(.nav-link):not(.brand):not(.skip-link):not(.footer-brand):not(.social-link):hover::after {
  transform: scaleX(1);
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--color-gold);
}

/* —— 5. UTILITIES ——————————————————————————————————————————————————————— */
.shell {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 32px;
}

.skip-link {
  position: absolute;
  top: -100%; left: 16px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--color-gold);
  color: var(--color-navy);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease,
              box-shadow 0.25s ease, border-color 0.25s ease;
}
.btn-gold {
  background: var(--color-gold);
  color: var(--color-navy);
  box-shadow: 0 10px 30px -12px rgba(217, 164, 65, 0.55);
}
.btn-gold:hover {
  background: var(--color-gold-hi);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -14px rgba(240, 198, 104, 0.65);
}
.btn-gold .arrow { transition: transform 0.25s ease; }
.btn-gold:hover .arrow { transform: translateX(4px); }

.btn-ghost {
  background: transparent;
  border-color: rgba(217, 164, 65, 0.30);
  color: var(--color-ink);
}
.btn-ghost:hover {
  background: rgba(217, 164, 65, 0.08);
  border-color: rgba(217, 164, 65, 0.50);
  transform: translateY(-2px);
}
.btn-sm { padding: 10px 18px; font-size: var(--text-xs); }

/* Reveal (JS adds .in via IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms cubic-bezier(.2, .7, .2, 1),
              transform 700ms cubic-bezier(.2, .7, .2, 1);
}
.reveal.in { opacity: 1; transform: translateY(0); }

.card-hover {
  transition: transform 0.35s cubic-bezier(.2, .7, .2, 1),
              box-shadow 0.35s ease, border-color 0.35s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -6px rgba(217, 164, 65, 0.15);
  border-color: rgba(217, 164, 65, 0.45);
}

/* —— 6. HEADER —————————————————————————————————————————————————————————— */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease,
              backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(12, 19, 48, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  max-width: 1240px;
  margin-inline: auto;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

/* Brand wordmark */
.brand { display: flex; align-items: center; gap: 12px; color: var(--color-ink); flex: none; }
.brand-mark { width: 30px; height: 30px; color: var(--color-gold); flex: none; }
.brand-text { line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--color-ink);
}
.brand-name .ai { color: var(--color-gold); }
.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--color-mute);
  margin-top: 4px;
}

/* Primary nav */
.nav-list { display: flex; align-items: center; gap: var(--space-3); list-style: none; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--color-ink-soft);
  padding: 6px 2px;
  transition: color 0.25s ease;
}
.nav-link:hover { color: var(--color-ink); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--color-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}
.nav-link:hover::after { transform: scaleX(1); }
.nav-caret {
  width: 9px; height: 9px;
  color: var(--color-mute);
  transition: transform 0.25s ease, color 0.25s ease;
}
.nav-link:hover .nav-caret { color: var(--color-gold); transform: rotate(180deg); }

.header-ctas { display: flex; align-items: center; gap: 12px; flex: none; }
.header-ctas .btn { padding: 11px 20px; }

/* Hamburger toggle (shown < 600px in responsive.css) */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--color-line-gold);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  padding: 10px;
  flex: none;
}
.nav-toggle svg { width: 100%; height: 100%; }

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 11, 26, 0.98);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.2, .7, .2, 1);
  visibility: hidden;
}
.drawer.open { transform: translateX(0); visibility: visible; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}
.drawer-close {
  width: 42px; height: 42px;
  border: 1px solid var(--color-line-gold);
  border-radius: var(--radius-sm);
  color: var(--color-ink);
  padding: 10px;
}
.drawer-nav { display: flex; flex-direction: column; gap: 6px; }
.drawer-nav .nav-link { font-size: 22px; padding: 12px 4px; font-family: var(--font-display); }
.drawer-ctas { margin-top: auto; display: grid; gap: 12px; }

/* —— 7. HERO ———————————————————————————————————————————————————————————— */
.hero {
  position: relative;
  min-height: 92vh;
  background: var(--color-navy);
  padding-top: calc(76px + var(--space-8));
  padding-bottom: var(--space-10);
  overflow: hidden;
}
.hero-circuit {
  position: absolute;
  top: 0; right: 0;
  width: 62%; height: 100%;
  pointer-events: none;
  color: var(--color-gold);
  opacity: 0.14;
}
.hero-skyline {
  position: absolute;
  left: 0; bottom: 0;
  width: min(720px, 60%);
  pointer-events: none;
  opacity: 0.06;
  color: var(--color-gold-hi);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
  align-items: start;
}
.hero-left  { grid-column: span 5; }
.hero-right { grid-column: span 7; }

.hero-eyebrow { display: flex; align-items: center; gap: 16px; margin-bottom: var(--space-4); }
.hero-eyebrow .rule { width: 40px; height: 2px; background: var(--color-gold); flex: none; }
.hero-title { margin-bottom: var(--space-4); }
.hero-title .line { display: block; }
.hero-title .line-gold { color: var(--color-gold); }
.hero-dek {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-ink-soft);
  max-width: 46ch;
  margin-bottom: var(--space-5);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: var(--space-6); }
.hero-highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); max-width: 560px; }
.highlight { display: flex; align-items: flex-start; gap: 10px; }
.highlight .glyph { font-family: var(--font-mono); font-size: 15px; color: var(--color-gold); line-height: 1.4; flex: none; }
.highlight .label { font-size: 13px; line-height: 1.45; color: var(--color-ink-soft); }

/* —— 8. DASHBOARD MOCKUP ———————————————————————————————————————————————— */
.dash-stage { position: relative; }
.laptop {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-line);
  background: linear-gradient(180deg, #101a3c, #0a1128);
  padding: 12px 12px 20px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.8),
              0 24px 60px -30px rgba(217, 164, 65, 0.15);
}
.laptop::after {
  content: "";
  position: absolute;
  left: -4%; right: -4%; bottom: -14px;
  height: 14px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: linear-gradient(180deg, #141f45, #0a1026);
  border: 1px solid var(--color-line);
  border-top: none;
}
.laptop-screen {
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(174, 182, 204, 0.08),
              inset 0 2px 18px rgba(0, 0, 0, 0.55);
}
.dash { display: grid; grid-template-columns: 46px 1fr; min-height: 420px; font-size: 12px; }
.dash-sidebar {
  background: rgba(14, 23, 51, 0.85);
  border-right: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}
.dash-sidebar .s-icon { width: 22px; height: 22px; color: var(--color-mute); }
.dash-sidebar .s-icon.active { color: var(--color-gold); }
.dash-main { padding: 18px 20px 20px; }
.dash-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.dash-title { font-weight: 600; font-size: 13px; color: var(--color-ink); letter-spacing: 0.01em; }
.dash-period {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-mute);
}
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi {
  background: rgba(14, 23, 51, 0.7);
  border: 1px solid var(--color-line);
  border-radius: 10px;
  padding: 10px 12px;
}
.kpi .k-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-mute);
  margin-bottom: 6px;
}
.kpi .k-value { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--color-ink); line-height: 1; }
.kpi .k-delta { font-family: var(--font-mono); font-size: 9px; margin-top: 5px; }
.kpi .k-delta.up { color: var(--color-live); }
.dash-charts { display: grid; grid-template-columns: 3fr 2fr; gap: 10px; margin-bottom: 14px; }
.chart-panel, .list-panel {
  background: rgba(14, 23, 51, 0.7);
  border: 1px solid var(--color-line);
  border-radius: 10px;
  padding: 12px 14px;
}
.panel-title {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-mute);
  margin-bottom: 10px;
}
.area-chart { width: 100%; height: 110px; }
.donut-wrap { display: flex; align-items: center; gap: 12px; }
.donut { width: 84px; height: 84px; flex: none; }
.donut-legend { display: grid; gap: 6px; }
.donut-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: var(--color-ink-soft); }
.donut-legend .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dash-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(174, 182, 204, 0.07);
  font-size: 10.5px;
  color: var(--color-ink-soft);
}
.list-row:last-child { border-bottom: none; }
.list-row .lr-meta { font-family: var(--font-mono); font-size: 9px; color: var(--color-mute); }
.pill {
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 999px;
}
.pill.live { color: var(--color-live); background: rgba(62, 207, 142, 0.10); border: 1px solid rgba(62, 207, 142, 0.35); }
.pill.gold { color: var(--color-gold); background: rgba(217, 164, 65, 0.08); border: 1px solid var(--color-line-gold); }

/* —— 9. FLOATING COMPONENTS ————————————————————————————————————————————— */
.float-card {
  position: absolute;
  background: rgba(14, 23, 51, 0.92);
  border: 1px solid var(--color-line-gold);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  animation: float-y 6s ease-in-out infinite;
  z-index: 3;
}
.listening-card { top: -28px; right: 0; width: 240px; animation-delay: 0s; }
.fc-eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-mute);
  margin-bottom: 4px;
}
.fc-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
  margin-bottom: 10px;
  min-height: 20px;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--color-live); animation: pulse 1.8s ease-in-out infinite; flex: none; }
.type-caret {
  display: inline-block;
  width: 2px; height: 14px;
  background: var(--color-gold);
  margin-left: 2px;
  animation: type-blink 1s step-end infinite;
}
.equalizer { display: flex; align-items: center; gap: 2px; height: 26px; }
.equalizer .eq-bar {
  flex: 1;
  height: 100%;
  background: var(--color-gold);
  border-radius: 1px;
  transform-origin: center;
  animation: eq-wave 1.1s ease-in-out infinite alternate;
  opacity: 0.9;
}
.equalizer.small { height: 18px; }
.hubspot-chip {
  top: 46%; right: -26px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  animation-delay: 1.4s;
}
.hubspot-chip .check { width: 18px; height: 18px; color: var(--color-live); flex: none; }
.hubspot-chip .chip-text { line-height: 1.3; }
.hubspot-chip .chip-name { font-size: 12px; font-weight: 600; color: var(--color-ink); }
.hubspot-chip .chip-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-live);
}
.agent-card { bottom: -26px; right: 8%; width: 250px; animation-delay: 2.6s; }
.agent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.agent-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-gold-deep));
  display: grid;
  place-items: center;
  color: var(--color-navy);
  flex: none;
}
.agent-avatar svg { width: 18px; height: 18px; }
.agent-name { font-size: 13px; font-weight: 600; color: var(--color-ink); }
.agent-msg { font-size: 12px; color: var(--color-ink-soft); margin-bottom: 10px; }
.connector {
  position: absolute;
  top: 12%; right: 6%;
  width: 190px; height: 170px;
  pointer-events: none;
  z-index: 2;
}
.connector path {
  stroke: var(--color-gold);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  fill: none;
  opacity: 0.55;
  animation: dash-march 1.6s linear infinite;
}

/* —— 10. KEYFRAMES (motion only when user allows it) ——————————————————— */
@media (prefers-reduced-motion: no-preference) {
  @keyframes eq-wave {
    0%   { transform: scaleY(0.15); }
    100% { transform: scaleY(1); }
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
  }
  @keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
  }
  @keyframes dash-march {
    to { stroke-dashoffset: -24; }
  }
  @keyframes type-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
  }
}
