/* ============================================================
   HODLIUM polish layer — smoother motion + richer atmosphere
   Loaded after the original bundle CSS; does not restyle brand.
   ============================================================ */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Boot fade so first paint feels intentional */
body {
  animation: hod-body-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes hod-body-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Stronger diamond float — closer to the live orbital feel */
.diamond-logo-stage img {
  animation: diamond-float-boost 7.2s ease-in-out infinite !important;
  will-change: transform, filter;
}

@keyframes diamond-float-boost {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
    filter: saturate(0.72) contrast(1.12) brightness(0.9)
      drop-shadow(0 18px 40px rgba(112, 188, 232, 0.18));
  }
  33% {
    transform: translate3d(6px, -12px, 0) scale(1.022) rotate(0.4deg);
    filter: saturate(0.88) contrast(1.14) brightness(1.04)
      drop-shadow(0 28px 58px rgba(159, 220, 255, 0.32));
  }
  66% {
    transform: translate3d(-5px, -6px, 0) scale(1.012) rotate(-0.35deg);
    filter: saturate(0.8) contrast(1.12) brightness(0.98)
      drop-shadow(0 22px 48px rgba(119, 199, 255, 0.24));
  }
}

/* Soft ambient glow behind logo stage */
.diamond-logo-stage::before {
  content: "";
  position: absolute;
  inset: 18% 22%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(159, 220, 255, 0.16) 0%,
    rgba(119, 199, 255, 0.06) 42%,
    transparent 70%
  );
  filter: blur(28px);
  animation: hod-glow-breathe 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hod-glow-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Contour canvas: slightly richer presentation */
.contour-field {
  filter: saturate(1.08) brightness(1.05);
  transition: opacity 0.6s ease;
}

/* Header glass + soft lift on scroll */
.site-header {
  transition: box-shadow 0.35s ease, background 0.35s ease, border-color 0.35s ease !important;
}

body.is-scrolled .site-header {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(159, 220, 255, 0.06) !important;
  background: rgba(3, 4, 5, 0.92) !important;
}

/* Buttons — smoother springy hover */
.primary-action,
.secondary-action,
.menu-button,
.wallet-menu button,
button:not(:disabled) {
  transition:
    transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    filter 0.25s ease !important;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translate(-3px, -3px) scale(1.01) !important;
  box-shadow:
    4px 4px 0 #415666,
    0 0 36px rgba(159, 220, 255, 0.22) !important;
}

.primary-action:active,
.secondary-action:active {
  transform: translate(0, 0) scale(0.99) !important;
  transition-duration: 0.12s !important;
}

/* Cards / bands — hover lift + edge glow */
.metric-band,
.position-summary,
.history-overview,
.wallet-band,
.event-band,
.page-title-band,
.staking-workbench,
.mechanism-band,
.history-section,
.data-section,
.staking-principles,
.history-ledger-full,
.status-column,
.empty-state-band,
.docs-title,
.docs-nav {
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.35s ease !important;
}

.metric-band:hover,
.position-summary:hover,
.history-overview:hover,
.wallet-band:hover,
.event-band:hover,
.staking-workbench:hover,
.mechanism-band:hover,
.history-section:hover,
.data-section:hover,
.status-column:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(159, 220, 255, 0.1);
  border-color: rgba(159, 220, 255, 0.35) !important;
}

/* Scroll-reveal for sections that miss original delays */
.hod-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.hod-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children inside revealed blocks */
.hod-reveal.is-visible > * {
  animation: section-rise 0.65s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hod-reveal.is-visible > *:nth-child(2) { animation-delay: 0.06s; }
.hod-reveal.is-visible > *:nth-child(3) { animation-delay: 0.12s; }
.hod-reveal.is-visible > *:nth-child(4) { animation-delay: 0.18s; }
.hod-reveal.is-visible > *:nth-child(5) { animation-delay: 0.24s; }

/* Status pulse a bit more alive */
.status-dot,
.network-check.is-correct .status-dot {
  animation: status-pulse 2.2s ease-in-out infinite;
}

/* Links */
a.text-link,
.site-header a {
  transition: color 0.25s ease, opacity 0.25s ease, text-shadow 0.25s ease;
}

a.text-link:hover,
.site-header a:hover {
  text-shadow: 0 0 18px rgba(159, 220, 255, 0.35);
}

/* COMING SOON chip */
.hod-ca-chip {
  position: fixed;
  z-index: 9999;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(159, 220, 255, 0.4);
  background: rgba(5, 9, 12, 0.88);
  color: #d9f3ff;
  font: 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px rgba(159, 220, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  animation: hod-chip-in 0.8s 0.4s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hod-ca-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 237, 255, 0.75);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 32px rgba(159, 220, 255, 0.22);
}

.hod-ca-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9fdcff;
  box-shadow: 0 0 0 0 rgba(159, 220, 255, 0.5);
  animation: hod-dot-pulse 1.8s ease-out infinite;
}

.hod-ca-chip.copied {
  border-color: rgba(188, 234, 255, 0.9);
  color: #020405;
  background: #c4edff;
}

@keyframes hod-chip-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hod-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(159, 220, 255, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(159, 220, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(159, 220, 255, 0); }
}

/* Soft vignette + grain for depth (very light) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, transparent 40%, rgba(0, 0, 0, 0.28) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.7;
  mix-blend-mode: soft-light;
}

/* Pointer ambient light */
.hod-pointer-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(159, 220, 255, 0.09) 0%, transparent 68%);
  opacity: 0;
  transition: opacity 0.4s ease;
  mix-blend-mode: screen;
  will-change: transform;
}

body.has-pointer .hod-pointer-glow {
  opacity: 1;
}

/* Route page-frame entrance already exists; reinforce smoothness */
.page-frame {
  animation: hod-frame-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes hod-frame-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile: dial back heavy effects */
@media (max-width: 720px) {
  .hod-pointer-glow { display: none; }
  .diamond-logo-stage img {
    animation-duration: 9s !important;
  }
  .metric-band:hover,
  .position-summary:hover,
  .history-overview:hover,
  .wallet-band:hover,
  .event-band:hover,
  .staking-workbench:hover,
  .mechanism-band:hover,
  .history-section:hover,
  .data-section:hover,
  .status-column:hover {
    transform: none;
  }
  .hod-ca-chip {
    right: 10px;
    bottom: 10px;
    font-size: 10px;
    padding: 8px 12px;
  }
}
