/* ============================================================
   ATAIHQ Landing — styles.css
   Palette: near-black base, blue→violet brand gradient
   Type: Syne (display) · DM Sans (body) · Share Tech Mono (labels)
   ============================================================ */

:root {
  --bg: #08090d;
  --surface: #0f1117;
  --surface-2: #141722;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef0f6;
  --text-dim: #9aa1b5;
  --blue: #00aaff;
  --purple: #7b2fff;
  --cyan: #59e6d4;
  --grad: linear-gradient(100deg, var(--blue), var(--purple));

  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "Share Tech Mono", monospace;

  --container: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --section-gap: clamp(5rem, 12vh, 9rem);
  --radius: 18px;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
em { font-style: normal; }

.container {
  width: min(var(--container), 100% - 2 * var(--pad));
  margin-inline: auto;
}

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

/* Subtle grain over everything for texture */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Scroll progress ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 1200;
  background: transparent;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---------- Shared bits ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.eyebrow__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  will-change: transform;
}
.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 170, 255, 0.25), 0 4px 18px rgba(123, 47, 255, 0.25);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 170, 255, 0.4), 0 8px 26px rgba(123, 47, 255, 0.4);
}
.btn--ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  border-color: rgba(0, 170, 255, 0.5);
  transform: translateY(-2px);
}
.btn--full { width: 100%; }

.textlink {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  display: inline-block;
  margin-top: 1.8rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.textlink:hover { color: var(--cyan); border-color: var(--cyan); }

/* ============================================================
   NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  transition: background-color 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(8, 9, 13, 0.78);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding-block: 1.1rem;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
}
.nav__logo-img {
  height: 22px;
  width: auto;
}
.nav__logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}
.nav__logo-text em {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav__links {
  display: flex;
  gap: 1.8rem;
}
.nav__links a {
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav__links a:hover { color: var(--text); }

.nav__cta { padding: 0.6rem 1.3rem; font-size: 0.85rem; }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  width: 24px; height: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__veil {
  position: absolute;
  inset: 0;
  /* kept light so the particle field reads clearly behind the headline */
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(123, 47, 255, 0.1), transparent 60%),
    radial-gradient(ellipse 70% 60% at 20% 80%, rgba(0, 170, 255, 0.08), transparent 60%),
    linear-gradient(to bottom, rgba(8, 9, 13, 0.12), rgba(8, 9, 13, 0) 35%, rgba(8, 9, 13, 0.02) 70%, var(--bg) 98%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  padding-block: 9rem 6rem;
}

.hero__eyebrow { margin-bottom: 2rem; }

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 16ch;
}
.hero__line { display: block; }
.hero__line--accent {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  margin-top: 1.8rem;
  max-width: 46ch;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--text-dim);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.6rem;
}

.hero__scrollcue {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.hero__scrollcue-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hero__scrollcue-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--blue), transparent);
  animation: scrollcue 2s ease-in-out infinite;
}
@keyframes scrollcue {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats {
  border-block: 1px solid var(--line);
  background: linear-gradient(to right, rgba(0, 170, 255, 0.04), rgba(123, 47, 255, 0.04));
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding-block: 3.2rem;
}
.stat {
  text-align: left;
  min-width: 0; /* allow grid item to shrink below content size */
}
.stat__num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere; /* never let long numbers push past the container */
}
.stat__unit {
  font-size: 0.4em;
  font-weight: 700;
  margin-left: 0.3em;
  letter-spacing: 0.04em;
}

/* glow pulse when a count-up lands on its final number */
.stat__num.is-done {
  animation: statLand 0.9s ease-out;
}
@keyframes statLand {
  0% { filter: drop-shadow(0 0 0 rgba(0, 170, 255, 0)); transform: scale(1); }
  35% { filter: drop-shadow(0 0 22px rgba(0, 170, 255, 0.9)) drop-shadow(0 0 40px rgba(123, 47, 255, 0.5)); transform: scale(1.06); }
  100% { filter: drop-shadow(0 0 0 rgba(0, 170, 255, 0)); transform: scale(1); }
}

