/* ============================================================================
   ThatDeveloperGuy.com — 3D/4D Visual Masterpiece Layer
   Layered ON TOP of styles.css — additive, not destructive.
   Activated when this stylesheet is loaded after styles.css.
   ============================================================================ */

/* ---------- Hardware acceleration globally for transformed elements ---------- */
.hero, .card, .btn, .section, [data-reveal] {
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ---------- 3D scroll-driven starfield (depth layers) ---------- */
.starfield-3d {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  perspective: 1000px;
  perspective-origin: 50% 50%;
}
.starfield-3d::before,
.starfield-3d::after,
.starfield-3d > .layer {
  content: "";
  position: absolute;
  inset: -10% -10%;
  background-repeat: repeat;
}
.starfield-3d::before {
  background-image:
    radial-gradient(1.5px 1.5px at 10% 12%, rgba(253,245,201,0.95), transparent 50%),
    radial-gradient(2px 2px at 22% 88%, rgba(247,226,142,0.85), transparent 55%),
    radial-gradient(1.2px 1.2px at 78% 41%, rgba(242,208,104,0.9), transparent 50%),
    radial-gradient(1.8px 1.8px at 35% 67%, rgba(253,245,201,0.85), transparent 55%),
    radial-gradient(1.4px 1.4px at 65% 14%, rgba(247,226,142,0.9), transparent 50%),
    radial-gradient(2.1px 2.1px at 90% 75%, rgba(242,208,104,0.85), transparent 55%),
    radial-gradient(1.3px 1.3px at 5% 50%, rgba(253,245,201,0.8), transparent 55%);
  background-size: 100% 100%;
  animation: drift-far 240s linear infinite;
  opacity: 0.55;
  transform: translateZ(-400px) scale(1.4);
}
.starfield-3d::after {
  background-image:
    radial-gradient(2.4px 2.4px at 12% 28%, rgba(253,245,201,0.95), transparent 60%),
    radial-gradient(2.8px 2.8px at 47% 71%, rgba(247,226,142,0.95), transparent 60%),
    radial-gradient(3px 3px at 82% 22%, rgba(253,245,201,1), transparent 65%),
    radial-gradient(2.2px 2.2px at 28% 92%, rgba(242,208,104,0.95), transparent 60%);
  background-size: 100% 100%;
  animation: drift-near 160s linear infinite reverse, twinkle 7s ease-in-out infinite;
  opacity: 0.85;
  transform: translateZ(-100px) scale(1.1);
}
.starfield-3d > .layer-mid {
  background-image:
    radial-gradient(1.6px 1.6px at 18% 55%, rgba(253,245,201,0.85), transparent 55%),
    radial-gradient(2px 2px at 60% 32%, rgba(247,226,142,0.8), transparent 55%),
    radial-gradient(1.8px 1.8px at 88% 78%, rgba(242,208,104,0.85), transparent 55%),
    radial-gradient(1.4px 1.4px at 7% 87%, rgba(253,245,201,0.7), transparent 55%);
  background-size: 100% 100%;
  animation: drift-mid 200s linear infinite, twinkle 11s ease-in-out infinite;
  opacity: 0.7;
  transform: translateZ(-220px) scale(1.25);
}
@keyframes drift-far { from { background-position: 0 0; } to { background-position: -500px -800px; } }
@keyframes drift-mid { from { background-position: 0 0; } to { background-position: 600px -400px; } }
@keyframes drift-near { from { background-position: 0 0; } to { background-position: -1200px -300px; } }
@keyframes twinkle { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---------- Aurora sweep (Van Gogh swirl, very subtle) ---------- */
.aurora-3d {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 1200px 600px at 18% -10%, rgba(86,119,199,0.18), transparent 60%),
    radial-gradient(ellipse 900px 500px at 92% 20%, rgba(247,226,142,0.10), transparent 65%),
    radial-gradient(ellipse 1100px 700px at 50% 110%, rgba(139,107,217,0.14), transparent 60%);
  filter: blur(40px);
  animation: aurora-shift 28s ease-in-out infinite alternate;
}
@keyframes aurora-shift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2vw, 1vh, 0) scale(1.08); }
  100% { transform: translate3d(2vw, -1vh, 0) scale(1.02); }
}

