/* ============================================
   GRIPPY CODE — Design System
   ============================================ */

:root {
  --bg: #050505;
  --surface: #0A0A0A;
  --surface-2: #141414;
  --surface-3: #1a1a1a;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --red: #FD6151;
  --red-hover: #E5554A;
  --red-glow: rgba(253, 97, 81, 0.35);
  --green: #34D399;
  --text-0: #ffffff;
  --text-1: #cfcfcf;
  --text-2: #999999;
  --text-3: #555555;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --shell: 1320px;
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text-0);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
/* full-bleed sections manage their own horizontal overflow to avoid blocking sticky */
.hero, .marquee, .big-marquee, .cap-rail, .phone-section, .final-cta, .mega-section {
  overflow-x: clip;
}

body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  min-height: 100vh;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: "zero"; }

/* ============== TYPOGRAPHY ============== */
h1, h2, h3, h4 { color: var(--text-0); font-weight: 800; line-height: 1.02; letter-spacing: -0.03em; }

.h-hero {
  font-size: clamp(44px, 6.5vw, 84px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.h-section {
  font-size: clamp(34px, 4.2vw, 56px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: pulseDot 1.6s infinite;
}
@keyframes pulseDot { 0%,100%{opacity:1} 50%{opacity:.3} }

.lead {
  font-size: clamp(17px, 1.4vw, 20px);
  color: var(--text-2);
  line-height: 1.55;
  max-width: 62ch;
}
/* In centered contexts the max-width:62ch block must auto-center, or it hugs the
   left under a wider (uncapped) heading. Scoped so left-aligned hero leads are untouched. */
.pricing-band .lead,
.shell[style*="text-align:center"] .lead,
.shell[style*="text-align: center"] .lead { margin-left: auto; margin-right: auto; }

/* ============== LAYOUT ============== */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 32px; }
section { position: relative; padding: 120px 0; }
section.tight { padding: 80px 0; }

/* ============== HEADER ============== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 32px;
  display: flex;
  justify-content: center;
  transition: all .4s var(--ease);
}
.header-inner {
  width: 100%;
  max-width: var(--shell);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0);
  border: 1px solid transparent;
  /* PERF: transition only the cheap properties, not `all` (which animates layout). */
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.header.scrolled .header-inner {
  background: rgba(10, 10, 10, 0.82);
  border-color: var(--border);
  /* PERF: lighter blur + no saturate — the 82%-opaque bg carries the frosted look,
     and a fixed element with a heavy backdrop-filter repaints every scroll frame
     (the cause of the laggy scroll on Safari/MacBook). */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* PERF: on mobile the nav is hidden and the backdrop-filter on the header still
   forces a compositing layer repaint on every scroll frame. Remove it entirely
   on small screens — the 82%-opaque background reads clearly without blur. */
@media (max-width: 768px) {
  .header.scrolled .header-inner {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 10, 10, 0.94);
  }
}

.logo {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.04em;
  color: var(--text-0);
  display: inline-flex;
  align-items: center;
}
.logo em {
  color: var(--red);
  font-style: normal;
  text-shadow: 0 0 12px var(--red-glow);
}

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  font-size: 14px;
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 500;
  transition: all .2s var(--ease);
}
.nav a:hover { color: var(--text-0); background: rgba(255,255,255,0.04); }

.header-cta { display: flex; gap: 10px; align-items: center; }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all .25s var(--ease);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 10px 30px -10px var(--red-glow), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: var(--red-hover); transform: translateY(-1px); box-shadow: 0 18px 40px -10px var(--red-glow), inset 0 1px 0 rgba(255,255,255,0.25); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-0);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ============== UTILITIES ============== */
.flex { display: flex; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; }
.divider { height: 1px; background: var(--border); width: 100%; }
.glow-text { background: linear-gradient(180deg, #fff 0%, #888 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.red-text { color: var(--red); }

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}
.tag-red { color: var(--red); border-color: rgba(253,97,81,0.3); background: rgba(253,97,81,0.08); }

/* ============== CARDS ============== */
.card {
  background: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: all .3s var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }

/* ============== FOOTER ============== */
.footer {
  border-top: 1px solid var(--border);
  padding: 80px 0 40px;
  background: var(--bg);
  position: relative;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}
.footer h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-3); margin-bottom: 18px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--text-2); font-size: 14px; transition: color .2s; }
.footer a:hover { color: var(--text-0); }
.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
}

/* ============== RESPONSIVE ============== */
@media (max-width: 1024px) {
  .nav { display: none; }
}
@media (max-width: 900px) {
  section { padding: 80px 0; }
  .shell { padding: 0 20px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 32px; }
  /* Brand block spans full width so the link columns align cleanly (kills the stagger) */
  .footer-grid > div:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
}
@media (max-width: 600px) {
  /* Reduce shell padding so cards get more breathing room on a 375px phone */
  .shell { padding: 0 16px; }
  /* Footer grid: 2-col is still fine at 375px but gap can tighten */
  .footer-grid { gap: 28px; }
  /* Footer bottom: stack copyright + links vertically and center them */
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }
  /* Header: reduce pill padding on very small screens */
  .header { padding: 10px 12px; }
  .header-inner { padding: 10px 14px; }
}

/* B153 — kill stray horizontal scroll. `clip` (not hidden) so position:sticky
   on the stack cards keeps working. */
html, body { overflow-x: clip; max-width: 100%; }

/* ============================================================
   PERF — prefers-reduced-motion
   Brand motion (marquees, reveals, smooth-scroll) plays for ALL
   users — reduced-motion or not. Only non-visible background
   repaints (spinning conic borders, ambient canvas loops) get
   stopped under reduced-motion, because those burn GPU with no
   perceptible benefit to any user.
   We never stop: marquees, reveals, floaty cards, pulseDot,
   Lenis smooth scroll, or the Three.js orb on desktop.
   ============================================================ */
/* (no reduced-motion overrides for brand/decorative motion) */

/* ============================================================
   PERF — mobile paint optimisations
   Remove expensive CSS effects that cost GPU compositing cycles
   on low-end phones but add little visible value at 390px width.
   ============================================================ */
@media (max-width: 768px) {
  /* The mobile overlay blur (backdrop-filter: blur(2px)) repaints
     the entire viewport every time the panel slides. Drop it — the
     semi-opaque background is sufficient at phone sizes. */
  .mobile-overlay {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(0, 0, 0, 0.75);
  }

  /* The aurora behind the phone section is a blur(40px) fixed element.
     On a 390px screen it covers the full width and forces a GPU compositing
     layer. At mobile the phone grid is already stacked, the glow barely
     reads — remove it. */
  .phone-section .aurora {
    display: none;
  }

  /* Disable the 3D perspective tilts on the dashboard and phone mockups —
     CSS perspective + transform on mobile causes compositing overhead and
     the tilt is barely perceptible on a flat phone screen anyway. */
  .dashboard {
    transform: none !important;
  }
  .dashboard:hover {
    transform: none !important;
  }
  .phone {
    transform: none !important;
  }
  .phone:hover {
    transform: none !important;
  }

  /* The recep-glow uses filter: blur(46px) and animates position on hover.
     On mobile there's no hover, so this is a constant paint cost with no benefit. */
  .recep-glow {
    display: none;
  }
}
