/* =========================================================
   Zaher Mourad — personal site
   ========================================================= */

:root {
  --bg: #05060a;
  --bg-alt: #0a0c14;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-strong: rgba(255, 255, 255, 0.055);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #f1f3f9;
  --text-muted: #9aa3b8;
  --text-faint: #636b80;

  --c1: #22d3ee;   /* cyan */
  --c2: #8b5cf6;   /* violet */
  --c3: #ec4899;   /* magenta, used sparingly */
  --grad: linear-gradient(110deg, var(--c1), var(--c2) 55%, var(--c3));
  --grad-2: linear-gradient(120deg, var(--c1), var(--c2));
  --live: #34d399;

  --radius: 18px;
  --radius-lg: 26px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --container: 1200px;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.06; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.3rem); font-weight: 700; }
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 600; }
h3 { font-size: 1.22rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
p  { margin: 0; }
a  { color: inherit; text-decoration: none; }
::selection { background: rgba(139, 92, 246, .45); }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }

.gradient-text {
  background: var(--grad);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

/* =========================================================
   Backdrop layers
   ========================================================= */
#neural {
  position: fixed; inset: 0; z-index: -3;
  width: 100%; height: 100%;
  pointer-events: none;
}
.aurora { position: fixed; inset: 0; z-index: -4; overflow: hidden; pointer-events: none; }
.aurora__blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .5;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora__blob--1 { width: 620px; height: 620px; top: -180px; right: -120px; background: var(--c2); opacity: .35; }
.aurora__blob--2 { width: 520px; height: 520px; top: 30%; left: -220px; background: var(--c1); opacity: .18; animation-duration: 28s; }
.aurora__blob--3 { width: 420px; height: 420px; bottom: -160px; right: 20%; background: var(--c3); opacity: .14; animation-duration: 34s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-80px, 60px) scale(1.12); }
  100% { transform: translate(60px, -40px) scale(.95); }
}
.grain {
  position: fixed; inset: -50%; z-index: -2; pointer-events: none; opacity: .05;
  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='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .12), transparent);
  transform: translate3d(var(--cx, -999px), var(--cy, -999px), 0);
  transition: transform .15s linear;
}
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100;
  background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* =========================================================
   Reveal on scroll
   ========================================================= */
.js .reveal {
  opacity: 0; transform: translateY(28px); filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 110ms);
}
.js .reveal.is-in { opacity: 1; transform: none; filter: none; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; border: 1px solid transparent;
  font: 600 .95rem/1 var(--font-body);
  cursor: pointer; white-space: nowrap; isolation: isolate;
  transition: transform .25s var(--ease), box-shadow .25s ease, background .25s ease, border-color .25s ease;
}
.btn--primary {
  background: var(--grad-2); color: #05060a;
  box-shadow: 0 10px 40px -10px rgba(139, 92, 246, .8), inset 0 1px 0 rgba(255,255,255,.35);
  overflow: hidden;
}
.btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sheen 4s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.btn--primary:hover { box-shadow: 0 16px 50px -8px rgba(139, 92, 246, .95), inset 0 1px 0 rgba(255,255,255,.35); }
.btn--ghost { background: rgba(255,255,255,.04); border-color: var(--border-strong); color: var(--text); backdrop-filter: blur(8px); }
.btn--ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); }
.btn--small { padding: 10px 18px; font-size: .85rem; }
.btn--large { padding: 18px 34px; font-size: 1.05rem; }

/* =========================================================
   Nav
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(5, 6, 10, .6);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; }
.brand__mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--grad-2); color: #05060a; font-size: .85rem; font-weight: 700;
  box-shadow: 0 0 24px rgba(139, 92, 246, .5);
}
.nav__links { display: flex; gap: 34px; font-size: .9rem; color: var(--text-muted); }
.nav__links a { transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__links .mono { color: var(--c1); font-size: .72rem; margin-right: 4px; }

/* Menu button: phones only */
.nav__toggle {
  display: none; flex: none; width: 42px; height: 42px; margin-left: -12px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border-radius: 12px; border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.04); cursor: pointer;
}
.nav__toggle span {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform .3s var(--ease), opacity .2s;
}
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HUD labels / terminal
   ========================================================= */
.hud {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font: 500 .76rem/1.4 var(--font-mono); letter-spacing: .14em; color: var(--c1);
  margin-bottom: 22px;
}
.hud__bracket { color: var(--c2); }
.hud__x { color: var(--text-faint); }

