/* =============================================================
   Raze — polished motion layer
   Link AFTER styles.css. Pair with animations.js.
   ============================================================= */

/* ---------- Tunable tokens ---------- */
:root {
  --anim-duration: 780ms;
  --anim-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --anim-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --anim-distance: 28px;
  --anim-stagger: 75ms;
}

/* ---------- Ambient background orbs ---------- */
.ambient-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-orbs::before,
.ambient-orbs::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  will-change: transform;
}
.ambient-orbs::before {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.09) 0%, transparent 70%);
  animation: razeOrbDrift1 22s ease-in-out infinite alternate;
}
.ambient-orbs::after {
  width: min(45vw, 420px);
  height: min(45vw, 420px);
  bottom: 8%;
  right: -6%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 68%);
  animation: razeOrbDrift2 18s ease-in-out infinite alternate;
}
@keyframes razeOrbDrift1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(12vw, 18vh, 0) scale(1.12); }
}
@keyframes razeOrbDrift2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-10vw, -12vh, 0) scale(1.08); }
}

/* ---------- Floating particles ---------- */
.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  opacity: 0;
  animation: razeParticleFloat linear infinite;
  will-change: transform, opacity;
}
@keyframes razeParticleFloat {
  0%   { opacity: 0; transform: translate3d(0, 0, 0) scale(0.4); }
  10%  { opacity: var(--particle-opacity, 0.5); }
  90%  { opacity: var(--particle-opacity, 0.5); }
  100% { opacity: 0; transform: translate3d(var(--particle-dx, 40px), var(--particle-dy, -120vh), 0) scale(1); }
}

/* ---------- Cursor spotlight ---------- */
.cursor-spotlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    600px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(255, 255, 255, 0.04),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 400ms ease;
}
body.is-spotlight-active .cursor-spotlight {
  opacity: 1;
}

/* ---------- Hero badge glow ---------- */
.hero-badge {
  animation:
    razeEnter var(--anim-duration) var(--anim-ease) forwards,
    razeBadgePulse 3.5s ease-in-out 1s infinite;
}
@keyframes razeBadgePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    border-color: rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 24px -4px rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
  }
}

/* Section label + line reveal */
.section-label {
  opacity: 0;
  transform: translate3d(-8px, 0, 0);
  transition:
    opacity 600ms var(--anim-ease),
    transform 600ms var(--anim-ease);
}
.section-line {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms var(--anim-ease) 200ms;
}
[data-reveal].is-visible .section-label,
[data-reveal].is-visible .section-label {
  opacity: 1;
  transform: none;
}
[data-reveal].is-visible .section-line {
  transform: scaleX(1);
}

/* Sidebar — scrolls with page (not sticky) */
.sidebar-panel {
  position: static;
  top: auto;
}

/* Legal / prose sections */
.prose section[data-reveal] {
  transform: translate3d(0, 18px, 0);
  filter: blur(2px);
}
.prose section[data-reveal].is-visible {
  transform: none;
  filter: blur(0);
}

/* Page footers */
footer[data-reveal="fade"] {
  transform: none;
}

/* Docs overview stat pulse */
.doc-module-card.command-card.is-visible,
.doc-guide-card.command-card.is-visible {
  animation: razeCardSettle 520ms var(--anim-ease) both;
}
@keyframes razeCardSettle {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50%  { box-shadow: 0 8px 28px -12px rgba(255, 255, 255, 0.12); }
  100% { box-shadow: none; }
}

/* Studio preview panel subtle glow */
#preview-wrap {
  transition: box-shadow 420ms var(--anim-ease);
}
#preview-wrap:hover {
  box-shadow: 0 0 32px -8px rgba(88, 101, 242, 0.35);
}

article.module-card[data-reveal] {
  transform: translate3d(0, calc(var(--anim-distance) * 0.85), 0) scale(0.93);
  transition:
    opacity 720ms var(--anim-ease),
    transform 720ms var(--anim-spring),
    filter 720ms var(--anim-ease),
    border-color 320ms ease,
    box-shadow 420ms var(--anim-ease);
}
article.module-card[data-reveal="scale"] {
  transform: translate3d(0, calc(var(--anim-distance) * 0.7), 0) scale(0.9);
}
article.module-card[data-reveal].is-visible {
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}
article.module-card:hover {
  transform: translate3d(0, -5px, 0) scale(1.01);
  border-color: rgba(255, 255, 255, 0.2);
}
article.module-card svg.mb-4,
article.glass-card[data-reveal] svg.mb-4 {
  transition: transform 480ms var(--anim-spring), color 320ms ease, filter 320ms ease;
}
article.module-card:hover svg.mb-4,
article.glass-card[data-reveal]:hover svg.mb-4 {
  transform: translate3d(0, -3px, 0) rotate(-8deg) scale(1.12);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
}