.stat__label {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  overflow-wrap: anywhere; /* wrap long source words instead of overflowing */
}

/* ============================================================
   SERVICES
   ============================================================ */
.service {
  padding-block: var(--section-gap);
  position: relative;
  overflow: hidden;
}

/* ambient drifting orb behind each service — keeps the page feeling alive */
.service::before {
  content: "";
  position: absolute;
  top: 12%;
  left: -14vw;
  width: 46vw;
  max-width: 620px;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 170, 255, 0.09), transparent 70%);
  filter: blur(34px);
  animation: orbFloat 17s ease-in-out infinite alternate;
}
.service--flip::before {
  left: auto;
  right: -14vw;
  background: radial-gradient(circle, rgba(123, 47, 255, 0.1), transparent 70%);
  animation-duration: 21s;
}
@keyframes orbFloat {
  from { transform: translate3d(0, -5%, 0) scale(1); }
  to { transform: translate3d(7%, 9%, 0) scale(1.18); }
}

.service__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}
.service--flip .service__media { order: 2; }
.service--flip .service__copy { order: 1; }

/* Media bleeds into the dark background — no card box, edges fade out */
.media-frame {
  position: relative;
  transform-style: preserve-3d;
}
.media-frame img,
.media-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 48%, transparent 96%);
          mask-image: radial-gradient(ellipse 72% 68% at 50% 50%, #000 48%, transparent 96%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
}
.media-frame:hover img {
  transform: scale(1.05);
  filter: brightness(1.2) saturate(1.12);
}

.service__index {
  color: var(--text-dim);
  margin-right: 0.8rem;
}

.service__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.service__lead {
  margin-top: 1.3rem;
  color: var(--text-dim);
  max-width: 52ch;
}

.service__list {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.65rem;
}
.service__list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
}
.service__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px; height: 9px;
  border-radius: 2px;
  background: var(--grad);
  transform: rotate(45deg);
}

/* ============================================================
   CONSULTANCY
   ============================================================ */
.consultancy {
  padding-block: var(--section-gap);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(123, 47, 255, 0.08), transparent 70%),
    var(--surface);
  border-block: 1px solid var(--line);
}
.consultancy__inner { text-align: center; }
.consultancy .eyebrow { justify-content: center; }

.consultancy__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
  max-width: 24ch;
  margin-inline: auto;
}
.consultancy__title em {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.consultancy__lead {
  margin: 1.5rem auto 0;
  max-width: 62ch;
  color: var(--text-dim);
}

.consultancy__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  margin-top: 3.5rem;
  text-align: left;
}
.step {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.step:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 170, 255, 0.35);
}
.step__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue);
  border: 1px solid rgba(0, 170, 255, 0.35);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
}
.step__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-block: 0.9rem 0.4rem;
}
.step p { color: var(--text-dim); font-size: 0.92rem; }

/* ============================================================
   AGI TEASER
   ============================================================ */
.agi {
  position: relative;
  padding-block: clamp(7rem, 18vh, 12rem);
  overflow: hidden;
  text-align: center;
}
.agi__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.agi__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, var(--bg) 0%, rgba(8, 9, 13, 0.35) 30%, rgba(8, 9, 13, 0.35) 70%, var(--bg) 100%);
}
.agi__inner { position: relative; z-index: 2; }

.agi__tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--cyan);
  margin-bottom: 1.6rem;
}
.agi__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1.08;
}
.agi__sub {
  margin: 1.4rem auto 0;
  max-width: 48ch;
  color: var(--text-dim);
}
.agi__cta { margin-top: 2.4rem; }

/* ============================================================
   PROOF / WHY
   ============================================================ */
