/*
 * Apex UK brand tokens - reused exactly from prospect-audit/web's real,
 * shipped identity (see brand_assets/palette.md). Fixed dark palette,
 * deliberately not a light/dark toggle, for continuity with the app and
 * the client-deck report this site's "See what you get" section echoes.
 */
:root {
  --bg: #0b0f1c;
  --surface: #121729;
  --surface-2: #171d33;
  --ink: #f5f6f8;
  --ink-secondary: #b8bfd1;
  --ink-muted: #7c8298;
  --line: #232a42;
  --line-soft: #1a2036;
  --accent: #22d3ee;
  --accent-deep: #0891b2;
  --violet: #a78bfa;
  --good: #34d399;

  --font-display: 'Space Grotesk', 'Geist Sans', Arial, sans-serif;
  --font-body: 'Geist Sans', Arial, Helvetica, sans-serif;
  --font-mono: 'Cascadia Code', Consolas, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: clip;
  max-width: 100vw;
  overscroll-behavior-x: none;
  line-height: 1.55;
}

a, button { touch-action: manipulation; }

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  font-weight: 600;
  text-wrap: balance;
}

.mono {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Three-step elevation, cyan-tinted shadows - never a flat shadow-md */
.elevated {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px -12px rgba(8,145,178,0.25);
}
.floating {
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 4px 8px rgba(0,0,0,0.45), 0 16px 40px -12px rgba(8,145,178,0.35);
}

/* Gradient text for the ascent motif */
.ascent-text {
  background: linear-gradient(100deg, var(--accent) 0%, var(--violet) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 10px;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #04141a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 10px 28px -10px rgba(34,211,238,0.45);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 14px 32px -10px rgba(34,211,238,0.6); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Nav link */
.nav-link {
  color: var(--ink-secondary);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  transition: color 150ms ease;
  padding: 6px 2px;
  position: relative;
}
.nav-link:hover, .nav-link:focus-visible { color: var(--ink); }
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.nav-link[aria-current="page"] { color: var(--accent); }

/* Card */
.card {
  border-radius: 16px;
  padding: 28px;
}

/* Eyebrow label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.12em;
}

/* Sparkline / ascent motif */
.sparkline-wrap { display: flex; align-items: flex-end; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #04141a;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Chatbot launcher / panel - deliberately siblings of anything with backdrop-filter, never descendants (see CLAUDE.md CSS trap note).
   Bottom-LEFT, not bottom-right: Netlify's own "Powered by Netlify" badge
   (a free-tier iframe injected via post-processing) occupies bottom-right
   and intercepts clicks there - confirmed live via Puppeteer's
   elementFromPoint returning the badge's iframe instead of the launcher. */
#apex-chat-launcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--violet) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.45), 0 16px 40px -12px rgba(8,145,178,0.45);
  transition: transform 150ms ease;
}
#apex-chat-launcher:hover { transform: scale(1.06); }
#apex-chat-launcher:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

#apex-chat-panel {
  position: fixed;
  left: 20px;
  bottom: 88px;
  z-index: 60;
  width: min(380px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 140px));
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
#apex-chat-panel.open { display: flex; }

/* Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 720px) {
  .container { padding: 0 18px; }
}