/* Command pulse cells */
.pulse-cell {
  transition:
    border-color 280ms ease,
    transform 320ms var(--anim-ease),
    background-color 280ms ease;
}
.pulse-cell.is-active {
  border-color: rgba(255, 255, 255, 0.25);
  background-color: rgba(255, 255, 255, 0.04);
  transform: translate3d(0, -2px, 0);
}
.pulse-label {
  transition: color 280ms ease, text-shadow 280ms ease;
}
.pulse-cell.is-active .pulse-label {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}
.command-pulse-cursor {
  animation: razeCursorBlink 1.1s step-end infinite;
}
@keyframes razeCursorBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* Capability tags — pop in + float */
[data-enter-delay="4"] li {
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.92);
  animation: razeTagPop 520ms var(--anim-spring) forwards, razeTagFloat 4s ease-in-out infinite;
}
[data-enter-delay="4"] li:nth-child(1) { animation-delay: 480ms, 480ms; }
[data-enter-delay="4"] li:nth-child(2) { animation-delay: 540ms, 1.2s; }
[data-enter-delay="4"] li:nth-child(3) { animation-delay: 600ms, 1.9s; }
[data-enter-delay="4"] li:nth-child(4) { animation-delay: 660ms, 2.6s; }
[data-enter-delay="4"] li:nth-child(5) { animation-delay: 720ms, 3.3s; }
@keyframes razeTagPop {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes razeTagFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -3px, 0); }
}

/* Stat numbers glow on count complete */
.stat-card [data-count] {
  transition: text-shadow 600ms ease;
}
.stat-card:hover [data-count] {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Security section cards — slide-in accent */
#invite ~ *,
main section:nth-of-type(3) article.glass-card {
  position: relative;
}
main section:nth-of-type(3) article.glass-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transform: scaleY(0);
  transition: opacity 400ms ease, transform 500ms var(--anim-ease);
}
main section:nth-of-type(3) article.glass-card.is-visible::after,
main section:nth-of-type(3) article.glass-card:hover::after {
  opacity: 1;
  transform: scaleY(1);
}

body > header,
body > main,
body > footer {
  position: relative;
  z-index: 1;
}

/* Subtle grid breathe */
.bg-grid {
  animation: razeGridPulse 14s ease-in-out infinite;
}
@keyframes razeGridPulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.04); }
}

/* ---------- 1. Page entrance ---------- */
[data-enter] {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  filter: blur(6px);
  animation: razeEnter var(--anim-duration) var(--anim-ease) forwards;
}
[data-enter-delay="1"] { animation-delay: 100ms; }
[data-enter-delay="2"] { animation-delay: 200ms; }
[data-enter-delay="3"] { animation-delay: 300ms; }
[data-enter-delay="4"] { animation-delay: 400ms; }
[data-enter-delay="5"] { animation-delay: 500ms; }
[data-enter-delay="6"] { animation-delay: 600ms; }

