/* ======================================================================
   MGEQuant · assets/css/site.css
   "Out of this world" visual layer — loads after each page's inline <style>.
   Reuses the page's own design tokens (--bg, --blue, --aurora-*, --border, …);
   declares NO new colors. Respects prefers-reduced-motion.
   ====================================================================== */

:root {
  --site-ease: 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  --site-glow: rgba(59, 139, 255, 0.45);
  --site-glass: color-mix(in oklab, var(--bg-panel) 78%, transparent);
  --site-border-glass: rgba(255, 255, 255, 0.06);
}

/* ---------------------------------------------------------------- aurora
   Body-wide drifting glow orbs. Pure CSS, no images, no layout shift. */
.site-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.site-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.5;
  animation: site-drift 16s ease-in-out infinite alternate;
}
.site-orb.a { top: 8%;   left: 6%;  width: 760px; height: 760px; background: var(--aurora-a); animation-duration: 17s; }
.site-orb.b { bottom: 12%; right: 10%; width: 960px; height: 960px; background: var(--aurora-d); animation-duration: 23s; animation-delay: -6s; }
.site-orb.c { top: 28%;  right: 18%; width: 560px; height: 560px; background: var(--aurora-c); animation-duration: 20s; animation-delay: -10s; }
@keyframes site-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(24px, -48px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .site-orb { animation: none !important; filter: blur(48px); opacity: 0.35; }
}

/* ---------------------------------------------------------------- glass
   Frosted panels: backdrop-blur, hairline border, inner sheen edge. */
.glass {
  position: relative;
  background: var(--site-glass);
  border: 1px solid var(--site-border-glass);
  box-shadow: 0 24px 56px -20px rgba(0, 0, 0, 0.45);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(111, 168, 255, 0.08), transparent);
  -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: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}
@supports not (mask-composite: exclude) { .glass::before { display: none; } }
.glass:hover {
  border-color: var(--blue-dim);
  box-shadow: 0 28px 70px -24px rgba(59, 139, 255, 0.55);
}

/* --------------------------------------------------------------- reveal
   Scroll-reveal sections and cards. */
.reveal {
  transition: opacity 0.85s var(--site-ease), transform 0.85s var(--site-ease);
}
/* Only sections the script marked as below the fold start hidden: without the script nothing is ever hidden. */
.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(24px);
}
.reveal--stagger:nth-child(1) { transition-delay: 0.08s; }
.reveal--stagger:nth-child(2) { transition-delay: 0.18s; }
.reveal--stagger:nth-child(3) { transition-delay: 0.28s; }
.reveal--stagger:nth-child(4) { transition-delay: 0.38s; }
.reveal--stagger:nth-child(5) { transition-delay: 0.48s; }
.reveal--stagger:nth-child(6) { transition-delay: 0.58s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

.glow {
  box-shadow: 0 0 0 1px rgba(59, 139, 255, 0.25), 0 0 26px var(--site-glow);
}

/* ------------------------------------------------------------- workstation
   Hero: an animated trading desk (inline SVG, no image files). Candles form one by one, keys light up,
   the coffee steams. Everything stops for visitors who turn motion off. */
.hero-visual.ws::after { display: none; }
.ws-scene { position: absolute; inset: 0; width: 100%; height: calc(100% - 72px); }   /* the slogan gets its own strip below the desk */
.ws-frame { fill: #0a0e16; stroke: rgba(140, 180, 255, 0.28); stroke-width: 1.2; }
.ws-screen { fill: #04070d; }
.ws-grid { stroke: rgba(120, 160, 255, 0.09); stroke-width: 1; }
.ws-label { fill: #7d8390; font: 600 7.5px system-ui, sans-serif; letter-spacing: 0.06em; }
.ws-wick { stroke: #9aa0ab; stroke-width: 1.3; stroke-linecap: round; opacity: 0.8; }
.ws-up { fill: #3b8bff; }
.ws-dn { fill: rgba(111, 168, 255, 0.28); stroke: rgba(111, 168, 255, 0.55); stroke-width: 0.8; }
.ws-equity { fill: none; stroke: #8cc6ff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ws-desk { fill: #0b1018; }
.ws-desk-edge { stroke: rgba(140, 180, 255, 0.35); stroke-width: 1.2; }
.ws-stand { fill: #121a28; }
.wsb-c { animation: wsb-grow 6.4s ease-out infinite both; }
@keyframes wsb-grow { 0% { transform: scaleY(0); opacity: 0; } 5% { transform: scaleY(1); opacity: 1; } 88% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.wsb-line { stroke-dasharray: 330; stroke-dashoffset: 330; animation: wsb-line 6.4s ease-out infinite; opacity: 0.85; }
@keyframes wsb-line { 0% { stroke-dashoffset: 330; } 80%, 88% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.wsb-logo { animation: ws-blink 3.5s ease-in-out infinite; }
@keyframes ws-blink { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.45; } }
.wsb-bar { fill: rgba(59, 139, 255, 0.55); }
.wsb-kb { fill: #0d1320; stroke: rgba(140, 180, 255, 0.22); stroke-width: 1; }
.wsb-keys rect { fill: rgba(111, 168, 255, 0.22); animation: wsb-key 3.3s steps(1) infinite; }
@keyframes wsb-key { 0%, 92% { fill: rgba(111, 168, 255, 0.22); } 93%, 100% { fill: #8cc6ff; } }
.wsb-mug { fill: #121a28; stroke: rgba(140, 180, 255, 0.3); stroke-width: 1; }
.wsb-handle { fill: none; stroke: rgba(140, 180, 255, 0.3); stroke-width: 5; }
.wsb-steam { fill: none; stroke: rgba(200, 220, 255, 0.45); stroke-width: 2.2; stroke-linecap: round; animation: wsb-steam 3.2s ease-in-out infinite; }
@keyframes wsb-steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) {
  .ws-scene * { animation: none !important; }
  .wsb-c { opacity: 1; transform: none; }
  .wsb-line { stroke-dashoffset: 0; }
}
/* Phones: the desk on top, markets and slogan in a strip underneath (no text over the picture). */
@media (max-width: 760px) {
  .hero-visual.ws { aspect-ratio: auto; min-height: 360px; }
  .hero-visual.ws .ws-scene { height: calc(100% - 78px); }
  .hero-visual.ws .markets { top: auto; right: auto; left: 16px; bottom: 18px; display: flex; gap: 14px; }
  .hero-visual.ws .slogan { bottom: 12px; font-size: 0.66rem; line-height: 1.7; }
}

/* ------------------------------------------------------------- hero
   Soft glow behind the hero visual. */
.hero-glow {
  position: absolute;
  inset: -10%;
  z-index: -1;
  filter: blur(44px);
  background: radial-gradient(circle at 40% 40%, color-mix(in oklab, var(--blue) 35%, transparent), transparent 55%);
  opacity: 0.45;
  animation: site-pulse 5s ease-in-out infinite alternate;
}
@keyframes site-pulse {
  from { opacity: 0.35; transform: scale(1); }
  to   { opacity: 0.7;   transform: scale(1.06); }
}

/* ----------------------------------------------------------- interaction
   Glass social icons. */
.social a {
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.social a:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 0 14px var(--site-glow);
}

/* Phones and small screens: the glow stays, the constant motion does not (battery, smooth scrolling). */
@media (max-width: 760px) {
  .site-orb { animation: none; filter: blur(48px); opacity: 0.35; }
  .hero-glow { animation: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-glow { animation: none; } }
