/* ═══════════════════════════════════════════════════
   THE BLINK — Alcyone Motion & FX layer (home page)
   Everything scoped to body.fx (added when alcyone-fx.js
   boots) so the page degrades gracefully without JS/CDNs.
═══════════════════════════════════════════════════ */

/* ── Lenis host rules ── */
html.lenis,
html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ── Hand animation control to GSAP ── */
body.fx .reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

body.fx .mtrack.fw,
body.fx .mtrack.rv { animation: none; will-change: transform; }

/* old cursor is replaced by the FX cursor */
body.fx #cur,
body.fx #cring { display: none; }

/* GSAP owns accordion heights under fx */
body.fx .pillar-panel,
body.fx .faq-a { transition: none; }

/* animated grain (overrides the static noise) */
body.fx::after {
  inset: -100%;
  animation: fxa-grain 7s steps(10) infinite;
}

@keyframes fxa-grain {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-4%, -8%); }
  20%  { transform: translate(-10%, 4%); }
  30%  { transform: translate(6%, -12%); }
  40%  { transform: translate(-4%, 10%); }
  50%  { transform: translate(-10%, 6%); }
  60%  { transform: translate(10%, 0); }
  70%  { transform: translate(0, 8%); }
  80%  { transform: translate(-8%, -2%); }
  90%  { transform: translate(8%, 4%); }
  100% { transform: translate(0, 0); }
}

/* ── PRELOADER ── */
.fx-loader {
  position: fixed;
  inset: 0;
  z-index: 9700;
  background: #08080f;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.fxl-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
}

.fxl-logo {
  font-family: var(--display);
  font-weight: 200;
  letter-spacing: .38em;
  text-transform: uppercase;
  font-size: 1rem;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: .8rem;
}

.fxl-logo strong { font-weight: 800; letter-spacing: .12em; }

.fxl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 14px var(--red);
}

.fxl-count {
  font-family: var(--display);
  font-weight: 200;
  font-size: clamp(3.4rem, 8vw, 6.5rem);
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.fxl-count em {
  font-style: normal;
  color: var(--red);
  font-weight: 800;
}

.fxl-spin {
  position: relative;
  width: 56px;
  height: 56px;
}
.fxl-spin span {
  position: absolute;
  border-radius: 50px;
  box-shadow: inset 0 0 0 3px var(--cream);
  animation: fxlSpin 2.5s infinite;
}
.fxl-spin span:last-child { animation-delay: -1.25s; }
@keyframes fxlSpin {
  0%    { inset: 0 30px 30px 0; }
  12.5% { inset: 0 30px 0 0; }
  25%   { inset: 30px 30px 0 0; }
  37.5% { inset: 30px 0 0 0; }
  50%   { inset: 30px 0 0 30px; }
  62.5% { inset: 0 0 0 30px; }
  75%   { inset: 0 0 30px 30px; }
  87.5% { inset: 0 0 30px 0; }
  100%  { inset: 0 30px 30px 0; }
}

.fxl-tag {
  font-family: var(--body);
  font-size: .5rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: rgba(232, 228, 216, .25);
}

/* ── SCROLL PROGRESS ── */
.fx-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 9600;
  background: transparent;
  pointer-events: none;
}

.fx-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red2));
  transform: scaleX(0);
  transform-origin: left;
  box-shadow: 0 0 10px rgba(224, 53, 40, .5);
}

/* ── AURORA HERO CANVAS ── */
.fx-aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.fx-aurora canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
}

/* ── SPLIT-TEXT SCAFFOLDING ── */
.hline {
  display: block;
  overflow: hidden;
  /* generous room for descenders (g, y) — must exceed the font's ~.27em
     descender at line-height .88, else the mask clips the tails.
     .5em wasn't enough for heavy 800-weight display sizes; .7em clears it. */
  padding-bottom: .7em;
  margin-bottom: -.7em;
}

.hline .hin {
  display: block;
  will-change: transform;
}

.wm {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .12em;
  margin-bottom: -.12em;
}

.wm .w {
  display: inline-block;
  will-change: transform;
}

/* ── VAPORIZE HEADLINE ── */
.fx-vapor-wrap { position: relative; }

.fx-vapor-wrap canvas { display: block; }

.fx-vapor-sr {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  margin: 0;
  white-space: nowrap;
  /* not `.display-md` on purpose — this headline gets its own, bigger scale */
  font-family: var(--display);
  font-size: clamp(48px, 8.2vw,calc(118px*var(--k,1)));
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .95;
}