.proof {
  padding-block: var(--section-gap);
  position: relative;
  overflow: hidden;
}
.proof::before {
  content: "";
  position: absolute;
  bottom: 5%;
  right: -12vw;
  width: 40vw;
  max-width: 560px;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(123, 47, 255, 0.08), transparent 70%);
  filter: blur(34px);
  animation: orbFloat 19s ease-in-out infinite alternate;
}

.proof__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.14;
}

.proof__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  margin-top: 2.8rem;
  align-items: start;
}
.proof__text p + p { margin-top: 1.2rem; }
.proof__text p { color: var(--text-dim); max-width: 56ch; }

.proof__notes { display: grid; gap: 1.2rem; }
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid;
  border-image: linear-gradient(to bottom, var(--blue), var(--purple)) 1;
  padding: 1.3rem 1.5rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.note:hover {
  transform: translateX(6px);
  box-shadow: -8px 0 30px rgba(0, 170, 255, 0.12), 0 10px 36px rgba(0, 0, 0, 0.4);
}
.note__tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--cyan);
}
.note p { margin-top: 0.5rem; font-size: 0.94rem; color: var(--text); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding-block: var(--section-gap);
  background:
    radial-gradient(ellipse 50% 60% at 85% 20%, rgba(123, 47, 255, 0.09), transparent 65%),
    radial-gradient(ellipse 50% 60% at 10% 90%, rgba(0, 170, 255, 0.07), transparent 65%),
    var(--surface);
  border-top: 1px solid var(--line);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}

.contact__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.12;
}
.contact__lead { margin-top: 1.2rem; color: var(--text-dim); max-width: 44ch; }

.contact__emails { margin-top: 2.2rem; display: grid; gap: 1rem; }
.contact__emails li { display: flex; flex-direction: column; gap: 0.15rem; }
.contact__email-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact__emails a {
  font-size: 1.05rem;
  color: var(--blue);
  transition: color 0.2s ease;
}
.contact__emails a:hover { color: var(--cyan); }

.contact__form {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  display: grid;
  gap: 1.2rem;
}
.hidden-field { display: none; }

.field { display: grid; gap: 0.45rem; }
.field label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.field input,
.field textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.15);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem;
  background: var(--bg);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer__brand p { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.6rem; }
