/* =========================================================
   DG ANIMATIONS v4
   Fixes from feedback:
   - Text NEVER fades (opacity stays 1 at all times) — only
     moves/slides into place.
   - Boxes (hero card, product image frames) keep their
     border/shape visible from the very start — nothing is
     clipped away and revealed later.
   - Bubbles replaced with a canvas particle "constellation"
     network in the hero (connecting lines that react to the
     cursor) — a genuinely different, more premium effect.
   ========================================================= */

/* ---------- 0. Page loader ---------- */
#dgLoader {
  position: fixed; inset: 0;
  background: #0e0e0e;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.6s ease 0.1s;
}
#dgLoader.dg-loader-done {
  transform: translateY(-100%);
  opacity: 0.98;
  pointer-events: none;
}
#dgLoader .dg-loader-bar-track {
  width: 200px; height: 2px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
#dgLoader .dg-loader-bar {
  width: 0%; height: 100%;
  background: #fff;
  transition: width 0.3s ease;
}
#dgLoader .dg-loader-word {
  position: absolute;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.6;
  transform: translateY(28px);
}
body.dg-loading { overflow: hidden; }

/* ---------- 1. Custom cursor — hero section only ---------- */
.dg-cursor-dot, .dg-cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  border-radius: 50%;
  z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease, width 0.25s ease, height 0.25s ease, border-color 0.25s ease;
}
.dg-cursor-dot.dg-cursor-active, .dg-cursor-ring.dg-cursor-active {
  opacity: 1;
}
.dg-cursor-dot {
  width: 6px; height: 6px;
  background: #111;
}
.dg-cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(17,17,17,0.4);
}
.dg-cursor-ring.dg-cursor-hover {
  width: 56px; height: 56px;
  border-color: rgba(17,17,17,0.7);
}
@media (hover: none) {
  .dg-cursor-dot, .dg-cursor-ring { display: none; }
}
/* hide the native cursor only inside the hero, where the custom one takes over */
.dg-hero { cursor: none; }

/* ---------- 2. Reveal on scroll — MOTION ONLY, opacity always 1 ---------- */
[data-reveal] {
  opacity: 1;                 /* never invisible */
  transform: translateY(28px);
  transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].dg-in-view {
  transform: translateY(0);
}
[data-reveal]:nth-child(2) { transition-delay: 0.08s; }
[data-reveal]:nth-child(3) { transition-delay: 0.16s; }
[data-reveal]:nth-child(4) { transition-delay: 0.24s; }

/* ---------- 3. Product image entrance — box/frame stays put, only the photo settles ---------- */
.dg-product-img {
  overflow: hidden;
  position: relative;
  border-radius: inherit;
  /* box/frame itself: no clip-path, no opacity animation, always fully visible */
}
.dg-product-img img {
  transform: scale(1.08);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.dg-product-img.dg-in-view img {
  transform: scale(1);
}
.dg-product:hover .dg-product-img img {
  transform: scale(1.06);
}
.dg-product-img::after {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.dg-product:hover .dg-product-img::after { left: 130%; }

/* ---------- 4. Hero card: box is ALWAYS fully visible, border/shadow intact from load ---------- */
.dg-hero-card-wrap { perspective: 1000px; }
.dg-hero-card {
  transition: transform 0.15s ease-out, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  /* no opacity, no clip-path — box shape is stable at all times */
}
.dg-hero-card:hover { box-shadow: 0 28px 56px rgba(0, 0, 0, 0.18); }

.dg-hero-card-body { position: relative; min-height: 220px; }
.dg-hero-card-body .dg-panel {
  position: absolute; inset: 0;
  opacity: 0;                 /* panel crossfade is content-swap, not entrance — kept minimal */
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.dg-hero-card-body .dg-panel.dg-panel-active {
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}

/* ---------- 5. Hero: constellation canvas replaces bubbles ---------- */
.dg-hero { position: relative; overflow: hidden; }
.dg-hero-grid { position: relative; z-index: 1; }
#dgConstellation {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 6. Headline: line-by-line curtain reveal.
   Each line sits inside a mask (overflow:hidden) and slides
   up from behind it — no letter-splitting, no blur, text is
   solid black and fully opaque at all times. ---------- */
.dg-h1 {
  opacity: 1;
}
.dg-h1 .dg-line-mask {
  display: block;
  overflow: hidden;
}
.dg-h1 .dg-line-inner {
  display: block;
  transform: translateY(115%);
  transition: transform 1.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.dg-h1.dg-in-view .dg-line-mask:nth-of-type(1) .dg-line-inner { transition-delay: 0.05s; }
.dg-h1.dg-in-view .dg-line-mask:nth-of-type(2) .dg-line-inner { transition-delay: 0.22s; }
.dg-h1.dg-in-view .dg-line-mask:nth-of-type(3) .dg-line-inner { transition-delay: 0.39s; }
.dg-h1.dg-in-view .dg-line-mask:nth-of-type(4) .dg-line-inner { transition-delay: 0.56s; }
.dg-h1.dg-in-view .dg-line-inner {
  transform: translateY(0);
}
.dg-h1 mark {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #000;
}

/* ---------- 7. Magnetic buttons + underline sweep ---------- */
.dg-btn-dark, .dg-btn-accent {
  position: relative;
  transition: transform 0.15s ease-out, box-shadow 0.25s ease;
  will-change: transform;
}
.dg-btn-dark:hover, .dg-btn-accent:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.dg-btn-underline { position: relative; }
.dg-btn-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.3s ease;
}
.dg-btn-underline:hover::after { width: 100%; }

/* ---------- 8. Sliding tab indicator ---------- */
.dg-tabs { position: relative; }
.dg-tabs::after {
  content: "";
  position: absolute;
  bottom: 0; height: 2px;
  background: currentColor;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  left: var(--dg-tab-left, 0px);
  width: var(--dg-tab-width, 0px);
}
.dg-tabs button { transition: color 0.25s ease, transform 0.2s ease; }
.dg-tabs button:hover { transform: translateY(-1px); }
.dg-tab-panel { transition: transform 0.3s ease; }
.dg-tab-panel.dg-tab-fading { transform: translateY(6px); }

/* ---------- 9. Count-up stat ---------- */
.dg-count { display: inline-block; font-variant-numeric: tabular-nums; }

/* ---------- 10. Ticker: speeds up with scroll velocity, pauses on hover ---------- */
.dg-ticker:hover .dg-ticker-track { animation-play-state: paused; }
.dg-ticker-track { will-change: transform; }

/* ---------- 11. CTA pulse ring ---------- */
.dg-btn-accent { position: relative; }
.dg-btn-accent::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid currentColor;
  opacity: 0;
  animation: dg-pulse-ring 2.4s ease-out infinite;
}
@keyframes dg-pulse-ring {
  0%   { opacity: 0.4; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.15); }
}

/* ---------- 12. Accreditation logos ---------- */
.dg-accred-row > div img {
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
}
.dg-accred-row > div:hover img {
  filter: grayscale(0);
  opacity: 1;
  transform: translateY(-3px);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  [data-reveal], .dg-product-img img { transition: none; transform: none; }
  .dg-h1 .dg-line-inner { transition: none; transform: none; }
  .dg-btn-accent::before { animation: none; display: none; }
  .dg-hero-card { transition: none; }
  #dgLoader { display: none; }
  #dgConstellation { display: none; }
}