/* HEXA-V design tokens — Dark techwear / industrial */
:root {
  /* Lava + mono palette */
  --bg: #080d1a;
  --bg-1: #0e1428;
  --bg-2: #141c38;
  --bg-3: #1c2648;
  --line: #2a3a6a;
  --line-2: #3a4e8a;
  --fg: #c8d4f0;
  --fg-1: #a8b8e0;
  --fg-2: #8090c0;
  --fg-3: #7888b8;
  --accent: #ff4500;     /* lava */
  --accent-1: #ff6a33;
  --accent-glow: rgba(255, 69, 0, 0.35);
  --blue: #2563eb;
  --blue-1: #1d4ed8;
  --blue-glow: rgba(37, 99, 235, 0.35);
  --good: #22c55e;
  --bad: #ef4444;

  --font-display: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

[data-theme="light"] {
  --bg: #f2f0ea;
  --bg-1: #e9e6dc;
  --bg-2: #ddd8c8;
  --bg-3: #c9c3b0;
  --line: #c9c3b0;
  --line-2: #aea88f;
  --fg: #0a0a0a;
  --fg-1: #2a2a2a;
  --fg-2: #555;
  --fg-3: #888;
  --accent: #ff3b00;
  --accent-1: #ff5a26;
  --accent-glow: rgba(255, 59, 0, 0.25);
}

/* base */
* { box-sizing: border-box; }
.hexa { font-family: var(--font-sans); color: var(--fg); background: var(--bg); }
.hexa .mono { font-family: var(--font-mono); }
.hexa .display { font-family: var(--font-display); letter-spacing: -0.02em; }

.tick::before { content: "▸ "; color: var(--accent); }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--accent); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 3px; color: var(--fg-1); background: var(--bg-1); }

.grid-bg {
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
}

.dotgrid-bg {
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}

.hexpattern {
  --hex-c: var(--line);
  background-color: transparent;
  background-image:
    linear-gradient(150deg, var(--hex-c) 1px, transparent 1px),
    linear-gradient(30deg,  var(--hex-c) 1px, transparent 1px),
    linear-gradient(90deg,  var(--hex-c) 1px, transparent 1px);
  background-size: 60px 104px;
}

/* scan / noise overlays */
.scanlines {
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(255,255,255,0.015) 2px, rgba(255,255,255,0.015) 3px);
}
.noise {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.08 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line-2); background: transparent; color: var(--fg);
  cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: #0a0a0a; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-1); color: #0a0a0a; border-color: var(--accent-1); box-shadow: 0 0 0 4px var(--accent-glow); }
.btn-block { padding: 16px 22px; font-size: 13px; }

/* card */
.card { background: var(--bg-1); border: 1px solid var(--line); position: relative; }
.card-corner { position: absolute; width: 10px; height: 10px; border: 1px solid var(--accent); }
.card-corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.card-corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.card-corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.card-corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-2);
}

.divider { height: 1px; background: var(--line); width: 100%; }

.tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid var(--line-2); padding: 3px 8px; color: var(--fg-1); display: inline-flex; align-items: center; gap: 6px;
}
.tag .dot { width: 5px; height: 5px; }

/* link */
.lnk { color: var(--fg-1); font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; }
.lnk:hover { color: var(--accent); }

/* scrolling marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track { display: flex; gap: 64px; animation: marquee 40s linear infinite; }

/* pulse */
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 8px rgba(255,69,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,69,0,0); }
}
.pulse { animation: pulseDot 1.8s infinite; }

/* number flicker */
@keyframes flicker { 0%{opacity:.85} 50%{opacity:1} 100%{opacity:.85} }
.flick { animation: flicker 2.2s infinite; }

/* product mock */
.win {
  background: var(--bg-1); border: 1px solid var(--line);
  display: grid; grid-template-rows: 36px 1fr;
}
.win-bar { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--fg-2); font-family: var(--font-mono); font-size: 11px; }
.win-bar .d { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--line-2); }

/* chart bars */
.bar { background: var(--bg-3); }
.bar-fill { background: var(--accent); }

/* spark */
.spark line { stroke: var(--accent); stroke-width: 1.5; fill: none; }

/* ============================================================
   ANIMATIONS — spring/bounce, slide-up, blob, timing
   ============================================================ */

/* Spring easing shorthand */
:root { --spring: cubic-bezier(0.68, -0.55, 0.27, 1.55); --ease-out-hard: cubic-bezier(0.22, 1, 0.36, 1); }

