:root {
  --bg-0: #05050a;
  --bg-1: #08070f;
  --bg-2: #0c0a16;
  --bg-card: rgba(14, 12, 24, 0.6);
  --bg-card-hover: rgba(22, 18, 38, 0.8);

  --violet-900: #1a0b3d;
  --violet-800: #2d1173;
  --violet-700: #4c1d95;
  --violet-600: #6d28d9;
  --violet-500: #7c3aed;
  --violet-400: #a855f7;
  --violet-300: #c084fc;
  --violet-200: #d8b4fe;

  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --cyan-300: #67e8f9;

  --text-0: #ffffff;
  --text-1: #e7e5f0;
  --text-2: #9b96b0;
  --text-3: #5f5a75;
  --text-4: #2e2940;

  --border-0: rgba(255, 255, 255, 0.04);
  --border-1: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --border-violet: rgba(168, 85, 247, 0.3);

  --glow-violet: 0 0 80px rgba(124, 58, 237, 0.4);
  --glow-cyan: 0 0 30px rgba(34, 211, 238, 0.3);

  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --font-sans: 'Geist', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html, body { background: var(--bg-0); color: var(--text-1); }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.55;
  font-size: 15px;
}

#root { isolation: isolate; }

.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.92;
  color: var(--text-0);
}
.sans { font-family: var(--font-sans); }
.mono { font-family: var(--font-mono); }

::selection { background: var(--violet-600); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: #2a2440; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet-800); }

/* Utility */
.container { max-width: 1400px; margin: 0 auto; padding: 0 48px; }
@media (max-width: 900px) { .container { padding: 0 24px; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-accent { color: var(--violet-300); }
.eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* Grain */
.noise::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: #ffffff;
  color: #0a0814;
}
.btn-primary:hover {
  background: var(--violet-300);
  color: #0a0814;
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text-0);
  border-color: var(--border-2);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); }

.btn-violet {
  background: var(--violet-500);
  color: #fff;
  box-shadow: 0 8px 40px rgba(124, 58, 237, 0.4);
}
.btn-violet:hover {
  background: var(--violet-400);
  transform: translateY(-1px);
  box-shadow: 0 12px 50px rgba(124, 58, 237, 0.55);
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 1s cubic-bezier(.2,.8,.2,1), transform 1s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* Section padding */
section { position: relative; padding: 160px 0; }
@media (max-width: 900px) { section { padding: 100px 0; } }

/* Hairline */
.hairline {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2), transparent);
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-1);
  letter-spacing: 0.02em;
}
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--violet-400); box-shadow: 0 0 8px var(--violet-400); }

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 280px;
  background: rgba(8, 7, 15, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 18px;
  z-index: 1000;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  font-family: var(--font-sans);
  font-size: 12px;
}
.tweaks-panel h4 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--text-2); text-transform: uppercase; margin-bottom: 14px; }
.tweak-row { display: flex; gap: 6px; margin-bottom: 10px; }
.tweak-chip {
  flex: 1;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border-1);
  color: var(--text-2);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: all 0.15s;
}
.tweak-chip:hover { border-color: var(--border-2); color: var(--text-0); }
.tweak-chip.active { background: var(--text-0); border-color: var(--text-0); color: var(--bg-0); }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes rotateY3d {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nodePulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes heroSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Category chip — services-style hover sweep */
.cat-chip {
  position: relative;
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-2);
  padding: 12px 22px;
  border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  isolation: isolate;
}
.cat-chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  transition: color 0.25s;
  position: relative;
  z-index: 1;
}
.cat-chip-label { position: relative; z-index: 1; }
.cat-chip::before {
  /* The violet sweep, same language as service rows */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(168,85,247,0.18), rgba(168,85,247,0.06) 60%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
  z-index: 0;
}
.cat-chip:hover:not(.is-active) {
  border-color: rgba(168, 85, 247, 0.5);
  color: var(--text-0);
}
.cat-chip:hover:not(.is-active)::before { transform: translateX(0); }
.cat-chip:hover:not(.is-active) .cat-chip-count { color: var(--violet-300); }

