/* ==========================================================================
   FGX homepage — index-claude premium layer
   Loaded after the original homepage styles; scoped to index-claude only.
   ========================================================================== */

/* ---------- Hero stage ---------------------------------------------------- */

/* WebGL now draws the molecule field, so retire the CSS dot pattern. */
html.fgx-particles-webgl .mxd-molecule-field { background: #000; }
html.fgx-particles-webgl .mxd-molecule-field::before,
html.fgx-particles-webgl .mxd-molecule-field::after { display: none; }

/* A deep crimson bloom that follows the cursor, behind the particles. */
html.fgx-particle-document .mxd-particles::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38vw 30vw at var(--fgx-pointer-x, 50%) var(--fgx-pointer-y, 40%), rgba(229, 36, 33, .16), transparent 70%),
    radial-gradient(70vw 50vw at 50% 42%, rgba(120, 8, 8, .22), transparent 72%);
  transition: background-position .6s ease;
}
html.fgx-particle-document .mxd-particles__canvas { position: relative; z-index: 1; }
html.fgx-particle-document .mxd-particles__trigger { z-index: 2; }

/* Cinematic vignette + fine horizontal light falloff. */
html.fgx-particle-document .mxd-hero-01--particles::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .78) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, .35), transparent 22%, transparent 62%, rgba(0, 0, 0, .7));
}

/* Lockup drifts up and dissolves as the word warps away on scroll. */
html.fgx-particle-document .fgx-hero-lockup.loading-fade {
  transform: translate3d(0, calc(var(--fgx-hero-scroll, 0) * -90px), 0) !important;
  opacity: calc(1 - var(--fgx-hero-scroll, 0) * 2.2) !important;
  filter: blur(calc(var(--fgx-hero-scroll, 0) * 10px));
}
html.fgx-particle-document .mxd-particles::before { opacity: calc(1 - var(--fgx-hero-scroll, 0) * 1.3); }

/* ---------- Word index (replaces the bare "click the canvas" hint) -------- */
.fgx-morph-index {
  display: grid;
  gap: .85rem;
  justify-items: end;
  pointer-events: auto;
}
.fgx-morph-index__words {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(10, 10, 10, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.fgx-morph-index__words button {
  position: relative;
  min-width: 3.4rem;
  padding: .7rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, .45);
  font-family: "Epillox", Inter, sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .35s ease, background .35s ease;
}
.fgx-morph-index__words button:hover { color: #fff; }
.fgx-morph-index__words button.is-active {
  color: #fff;
  background: #e52421;
  box-shadow: 0 0 1.8rem rgba(229, 36, 33, .55);
}
.fgx-morph-index__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  font-family: Inter, sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .42);
}
.fgx-morph-index__bar {
  position: relative;
  flex: 1;
  height: 1px;
  overflow: hidden;
  background: rgba(255, 255, 255, .14);
}
.fgx-morph-index__bar span {
  position: absolute;
  inset: 0;
  background: #e52421;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

html.fgx-particle-document .fgx-hero-lockup__aside { gap: 2.2rem; }
html.fgx-particle-document .fgx-hero-lockup__hint { display: none; }

/* ---------- Scroll cue ----------------------------------------------------- */
.fgx-scroll-cue {
  display: none;
}

/* ---------- Hero statement: word-by-word blur in -------------------------- */
.fgx-cl-word {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: translate3d(0, .35em, 0);
  transition:
    opacity 1.1s cubic-bezier(.16, 1, .3, 1),
    filter 1.1s cubic-bezier(.16, 1, .3, 1),
    transform 1.1s cubic-bezier(.16, 1, .3, 1);
  transition-delay: calc(var(--i, 0) * 55ms + var(--d, 0ms));
}
.fgx-cl-in .fgx-cl-word { opacity: 1; filter: blur(0); transform: none; }

.fgx-cl-fade {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 1s cubic-bezier(.16, 1, .3, 1), transform 1s cubic-bezier(.16, 1, .3, 1);
  transition-delay: var(--d, 0ms);
}
.fgx-cl-in .fgx-cl-fade, .fgx-cl-fade.fgx-cl-in { opacity: 1; transform: none; }

/* ---------- Page-wide finishing ------------------------------------------- */

/* Film grain: a barely-there analogue texture over the whole page. */
.fgx-grain {
  position: fixed;
  inset: -50%;
  z-index: 9998;
  pointer-events: none;
  opacity: .065;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: fgx-grain 1.2s steps(6) infinite;
}
@keyframes fgx-grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* Magnetic primary buttons get a soft red halo on hover. */
.fgx-cl-magnetic { transition: box-shadow .4s ease; will-change: transform; }
.fgx-cl-magnetic:hover { box-shadow: 0 1rem 3rem rgba(229, 36, 33, .35); }

@media (prefers-reduced-motion: reduce) {
  .fgx-grain { animation: none; }
  .fgx-cl-word, .fgx-cl-fade { opacity: 1; filter: none; transform: none; transition: none; }
  html.fgx-particle-document .fgx-hero-lockup.loading-fade { transform: none !important; filter: none; }
}