.terminal {
  margin-top: 34px; font: .85rem/1.4 var(--font-mono); color: var(--text-muted);
  display: flex; align-items: center; gap: 10px; min-height: 1.4em;
}
.terminal__prompt { color: var(--live); }
.terminal__caret { width: 8px; height: 1.1em; background: var(--c1); animation: blink 1s steps(1) infinite; margin-left: -6px; }
@keyframes blink { 50% { opacity: 0; } }

/* =========================================================
   Hero
   ========================================================= */
.hero { position: relative; padding: 64px 0 0; }
.hero__inner {
  display: grid; grid-template-columns: 1fr 1.08fr; gap: 64px; align-items: center;
  padding-bottom: 80px;
}
.hero h1 .scramble { display: block; min-height: 1.06em; white-space: nowrap; }
/* let grid columns shrink instead of widening the page */
.hero__copy, .avatar { min-width: 0; }
.lead { margin-top: 26px; font-size: 1.14rem; color: var(--text-muted); max-width: 33rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* =========================================================
   Avatar
   ========================================================= */
.avatar { position: relative; }
.avatar__border {
  position: relative; padding: 1.5px; border-radius: var(--radius-lg);
  overflow: hidden; isolation: isolate;
  box-shadow: 0 50px 100px -40px rgba(0,0,0,.9), 0 0 120px -30px rgba(139, 92, 246, .55);
}
.avatar__border::before {
  content: ""; position: absolute; inset: -50%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 55%, var(--c1) 70%, var(--c2) 82%, var(--c3) 90%, transparent 100%);
  animation: spin 6s linear infinite;
}
.avatar__border::after {
  content: ""; position: absolute; inset: 0; z-index: -2; border-radius: inherit;
  background: rgba(255,255,255,.08);
}
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }

.avatar__frame {
  border-radius: calc(var(--radius-lg) - 1.5px); overflow: hidden;
  background: linear-gradient(180deg, #0f1220, #080a12);
}
.avatar__topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); font-size: .76rem; color: var(--text-faint);
}
.avatar__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar__dots { display: flex; gap: 6px; }
.avatar__dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.12); }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px;
  background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .25); color: var(--live);
  font: 600 .66rem/1.3 var(--font-mono); letter-spacing: .1em; white-space: nowrap;
}
.live-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; animation: pulse 1.4s infinite; }
.live-pill.is-live { background: rgba(236, 72, 153, .12); border-color: rgba(236, 72, 153, .35); color: #f472b6; }
@keyframes pulse { 50% { opacity: .3; } }

.avatar__stage {
  position: relative; aspect-ratio: 4 / 3;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(139, 92, 246, .18), transparent 65%),
    #05060a;
}
.avatar__stage tavus-embed { position: absolute; inset: 0; display: block; width: 100%; height: 100%; z-index: 1; }

.corner { position: absolute; width: 22px; height: 22px; z-index: 2; pointer-events: none; border-color: var(--c1); border-style: solid; opacity: .8; }
.corner--tl { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
.corner--tr { top: 12px; right: 12px; border-width: 2px 2px 0 0; }
.corner--bl { bottom: 12px; left: 12px; border-width: 0 0 2px 2px; }
.corner--br { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }
.scanline {
  position: absolute; left: 0; right: 0; height: 90px; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(34, 211, 238, .08), transparent);
  animation: scan 5s linear infinite;
}
@keyframes scan { from { top: -90px; } to { top: 100%; } }
.avatar.is-live .scanline, .avatar.is-live .corner { opacity: 0; transition: opacity .4s; }

