/* =========================================================
   FX 2030 — Web Mesh + 3D Depth Layer
   Loaded AFTER site.css
   ========================================================= */

/* =========================================================
   WEB MESH — subtle radial web pattern
   ========================================================= */
.hero-web {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0%, transparent 60%, rgba(34,211,238,.4) 61%, transparent 62%),
    repeating-conic-gradient(from 0deg at 50% 50%,
      transparent 0deg 14deg,
      rgba(34,211,238,.35) 14deg 15deg,
      transparent 15deg 30deg);
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  animation: webPulse 12s ease-in-out infinite;
}
@keyframes webPulse {
  0%, 100% { opacity: .12; transform: scale(1); }
  50%      { opacity: .22; transform: scale(1.04); }
}

/* Web mesh on programs section */
.programs-web {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(34,211,238,.4) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(34,211,238,.4) 39px 40px);
  mask-image: radial-gradient(ellipse at 80% 20%, black 0%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 80% 20%, black 0%, transparent 60%);
}

/* =========================================================
   PERSPECTIVE GRID FLOOR — 2030 dashboard feel
   ========================================================= */
.hero-floor {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: -10%;
  height: 55%;
  pointer-events: none;
  perspective: 400px;
  perspective-origin: 50% 0%;
  opacity: .5;
  mask-image: linear-gradient(180deg, transparent 0%, black 40%, black 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 40%, black 100%);
}
.hero-floor::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34,211,238,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,211,238,.35) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: rotateX(65deg);
  transform-origin: 50% 0%;
  animation: floorScroll 8s linear infinite;
}
@keyframes floorScroll {
  to { background-position: 0 60px, 60px 0; }
}

/* =========================================================
   FLOATING 3D SHAPES
   ========================================================= */
.fx-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.fx-cube {
  position: absolute;
  width: 90px;
  height: 90px;
  transform-style: preserve-3d;
  animation: cubeSpin 22s linear infinite;
}
.fx-cube--lg { width: 130px; height: 130px; }
.fx-cube > span {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(34,211,238,.55);
  background: rgba(34,211,238,.04);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.fx-cube > span:nth-child(1) { transform: translateZ(45px); }
.fx-cube > span:nth-child(2) { transform: rotateY(180deg) translateZ(45px); }
.fx-cube > span:nth-child(3) { transform: rotateY(90deg) translateZ(45px); }
.fx-cube > span:nth-child(4) { transform: rotateY(-90deg) translateZ(45px); }
.fx-cube > span:nth-child(5) { transform: rotateX(90deg) translateZ(45px); }
.fx-cube > span:nth-child(6) { transform: rotateX(-90deg) translateZ(45px); }
.fx-cube--lg > span:nth-child(1) { transform: translateZ(65px); }
.fx-cube--lg > span:nth-child(2) { transform: rotateY(180deg) translateZ(65px); }
.fx-cube--lg > span:nth-child(3) { transform: rotateY(90deg) translateZ(65px); }
.fx-cube--lg > span:nth-child(4) { transform: rotateY(-90deg) translateZ(65px); }
.fx-cube--lg > span:nth-child(5) { transform: rotateX(90deg) translateZ(65px); }
.fx-cube--lg > span:nth-child(6) { transform: rotateX(-90deg) translateZ(65px); }

@keyframes cubeSpin {
  0%   { transform: rotateX(0) rotateY(0) rotateZ(0); }
  100% { transform: rotateX(360deg) rotateY(720deg) rotateZ(180deg); }
}

.fx-sphere {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%,
      rgba(255,255,255,.4) 0%,
      rgba(34,211,238,.35) 25%,
      rgba(5,150,105,.4) 55%,
      rgba(4,30,51,.9) 100%);
  box-shadow:
    inset -10px -10px 30px rgba(0,0,0,.6),
    inset 8px 8px 20px rgba(34,211,238,.35),
    0 0 40px rgba(34,211,238,.4);
  animation: sphereFloat 8s ease-in-out infinite;
}
@keyframes sphereFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-25px) scale(1.05); }
}

.fx-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(34,211,238,.5);
  box-shadow: 0 0 30px rgba(34,211,238,.3), inset 0 0 30px rgba(34,211,238,.15);
  animation: ringSpin 10s linear infinite;
}
.fx-ring::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(16,185,129,.6);
  animation: ringSpin 6s linear infinite reverse;
}
.fx-ring::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(34,211,238,.9);
  box-shadow: 0 0 20px rgba(34,211,238,1);
}
@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

/* Position shapes inside hero */
.fx-shapes--hero .fx-cube--1   { top: 12%; right: 8%; }
.fx-shapes--hero .fx-cube--2   { bottom: 18%; left: 6%; transform: scale(.75); }
.fx-shapes--hero .fx-sphere--1 { top: 30%; right: 22%; }
.fx-shapes--hero .fx-sphere--2 { bottom: 22%; right: 34%; transform: scale(.7); }
.fx-shapes--hero .fx-ring--1   { top: 20%; left: 12%; }
.fx-shapes--hero .fx-ring--2   { bottom: 12%; right: 12%; transform: scale(.8); }

/* Position shapes inside programs */
.fx-shapes--programs .fx-cube--1   { top: 8%; right: 6%; transform: scale(.7); }
.fx-shapes--programs .fx-sphere--1 { bottom: 12%; left: 5%; }
.fx-shapes--programs .fx-ring--1   { top: 45%; right: 3%; transform: scale(.6); }

