/* =========================================================
  Hero Q + graph — monochrome chrome + living graph
========================================================= */

.hero-visual-card--q-graph {
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

@media (min-width: 981px) {
  /* Increase spacing between text column and visual without altering layout. */
  .section--hero .hero__layout {
    gap: 72px;
  }
}

.hero-visual-card--q-graph .hero-visual-card__object-wrap {
  padding: 16px 14px 12px;
}

.hero-visual-card--q-graph .hero-visual-card__glow {
  opacity: 0.30;
  background:
    radial-gradient(circle at 45% 35%, rgba(255, 255, 255, 0.05), transparent 55%),
    radial-gradient(circle at 70% 55%, rgba(255, 255, 255, 0.03), transparent 60%);
  filter: blur(24px);
}

.hero-system {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  margin-inline: auto;
  perspective: 1200px;
}

/* Q image + masked canvas (replaces inline SVG foreignObject when used) */
.hero-system:has(.hero-system__graph-mask) {
  max-height: min(420px, 72vw);
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}

.hero-system__graph-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  background: #000000;
  /* Aligns with #qInnerClipHero: r=153.90625/800 ≈ 19.24%, cy=390.625/800 */
  clip-path: circle(19.25% at 50% 48.75%);
  pointer-events: auto;
}

.hero-system__q-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  will-change: transform;
  /* Transform driven by rAF + lerp in JS; avoid CSS transition fighting the loop */
  transition: none;
  transform-style: preserve-3d;
  z-index: 3;
  pointer-events: none;
}

.hero-system__q-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  display: block;
}

.system-pill {
  appearance: none;
  margin: 0;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.hero__substack-link {
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.system-pill.is-active,
.hero__substack-link.is-active {
  transform: translateY(-1px);
  opacity: 1;
}

.system-pill:hover {
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.system-pill:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.hero-system__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: min(440px, 72vw);
  margin-inline: auto;
  background: #000000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 14px 32px rgba(0, 0, 0, 0.58),
    0 6px 14px rgba(0, 0, 0, 0.35);
}

/* Vignette sits behind SVG so transparent corners deepen; does not cover the Q */
.hero-system__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 92% 92% at 50% 48%,
    rgba(0, 0, 0, 0) 45%,
    rgba(0, 0, 0, 0.28) 100%
  );
}

.hero-system__tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
  z-index: 1;
}

.hero-system__svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-system__svg foreignObject {
  pointer-events: none;
}

.hero-system__fo-root {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: block;
  background: #000000;
}

.hero-system__canvas {
  width: 100%;
  height: 100%;
  display: block;
  vertical-align: top;
  pointer-events: none;
}

.hero-system__q-path {
  vector-effect: non-scaling-stroke;
}

@media (max-width: 980px) {
  .hero-system {
    max-width: 400px;
  }

  .hero-visual-card.hero-visual-card--q-graph {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .hero-system__stage {
    max-height: min(360px, 78vw);
  }

  .hero-system:has(.hero-system__graph-mask) {
    max-height: min(360px, 78vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-system__tilt {
    transform: none !important;
    will-change: auto;
  }

  .hero-system__q-shell {
    will-change: auto;
  }
}
