/* ============================================
   SOPHICOR — MAGIC LAYER
   The difference between beautiful and extraordinary.
   Linear/Vercel-tier visual effects for a dark premium SaaS.
   ============================================ */

/* ---- 1. NOISE TEXTURE OVERLAY ---- */
/* Adds film-grain depth — flat dark backgrounds look cheap without it */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ---- 2. PAGE ENTRANCE ---- */
/* Everything fades in smoothly on load — no flash of unstyled content */
body {
  animation: page-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- 3. GLASSMORPHISM NAV ---- */
/* Upgraded from flat blur to proper glass with edge highlight */
.nav {
  background: rgba(4, 12, 24, 0.65) !important;
  backdrop-filter: blur(20px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.5) !important;
  border-bottom: 1px solid rgba(201, 168, 76, 0.08) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03);
}

/* ---- 4. CURSOR-TRACKING CARD GLOW ---- */
/* Cards glow where your mouse is — makes them feel alive */
.engine-card-v2,
.product-card,
.manifesto-item,
.stat-item,
.consult-card,
.article-card,
.pricing-card,
.bundle-card {
  position: relative;
  overflow: hidden;
}
.engine-card-v2::after,
.product-card::after,
.consult-card::after,
.article-card::after,
.pricing-card::after,
.bundle-card::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  transform: translate(-50%, -50%);
  z-index: 0;
}
.engine-card-v2:hover::after,
.product-card:hover::after,
.consult-card:hover::after,
.article-card:hover::after,
.pricing-card:hover::after,
.bundle-card:hover::after {
  opacity: 1;
}
/* Card children stay above the glow */
.engine-card-v2 > *,
.product-card > *,
.consult-card > *,
.article-card > *,
.pricing-card > *,
.bundle-card > * {
  position: relative;
  z-index: 1;
}
/* JS-injected glow div (precise cursor tracking) */
.card-glow {
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,0.14) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s ease;
  z-index: 0;
}
.engine-card-v2:hover .card-glow,
.product-card:hover .card-glow,
.consult-card:hover .card-glow,
.article-card:hover .card-glow,
.pricing-card:hover .card-glow,
.bundle-card:hover .card-glow {
  opacity: 1;
}

/* ---- 5. ANIMATED GRADIENT BORDER ---- */
/* A slow-rotating gold border glow on featured elements */
@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes border-rotate {
  to { --gradient-angle: 360deg; }
}
.product-card:hover,
.engine-card-v2:hover,
.demo-launcher:hover {
  border-color: transparent !important;
  background-clip: padding-box;
}
.product-card:hover::before,
.engine-card-v2:hover::before {
  content: '' !important;
  position: absolute !important;
  inset: -1px !important;
  border-radius: inherit !important;
  background: conic-gradient(
    from var(--gradient-angle, 0deg),
    transparent 0%,
    rgba(201,168,76,0.5) 25%,
    transparent 50%,
    rgba(201,168,76,0.3) 75%,
    transparent 100%
  ) !important;
  z-index: -1 !important;
  animation: border-rotate 4s linear infinite !important;
  transform: none !important;
  height: auto !important;
  width: auto !important;
  opacity: 1 !important;
}

/* ---- 6. TEXT SHIMMER (hero gold text) ---- */
/* A metallic light sweep across the gold gradient text */
.gold-gradient {
  position: relative;
  background-size: 200% auto !important;
  animation: text-shimmer 4s linear infinite !important;
}
@keyframes text-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: 0% center; }
}

/* ---- 7. BUTTON HOVER SHINE ---- */
/* A light sweep moves across gold buttons */
.btn-gold {
  position: relative;
  overflow: hidden;
}
.btn-gold::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.25) 50%,
    transparent 100%
  );
  transition: none;
  transform: skewX(-20deg);
}
.btn-gold:hover::after {
  animation: btn-shine 0.6s ease forwards;
}
@keyframes btn-shine {
  to { left: 150%; }
}

/* ---- 8. SECTION GRADIENT TRANSITIONS ---- */
/* No hard color breaks — sections blend into each other */
.section-manifesto::after,
.section-dark::after,
.section-stats::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--navy));
  pointer-events: none;
  z-index: 0;
}
.section-manifesto,
.section-dark,
.section-stats {
  position: relative;
}
.section-navy + .section-dark::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to bottom, var(--navy), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ---- 9. UPGRADED REVEAL ANIMATIONS ---- */
/* Elements don't just slide up — they deblur into focus */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1.2s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

