/* ================================================================
   LIQUID ALGORITHM — shared design system
   AIKills.us · 2026
   ================================================================ */

:root {
  --void: #0A0A0A;
  --void-2: #050505;
  --gold: #D4AF37;
  --pink: #E91E63;
  --mist: #A1A1A1;
  --mist-dim: #5A5A5A;
  --scanline: 0.06;
  --grain: 0.05;
  --aberration: 1px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--void);
  color: #EDEDED;
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

/* ---- atmosphere ---- */
.void-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(212,175,55,0.05), transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 20%, rgba(233,30,99,0.06), transparent 60%),
    radial-gradient(ellipse 60% 80% at 15% 85%, rgba(212,175,55,0.04), transparent 60%),
    var(--void);
}
.scanlines {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 2px,
    rgba(255,255,255,calc(var(--scanline) * 1)) 2px,
    rgba(255,255,255,calc(var(--scanline) * 1)) 3px
  );
  mix-blend-mode: overlay;
}
.grain {
  position: fixed; inset: 0; z-index: 101; pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.vignette {
  position: fixed; inset: 0; z-index: 102; pointer-events: none;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 45%, rgba(0,0,0,0.65) 100%);
}

/* ---- typography: orphan prevention (global) ---- */
p, li, span, td, dd, blockquote {
  text-wrap: pretty;
}
h1, h2, h3, h4 {
  text-wrap: balance;
}

/* Manifesto body paragraphs */
.manifesto-para {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--mist);
  line-height: 1.9;
  margin: 0 auto 28px;
  max-width: 60ch;
  text-align: center;
  text-wrap: balance;
}
.display {
  font-family: 'Bricolage Grotesque', serif;
  font-weight: 800; font-stretch: 75%;
  letter-spacing: -0.05em; line-height: 0.86;
  text-wrap: balance;
}
.display-mono {
  font-family: 'Bricolage Grotesque', serif;
  font-weight: 700; font-stretch: 50%;
  letter-spacing: -0.06em; line-height: 0.82;
  text-wrap: balance;
}
.mono { font-family: 'JetBrains Mono', monospace; }
.ui   { font-family: 'Space Grotesk', sans-serif; }