.footer__nav { display: grid; gap: 0.5rem; }
.footer__nav a {
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.footer__nav a:hover { color: var(--text); }
.footer__meta { color: var(--text-dim); font-size: 0.82rem; display: grid; gap: 0.3rem; }

/* ============================================================
   REVEAL DEFAULTS (pre-GSAP state set in JS, fallback visible)
   ============================================================ */
.no-js [data-reveal],
.no-js [data-hero-reveal] { opacity: 1 !important; transform: none !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .service__grid,
  .contact__grid,
  .proof__grid {
    grid-template-columns: 1fr;
  }
  .service--flip .service__media { order: 0; }
  .service--flip .service__copy { order: 1; }
  .consultancy__steps { grid-template-columns: 1fr; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); gap: 2.4rem 1.5rem; }
  .footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav__links {
    /* top/left/width/height instead of inset:0 — the header's backdrop-filter
       creates a containing block, which would shrink an inset-based overlay */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    background: rgba(8, 9, 13, 0.96);
    backdrop-filter: blur(18px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    font-size: 1.3rem;
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.4s;
    z-index: 1050;
  }
  .nav__links.is-open {
    transform: translateY(0);
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0s;
  }
  .nav__links a { font-size: 1.25rem; color: var(--text); }
  .nav__cta { display: none; }
  .nav__burger { display: flex; z-index: 1060; }
  .nav__burger.is-open span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__burger.is-open span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .hero__scrollcue { display: none; }
}

/* Stack the four stat cards one per row below 768px — two columns of large
   gradient numbers were forcing content wider than the viewport on phones. */
@media (max-width: 767.98px) {
  .stats__grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* Prevent stat numbers wrapping at tablet and above (mobile handled separately). */
@media (min-width: 769px) {
  .stat__num { white-space: nowrap; }
}

/* At 4-column layout (>960px) the columns are narrow enough that £19,000 wraps
   at the base font-size. Scale down the vw and cap the max so every stat fits
   on a single line without horizontal overflow. */
@media (min-width: 961px) {
  .stat__num { font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
}

/* ============================================================
   CUSTOM CURSOR (desktop pointer devices only)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor,
  body.has-cursor a,
  body.has-cursor button,
  body.has-cursor input,
  body.has-cursor textarea,
  body.has-cursor select {
    cursor: none;
  }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 3000;
    border-radius: 50%;
    opacity: 0; /* shown on first pointer move */
    will-change: transform;
  }
  .cursor-dot {
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    background: var(--grad);
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.9);
  }
  .cursor-ring {
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 1.5px solid rgba(0, 170, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease,
      border-color 0.25s ease, background-color 0.25s ease;
  }
  .cursor-ring span {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  /* over links / buttons / form fields: ring grows and warms to purple */
  body.cursor-hover .cursor-ring {
    width: 54px;
    height: 54px;
    margin: -27px 0 0 -27px;
    border-color: var(--purple);
    background: rgba(123, 47, 255, 0.14);
  }

  /* over section media: morphs into a labelled "view" lens */
  body.cursor-media .cursor-ring {
    width: 68px;
    height: 68px;
    margin: -34px 0 0 -34px;
    border-color: var(--cyan);
    background: rgba(8, 9, 13, 0.55);
  }
  body.cursor-media .cursor-ring span { opacity: 1; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   STATS SOURCES NOTE
   ============================================================ */
.stats__sources {
  text-align: center;
  padding: 0 var(--pad) 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  opacity: 0.4;
}

/* ============================================================
   MEDIA VEIL — overlay for reliable edge-bleed on video
   The video mask-image has browser inconsistencies; this span
   overlays a matching radial gradient on top of the video,
   ensuring clean seamless edges in all browsers.
   ============================================================ */
.media-veil {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(ellipse 78% 72% at 50% 50%, transparent 44%, var(--bg) 88%);
}

/* Wrapper div around <video> so the scale transform is applied to a normal
   div element rather than to the GPU-composited video surface directly.
   In Chromium, transform on <video> in a preserve-3d context changes the
   layout box but not the actual video pixels — wrapping fixes this. */
.media-frame__video-wrap {
  position: relative; /* keeps .media-veil positioned against the wrap */
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
}
.media-frame:hover .media-frame__video-wrap {
  transform: scale(1.05);
  filter: brightness(1.2) saturate(1.12);
}

/* ============================================================
   INLINE SVG DIAGRAMS (Automation & AI Agents)
   ============================================================ */
.media-frame svg {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  overflow: visible;
  -webkit-mask-image: radial-gradient(ellipse 80% 76% at 50% 50%, #000 50%, transparent 94%);
          mask-image: radial-gradient(ellipse 80% 76% at 50% 50%, #000 50%, transparent 94%);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
}
.media-frame:hover svg {
  transform: scale(1.05);
  filter: brightness(1.15) drop-shadow(0 0 28px rgba(0,170,255,0.28)) drop-shadow(0 0 60px rgba(123,47,255,0.2));
}

/* Node halos — soft ambient breathing pulse */
.node-halo { animation: haloBreath 4s ease-in-out infinite; }
@keyframes haloBreath {
  0%, 100% { opacity: 0.07; }
  50%       { opacity: 0.22; }
}

/* Traveling data pulses along connections */
.wf-dash, .ag-dash { animation: dashFlow 2.5s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -200; } }

/* Hover: speed up pulses, brighter glow lines */
.media-frame:hover .wf-dash,
.media-frame:hover .ag-dash { animation-duration: 0.7s; }
.media-frame:hover .node-halo { animation-duration: 1.2s; }
.media-frame:hover .wf-line,
.media-frame:hover .ag-line  { opacity: 0.5 !important; }