@keyframes razeEnter {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

/* Hero title shimmer */
.hero-title {
  background: linear-gradient(
    105deg,
    #fff 0%,
    #fff 38%,
    rgba(255, 255, 255, 0.55) 48%,
    #fff 58%,
    #d4d4d8 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation:
    razeEnter var(--anim-duration) var(--anim-ease) forwards,
    razeTitleShine 6s ease-in-out 1.2s infinite;
}
@keyframes razeTitleShine {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

/* Stat cards */
.stat-card {
  transition:
    transform 380ms var(--anim-ease),
    border-color 320ms ease,
    box-shadow 380ms var(--anim-ease);
}
.stat-card:hover {
  transform: translate3d(0, -3px, 0);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 32px -16px rgba(255, 255, 255, 0.12);
}

/* ---------- 2. Scroll reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--anim-distance), 0);
  filter: blur(4px);
  transition:
    opacity var(--anim-duration) var(--anim-ease),
    transform var(--anim-duration) var(--anim-ease),
    filter var(--anim-duration) var(--anim-ease);
  will-change: opacity, transform, filter;
}

[data-reveal="left"]  { transform: translate3d(calc(var(--anim-distance) * -1.4), 0, 0); }
[data-reveal="right"] { transform: translate3d(calc(var(--anim-distance) *  1.4), 0, 0); }
[data-reveal="fade"]  { transform: none; filter: blur(8px); }
[data-reveal="scale"] {
  transform: translate3d(0, calc(var(--anim-distance) * 0.6), 0) scale(0.94);
  filter: blur(6px);
}
[data-reveal="blur"]  { transform: translate3d(0, 12px, 0); filter: blur(14px); }

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

[data-reveal-stagger] > [data-reveal] {
  transition-delay: calc(var(--i, 0) * var(--anim-stagger));
}

/* ---------- 3. Glass cards ---------- */
.glass-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 420ms var(--anim-ease),
    border-color 320ms ease,
    box-shadow 420ms var(--anim-ease),
    background-color 320ms ease;
  will-change: transform;
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 45%,
    transparent 55%
  );
  transform: translate3d(-120%, 0, 0);
  transition: transform 700ms var(--anim-ease);
  pointer-events: none;
  z-index: 1;
}
.glass-card:hover::before {
  transform: translate3d(120%, 0, 0);
}
.glass-card:hover {
  transform: translate3d(0, -5px, 0);
  box-shadow:
    0 14px 36px -14px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 40px -12px rgba(255, 255, 255, 0.08);
}

/* 3D tilt (JS sets --rx / --ry) */
.glass-card.tilt-active {
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translate3d(0, -5px, 0);
  transition:
    transform 120ms ease-out,
    border-color 320ms ease,
    box-shadow 320ms ease;
}
.glass-card.tilt-active:hover {
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translate3d(0, -6px, 0);
}
.glass-card.no-tilt,
.glass-card.no-tilt.tilt-active {
  transform: none;
}
.glass-card.no-tilt:hover {
  transform: translate3d(0, -5px, 0);
}

.glass-card article svg,
.glass-card > svg {
  transition: transform 380ms var(--anim-spring), color 320ms ease;
}
.glass-card:hover > svg,
article.glass-card:hover svg.mb-4 {
  transform: translate3d(0, -2px, 0) scale(1.08);
  color: #fff;
}

.mascot-glow {
  animation: razeFloat 6s ease-in-out infinite;
}
.mascot-glow:hover {
  transform: translate3d(0, -6px, 0) scale(1.015);
  animation-play-state: paused;
}
@keyframes razeFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -6px, 0); }
}

#command-modal,
#docs-modal,
.modal-root {
  animation: none;
  isolation: isolate;
}

#command-modal:not(.hidden),
#docs-modal:not(.hidden),
.modal-root:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.modal-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  cursor: pointer;
  pointer-events: auto;
}

.modal-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: calc(100% - 2rem);
  max-width: 32rem;
  max-height: min(90dvh, calc(100dvh - 2rem));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  opacity: 1;
  visibility: visible;
  filter: none;
}

@media (max-width: 639px) {
  .modal-panel {
    width: calc(100% - 1.25rem);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1rem);
  }
}

html.is-modal-open,
html.is-modal-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-panel.glass-card {
  background-color: rgba(18, 18, 18, 0.45);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  backdrop-filter: blur(20px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 15px rgba(255, 255, 255, 0.06),
    0 0 48px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.modal-panel.glass-card::before {
  opacity: 0.85;
}

main section:first-of-type > div > div:last-child > .glass-card.bloom.no-tilt,
.hero-panel-glow {
  animation: razeFloatSubtle 3.2s ease-in-out infinite;
}

/* ---------- Home page extras ---------- */
.hero-panel-aura {
  background: radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.08), transparent 62%);
  animation: razeAuraPulse 5s ease-in-out infinite;
}
@keyframes razeAuraPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.04); }
}

.hero-panel-glow {
  position: relative;
}
.hero-panel-glow::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,0.2) 50%, transparent 75%);
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: razeBorderSweep 4s linear infinite;
  pointer-events: none;
}