.avatar__footer {
  display: flex; align-items: center; gap: 16px; padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.avatar__hint { font-size: .72rem; color: var(--text-faint); }

.wave { display: flex; align-items: center; gap: 3px; height: 24px; }
.wave i {
  width: 3px; height: 100%; border-radius: 3px; background: var(--grad-2);
  transform: scaleY(.25); animation: wave 1.2s ease-in-out infinite;
}
.wave i:nth-child(2n)  { animation-delay: -.2s; }
.wave i:nth-child(3n)  { animation-delay: -.45s; }
.wave i:nth-child(4n)  { animation-delay: -.7s; }
.wave i:nth-child(5n)  { animation-delay: -.95s; }
@keyframes wave { 0%, 100% { transform: scaleY(.2); } 50% { transform: scaleY(1); } }

.chip {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  font: 500 .75rem/1 var(--font-mono); color: var(--text);
  background: rgba(15, 18, 32, .75); border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.8);
  animation: float 6s ease-in-out infinite;
}
.chip svg { color: var(--c1); }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 10px var(--live); }
.chip--tl { top: -16px; left: -26px; }
.chip--br { bottom: 48px; right: -28px; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* =========================================================
   Marquee
   ========================================================= */
.marquee {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee__track span {
  display: inline-flex; align-items: center; gap: 48px; padding: 22px 24px;
  font: 500 1rem/1 var(--font-display); color: var(--text-faint); letter-spacing: .02em; white-space: nowrap;
}
.marquee__track span::after { content: "✦"; color: var(--c2); font-size: .7rem; margin-left: 24px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* =========================================================
   Sections
   ========================================================= */
.section { position: relative; padding: 120px 0; }
.section__head { max-width: 44rem; margin-bottom: 60px; }
.section__lead { margin-top: 18px; color: var(--text-muted); font-size: 1.08rem; }
.card__kicker { font-size: .72rem; color: var(--c1); letter-spacing: .08em; margin-bottom: 8px; }

/* ---------- Cards (shared) ---------- */
.cards { display: grid; gap: 20px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--2 { grid-template-columns: repeat(2, 1fr); }

.card, .tile {
  position: relative; overflow: hidden;
  padding: 30px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  transition: border-color .3s ease, transform .5s var(--ease), opacity .9s var(--ease), filter .9s var(--ease);
  transform-style: preserve-3d;
}
.card h3, .tile h3 { margin-bottom: 10px; }
.card p:not(.card__kicker), .tile p:not(.card__kicker) { color: var(--text-muted); font-size: .96rem; }

/* Mouse-follow spotlight */
.spot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 92, 246, .16), transparent 45%);
}
.spot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  border-radius: inherit; padding: 1px;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, .8), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.spot:hover::before, .spot:hover::after { opacity: 1; }
.spot:hover { border-color: var(--border-strong); }

/* ---------- Mini visuals ---------- */
.viz {
  position: relative; height: 110px; margin: -6px -6px 22px; border-radius: 12px;
  background: rgba(0,0,0,.25); border: 1px solid var(--border); overflow: hidden;
}
.viz--bars { display: flex; align-items: flex-end; gap: 8px; padding: 16px 18px; }
.viz--bars i {
  flex: 1; height: 100%; border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, var(--c1), rgba(139, 92, 246, .3));
  transform-origin: bottom; transform: scaleY(var(--h));
  animation: bars 2.4s var(--ease) infinite alternate; animation-delay: var(--t);
}
@keyframes bars { from { transform: scaleY(calc(var(--h) * .35)); } to { transform: scaleY(var(--h)); } }

.viz--line svg { position: absolute; inset: 14px 14px 10px; width: calc(100% - 28px); height: calc(100% - 24px); overflow: visible; }
.viz__grid { stroke: rgba(255,255,255,.06); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.viz__path {
  fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 4s var(--ease) infinite;
}
.viz__area { opacity: 0; animation: area 4s var(--ease) infinite; }
@keyframes draw { 0% { stroke-dashoffset: 400; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes area { 0%, 25% { opacity: 0; } 55%, 85% { opacity: 1; } 100% { opacity: 0; } }
.viz__ping {
  position: absolute; top: 18px; right: 12px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c2); box-shadow: 0 0 0 0 rgba(139, 92, 246, .7); animation: ping 2s infinite;
}
@keyframes ping { 70% { box-shadow: 0 0 0 14px rgba(139, 92, 246, 0); } 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); } }