/* pillars section head: single big cycling line, subtitle stacks underneath
   instead of sitting beside it in the default two-column .section-head grid */
.pillars-head { grid-template-columns: 1fr; margin-bottom: 4rem; }

.pillars-head .body-lg { margin-top: 1.75rem; max-width:calc(640px*var(--k,1)); }

/* ── APPROACH CARDS: "GlowingShadow" (ported from user's 21st.dev snippet) ──
   An animated gradient BORDER: a CORAL highlight (the site's own accent, a
   touch brighter than the base) travels the card's perimeter over a faint
   edge; subtle at rest, then on HOVER the border blooms bright, the title
   lights up coral, and a tight coral halo casts around the card. Brand-only
   palette (no rainbow hue-cycle). Two-layer ring: bright `.apr-border` under
   a dark `.apr-fill` that leaves only the ~2px edge showing. Pure CSS
   (@property custom props + @keyframes); JS only injects the layers. */
@property --apr-rotate { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --apr-bg-x { syntax: '<number>'; inherits: true; initial-value: 50; }
@property --apr-bg-y { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --apr-bg-size { syntax: '<number>'; inherits: true; initial-value: 1; }
@property --apr-glow-blur { syntax: '<number>'; inherits: true; initial-value: 3.4; }
@property --apr-glow-opacity { syntax: '<number>'; inherits: true; initial-value: .18; }
@property --apr-glow-scale { syntax: '<number>'; inherits: true; initial-value: 1.15; }

#approach .apr-card {
  position: relative;
  overflow: visible;
  isolation: isolate;
  border-radius: 16px;
  --apr-anim-speed: 7s;
  /* brand coral, a touch enhanced */
  --apr-coral-hot: hsl(12 100% 82%);
  --apr-coral: hsl(8 92% 63%);
  --apr-coral-deep: hsl(5 82% 52%);
}

/* soft blurred blob orbiting behind the card = the outer glow. Kept tight —
   small, lightly blurred, close to center — so it only just kisses the edges
   rather than bleeding far out. */
#approach .apr-card .apr-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  height: 24%;
  z-index: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) rotateZ(calc(var(--apr-rotate) * 1deg));
  transform-origin: center;
  animation: apr-orbit var(--apr-anim-speed) linear infinite;
}
#approach .apr-card .apr-glow::after {
  content: '';
  display: block;
  position: relative;
  width: 125%;
  height: 125%;
  left: -12.5%;
  top: -12.5%;
  border-radius: 50%;
  background: var(--apr-coral);
  filter: blur(calc(var(--apr-glow-blur) * 5px));
  opacity: var(--apr-glow-opacity);
  transform:
    scaleY(calc(var(--apr-glow-scale) / 1.1))
    scaleX(calc(var(--apr-glow-scale) * 1.25))
    translateY(-42%);
  transition: --apr-glow-blur .45s ease, --apr-glow-opacity .45s ease, --apr-glow-scale .45s ease;
}

/* the bright ring: a coral highlight travels the perimeter over a faint base;
   the dark fill on top leaves only ~2px of it showing as the border */
#approach .apr-card .apr-border {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  background:
    radial-gradient(
      38% 38% at calc(var(--apr-bg-x) * 1%) calc(var(--apr-bg-y) * 1%),
      var(--apr-coral-hot) 0%,
      var(--apr-coral) calc(22% * var(--apr-bg-size)),
      var(--apr-coral-deep) calc(46% * var(--apr-bg-size)),
      transparent 100%
    ),
    rgba(232, 228, 216, .09);
  animation: apr-bg-orbit var(--apr-anim-speed) linear infinite;
  transition: --apr-bg-size .5s ease, box-shadow .45s ease;
}

#approach .apr-card .apr-fill {
  position: absolute;
  inset: 2px;
  z-index: 2;
  pointer-events: none;
  border-radius: 14px;
  background: rgba(9, 8, 15, 0.12);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
}
/* hide the orbiting coral spotlight inside the cards; keep only the edge glow */
#approach .apr-card .apr-glow { display: none; }

/* real content sits above every glow layer */
#approach .apr-card > :not(.apr-glow):not(.apr-border):not(.apr-fill) {
  position: relative;
  z-index: 3;
}

