/* ── Design tokens ────────────────────────────────────────────────── */
:root {
  --bg:            #0A0A0B;
  --bg-elevated:   #111114;
  --bg-subtle:     #15151A;
  --border:        #1F1F25;
  --border-strong: #2A2A33;
  --fg:            #F4F4F5;
  --fg-muted:      #A1A1AA;
  --fg-subtle:     #71717A;
  --accent:        #6366F1;
  --accent-hover:  #818CF8;
  --success:       #10B981;
  --warn:          #F59E0B;
  --card-radius:   20px;
  --ease-expo:     cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body { scroll-behavior: smooth; }

a { color: inherit; }

/* Hide scrollbar while Lenis is active, but keep keyboard & wheel scrolling */
::selection { background: var(--accent); color: #fff; }

/* Set element defaults expected by GSAP reveal animations */
.hero-eyebrow,
.prob-eyebrow, .prob-h2,
.sol-eyebrow, .sol-h2,
.svc-eyebrow, .svc-h2,
.eng-eyebrow, .eng-h2,
.proc-eyebrow, .proc-h2,
.ts-eyebrow, .ts-h2,
.cs-eyebrow, .cs-h2,
.tm-eyebrow, .tm-h2,
.team-eyebrow, .team-h2, .team-body,
.faq-eyebrow, .faq-h2 { opacity: 0; }

.pillar-item,
.eng-card,
.tm-card,
.headshot,
.team-stat,
.faq-item,
.cta-sub, .cta-btn { opacity: 0; }

h1, h2, h3, h4, p, ul, blockquote { margin: 0; }

/* ── Shared pieces ────────────────────────────────────────────────── */
.section-padding {
  padding: clamp(64px, 10vw, 120px) clamp(24px, 5vw, 80px);
}

.eyebrow {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.2s var(--ease-expo), border-color 0.2s var(--ease-expo), color 0.2s, transform 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 8px 24px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { background: var(--accent-hover); }

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

/* Pills / chips */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 11px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Glass card */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Accent hairline */
.glow-line {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  opacity: 0.8;
}

/* ── Nav ──────────────────────────────────────────────────────────── */
#nav-links-wrap {
  display: flex;
  align-items: center;
  gap: 36px;
}
#nav-mobile-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}

@media (max-width: 820px) {
  #nav-mobile-btn { display: inline-flex; align-items: center; justify-content: center; }
  #nav-links-wrap {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 20px 24px 32px;
    background: rgba(10, 10, 11, 0.92);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s var(--ease-expo), opacity 0.3s var(--ease-expo);
  }
  #nav-links-wrap a {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px !important;
  }
  #nav-links-wrap.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  #nav-links-wrap .btn-primary { margin-top: 16px; width: 100%; }
}

/* ── Marquee (logo wall) ──────────────────────────────────────────── */
.marquee-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 40s linear infinite;
}
.marquee-wrap:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Process timeline ─────────────────────────────────────────────── */
@media (max-width: 820px) {
  .process-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .proc-track { display: none !important; }
  .process-step { text-align: left !important; padding: 0 !important; display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start; }
  .process-step .proc-dot { margin: 4px 0 !important; }
}

/* ── Services grid responsive ─────────────────────────────────────── */
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr !important; }
}

/* ── Engagement grid responsive ───────────────────────────────────── */
@media (max-width: 920px) {
  .eng-grid { grid-template-columns: 1fr !important; }
}

/* ── Case studies responsive ──────────────────────────────────────── */
@media (max-width: 980px) {
  .cs-header { grid-template-columns: 1fr !important; gap: 32px !important; align-items: start !important; }
  .cs-aggregate { max-width: 520px; }
}
@media (max-width: 820px) {
  .case-card { grid-template-columns: 1fr !important; }
  .case-mockup-panel {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding: 24px !important;
  }
  .case-content { padding: 28px !important; }
  .case-content > div:nth-child(4) { /* metrics grid */
    grid-template-columns: 1fr 1fr !important;
  }
  .case-content > div:nth-child(4) > div:nth-child(3) {
    grid-column: 1 / -1;
    border-left: none !important;
    padding-left: 0 !important;
    border-top: 1px solid var(--border);
    padding-top: 16px !important;
  }
}
@media (max-width: 540px) {
  .cs-aggregate { grid-template-columns: 1fr !important; }
}

/* ── Team responsive ──────────────────────────────────────────────── */
@media (max-width: 820px) {
  .team-grid { grid-template-columns: 1fr !important; gap: 48px !important; }
}

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none !important; }
}

/* ── Scroll progress bar ──────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.65);
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-expo);
  will-change: width;
}

/* ── Back-to-top button ───────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 150;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.3s var(--ease-expo), transform 0.3s var(--ease-expo),
              background 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--bg-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Hero pointer spotlight ───────────────────────────────────────── */
.hero-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(
    circle 180px at var(--sx, 50%) var(--sy, 40%),
    rgba(99, 102, 241, 0.22),
    rgba(99, 102, 241, 0.08) 40%,
    transparent 70%
  );
  mix-blend-mode: screen;
  transition: opacity 0.45s var(--ease-expo);
  will-change: background, opacity;
}
.hero-spotlight.visible { opacity: 1; }

/* ── Focus ring ───────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}