.hero-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.hero-marquee-track {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  animation: razeMarquee 28s linear infinite;
}
.hero-marquee-track span {
  flex-shrink: 0;
  border-radius: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem 0.625rem;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  transition: color 320ms ease, border-color 320ms ease, transform 320ms var(--anim-ease);
}
.hero-marquee-track span:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}
@keyframes razeMarquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.home-stat[data-reveal].is-visible {
  animation: razeStatPop 560ms var(--anim-spring) both;
}
@keyframes razeStatPop {
  from { transform: translate3d(0, 16px, 0) scale(0.94); opacity: 0; }
  to   { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}

.security-card {
  transition:
    transform 380ms var(--anim-ease),
    border-color 320ms ease,
    box-shadow 380ms var(--anim-ease);
}
.security-card:hover {
  transform: translate3d(-4px, -4px, 0);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 36px -16px rgba(255, 255, 255, 0.1);
}
.security-card:hover svg {
  color: #fff;
  transform: scale(1.1) rotate(-6deg);
}
.security-card svg {
  transition: transform 400ms var(--anim-spring), color 320ms ease;
}

.cta-secondary {
  position: relative;
  overflow: hidden;
}
.cta-secondary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translate3d(-120%, 0, 0);
  transition: transform 600ms var(--anim-ease);
}
.cta-secondary:hover::after {
  transform: translate3d(120%, 0, 0);
}

.activity-card.is-highlight {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(255, 255, 255, 0.05);
  transform: translate3d(-4px, -2px, 0);
  box-shadow: 0 8px 24px -12px rgba(255, 255, 255, 0.12);
}
@keyframes razeFloatSubtle {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -8px, 0); }
}

/* Parallax layer (JS sets --parallax-y) */
[data-parallax] {
  transform: translate3d(0, var(--parallax-y, 0px), 0);
  will-change: transform;
}

/* ---------- 4. Buttons ---------- */
.btn-primary,
a[data-invite],
a.rounded-full {
  position: relative;
  overflow: hidden;
  transition:
    transform 220ms var(--anim-ease),
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms var(--anim-ease);
}
.btn-primary > *,
a[data-invite] > * {
  position: relative;
  z-index: 1;
}
.btn-primary::after,
a[data-invite]::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translate3d(-130%, 0, 0);
  transition: transform 600ms var(--anim-ease);
}
.btn-primary:hover::after,
a[data-invite]:hover::after {
  transform: translate3d(130%, 0, 0);
}
.btn-primary:hover,
a[data-invite]:hover {
  transform: translate3d(0, -2px, 0) scale(1.02);
  box-shadow: 0 10px 28px -10px rgba(255, 255, 255, 0.4);
}
.btn-primary:active,
a[data-invite]:active {
  transform: translate3d(0, 0, 0) scale(0.98);
  transition-duration: 90ms;
}

/* ---------- 5. Nav link underline sweep ---------- */
header nav a {
  position: relative;
}
header nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms var(--anim-ease);
  opacity: 0.55;
}
header nav ul a:hover::after,
header nav ul a.nav-active::after {
  transform: scaleX(1);
}

/* Logo subtle pulse */
header nav > a:first-child img {
  transition: transform 400ms var(--anim-spring), box-shadow 400ms ease;
}
header nav > a:first-child:hover img {
  transform: scale(1.06) rotate(-3deg);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

/* ---------- 6. Sidebar links (hover handled in tab motion block) ---------- */

/* ---------- 7. Command cards ---------- */
.command-card {
  opacity: 0;
  transform: translate3d(0, 20px, 0) scale(0.97);
  filter: blur(3px);
  transition:
    opacity 560ms var(--anim-ease),
    transform 560ms var(--anim-ease),
    filter 560ms var(--anim-ease),
    border-color 320ms ease;
  transition-delay: calc(min(var(--i, 0), 11) * 45ms);
}
.command-card.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}
.command-card:hover {
  transform: translate3d(0, -4px, 0) scale(1.01);
}

