/* MOSS — ported 21st.dev components, translated to vanilla CSS on the
   existing sage/moss token system. No frameworks, no Tailwind classes.
   Loaded after the inline <style> block in index.html so these rules win
   any shared-specificity ties with the base .cards-4 / .engine-stats css. */

/* ---------------------------------------------------------------------
   1. Hero radial gradient background (cult-ui "Hero Static Radial Gradient")
   Foreman override: the hero is now a full-bleed video background: the
   shader-style bloom below is the fallback/overlay ambience (sits behind
   the video and shows through before it loads, or if it never loads),
   not the main event. Structural rules for .hero / .hero-grid live in
   index.html's own <style> block; this file only layers the visuals. */
.hero-glow {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
  background:
    radial-gradient(46% 60% at 74% 28%, rgba(131, 197, 127, 0.30), transparent 68%),
    radial-gradient(38% 46% at 90% 70%, rgba(169, 194, 75, 0.20), transparent 70%),
    radial-gradient(52% 55% at 28% 84%, rgba(46, 91, 59, 0.14), transparent 72%);
  filter: blur(46px);
}
.hero-glow::after {
  content: "";
  position: absolute; inset: 0;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.hero-video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; object-fit: cover;
  background: var(--ground-2);
}
.hero-scrim {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(100deg,
    rgba(238, 243, 233, 0.94) 0%,
    rgba(238, 243, 233, 0.86) 40%,
    rgba(238, 243, 233, 0.64) 58%,
    rgba(238, 243, 233, 0.22) 80%,
    rgba(238, 243, 233, 0.04) 100%);
}
.hero .wrap.hero-grid { position: relative; z-index: 3; max-width: 640px; }
@media (max-width: 640px) {
  .hero-glow { opacity: 0.75; }
  .hero-scrim {
    background: linear-gradient(180deg,
      rgba(238, 243, 233, 0.90) 0%,
      rgba(238, 243, 233, 0.78) 55%,
      rgba(238, 243, 233, 0.55) 100%);
  }
}

/* ---------------------------------------------------------------------
   2. Count Up (unlumen) — spring-eased count with a per-digit pop.
   Markup/behaviour lives in js/components.js; this is just the digit
   reveal micro-animation. */
.cu-digit { display: inline-block; }
.cu-pop { animation: cuPop 0.22s ease; }
@keyframes cuPop {
  from { opacity: 0.35; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cu-pop { animation: none; }
}

/* ---------------------------------------------------------------------
   3. Live pulse (shadcnspace Number Ticker) — small pulsing "live" dot,
   used on the epoch-countdown labels, not as a new metric. */
.live-pulse { display: inline-flex; align-items: center; gap: 6px; }
.pulse-dot { position: relative; width: 7px; height: 7px; flex: none; }
.pulse-ping {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--moss-bright); opacity: 0.65;
  animation: mossPing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-core { position: absolute; inset: 0; border-radius: 50%; background: var(--moss); }
@keyframes mossPing {
  0% { transform: scale(1); opacity: 0.65; }
  75%, 100% { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-ping { animation: none; opacity: 0; }
}

/* ---------------------------------------------------------------------
   4. Glowing Effect (Cursor-style pointer-tracking border) — engine
   panel + spread-grid card. JS drives --glow-active / --glow-angle. */
.glow-card { position: relative; }
.glow-card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: var(--radius);
  padding: 2px;
  background: conic-gradient(from var(--glow-angle, 0deg) at 50% 50%,
    var(--moss-bright), var(--chartreuse), var(--moss-deep), var(--moss-bright));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: var(--glow-active, 0);
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 3;
}
@media (prefers-reduced-motion: reduce) {
  .glow-card::before { display: none; }
}

/* ---------------------------------------------------------------------
   5. Bento Grid (kokonutd) — "How it works" restructured into a mixed
   grid: Spread is the featured cell, the other three stay small. Copy
   is untouched, only placement/sizing changes. */
.bento-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(150px, auto);
  gap: var(--s3);
}
.bento-grid .bento-a { grid-column: 1 / 2; grid-row: 1 / 2; }
.bento-grid .bento-b { grid-column: 1 / 2; grid-row: 2 / 3; }
.bento-grid .card-featured {
  grid-column: 2 / 4; grid-row: 1 / 3;
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(160deg, var(--panel), var(--ground-2));
}
.bento-grid .bento-d {
  grid-column: 4 / 5; grid-row: 1 / 3;
  display: flex; flex-direction: column; justify-content: center;
}
.bento-grid .card-featured .dot { width: 44px; height: 44px; font-size: 16px; }
.bento-grid .card-featured h3 { font-size: clamp(22px, 2.4vw, 28px); }
.bento-grid .card-featured p { font-size: 16px; max-width: 380px; }
@media (max-width: 980px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; }
  .bento-grid .bento-a { grid-column: 1 / 2; grid-row: auto; }
  .bento-grid .bento-b { grid-column: 2 / 3; grid-row: auto; }
  .bento-grid .card-featured { grid-column: 1 / 3; grid-row: auto; }
  .bento-grid .bento-d { grid-column: 1 / 3; grid-row: auto; }
}
@media (max-width: 480px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-grid .bento-a,
  .bento-grid .bento-b,
  .bento-grid .card-featured,
  .bento-grid .bento-d { grid-column: 1 / 2; }
}

/* ---------------------------------------------------------------------
   6. Crypto Asset Card (ravikatiyar162) — two-panel gradient card used
   to restyle the wallet balance/staked readout. #engineBalance and
   #engineStaked keep their ids so moss-live.js is untouched. */
.engine-stats { align-items: stretch; }
.asset-card {
  display: flex; flex: 1 1 320px; max-width: 360px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--lift);
}
.asset-card-panel {
  flex: 1 1 50%; padding: var(--s2) var(--s3);
  display: flex; flex-direction: column; gap: 6px; justify-content: center;
}
.asset-card-gradient { background: var(--spread-gradient); }
.asset-card-gradient .mono-label { color: rgba(255, 255, 255, 0.75); }
.asset-card-plain { background: var(--ground-2); }
.asset-card-value { font-size: 17px; }
.asset-card-gradient .asset-card-value { color: #fff; }
.engine-next { display: flex; flex-direction: column; gap: 6px; justify-content: center; }

/* ---------------------------------------------------------------------
   7. Fluid Accordion (micka_design) — proximity hover + spring open/close
   on the FAQ, kept as native details/summary for no-JS degradation. */
.faq { position: relative; }
.faq-highlight {
  position: absolute; left: -16px; right: -16px; top: 0; height: 0;
  opacity: 0; background: var(--ground-2); border-radius: 14px;
  pointer-events: none; z-index: 0;
  transition: top 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              height 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.2s ease;
}
.faq details { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .faq-highlight { transition: opacity 0.2s ease; }
}
