/* Visual motion layer — blue/black glass, respects reduced motion */

.fx-aurora,
.fx-grid,
.fx-spot,
.fx-canvas {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.fx-canvas { z-index: 1; opacity: 0.55; }
.fx-spot {
  z-index: 1;
  width: 42vw;
  height: 42vw;
  max-width: 560px;
  max-height: 560px;
  margin: -21vw 0 0 -21vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.18), rgba(37,99,235,.06) 42%, transparent 70%);
  filter: blur(8px);
  opacity: 0.9;
  will-change: transform;
}
.fx-aurora {
  z-index: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(37,99,235,.34), transparent 60%),
    radial-gradient(720px 420px at 88% 8%, rgba(56,189,248,.14), transparent 55%),
    radial-gradient(640px 520px at 50% 110%, rgba(29,78,216,.16), transparent 50%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}
.fx-grid {
  z-index: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(147,197,253,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147,197,253,.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 75%);
  animation: gridPulse 12s ease-in-out infinite;
}

.fx-main,
.site-footer {
  position: relative;
  z-index: 2;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

body.fx-page {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1);
}
body.fx-page.fx-booted {
  opacity: 1;
  transform: none;
}

.site-header {
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.site-header.is-scrolled {
  background: rgba(5, 7, 12, 0.9);
  border-bottom-color: rgba(96,165,250,.28);
  box-shadow: 0 10px 40px rgba(0,0,0,.35), 0 0 0 1px rgba(59,130,246,.08);
}

.brand img {
  transition: transform .45s cubic-bezier(.22,1,.36,1), box-shadow .45s ease, filter .45s ease;
}
.brand:hover img {
  transform: scale(1.06) rotate(-3deg);
  filter: drop-shadow(0 0 14px rgba(59,130,246,.45));
}

.nav-links a {
  position: relative;
  overflow: hidden;
  transition: color .25s ease, background .25s ease, border-color .25s ease, transform .25s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #60a5fa, transparent);
  transform: scaleX(0);
  transition: transform .3s ease;
}
.nav-links a:hover { transform: translateY(-1px); }
.nav-links a.active::after,
.nav-links a:hover::after { transform: scaleX(1); }

[data-reveal] {
  opacity: 0;
  transform: translateY(22px) scale(.98);
  filter: blur(6px);
  transition:
    opacity .7s cubic-bezier(.22,1,.36,1),
    transform .7s cubic-bezier(.22,1,.36,1),
    filter .7s ease;
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,.28);
  background: linear-gradient(90deg, rgba(37,99,235,.18), rgba(14,165,233,.08));
  color: #bfdbfe;
  font-size: 0.82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  animation: kickerGlow 3.2s ease-in-out infinite;
}
.hero-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 12px #60a5fa;
  animation: pulseDot 1.6s ease-in-out infinite;
}

.fx-title .fx-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px) rotateX(40deg);
  animation: charIn .7s cubic-bezier(.22,1,.36,1) forwards;
  animation-delay: calc(var(--i) * 42ms + 120ms);
  background: linear-gradient(180deg, #fff 20%, #93c5fd 75%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 28px rgba(59,130,246,.18);
}

.hero-badge {
  position: relative;
  transition: transform .25s ease;
  animation: badgeFloat 5.5s ease-in-out infinite;
}
.hero-badge img {
  position: relative;
  z-index: 2;
  border-radius: 28px;
  filter: drop-shadow(0 0 24px rgba(59,130,246,.35));
  animation: logoPulse 4.8s ease-in-out infinite;
}

.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s ease, box-shadow .3s ease, filter .25s ease, border-color .25s ease;
}
.btn > span { position: relative; z-index: 1; }
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.22), transparent 45%);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 0;
}
.btn:hover::before { opacity: 1; }
.btn-primary {
  box-shadow: 0 10px 30px var(--blue-glow), 0 0 0 1px rgba(147,197,253,.12);
  animation: ctaPulse 3.4s ease-in-out infinite;
}
.btn-primary:hover {
  box-shadow: 0 14px 40px rgba(59,130,246,.5), 0 0 0 1px rgba(191,219,254,.25);
}
.fx-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  transform: scale(0);
  animation: ripple .6s ease-out forwards;
  pointer-events: none;
  z-index: 2;
}