.viz--net svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
.net__edges path { stroke: rgba(255,255,255,.1); stroke-width: 1; fill: none; }
.net__signals path {
  stroke: var(--c1); stroke-width: 2; fill: none; stroke-linecap: round;
  stroke-dasharray: 18 400; stroke-dashoffset: 18; filter: drop-shadow(0 0 4px var(--c1));
  animation: signal 2.4s linear infinite;
}
@keyframes signal { to { stroke-dashoffset: -200; } }
.net__nodes circle { fill: #0b0e1a; stroke: var(--c2); stroke-width: 2; animation: node 2.4s ease-in-out infinite; }
@keyframes node { 50% { fill: var(--c2); filter: drop-shadow(0 0 6px var(--c2)); } }

/* ---------- Bento ---------- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tile { display: flex; flex-direction: column; justify-content: flex-end; min-height: 280px; }
.tile--wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.tile__viz { margin-bottom: 24px; }
.tile--wide .tile__viz { margin: 0; }
.tile--glow { background: radial-gradient(500px 200px at 20% 50%, rgba(139, 92, 246, .16), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); }

.platforms { display: flex; flex-wrap: wrap; gap: 10px; }
.platforms span {
  padding: 10px 16px; border-radius: 999px; font: 500 .82rem/1 var(--font-mono);
  border: 1px solid var(--border-strong); color: var(--text-muted); background: rgba(0,0,0,.3);
  animation: light 6s infinite;
}
.platforms span:nth-child(2) { animation-delay: 1s; }
.platforms span:nth-child(3) { animation-delay: 2s; }
.platforms span:nth-child(4) { animation-delay: 3s; }
.platforms span:nth-child(5) { animation-delay: 4s; }
.platforms span:nth-child(6) { animation-delay: 5s; }
@keyframes light {
  0%, 20%, 100% { color: var(--text-muted); border-color: var(--border-strong); box-shadow: none; }
  8% { color: var(--text); border-color: var(--c1); box-shadow: 0 0 20px -4px var(--c1); }
}

.clusters { position: relative; height: 90px; }
.clusters i {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  animation: cluster 6s var(--ease) infinite alternate;
}
.clusters i:nth-child(3n+1) { background: var(--c1); box-shadow: 0 0 12px var(--c1); --x: 12%; }
.clusters i:nth-child(3n+2) { background: var(--c2); box-shadow: 0 0 12px var(--c2); --x: 46%; }
.clusters i:nth-child(3n)   { background: var(--c3); box-shadow: 0 0 12px var(--c3); --x: 80%; }
.clusters i:nth-child(1) { top: 70%; left: 60%; --y: 20%; }
.clusters i:nth-child(2) { top: 10%; left: 20%; --y: 30%; }
.clusters i:nth-child(3) { top: 40%; left: 5%;  --y: 25%; }
.clusters i:nth-child(4) { top: 20%; left: 75%; --y: 55%; }
.clusters i:nth-child(5) { top: 80%; left: 30%; --y: 60%; }
.clusters i:nth-child(6) { top: 50%; left: 50%; --y: 50%; }
.clusters i:nth-child(7) { top: 5%;  left: 45%; --y: 80%; }
.clusters i:nth-child(8) { top: 60%; left: 88%; --y: 85%; }
.clusters i:nth-child(9) { top: 30%; left: 35%; --y: 75%; }
@keyframes cluster { 0%, 20% { } 70%, 100% { top: var(--y); left: var(--x); } }

.docs { display: grid; gap: 10px; padding: 18px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--border); }
.docs i {
  display: block; height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); position: relative; overflow: hidden;
}
.docs i::after {
  content: ""; position: absolute; inset: 0; width: var(--w); border-radius: inherit; background: var(--grad-2);
  transform-origin: left; animation: fill 3.2s var(--ease) infinite;
}
.docs i:nth-child(2)::after { animation-delay: .25s; }
.docs i:nth-child(3)::after { animation-delay: .5s; }
.docs i:nth-child(4)::after { animation-delay: .75s; }
@keyframes fill { 0% { transform: scaleX(0); } 45%, 80% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

.wave--big { height: 110px; gap: 6px; justify-content: center; }
.wave--big i { width: 6px; }

.link { color: var(--c1); font-weight: 500; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* ---------- Build cards ---------- */
.card--build { padding: 34px; }
.icon {
  width: 52px; height: 52px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .16));
  border: 1px solid rgba(139, 92, 246, .35);
  box-shadow: 0 0 30px -8px rgba(139, 92, 246, .6);
}
.icon svg { width: 24px; height: 24px; fill: none; stroke: var(--c1); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tag {
  position: absolute; top: 22px; right: 22px;
  font: 500 .68rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--c1); padding: 6px 10px; border-radius: 999px;
  background: rgba(34, 211, 238, .08); border: 1px solid rgba(34, 211, 238, .3);
}

/* =========================================================
   CTA
   ========================================================= */