/* ---------- Hero: 3D depth ---------- */
.hero {
  perspective: 1400px;
  transform-style: preserve-3d;
}
.hero-inner {
  transform-style: preserve-3d;
}
.hero h1 {
  text-shadow:
    0 1px 0 rgba(242,208,104,0.18),
    0 2px 0 rgba(242,208,104,0.14),
    0 4px 12px rgba(242,208,104,0.20),
    0 8px 24px rgba(10,22,53,0.55),
    0 18px 60px rgba(0,0,0,0.55);
  animation: hero-float 9s ease-in-out infinite;
}
.hero h1 em {
  display: inline-block;
  background: linear-gradient(135deg, #fdf5c9 0%, #f7e28e 35%, #e0a24a 65%, #f2d068 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shimmer 6s ease-in-out infinite;
  filter: drop-shadow(0 4px 18px rgba(242,208,104,0.5));
}
@keyframes hero-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0deg); }
  50%      { transform: translate3d(0, -6px, 20px) rotateX(0.5deg); }
}
@keyframes gradient-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-sub {
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* ---------- 3D card tilt — pure CSS, no JS ---------- */
.card,
.card-grid .card,
.pricing-card,
article.card {
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateZ(0);
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              border-color 0.4s ease;
  will-change: transform, box-shadow;
}
.card:hover,
.card-grid .card:hover,
article.card:hover {
  transform: perspective(1200px) rotateX(-4deg) rotateY(6deg) translateZ(24px);
  box-shadow:
    0 0 0 1px rgba(242,208,104,0.5),
    0 14px 40px -10px rgba(242,208,104,0.30),
    0 30px 80px -20px rgba(0,0,0,0.6),
    0 50px 130px -30px rgba(86,119,199,0.25);
  border-color: rgba(242,208,104,0.6) !important;
}

/* Holographic gradient border for cards on hover */
.card::before,
.card-grid .card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg,
    rgba(242,208,104,0) 0%,
    rgba(242,208,104,0.4) 25%,
    rgba(247,226,142,0.7) 50%,
    rgba(86,119,199,0.4) 75%,
    rgba(242,208,104,0) 100%);
  background-size: 300% 300%;
  -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 0.5s ease;
  pointer-events: none;
  animation: gradient-shimmer 4s linear infinite;
}
.card:hover::before,
.card-grid .card:hover::before {
  opacity: 1;
}

/* Card content lifts to second 3D layer on hover */
.card h3,
.card .card-emoji {
  transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  transform: translateZ(0);
}
.card:hover h3 { transform: translateZ(30px); }
.card:hover .card-emoji { transform: translateZ(40px) scale(1.08); }
.card:hover p { transform: translateZ(15px); }

/* ---------- Buttons: 3D depth with magnetic glow ---------- */
.btn {
  position: relative;
  transform-style: preserve-3d;
  transform: translateZ(0) translateY(0);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 0.35s ease,
              filter 0.35s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(242,208,104,0.45), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  filter: blur(20px);
  z-index: -1;
}
.btn:hover {
  transform: translateZ(8px) translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(242,208,104,0.7),
    0 12px 28px -8px rgba(242,208,104,0.5),
    0 24px 60px -16px rgba(0,0,0,0.55);
  filter: brightness(1.08);
}
.btn:hover::after { opacity: 1; }
.btn:active {
  transform: translateZ(2px) translateY(-1px);
  transition: transform 0.1s ease;
}

