/* ================================================================
   OMNIAGENT  -  FX Layer  |  Custom Cursor only
   ================================================================ */

/* -- Hide native cursor on pointer-fine devices -- */
@media (hover: hover) and (pointer: fine) {
  * { cursor: none !important; }
}

/* -- Cursor container -- */
.fx-cursor {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
}

/* -- Inner dot -- */
.fx-cursor__dot {
  position: relative;
  width: 6px;
  height: 6px;
  background: var(--white);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width  180ms var(--ease-expo),
    height 180ms var(--ease-expo),
    background 180ms,
    opacity 180ms;
}

/* -- Outer ring -- */
.fx-cursor__ring {
  position: absolute;
  top: 0; left: 0;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(93, 115, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width  320ms var(--ease-expo),
    height 320ms var(--ease-expo),
    border-color 320ms,
    background 320ms,
    opacity 200ms;
}

/* -- State: hovering a link / button -- */
.fx-cursor--link .fx-cursor__dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
}
.fx-cursor--link .fx-cursor__ring {
  width: 56px;
  height: 56px;
  border-color: rgba(93, 115, 255, 0.85);
  background: rgba(93, 115, 255, 0.05);
}

/* -- State: hovering a text input -- */
.fx-cursor--text .fx-cursor__dot {
  width: 2px;
  height: 26px;
  border-radius: 1px;
  background: var(--white);
}
.fx-cursor--text .fx-cursor__ring {
  opacity: 0;
}

/* -- State: pointer pressed -- */
.fx-cursor--pressed .fx-cursor__dot {
  width: 4px;
  height: 4px;
}
.fx-cursor--pressed .fx-cursor__ring {
  width: 26px;
  height: 26px;
  border-color: rgba(93, 115, 255, 1);
}

/* -- State: cursor outside window -- */
.fx-cursor--hidden .fx-cursor__dot,
.fx-cursor--hidden .fx-cursor__ring {
  opacity: 0;
}

/* -- Reduced motion / touch: restore native cursor -- */
@media (prefers-reduced-motion: reduce) {
  * { cursor: auto !important; }
  .fx-cursor { display: none !important; }
}


/* ================================================================
   TECH STACK ORBIT  —  Scroll-driven rotation
   ================================================================ */

/* Tall outer wrapper — provides scroll travel distance */
.stack-orbit-section {
  position: relative;
  height: 280vh;
  background: var(--black);
}

/* Sticky frame — viewport-locked while user scrolls through */
.stack-orbit-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Inner flex layout: heading above, orbit below */
.stack-orbit-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
}

/* Heading */
.stack-orbit-head {
  text-align: center;
  max-width: 560px;
}
.stack-orbit-head h2 {
  margin-bottom: 0.75rem;
}
.stack-orbit-head p {
  color: var(--muted);
  font-size: var(--fs-16);
}

/* Square orbit stage — cards are absolutely positioned inside */
.stack-orbit {
  position: relative;
  width: 480px;
  height: 480px;
  max-width: min(480px, 86vw);
  max-height: min(480px, 86vw);
  flex-shrink: 0;
}

/* Outer orbit path ring */
.orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
}
/* Inner subtle accent ring */
.orbit-ring::after {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  border: 1px solid rgba(93, 115, 255, 0.08);
}

/* Center hub */
.orbit-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
  pointer-events: none;
  text-align: center;
}
.orbit-center__glow {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93,115,255,0.15) 0%, transparent 72%);
  pointer-events: none;
}
.orbit-center__icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  position: relative;
  z-index: 1;
}
.orbit-center__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* Individual tech card — transform is set by JS */
.orbit-card {
  position: absolute;
  top: 50%; left: 50%;
  background: var(--raised);
  border: 1px solid var(--line-mid);
  border-radius: var(--r-md);
  padding: 0.35rem 0.8rem;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--white);
  pointer-events: none;
  will-change: transform;
}