.cta {
  position: relative; overflow: hidden; text-align: center;
  padding: 100px 40px; border-radius: 32px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(600px 320px at 50% 0%, rgba(139, 92, 246, .3), transparent 70%),
    radial-gradient(500px 300px at 50% 100%, rgba(34, 211, 238, .14), transparent 70%),
    var(--bg-alt);
}
.cta > * { position: relative; }
.cta h2 { max-width: 44rem; margin: 0 auto; }
.cta p:not(.hud) { margin: 20px auto 36px; color: var(--text-muted); max-width: 32rem; font-size: 1.08rem; }
.cta__rings { position: absolute !important; inset: 0; display: grid; place-items: center; pointer-events: none; }
.cta__rings i {
  position: absolute; border-radius: 50%; border: 1px solid rgba(139, 92, 246, .25);
  width: 300px; height: 300px; animation: ring 6s linear infinite;
}
.cta__rings i:nth-child(2) { animation-delay: -2s; }
.cta__rings i:nth-child(3) { animation-delay: -4s; }
@keyframes ring { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }

/* =========================================================
   Contact popup
   ========================================================= */
.contact {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 36px 28px 28px; border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong); color: var(--text);
  background:
    radial-gradient(420px 220px at 50% 0%, rgba(139, 92, 246, .28), transparent 70%),
    #0b0d16;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9), 0 0 100px -30px rgba(139, 92, 246, .6);
}
.contact::backdrop { background: rgba(3, 4, 8, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.contact[open] { animation: pop .35s var(--ease); }
.contact[open]::backdrop { animation: fade .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.contact h2 { font-size: 2rem; }
.contact .hud { margin-bottom: 14px; }
.contact__lead { margin: 10px 0 24px; color: var(--text-muted); }
.contact__close {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text-muted);
  transition: color .2s, background .2s;
}
.contact__close:hover { color: var(--text); background: rgba(255,255,255,.1); }
.contact__list { display: grid; gap: 12px; }
.contact__item {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border-radius: 16px; border: 1px solid var(--border); background: rgba(255,255,255,.03);
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.contact__item:hover { border-color: var(--c1); background: rgba(34, 211, 238, .06); transform: translateY(-2px); }
.contact__icon {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px;
  background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .16));
  border: 1px solid rgba(139, 92, 246, .35);
}
.contact__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--c1); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.contact__icon--wa { background: rgba(37, 211, 102, .12); border-color: rgba(37, 211, 102, .4); }
.contact__icon--wa svg { stroke: #25d366; }
.contact__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.contact__label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.contact__value { font-weight: 600; overflow-wrap: anywhere; }
.contact__arrow { color: var(--text-faint); transition: transform .25s var(--ease), color .25s; }
.contact__item:hover .contact__arrow { color: var(--c1); transform: translateX(4px); }

/* =========================================================
   Footer
   ========================================================= */
.footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-faint); font-size: .85rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 24px; }
.footer__links a:hover { color: var(--text); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 64px; }
  .avatar { max-width: 720px; }
  .cards--3 { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .tile--wide { grid-column: span 2; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .brand__name { display: none; }
  .brand { margin-right: auto; }
  /* sized so the longest rotating word ("conversations.") fits on a phone */
  .hero h1 { font-size: clamp(1.9rem, 9.2vw, 2.6rem); }
  .nav__toggle { display: flex; }
  /* links become a dropdown panel under the bar */
  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: #07080e; border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.8);
  }
  .nav.is-open .nav__links { display: flex; animation: menu-in .25s var(--ease); }
  .nav__links a {
    display: flex; align-items: center; gap: 12px; padding: 15px 4px;
    font-size: 1.05rem; color: var(--text); border-bottom: 1px solid var(--border);
  }
  .nav__links a:last-child { border-bottom: 0; }
  .nav__links .mono { font-size: .78rem; }
  .hero { padding-top: 40px; }
  .hero__inner { padding-bottom: 56px; }
  .section { padding: 80px 0; }
  .section__head { margin-bottom: 40px; }
  .cards--2, .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .card, .tile, .card--build { padding: 24px; }
  .avatar__stage { aspect-ratio: 3 / 4; }
  .avatar__hint { display: none; }
  .chip--tl { left: 8px; top: -14px; }
  .chip--br { right: 8px; bottom: 44px; }
  .cta { padding: 64px 22px; }
  .btn--large { width: 100%; }
  .terminal { font-size: .78rem; }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
  #neural, .cursor-glow { display: none; }
}