/* ---------- 8. Modal ---------- */
#command-modal:not(.hidden) .modal-backdrop,
#docs-modal:not(.hidden) .modal-backdrop {
  animation: razeFade 220ms ease-out both;
}
#command-modal:not(.hidden) .modal-panel.is-animating,
#docs-modal:not(.hidden) .modal-panel.is-animating {
  animation: razePanelCentered 280ms var(--anim-ease) both;
}
@keyframes razeFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes razePanelCentered {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* ---------- Category / tab motion ---------- */
.category-btn,
.sidebar-link {
  opacity: 0;
  transform: translate3d(-10px, 0, 0);
  animation: razeTabIn 480ms var(--anim-ease) forwards;
  animation-delay: calc(var(--tab-i, 0) * 45ms);
}
@keyframes razeTabIn {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.category-btn.is-active {
  animation: razeTabIn 480ms var(--anim-ease) forwards, razeTabGlow 2.8s ease-in-out infinite;
  animation-delay: calc(var(--tab-i, 0) * 45ms), 600ms;
}
@keyframes razeTabGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  50%      { box-shadow: 0 0 18px -6px rgba(255, 255, 255, 0.14); }
}
.category-btn:hover,
.sidebar-link:hover {
  transform: translate3d(4px, -1px, 0);
  background-color: rgba(255, 255, 255, 0.05);
}
.category-btn.is-active:hover {
  transform: translate3d(4px, -1px, 0);
}

#command-grid,
#docs-content {
  transition:
    opacity 280ms var(--anim-ease),
    transform 280ms var(--anim-ease),
    filter 280ms var(--anim-ease);
}
#command-grid.is-swapping,
#docs-content.is-swapping {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  filter: blur(4px);
  pointer-events: none;
}

.doc-cmd-card.command-card:hover,
.doc-guide-card.command-card:hover,
.doc-module-card.command-card:hover {
  transform: translate3d(0, -5px, 0) scale(1.015);
}

/* ---------- Hero: Live Protection panel ---------- */
.activity-card {
  opacity: 0;
  transform: translate3d(24px, 10px, 0);
  animation: razeActivityIn 680ms var(--anim-ease) forwards;
}
.activity-card:nth-child(1) { animation-delay: 560ms; }
.activity-card:nth-child(2) { animation-delay: 700ms; }
.activity-card:nth-child(3) { animation-delay: 840ms; }
@keyframes razeActivityIn {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
.activity-card {
  transition: border-color 280ms ease, transform 320ms var(--anim-ease);
}
.activity-card:hover {
  transform: translate3d(-3px, -2px, 0);
  border-color: rgba(255, 255, 255, 0.2);
}

.pulse-bar {
  width: 0%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  animation: razePulse 2.4s var(--anim-ease) infinite;
}
.pulse-bar--1 { animation-delay: 0s; }
.pulse-bar--2 { animation-delay: 0.65s; }
.pulse-bar--3 { animation-delay: 1.3s; }

@keyframes razePulse {
  0%   { width: 0%;   opacity: 0.35; box-shadow: 0 0 4px rgba(255, 255, 255, 0.2); }
  40%  { width: 72%;  opacity: 1;   box-shadow: 0 0 12px rgba(255, 255, 255, 0.5); }
  65%  { width: 88%;  opacity: 0.95; }
  100% { width: 100%; opacity: 0;   box-shadow: none; }
}

/* ---------- 9. Mobile menu ---------- */
#mobile-menu:not(.hidden) {
  animation: razeSlideDown 300ms var(--anim-spring) both;
  transform-origin: top center;
}
@keyframes razeSlideDown {
  from { opacity: 0; transform: translate3d(0, -12px, 0) scale(0.98); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* ---------- 10. CTA border glow ---------- */
#invite .glass-card {
  position: relative;
}
#invite .glass-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 80%
  );
  background-size: 200% 100%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: razeBorderSweep 5s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes razeBorderSweep {
  to { background-position: 200% center; }
}

/* ---------- 11. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal],
  [data-enter],
  .command-card,
  .activity-card,
  .hero-title,
  .category-btn,
  .sidebar-link {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    color: #fff !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    animation: none !important;
  }
  .modal-panel {
    opacity: 1 !important;
    transform: translate(-50%, -50%) !important;
  }
  .ambient-orbs,
  .bg-grid,
  .particle-field,
  .cursor-spotlight {
    animation: none !important;
    opacity: 0 !important;
  }
  [data-parallax] {
    transform: none !important;
  }
}