/* ── HOVER: bloom the border, light the title, cast a tight coral halo ── */
#approach .apr-card:hover .apr-glow {
  animation-play-state: paused;
}
#approach .apr-card:hover .apr-glow::after {
  --apr-glow-blur: 2.6;
  --apr-glow-opacity: .34;
  --apr-glow-scale: 1.45;
}
#approach .apr-card:hover .apr-border {
  --apr-bg-size: 16;
  animation-play-state: paused;
  /* tighter halo than before — hugs the card */
  box-shadow:
    0 0 14px 0 hsl(8 92% 60% / .5),
    0 0 26px 2px hsl(6 88% 54% / .22);
}
/* title picks up the coral as a gradient */
#approach .apr-card h4 {
  transition: color .3s ease;
}
#approach .apr-card:hover h4 {
  background: linear-gradient(180deg, var(--apr-coral-hot), var(--apr-coral));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@keyframes apr-orbit {
  from { --apr-rotate: 0; }
  to   { --apr-rotate: 360; }
}
/* travel the perimeter via edge midpoints (top → right → bottom → left) */
@keyframes apr-bg-orbit {
  0%   { --apr-bg-x: 50;  --apr-bg-y: 0; }
  25%  { --apr-bg-x: 100; --apr-bg-y: 50; }
  50%  { --apr-bg-x: 50;  --apr-bg-y: 100; }
  75%  { --apr-bg-x: 0;   --apr-bg-y: 50; }
  100% { --apr-bg-x: 50;  --apr-bg-y: 0; }
}

/* ── FX CURSOR ── */
.fxc {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
}

.fxc-dot,
.fxc-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 999px;
  pointer-events: none;
  will-change: transform;
}

.fxc-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--red);
  transition: opacity .25s;
}

.fxc-ring {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(224, 53, 40, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    width .3s cubic-bezier(.16, 1, .3, 1),
    height .3s cubic-bezier(.16, 1, .3, 1),
    margin .3s cubic-bezier(.16, 1, .3, 1),
    background-color .3s,
    border-color .3s;
}

.fxc-label {
  font-family: var(--body);
  font-size: .5rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cream2);
  white-space: nowrap;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s, transform .3s cubic-bezier(.16, 1, .3, 1);
}

.fxc.is-link .fxc-ring {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-color: rgba(224, 53, 40, .75);
}

.fxc.is-pill .fxc-dot { opacity: 0; }

.fxc.is-pill .fxc-ring {
  width: 108px;
  height: 108px;
  margin: -54px 0 0 -54px;
  background: var(--red);
  border-color: var(--red);
}

.fxc.is-pill .fxc-label { opacity: 1; transform: scale(1); }

.fxc.is-down .fxc-ring { transform: scale(.82); }

.fxc.is-hidden { opacity: 0; }

@media (hover: none), (pointer: coarse) {
  .fxc { display: none; }
}

/* ── NAV hide/reveal ── */
body.fx .nav {
  transition:
    transform .55s cubic-bezier(.16, 1, .3, 1),
    padding .4s, background .5s, backdrop-filter .5s;
}

body.fx .nav.nav-up { transform: translateY(-110%); }

/* ── WORK CARDS: tilt, tone, parallax ── */
body.fx .wi-card { perspective: 1000px; }

body.fx .wi-img {
  transform-style: preserve-3d;
  will-change: transform, clip-path;
}

body.fx .wi-img img {
  will-change: transform;
  filter: saturate(.5) brightness(.85) contrast(1.05);
  transition: filter .7s cubic-bezier(.16, 1, .3, 1);
  transform: scale(1.15);
}

body.fx .wi-card:hover .wi-img img { filter: saturate(1) brightness(1) contrast(1); }

@media (hover: none) {
  body.fx .wi-img img { filter: none; }
}

/* ── PILLAR ROWS: cursor spotlight ── */
body.fx .pillar-row { position: relative; }

body.fx .pillar-row::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 50%),
    rgba(224, 53, 40, .07),
    transparent 65%
  );
  opacity: 0;
  transition: opacity .35s;
}

body.fx .pillar-row:hover::after { opacity: 1; }

/* stat cells get one too */
body.fx .stat-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    rgba(232, 228, 216, .04),
    transparent 65%
  );
  opacity: 0;
  transition: opacity .35s;
}

body.fx .stat-cell:hover::before { opacity: 1; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .fx-loader,
  .fx-progress,
  .fxc,
  .fx-aurora { display: none !important; }

  body.fx::after { animation: none; }
}