.card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform .25s ease, border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgba(59,130,246,.22), transparent 45%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.card:hover {
  border-color: rgba(96,165,250,.42);
  box-shadow: 0 18px 50px rgba(0,0,0,.35), 0 0 0 1px rgba(59,130,246,.15);
}
.card:hover::before { opacity: 1; }
.card .icon {
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease;
}
.card:hover .icon {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 24px rgba(59,130,246,.35);
}

.contact-strip {
  position: relative;
  overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.contact-strip::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 45%;
  background: linear-gradient(110deg, transparent, rgba(147,197,253,.14), transparent);
  transform: translateX(-120%) skewX(-18deg);
  animation: sheen 5.5s ease-in-out infinite;
}
.contact-strip:hover {
  transform: translateY(-2px);
  border-color: rgba(96,165,250,.4);
  box-shadow: 0 16px 40px rgba(0,0,0,.3);
}

.guide-search {
  transition: border-color .3s ease, box-shadow .3s ease;
}
.guide-search:focus-within {
  border-color: rgba(96,165,250,.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}
.doc-side {
  /* keep sticky panel solid above animated chapters */
  isolation: isolate;
}
.guide-search input[type=search] {
  transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.settings-hit {
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
  animation: hitIn .35s cubic-bezier(.22,1,.36,1) both;
}
.settings-hit:hover {
  transform: translateX(4px);
  border-color: rgba(96,165,250,.45);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
@keyframes hitIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.chapter {
  position: relative;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease, background .35s ease;
}
.chapter::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #60a5fa, transparent);
  opacity: 0;
  transition: opacity .3s ease;
}
.chapter:hover {
  border-color: rgba(96,165,250,.35);
  box-shadow: 0 14px 36px rgba(0,0,0,.28);
}
.chapter:hover::before { opacity: 1; }
.chapter.is-focused {
  border-color: rgba(96,165,250,.7);
  background: #0f1b33;
  box-shadow:
    0 0 0 1px rgba(96,165,250,.35),
    0 18px 48px rgba(37,99,235,.28),
    0 0 40px rgba(59,130,246,.18);
  animation: chapterPulse 1.1s ease;
}
.chapter.is-focused::before { opacity: 1; }
@keyframes chapterPulse {
  0% { transform: scale(0.985); }
  40% { transform: scale(1.01); }
  100% { transform: none; }
}

.toc-body a {
  position: relative;
  transition: color .25s ease, background .25s ease, transform .25s ease, padding-left .25s ease;
}
.toc-body a.is-active,
.toc-body a:hover {
  color: #e2e8f0;
  background: rgba(59,130,246,.14);
  transform: translateX(3px);
}
.toc-body a.is-active {
  box-shadow: inset 3px 0 0 #60a5fa;
}

.mobile-toc {
  transition: border-color .3s ease, box-shadow .3s ease;
}
.mobile-toc[open] {
  box-shadow: 0 12px 36px rgba(0,0,0,.25);
}

.prose code {
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.prose code:hover {
  border-color: rgba(96,165,250,.45);
  color: #dbeafe;
}

@keyframes auroraDrift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-2%, 1.5%, 0) scale(1.05); }
}
@keyframes gridPulse {
  0%, 100% { opacity: .14; }
  50% { opacity: .24; }
}
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(59,130,246,.28)); }
  50% { filter: drop-shadow(0 0 34px rgba(96,165,250,.55)); }
}
@keyframes charIn {
  to { opacity: 1; transform: none; }
}
@keyframes ripple {
  to { transform: scale(2.4); opacity: 0; }
}
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 10px 30px rgba(59,130,246,.35); }
  50% { box-shadow: 0 12px 38px rgba(59,130,246,.55); }
}
@keyframes sheen {
  0%, 55% { transform: translateX(-120%) skewX(-18deg); }
  80%, 100% { transform: translateX(320%) skewX(-18deg); }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .55; }
}
@keyframes kickerGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(59,130,246,0); }
  50% { box-shadow: 0 0 24px rgba(59,130,246,.18); }
}

@media (max-width: 900px) {
  .fx-spot { display: none; }
  .fx-canvas { opacity: .35; }
  .hero-badge { animation-duration: 7s; }
  .card:hover { transform: none; }
  .btn:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fx-aurora,
  .fx-grid,
  .fx-spot,
  .fx-canvas,
  .contact-strip::after { display: none !important; }

  body.fx-page,
  [data-reveal],
  .fx-title .fx-char,
  .hero-badge,
  .hero-badge img,
  .btn-primary,
  .brand img,
  .chapter.is-focused,
  .chapter-sheet,
  .chapter-sheet-bar,
  .chapter-sheet-body {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}