/* ---------- Section transitions: 4D scroll feel ---------- */
.section,
section.section {
  position: relative;
  transform: perspective(1500px) translateZ(0);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(40px) translateZ(-60px) rotateX(8deg);
  transition: opacity 1s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              transform 1s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
[data-reveal].in,
[data-reveal][data-revealed],
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) translateZ(0) rotateX(0deg);
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero h1, .aurora-3d, .starfield-3d::before, .starfield-3d::after, .starfield-3d > .layer { animation: none; }
}

/* ---------- Section accent: depth-of-field gradient mask ---------- */
.section-accent,
section.section-accent {
  position: relative;
  overflow: hidden;
}
.section-accent::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(242,208,104,0.5) 20%,
    rgba(247,226,142,0.8) 50%,
    rgba(242,208,104,0.5) 80%,
    transparent 100%);
}
.section-accent::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(242,208,104,0.06), transparent 60%);
  pointer-events: none;
}

/* ---------- Headings: 3D extruded depth ---------- */
.section h2 {
  position: relative;
  text-shadow:
    0 1px 0 rgba(242,208,104,0.16),
    0 2px 0 rgba(242,208,104,0.12),
    0 6px 18px rgba(0,0,0,0.4);
  transform-style: preserve-3d;
}

/* ---------- Pricing cards: floating with 3D shadow ---------- */
.pricing-card {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 0.6s ease;
}
.pricing-card:hover {
  transform: perspective(1500px) rotateX(-2deg) translateZ(30px) translateY(-6px);
  box-shadow:
    0 0 0 1px rgba(242,208,104,0.55),
    0 18px 50px -12px rgba(242,208,104,0.32),
    0 40px 100px -25px rgba(0,0,0,0.65);
}

/* ---------- Glassmorphism for elevated surfaces ---------- */
.bg-elev,
.glass {
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  background: linear-gradient(135deg,
    rgba(19,42,85,0.55) 0%,
    rgba(10,22,53,0.72) 100%);
  border: 1px solid rgba(242,208,104,0.18);
}

/* ---------- Hero CTAs: enhanced depth ---------- */
.hero-ctas .btn {
  position: relative;
}
.hero-ctas .btn:first-child {
  background-image: linear-gradient(135deg, #f2d068 0%, #f7e28e 50%, #e0a24a 100%);
  background-size: 200% 200%;
  animation: gradient-shimmer 8s ease-in-out infinite;
  color: #0a1635 !important;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
  box-shadow:
    0 0 0 1px rgba(242,208,104,0.6),
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 8px 24px rgba(242,208,104,0.4);
}

/* ---------- Floating decoration: rotating concentric rings (3D) ---------- */
.deco-ring {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(242,208,104,0.10);
  pointer-events: none;
  z-index: 0;
  transform-style: preserve-3d;
  animation: rotate-ring 60s linear infinite;
}
.deco-ring::before,
.deco-ring::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(242,208,104,0.08);
}
.deco-ring::before { inset: 80px; }
.deco-ring::after { inset: 160px; border-color: rgba(247,226,142,0.06); }
@keyframes rotate-ring {
  0%   { transform: rotateX(70deg) rotateZ(0deg); }
  100% { transform: rotateX(70deg) rotateZ(360deg); }
}

/* ---------- Constellation lines (subtle SVG-style) ---------- */
.constellation {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(45deg, transparent 49.5%, rgba(242,208,104,0.6) 50%, transparent 50.5%),
    linear-gradient(-30deg, transparent 49.5%, rgba(247,226,142,0.5) 50%, transparent 50.5%);
  background-size: 800px 800px, 600px 600px;
  background-position: 100px 200px, 400px 600px;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
}