/* ---- liquid gradient ---- */
.liquid-text {
  background-image: linear-gradient(95deg, var(--gold) 0%, #E89A4D 35%, var(--pink) 75%, #B8156A 100%);
  background-size: 250% 250%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: liquid-flow 12s ease-in-out infinite;
  filter: url(#liquid-melt-strong);
}
.liquid-text-extreme {
  background-image: linear-gradient(95deg, var(--gold) 0%, #FF6B35 30%, var(--pink) 65%, #B8156A 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: liquid-flow 10s ease-in-out infinite;
  filter: url(#liquid-melt-extreme);
}

@keyframes liquid-flow {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ---- bleed ---- */
.liquid-bleed { position: relative; overflow: hidden; }
.liquid-bleed::before {
  content: "";
  position: absolute; inset: -2px;
  background:
    radial-gradient(ellipse 60% 80% at 20% 30%, rgba(212,175,55,0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 70%, rgba(233,30,99,0.55), transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 90%, rgba(212,175,55,0.35), transparent 60%);
  mix-blend-mode: screen;
  filter: blur(18px);
  animation: bleed-swirl 16s linear infinite;
  opacity: 0.7; pointer-events: none;
}
@keyframes bleed-swirl {
  0%   { transform: rotate(0deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1.1); }
}

/* ---- liquid border ---- */
.liquid-border { position: relative; }
.liquid-border::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid transparent;
  background: linear-gradient(120deg, var(--gold), var(--pink), var(--gold)) border-box;
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: liquid-flow 8s ease-in-out infinite;
  pointer-events: none; border-radius: inherit;
}

/* ---- chromatic ---- */
.chromatic:hover {
  text-shadow:
    calc(var(--aberration) * -1) 0 var(--pink),
    var(--aberration) 0 var(--gold);
}

/* ---- shake ---- */
@keyframes chromatic-shake {
  0%, 100% { transform: translate(0,0); filter: none; }
  10%  { transform: translate(-3px, 1px);  filter: hue-rotate(-15deg); }
  20%  { transform: translate(3px, -1px);  filter: hue-rotate(20deg); }
  30%  { transform: translate(-2px, 2px); }
  40%  { transform: translate(2px, -2px);  filter: hue-rotate(-10deg); }
  50%  { transform: translate(-1px, 1px); }
  60%  { transform: translate(1px, -1px);  filter: hue-rotate(15deg); }
  70%  { transform: translate(-2px, 0); }
  80%  { transform: translate(2px, 0); }
  90%  { transform: translate(0, 1px); }
}
.shaking { animation: chromatic-shake 600ms ease-in-out; }
.shaking::before {
  content: ""; position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(circle at 50% 50%, rgba(233,30,99,0.18), transparent 70%);
  pointer-events: none; mix-blend-mode: screen;
  animation: flash 600ms ease-out;
}
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---- blink / pulse ---- */
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
.blink { animation: blink 1s steps(1) infinite; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(233,30,99,0.6); }
  50%       { transform: scale(1.15); opacity: 0.85; box-shadow: 0 0 0 8px rgba(233,30,99,0); }
}
.pulse-dot { animation: pulse-dot 1.6s ease-in-out infinite; }

/* ---- melt wobble ---- */
@keyframes glitch-x {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-1px, 0.5px); }
  40% { transform: translate(1px, -0.5px); }
  60% { transform: translate(-0.5px, 1px); }
  80% { transform: translate(0.5px, -1px); }
}
.melt { animation: glitch-x 7s ease-in-out infinite; }

/* ---- grid faint ---- */
.grid-faint {
  background-image:
    linear-gradient(rgba(161,161,161,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(161,161,161,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ---- terminal scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold), var(--pink)); border-radius: 3px; }

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

/* ---- card surface ---- */
.card-void {
  background: rgba(8,8,8,0.82);
  border: 1px solid rgba(161,161,161,0.1);
  backdrop-filter: blur(6px);
}

/* ================================================================
   RESPONSIVE HELPERS
   ================================================================ */

/* Nav */
.nav-items { display: flex; gap: 24px; }
.nav-live   { display: flex; }
.mobile-bottom-nav { display: none; }
.mobile-bottom-spacer { display: none; }

/* Layout grids */
.hero-grid     { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.two-col       { display: grid; grid-template-columns: 1fr 1fr;   gap: 16px; }
.three-col     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.featured-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0; align-items: stretch; }
.stats-grid    { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Padding helpers */
.px-page { padding-left: 40px; padding-right: 40px; }
.py-section-lg { padding-top: 100px; padding-bottom: 100px; }
.py-section    { padding-top: 60px;  padding-bottom: 60px; }

/* Pulse inner */
.pulse-pad      { padding: 64px 72px 56px; }
.pulse-cmd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* Featured */
.featured-left  { padding: 56px 56px 56px 0; }
.featured-right { padding: 44px 40px; }

/* Toll row */
.toll-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }

/* CTA row */
.cta-row { display: flex; align-items: flex-end; gap: 40px; flex-wrap: wrap; }

/* ---- tablet ---- */
@media (max-width: 1024px) {
  .hero-grid     { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .three-col     { grid-template-columns: 1fr 1fr; }
  .stats-grid    { grid-template-columns: 1fr 1fr; }
}

/* ---- mobile ---- */
@media (max-width: 768px) {
  body           { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .px-page        { padding-left: 20px; padding-right: 20px; }
  .py-section-lg  { padding-top: 60px; padding-bottom: 60px; }
  .py-section     { padding-top: 40px; padding-bottom: 40px; }
  .nav-items      { display: none; }
  .nav-live       { display: none; }
  .mobile-bottom-spacer { display: block; height: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mobile-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    pointer-events: none;
    padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-bottom-nav-bar {
    pointer-events: auto;
    border: 1px solid rgba(161,161,161,0.18);
    background: linear-gradient(
      180deg,
      rgba(16,16,16,0.96) 0%,
      rgba(6,6,6,0.96) 100%
    );
    backdrop-filter: blur(14px);
    box-shadow:
      0 -10px 28px rgba(0,0,0,0.45),
      inset 0 1px 0 rgba(255,255,255,0.03);
    border-radius: 18px;
    overflow: hidden;
  }
  .mobile-bottom-nav-list {
    min-height: 70px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: stretch;
  }
  .mobile-bottom-nav-item {
    min-width: 0;
    padding: 8px 4px 7px;
    text-decoration: none;
    color: var(--mist);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-top: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  }
  .mobile-bottom-nav-item.active {
    color: #EDEDED;
    border-top-color: var(--pink);
    background: radial-gradient(ellipse at 50% 0%, rgba(233,30,99,0.18), transparent 70%);
  }
  .mobile-bottom-nav-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1;
  }
  .mobile-bottom-nav-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.06em;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
  .two-col        { grid-template-columns: 1fr; }
  .three-col      { grid-template-columns: 1fr; }
  .stats-grid     { grid-template-columns: 1fr; }
  .featured-left  { padding: 32px 0; }
  .featured-right { padding: 28px 20px; }
  .pulse-pad      { padding: 28px 20px 24px; }
  .pulse-cmd-grid { grid-template-columns: 1fr 1fr; }
  .toll-bottom    { flex-direction: column; align-items: flex-start; gap: 20px; }
  .cta-row        { flex-direction: column; align-items: flex-start; }
  .hide-mobile    { display: none !important; }
  .footer-grid    { grid-template-columns: 1fr 1fr !important; gap: 28px !important; }
}

@media (max-width: 480px) {
  .pulse-cmd-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .featured-grid  { grid-template-columns: 1fr; }
  .footer-grid    { grid-template-columns: 1fr !important; }
}

@media (max-width: 390px) {
  .mobile-bottom-nav-bar {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .mobile-bottom-nav-bar::-webkit-scrollbar { display: none; }
  .mobile-bottom-nav-list {
    display: flex;
    min-width: max-content;
  }
  .mobile-bottom-nav-item {
    min-width: 62px;
  }
}