/* Load burst — elements scale in with overshoot */
@keyframes burstIn {
  0%   { opacity: 0; transform: scale(0.72) translateY(24px); }
  65%  { opacity: 1; transform: scale(1.04) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.burst { animation: burstIn 380ms var(--spring) both; }
.burst-1 { animation-delay: 60ms; }
.burst-2 { animation-delay: 120ms; }
.burst-3 { animation-delay: 180ms; }
.burst-4 { animation-delay: 240ms; }
.burst-5 { animation-delay: 300ms; }

/* Text slide-up with skew stagger */
@keyframes slideUpSkew {
  0%   { opacity: 0; transform: translateY(48px) skewY(4deg); }
  60%  { opacity: 1; transform: translateY(-6px) skewY(-1deg); }
  100% { opacity: 1; transform: translateY(0) skewY(0deg); }
}
.slide-up        { animation: slideUpSkew 340ms var(--spring) both; }
.slide-up.d1     { animation-delay: 80ms; }
.slide-up.d2     { animation-delay: 160ms; }
.slide-up.d3     { animation-delay: 240ms; }
.slide-up.d4     { animation-delay: 320ms; }
.slide-up.d5     { animation-delay: 400ms; }

/* Scroll-triggered slam — add .is-visible via JS IntersectionObserver */
.snap-in {
  opacity: 0;
  transform: translateY(60px) scale(0.96);
  transition: opacity 300ms var(--ease-out-hard), transform 300ms var(--ease-out-hard);
}
.snap-in.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Blob morph background */
@keyframes blobMorph {
  0%   { border-radius: 60% 40% 70% 30% / 50% 60% 40% 70%; transform: rotate(0deg) scale(1); }
  33%  { border-radius: 40% 70% 30% 60% / 70% 30% 60% 40%; transform: rotate(6deg) scale(1.06); }
  66%  { border-radius: 70% 30% 50% 50% / 30% 60% 70% 40%; transform: rotate(-4deg) scale(0.97); }
  100% { border-radius: 60% 40% 70% 30% / 50% 60% 40% 70%; transform: rotate(0deg) scale(1); }
}
.blob {
  animation: blobMorph 8s ease-in-out infinite;
  filter: blur(56px);
  pointer-events: none;
}
.blob-accent  { background: radial-gradient(circle, rgba(37,99,235,0.45), transparent 70%); }
.blob-lava    { background: radial-gradient(circle, rgba(255,69,0,0.28), transparent 70%); }

/* Button — breathing pulse + ripple */
.btn {
  position: relative;
  overflow: hidden;
  transition: transform 200ms var(--spring), border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.btn:hover  { transform: scale(1.04); }
.btn:active { transform: scale(0.97); }
.btn-primary:hover { box-shadow: 0 0 0 6px var(--accent-glow); }

/* Ripple on click */
.btn::after {
  content: "";
  position: absolute;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  transition: width 350ms ease, height 350ms ease, opacity 350ms ease;
  opacity: 0;
}
.btn:active::after { width: 200%; height: 200%; opacity: 0; }

/* Color bleed on hover for accent elements */
@keyframes hueBleed {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(18deg); }
  100% { filter: hue-rotate(0deg); }
}
.hue-live { animation: hueBleed 3s ease-in-out infinite; }

/* ============================================================
   SCREENSHOT PLACEHOLDER
   ============================================================ */
.screenshot-placeholder {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  min-height: 420px;
}
.screenshot-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.4;
}
.screenshot-placeholder .ph-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--fg-3);
  text-transform: uppercase;
  position: relative;
}
.screenshot-placeholder .ph-icon {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--fg-3);
  font-size: 22px;
  position: relative;
}

/* ============================================================
   MOBILE RESPONSIVE — full pass
   ============================================================ */

/* ── Prevent all horizontal overflow globally ── */
html, body { overflow-x: hidden; max-width: 100vw; }
* { min-width: 0; }

