/* ==========================================================================
   Animations: scroll-reveal, stagger, glow, hero parallax, spinner
   Driven by reveal.js toggling [data-reveal] -> .is-visible via IntersectionObserver.
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="fade"] { transform: none; }
[data-reveal="slide-up"] { transform: translateY(36px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="scale"].is-visible { transform: scale(1); }

/* Stagger: children get incremental delay via inline --stagger-index set by reveal.js */
[data-reveal-group] > [data-reveal] {
  transition-delay: calc(var(--stagger-index, 0) * 90ms);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Hero parallax layer (subtle, transform driven by parallax.js scroll listener) */
.hero__parallax-layer {
  will-change: transform;
}

/* Pixel-dissolve motif — echoes the dot-dissolve treatment in the TechBay
   mark. A sparse dot grid faded from one corner, not a blurred gradient
   blob: brand-specific decoration instead of generic glow. Static by
   default; a very slow, subtle drift only when motion is allowed. */
@keyframes pixel-drift {
  0%, 100% { background-position: 0 0; }
  50% { background-position: 6px 6px; }
}

.pixel-motif {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image: radial-gradient(circle, var(--color-blue-400) 1.6px, transparent 1.7px);
  background-size: 24px 24px;
}

@media (prefers-reduced-motion: no-preference) {
  .pixel-motif { animation: pixel-drift 14s ease-in-out infinite; }
}

.pixel-motif--top-right {
  width: 300px; height: 300px; top: -40px; right: -20px;
  -webkit-mask-image: radial-gradient(circle at 100% 0%, black 0%, black 8%, transparent 62%);
  mask-image: radial-gradient(circle at 100% 0%, black 0%, black 8%, transparent 62%);
}

.pixel-motif--top-left {
  width: 280px; height: 280px; top: -30px; left: -20px;
  -webkit-mask-image: radial-gradient(circle at 0% 0%, black 0%, black 8%, transparent 62%);
  mask-image: radial-gradient(circle at 0% 0%, black 0%, black 8%, transparent 62%);
}

.pixel-motif--bottom-left {
  width: 260px; height: 260px; bottom: -30px; left: -10px;
  background-image: radial-gradient(circle, var(--color-cyan-400) 1.6px, transparent 1.7px);
  -webkit-mask-image: radial-gradient(circle at 0% 100%, black 0%, black 8%, transparent 62%);
  mask-image: radial-gradient(circle at 0% 100%, black 0%, black 8%, transparent 62%);
  animation-delay: 3s;
}

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }

/* Sticky navbar entrance shadow already handled via .is-scrolled transition in components.css */

/* Simple page-load fade for main content (progressive enhancement, no FOUC risk since content is visible by default without JS) */
.page-fade-in {
  animation: page-fade-in var(--dur-slow) var(--ease-out);
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .page-fade-in { animation: none; }
}

/* Inner-page banners: a circuit-trace cluster anchored in the top-right
   corner (parallel bus traces with round terminals), faded toward the text.
   Pixel squares echo the dot-dissolve in the TechBay mark. */
.page-hero > .container { position: relative; z-index: 1; }
.page-hero::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 560px; max-width: 100%;
  height: 260px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='260' viewBox='0 0 560 260' fill='none'%3E%3Cg stroke='%233B8BFF' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M560 30H430L370 90H300'/%3E%3Cpath d='M560 44H444L384 104H270'/%3E%3Cpath d='M560 58H458L398 118H240'/%3E%3Cpath d='M560 72H472L412 132H210'/%3E%3Cpath d='M560 170H520L492 198V236'/%3E%3Cpath d='M560 196H548L534 210V246'/%3E%3Cpath d='M470 0V22L446 46'/%3E%3Cpath d='M420 0V40'/%3E%3C/g%3E%3Cg fill='%230A1F4A' stroke='%2322D3EE' stroke-width='1.6'%3E%3Ccircle cx='300' cy='90' r='4'/%3E%3Ccircle cx='270' cy='104' r='4'/%3E%3Ccircle cx='240' cy='118' r='4'/%3E%3Ccircle cx='210' cy='132' r='4'/%3E%3Ccircle cx='492' cy='240' r='4'/%3E%3Ccircle cx='534' cy='250' r='4'/%3E%3Ccircle cx='446' cy='46' r='4'/%3E%3Ccircle cx='420' cy='44' r='4'/%3E%3C/g%3E%3Cg fill='%2322D3EE'%3E%3Crect x='176' y='120' width='8' height='8'/%3E%3Crect x='190' y='134' width='6' height='6'/%3E%3Crect x='164' y='138' width='5' height='5'/%3E%3Crect x='200' y='118' width='4' height='4'/%3E%3Crect x='330' y='150' width='7' height='7'/%3E%3Crect x='344' y='164' width='5' height='5'/%3E%3C/g%3E%3C/svg%3E") no-repeat top right / contain;
  -webkit-mask-image: radial-gradient(ellipse at top right, #000 45%, transparent 90%);
  mask-image: radial-gradient(ellipse at top right, #000 45%, transparent 90%);
}
@media (max-width: 767px) {
  .page-hero::after { width: 320px; height: 150px; opacity: 0.5; }
}

/* Each inner page gets a different orientation of the corner circuit
   (About keeps the default top-right). Transforms carry the mask with them. */
.page-hero--tl::after { right: auto; left: 0; transform: scaleX(-1); }
.page-hero--br::after { top: auto; bottom: 0; transform: scaleY(-1); }
.page-hero--bl::after { top: auto; right: auto; bottom: 0; left: 0; transform: scale(-1, -1); }
.page-hero--tr-tilt::after { transform: rotate(-12deg) scale(1.05); }
.page-hero--tl-tilt::after { right: auto; left: 0; transform: scaleX(-1) rotate(-12deg) scale(1.05); }
.page-hero--br-tilt::after { top: auto; bottom: 0; transform: scaleY(-1) rotate(12deg) scale(1.05); }