/* ---- 10. STAT GLOW ACCENTS ---- */
/* Each stat number gets a soft halo behind it */
.stats-grid-large .stat-item::before {
  content: '';
  position: absolute;
  top: 10%; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(201,168,76,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.stats-grid-large .stat-item { position: relative; }
.stats-grid-large .stat-item > * { position: relative; z-index: 1; }

/* ---- 11. HERO PARALLAX ENHANCEMENT ---- */
/* The grid background moves slower than the content on scroll */
.hero-grid-bg {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ---- 12. FLOATING GLOW ORBS ---- */
/* Subtle animated gradient orbs in the background — gives depth */
.hero-manifesto::after {
  content: '';
  position: absolute;
  top: 20%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.06) 0%, transparent 60%);
  border-radius: 50%;
  animation: float-orb 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
@keyframes float-orb {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-80px, 60px) scale(1.1); }
  100% { transform: translate(40px, -40px) scale(0.95); }
}

/* ---- 13. CARD DEPTH (multi-layer shadow) ---- */
/* Premium cards use layered shadows, not a single box-shadow */
.engine-card-v2,
.product-card {
  box-shadow:
    0 2px 4px rgba(0,0,0,0.2),
    0 8px 16px rgba(0,0,0,0.15),
    0 24px 48px rgba(0,0,0,0.1);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1) !important;
}
.engine-card-v2:hover,
.product-card:hover {
  box-shadow:
    0 4px 8px rgba(0,0,0,0.3),
    0 16px 32px rgba(0,0,0,0.25),
    0 48px 80px rgba(0,0,0,0.2),
    0 0 0 1px rgba(201,168,76,0.15),
    0 0 60px rgba(201,168,76,0.06) !important;
}

/* ---- 14. MANIFESTO NUMBER GLOW ---- */
/* The oversized 01/02/03 numbers get a subtle gold glow */
.manifesto-num {
  text-shadow:
    0 0 40px rgba(201,168,76,0.15),
    0 0 80px rgba(201,168,76,0.05);
}
.manifesto-item:hover .manifesto-num {
  -webkit-text-stroke-color: var(--gold-light);
  text-shadow:
    0 0 20px rgba(201,168,76,0.3),
    0 0 60px rgba(201,168,76,0.1);
  transition: all 0.4s ease;
}

/* ---- 15. COMPARISON TABLE ROW GLOW ---- */
.comparison-table-v2 tbody tr:hover td.highlight {
  background: rgba(201,168,76,0.1);
  box-shadow: inset 0 0 30px rgba(201,168,76,0.05);
}

/* ---- 16. FOOTER GLOW LINE ---- */
.footer {
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.3), transparent);
}

/* ---- 17. DEMO LAUNCHER UPGRADED ---- */
/* Make the play button more dramatic */
.demo-launcher-play {
  box-shadow:
    0 8px 24px rgba(201,168,76,0.35),
    0 0 40px rgba(201,168,76,0.15),
    inset 0 1px 0 rgba(255,255,255,0.3) !important;
}
.demo-launcher:hover .demo-launcher-play {
  box-shadow:
    0 12px 32px rgba(201,168,76,0.45),
    0 0 60px rgba(201,168,76,0.25),
    inset 0 1px 0 rgba(255,255,255,0.3) !important;
}

/* ---- 18. ORIGIN DROP-CAP GLOW ---- */
.origin-prose p:first-letter {
  text-shadow: 0 0 30px rgba(201,168,76,0.3);
}

/* ---- 19. SCROLL-TRIGGERED SECTION LABELS ---- */
.section-label {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section:hover .section-label,
.section-header:hover .section-label {
  opacity: 1;
  transform: translateX(0);
}
/* Also reveal via JS when section is in view */
.is-visible .section-label,
.reveal.is-visible ~ .section-label,
.section-label { opacity: 1; transform: translateX(0); } /* fallback */

/* ---- 20. SMOOTH CURSOR ---- */
html { cursor: default; }
a, button, [role="button"] { cursor: pointer; }

/* ---- 21. SELECTION COLOR ---- */
::selection {
  background: rgba(201,168,76,0.3);
  color: var(--white);
}

/* ---- REDUCED MOTION ---- */
@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }
  body { animation: none; }
  .gold-gradient { animation: none !important; }
  .btn-gold::after { animation: none; display: none; }
  .reveal { filter: none !important; transition: opacity 0.3s ease !important; }
  .hero-manifesto::after { animation: none; }
  .manifesto-num { text-shadow: none; }
  .product-card::before, .engine-card-v2::before { animation: none !important; }
}