/* Hide on small screens for performance */
@media (max-width: 991.98px) {
  .fx-shapes { display: none; }
  .hero-floor { display: none; }
  .hero-web { opacity: .1; }
}

/* =========================================================
   HUD CORNER BRACKETS — comic / 2030 UI
   ========================================================= */
.hud { position: relative; }
.hud::before,
.hud::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--cyan, #22D3EE);
  border-style: solid;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 5;
}
.hud::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
  transform: translate(-6px, -6px);
}
.hud::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
  transform: translate(6px, 6px);
}
.hud:hover::before,
.hud:hover::after {
  opacity: 1;
  transform: translate(0, 0);
}

/* Full 4-corner version */
.hud-4 { position: relative; }
.hud-4 .hud-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--cyan, #22D3EE);
  border-style: solid;
  pointer-events: none;
  opacity: 0;
  transition: all .4s cubic-bezier(.34,1.56,.64,1);
  z-index: 5;
}
.hud-4 .hud-corner.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; transform: translate(-8px,-8px); }
.hud-4 .hud-corner.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; transform: translate(8px,-8px); }
.hud-4 .hud-corner.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; transform: translate(-8px,8px); }
.hud-4 .hud-corner.br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; transform: translate(8px,8px); }
.hud-4:hover .hud-corner { opacity: 1; transform: translate(0,0); }

/* =========================================================
   3D TILT CARDS
   ========================================================= */
.tilt {
  transform-style: preserve-3d;
  perspective: 1000px;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.tilt-inner {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    600px circle at var(--mx, 50%) var(--my, 50%),
    rgba(34,211,238,.15),
    transparent 40%
  );
  opacity: 0;
  transition: opacity .3s;
  z-index: 3;
}
.tilt:hover .tilt-shine { opacity: 1; }

/* Disable tilt on touch */
@media (hover: none) {
  .tilt-inner { transform: none !important; }
  .tilt-shine { display: none; }
}

/* =========================================================
   SPIDEY-SENSE PULSE on Donate button
   ========================================================= */
.btn-donate {
  position: relative;
}
.btn-donate::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1.5px solid rgba(34,211,238,.6);
  opacity: 0;
  pointer-events: none;
  animation: spideySense 3s ease-out infinite;
}
@keyframes spideySense {
  0%   { opacity: 0; transform: scale(.95); }
  30%  { opacity: .9; transform: scale(1.05); }
  60%  { opacity: 0; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* =========================================================
   NEON GLOW on hero primary button
   ========================================================= */
.btn-hero-primary {
  position: relative;
  overflow: hidden;
}
.btn-hero-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,.5), transparent);
  transform: translateX(-100%);
  transition: transform .8s ease;
  pointer-events: none;
}
.btn-hero-primary:hover::before { transform: translateX(100%); }
.btn-hero-primary:hover {
  box-shadow:
    0 16px 40px rgba(255,255,255,.25),
    0 0 30px rgba(34,211,238,.5),
    0 0 60px rgba(16,185,129,.35);
}

/* =========================================================
   DIAGONAL SECTION TRANSITION
   ========================================================= */
.section-diagonal {
  position: relative;
  clip-path: polygon(0 0, 100% 3vw, 100% 100%, 0 calc(100% - 3vw));
  padding-top: 7rem;
  padding-bottom: 7rem;
  margin-top: -3vw;
  margin-bottom: -3vw;
}
@media (max-width: 767.98px) {
  .section-diagonal { clip-path: none; padding-top: 4rem; padding-bottom: 4rem; margin: 0; }
}

/* =========================================================
   3D TEXT DEPTH on hero title
   ========================================================= */
.hero-title {
  text-shadow:
    0 1px 0 rgba(0,0,0,.15),
    0 2px 0 rgba(0,0,0,.1),
    0 4px 12px rgba(0,0,0,.35),
    0 8px 30px rgba(34,211,238,.25);
}
.hero-title em {
  text-shadow:
    0 1px 0 rgba(0,0,0,.2),
    0 4px 16px rgba(16,185,129,.4),
    0 8px 40px rgba(34,211,238,.35);
}

/* =========================================================
   SCROLL-REVEAL 3D — cards come in rotated
   ========================================================= */
.reveal-3d {
  opacity: 0;
  transform: perspective(1000px) rotateX(12deg) translateY(40px);
  transition:
    opacity 1s cubic-bezier(.2,.8,.2,1),
    transform 1.1s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}
.reveal-3d.is-visible {
  opacity: 1;
  transform: perspective(1000px) rotateX(0) translateY(0);
}

/* =========================================================
   ANIMATED GRADIENT BORDER (2030 glow)
   ========================================================= */
.glow-border {
  position: relative;
  isolation: isolate;
}
.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--angle, 0deg),
    transparent 0deg,
    var(--cyan, #22D3EE) 90deg,
    var(--emerald, #059669) 180deg,
    transparent 270deg,
    transparent 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  z-index: -1;
  animation: rotateAngle 4s linear infinite;
}
.glow-border:hover::before { opacity: 1; }
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotateAngle {
  to { --angle: 360deg; }
}

/* =========================================================
   PERFORMANCE + ACCESSIBILITY
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .fx-cube, .fx-sphere, .fx-ring, .hero-web, .hero-floor::before,
  .btn-donate::after, .glow-border::before {
    animation: none !important;
  }
  .reveal-3d { opacity: 1; transform: none; }
}

/* Print */
@media print {
  .fx-shapes, .hero-web, .hero-floor { display: none !important; }
  .hud::before, .hud::after, .hud-4 .hud-corner { display: none !important; }
}