/* ---------- Card emoji nodes: pulse with 3D glow ---------- */
.card-emoji .node,
.node {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fdf5c9, #f2d068 60%, #b87333 100%);
  box-shadow:
    0 0 0 2px rgba(242,208,104,0.25),
    0 0 12px rgba(242,208,104,0.55),
    0 0 32px rgba(247,226,142,0.4),
    inset 0 1px 1px rgba(255,255,255,0.5);
  animation: node-pulse 3s ease-in-out infinite;
}
@keyframes node-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 2px rgba(242,208,104,0.25), 0 0 12px rgba(242,208,104,0.55), 0 0 32px rgba(247,226,142,0.4), inset 0 1px 1px rgba(255,255,255,0.5); }
  50%      { transform: scale(1.18); box-shadow: 0 0 0 4px rgba(242,208,104,0.4), 0 0 24px rgba(242,208,104,0.85), 0 0 60px rgba(247,226,142,0.6), inset 0 1px 1px rgba(255,255,255,0.7); }
}

/* ---------- "Live" badge / signal indicator, neural pulse ---------- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f7e28e;
  box-shadow: 0 0 0 0 rgba(247,226,142,0.7);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(247,226,142,0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(247,226,142,0); }
  100% { box-shadow: 0 0 0 0 rgba(247,226,142,0); }
}

/* ---------- Marquee strip with 3D perspective ---------- */
.marquee-3d {
  position: relative;
  overflow: hidden;
  perspective: 800px;
  perspective-origin: 50% 50%;
  padding: 1rem 0;
}
.marquee-3d-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: marquee-scroll 50s linear infinite;
  transform: rotateX(0deg);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "wght" 400, "WONK" 1;
  font-size: clamp(2.4rem, 5vw, 5rem);
  color: rgba(242,208,104,0.4);
}
.marquee-3d-track > span {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
}
.marquee-3d-track > span::after {
  content: "✦";
  color: rgba(247,226,142,0.6);
  font-size: 0.55em;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Footer wordmark: depth on hover ---------- */
.foot__wordmark, .footer-wordmark {
  background: linear-gradient(135deg, #fdf5c9 0%, #f2d068 50%, #b87333 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(242,208,104,0.25));
  transition: filter 0.5s ease, transform 0.5s ease;
}
.foot__wordmark:hover, .footer-wordmark:hover {
  filter: drop-shadow(0 10px 30px rgba(242,208,104,0.5));
  transform: scale(1.02);
}

/* ---------- Image: subtle 3D float on hover ---------- */
img.float-3d, .img-3d, .case-image {
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 0.6s ease,
              filter 0.5s ease;
  border-radius: 12px;
}
img.float-3d:hover, .img-3d:hover, .case-image:hover {
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg) translateZ(20px);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.65);
  filter: brightness(1.04) saturate(1.06);
}

/* ---------- "Hand-coded" emphasis: subtle paper grain ---------- */
.section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.020;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.82 0 0 0 0 0.4 0 0 0 0.5 0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
  background-repeat: repeat;
  z-index: 1;
}

/* ---------- CTA section: enhanced gradient depth ---------- */
section.cta-band, .cta-band, .cta-strip {
  position: relative;
  overflow: hidden;
}
section.cta-band::before, .cta-band::before, .cta-strip::before {
  content: "";
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(circle at 30% 40%, rgba(242,208,104,0.15), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(247,226,142,0.10), transparent 50%);
  filter: blur(50px);
  animation: aurora-shift 22s ease-in-out infinite alternate;
  pointer-events: none;
}

/* ---------- Reduce 3D effects on small screens to keep performance ---------- */
@media (max-width: 768px) {
  .card:hover, .card-grid .card:hover, article.card:hover {
    transform: perspective(1200px) rotateX(-2deg) rotateY(3deg) translateZ(12px);
  }
  .deco-ring { width: 400px; height: 400px; }
  .starfield-3d::before { animation-duration: 360s; }
  .starfield-3d::after  { animation-duration: 240s; }
}

/* ---------- Honor reduced-motion preference for everything ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .card:hover, .pricing-card:hover, img.float-3d:hover { transform: none !important; }
}