/* Scroll hint label */
.orbit-scroll-hint {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: rgba(240,240,234,0.2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.orbit-scroll-hint::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 22px;
  background: linear-gradient(to bottom, transparent, rgba(240,240,234,0.25));
  animation: orbit-hint-drop 2s ease-in-out infinite;
}
@keyframes orbit-hint-drop {
  0%, 100% { opacity: 0.25; transform: scaleY(0.5) translateY(4px); }
  50%       { opacity: 0.9;  transform: scaleY(1)   translateY(0); }
}

/* Mobile: collapse to static layout, hide sticky scroll mechanic */
@media (max-width: 600px) {
  .stack-orbit-section { height: auto; padding: 5rem 0; }
  .stack-orbit-sticky  { position: static; height: auto; }
  .stack-orbit {
    width: 300px;
    height: 300px;
    max-width: 86vw;
    max-height: 86vw;
  }
  .orbit-scroll-hint { display: none; }
  .stack-orbit-head h2 { font-size: var(--fs-32); }
}

/* Reduced motion: keep static layout, no animation */
@media (prefers-reduced-motion: reduce) {
  .orbit-scroll-hint::before { animation: none; }
}


/* ================================================================
   CAPABILITY PANELS — Curved projection display
   
   You stand at the centre of a massive curved display wall.
   - perspective(400px) is inline on every panel transform so it
     ALWAYS applies regardless of parent stacking context.
   - scale(1.06) on the active panel = panel bleeds past viewport
     edges = the display is larger than you = you feel small.
   - rotateX ±85° + rotateZ ±2.5° = spiral-staircase warp.
   - Vignette ::before on each panel = curved-screen edge falloff.
   ================================================================ */

.caps-scroll-section {
  position: relative;
  height: 450vh;               /* ~112vh dwell per panel */
}

.caps-scroll-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--black);
}

/* Screen-edge darkening — top and bottom horizon of the curved wall */
.caps-scroll-stage::before,
.caps-scroll-stage::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  z-index: 20;
  pointer-events: none;
}
.caps-scroll-stage::before {
  top: 0; height: 14vh;
  background: linear-gradient(to bottom, var(--black) 0%, transparent 100%);
}
.caps-scroll-stage::after {
  bottom: 0; height: 14vh;
  background: linear-gradient(to top, var(--black) 0%, transparent 100%);
}

/* Ambient projection glow — the display lights up the dark room */
.caps-screen-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 65% 55% at 50% 50%,
    rgba(93,115,255,0.08) 0%,
    transparent 70%);
}

/* Container = stage fill. Centering is handled per-panel below. */
.caps-scroll-stage > .container {
  position: absolute;
  inset: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Each panel — full-stage face, centred content via padding-inline */
.case[data-caps-panel] {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  /* Recreate container centering (max-width ~1360px) */
  padding-inline: max(1.5rem, calc(50% - 680px));
  padding-block: 2rem;
  will-change: transform, opacity;
  pointer-events: none;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  z-index: 2;
}

/* Curved-display vignette: centre is bright, edges fall off to black.
   Reinforces that the screen is curved and you're looking at its face. */
.case[data-caps-panel]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 50%,
    transparent 35%,
    rgba(6,6,9,0.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Grid sits above the vignette */
.case[data-caps-panel] > .case__grid {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ── Progress indicator ───────────────────────────────────── */
.caps-nav {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  z-index: 30;
}
.caps-nav__dot {
  display: block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--line-mid);
  transition: background 300ms, height 280ms var(--ease-expo), border-radius 280ms;
  cursor: pointer;
}
.caps-nav__dot.is-active {
  background: var(--accent);
  height: 18px;
  border-radius: 2px;
}

/* ── Panel counter ────────────────────────────────────────── */
.caps-count {
  position: absolute;
  left: 1.5rem; bottom: 1.75rem;
  z-index: 30;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.caps-count b { color: var(--white); font-weight: 400; }

/* ── Reduced motion: revert to normal flow ───────────────── */
.caps-no-scroll { height: auto; }
.caps-no-scroll .caps-scroll-stage                  { position: static; height: auto; overflow: visible; background: transparent; }
.caps-no-scroll .caps-scroll-stage::before,
.caps-no-scroll .caps-scroll-stage::after           { display: none; }
.caps-no-scroll .caps-scroll-stage > .container     { position: static; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--pad); height: auto; }
.caps-no-scroll .case[data-caps-panel]              { position: static; opacity: 1 !important; pointer-events: auto; display: block; transform: none !important; padding-inline: 0; padding-block: clamp(4rem,8vw,7rem); }
.caps-no-scroll .case[data-caps-panel]::before      { display: none; }
.caps-no-scroll .caps-screen-glow,
.caps-no-scroll .caps-nav,
.caps-no-scroll .caps-count                         { display: none; }

/* ── Tablet & Mobile: normal flow ────────────────────────── */
@media (max-width: 900px) {
  .caps-scroll-section                              { height: auto; }
  .caps-scroll-stage                               { position: static; height: auto; overflow: visible; background: transparent; }
  .caps-scroll-stage::before, .caps-scroll-stage::after { display: none; }
  .caps-scroll-stage > .container                  { position: static; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--pad); height: auto; }
  .case[data-caps-panel]                           { position: static; opacity: 1 !important; pointer-events: auto; display: block; transform: none !important; padding-inline: 0; padding-block: clamp(3rem,6vw,5rem); }
  .case[data-caps-panel]::before                   { display: none; }
  .caps-screen-glow, .caps-nav, .caps-count        { display: none; }
}