@media (max-width: 900px) {
  /* Nav */
  .hexa-nav-links    { display: none !important; }
  .hexa-nav-actions  { gap: 8px !important; }
  .hexa-topbar-left  { display: none !important; }
  .hexa-nav-wrap     { padding: 14px 16px !important; }

  /* Hero: stack cols */
  .hexa-hero-grid    { grid-template-columns: 1fr !important; }
  .hexa-hero-right   { border-top: 1px solid var(--line); border-right: none !important; display: none !important; }
  .hexa-hero-h1      { font-size: 52px !important; line-height: 1 !important; }

  /* Inline padding tightening — beats React inline styles */
  [style*="padding: 120px 32px"] { padding: 64px 20px !important; }
  [style*="padding: 128px 32px"] { padding: 64px 20px !important; }
  [style*="padding: 96px 32px"]  { padding: 56px 20px !important; }
  [style*="padding: 80px 32px"]  { padding: 48px 20px !important; }
  [style*="padding: 64px 32px"]  { padding: 40px 20px !important; }
  [style*="padding: 48px 32px"]  { padding: 32px 16px !important; }
  [style*="padding: 96px 48px"]  { padding: 56px 20px !important; }
  [style*="padding: 64px 48px"]  { padding: 40px 20px !important; }
  [style*="padding: 80px 32px 120px"] { padding: 48px 20px 64px !important; }

  /* Module grid: single col */
  .hexa-modules-grid { grid-template-columns: 1fr !important; }
  .hexa-modules-grid > div { border-right: none !important; border-bottom: 1px solid var(--line) !important; min-height: auto !important; }

  /* MLF section */
  .mlf-grid        { grid-template-columns: 1fr 1fr !important; }
  .mlf-quotes      { grid-template-columns: 1fr !important; }
  .mlf-h2          { font-size: 40px !important; }
  .sub-two-col     { grid-template-columns: 1fr !important; }

  /* Pricing */
  .pricing-grid    { grid-template-columns: 1fr !important; }
  .pricing-grid > div { border-right: none !important; border-bottom: 1px solid var(--line) !important; }

  /* Product mock: hide complex table, show description only */
  .hexa-product-grid   { grid-template-columns: 1fr !important; }
  .hexa-product-sticky { position: static !important; }
  .win                 { height: auto !important; overflow-x: auto !important; }

  /* Integrations 4-col → 2-col */
  .hexa-integrations-grid { grid-template-columns: 1fr 1fr !important; }
  .hexa-integrations-grid > div:nth-child(2n) { border-right: none !important; }

  /* Footer */
  .hexa-footer-grid  { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .footer-meta       { flex-direction: column !important; gap: 8px !important; }

  /* Founder */
  .founder-row       { grid-template-columns: 1fr !important; gap: 32px !important; }

  /* CTA headline — overrides inline font-size: 96px */
  .hexa-cta-h2       { font-size: 44px !important; line-height: 1 !important; }
  h2.hexa-cta-h2     { font-size: 44px !important; }

  /* Sub-page nav */
  .sub-nav           { padding: 14px 16px !important; }
  .sub-nav-links     { display: none !important; }
}

@media (max-width: 600px) {
  /* Nav */
  .hexa-nav-brand    { gap: 0 !important; }
  .hexa-nav-actions  { gap: 6px !important; }
  .hexa-nav-actions .btn { display: none !important; }
  .hexa-nav-actions .btn-primary { display: inline-flex !important; padding: 8px 12px !important; font-size: 10px !important; }

  /* Hero */
  .hexa-hero-h1      { font-size: 36px !important; line-height: 1 !important; }

  /* H1 / H2 inline font sizes — !important beats React inline styles */
  h1.display         { font-size: 36px !important; line-height: 1 !important; }
  h2.display         { font-size: 28px !important; line-height: 1.05 !important; }
  .sub-hero-h1       { font-size: 32px !important; }

  /* MLF */
  .mlf-grid          { grid-template-columns: 1fr !important; }
  .mlf-grid > div    { border-right: none !important; border-bottom: 1px solid var(--line) !important; }
  .mlf-h2            { font-size: 32px !important; }

  /* Pricing price number */
  .pricing-grid .display { font-size: 40px !important; }

  /* Footer */
  .hexa-footer-grid  { grid-template-columns: 1fr !important; }

  /* CTA */
  .hexa-cta-h2       { font-size: 32px !important; }

  /* Trust strip */
  .hexa-hero-trust   { flex-wrap: wrap !important; gap: 12px !important; }

  /* Sub-pages */
  .sub-two-col       { grid-template-columns: 1fr !important; }
  .sub-nav           { padding: 12px 16px !important; }

  /* Reduce section padding even more */
  [style*="padding: 120px 32px"] { padding: 48px 16px !important; }
  [style*="padding: 128px 32px"] { padding: 48px 16px !important; }
  [style*="padding: 96px 32px"]  { padding: 40px 16px !important; }
  [style*="padding: 80px 32px"]  { padding: 40px 16px !important; }
  [style*="padding: 96px 48px"]  { padding: 40px 16px !important; }
  [style*="padding: 64px 48px"]  { padding: 32px 16px !important; }
  [style*="padding: 80px 32px 120px"] { padding: 40px 16px 48px !important; }

  /* Flex CTAs wrap on small screens */
  [style*="display: flex"][style*="gap: 12"] { flex-wrap: wrap !important; }

  /* Screenshot placeholders */
  [style*="grid-template-columns: 1fr 1fr"][style*="screenshots"] { grid-template-columns: 1fr !important; }
}