.cat-chip.is-active {
  background: var(--text-0);
  color: var(--bg-0);
  border-color: var(--text-0);
}
.cat-chip.is-active .cat-chip-count { color: rgba(0,0,0,0.5); }
.cat-chip.is-active::before { display: none; }

/* Testimonials carousel */
.testimonials-viewport {
  overflow: hidden;
  position: relative;
}
.testimonials-track {
  display: flex;
  gap: 20px;
  transition: transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.testimonials-track.no-transition { transition: none; }
.testimonial-slide {
  flex: 0 0 calc((100% - 40px) / 3);
}
@media (max-width: 900px) {
  .testimonial-slide { flex: 0 0 100%; }
}

/* Ecosystem ticker */
.ticker-viewport {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.ticker-track {
  display: inline-flex;
  gap: 48px;
  padding: 0 24px;
  animation: tickerScroll 48s linear infinite;
  will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-track.reverse { animation-direction: reverse; animation-duration: 60s; }

/* Gradient text */
.gradient-text {
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.5) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-violet {
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Responsive / mobile ===== */
@media (max-width: 1100px) {
  .section-header-2col { grid-template-columns: 1fr !important; gap: 32px !important; align-items: start !important; }
  .service-row { grid-template-columns: 60px 1.5fr 1fr auto !important; gap: 20px !important; }
  .service-row .service-desc { display: none; }
}

@media (max-width: 900px) {
  .nav-links > a { display: none !important; }
  .nav-links .btn { display: inline-flex !important; }
  .hero-stats { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .hero-bottom-row { flex-direction: column !important; align-items: flex-start !important; }
  .platform-grid { grid-template-columns: 1fr !important; gap: 24px !important; }
  .trust-grid { grid-template-columns: 1fr !important; }

  /* Services */
  .service-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 24px 0 !important;
  }
  .service-row .service-desc { display: block; font-size: 13px !important; }
  .service-row .service-arrow { display: none !important; }

  /* Generic auto-fit grids already collapse. */
  section { padding: 80px 0 !important; }
  .display { line-height: 1; }
  h1, h2 { text-wrap: balance; }

  /* CVE + platform tables — simpler stack */
  .cve-row { grid-template-columns: 1fr !important; gap: 4px !important; }
  .platform-split { grid-template-columns: 1fr !important; }
  .platform-bullets { grid-template-columns: 1fr !important; }
  .platform-nav { position: static !important; top: auto !important; flex-direction: row !important; flex-wrap: wrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 8px !important; }
  .platform-nav > button { flex: 1 1 calc(50% - 4px); min-width: 0; padding: 12px 14px !important; }

  /* Platform mocks — keep bounded, allow internal scroll */
  .platform-mock-shell { min-width: 0 !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  .platform-mock-shell > * { min-width: 0; }

  /* Platform detail card padding tighter */
  .platform-detail-card { padding: 24px !important; }
  .platform-detail-card h3 { font-size: 24px !important; }
  .mock-findings { grid-template-columns: 1fr !important; }
  .mock-sev { grid-template-columns: repeat(2, 1fr) !important; }

  /* Hide hacker on mobile — too dense */
  .hacker-layer { opacity: 0.25 !important; }

  /* Tweaks panel smaller */
  .tweaks-panel { width: calc(100vw - 32px); right: 16px; bottom: 16px; }

  /* Footer stack */
  footer .container { flex-direction: column !important; text-align: center; align-items: center !important; }
}

@media (max-width: 560px) {
  .container { padding: 0 20px !important; }
  .hero-stats { grid-template-columns: 1fr !important; }
  .btn { padding: 12px 18px !important; font-size: 13px !important; }
  .eyebrow { font-size: 10px !important; letter-spacing: 0.18em !important; }
}
