/*
  Landing page (front.blade.php) only. Loaded via @push('head') after
  public/css/iagd-theme.css, so these rules extend the theme and win ties.
  Every color and easing is a theme token.

  Motion is GPU-only (transform / opacity / offset-distance) and disabled
  under prefers-reduced-motion. will-change is used sparingly (one layer for
  the marquee) to avoid promoting dozens of compositor layers.
*/

.iagd-home {
  padding-bottom: 8px;
}

/* ---- Hero -------------------------------------------------------------- */

.iagd-hero2 {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 56px) 0 clamp(32px, 5vw, 60px);
}
/* Violet glow pooled behind the helix side. */
.iagd-hero2::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -10%;
  right: -6%;
  width: 60%;
  height: 120%;
  pointer-events: none;
  background: radial-gradient(45% 45% at 70% 40%, rgba(124, 58, 237, 0.28), transparent 70%);
}

/* World-map backdrop. The SVG is used only as an alpha mask over a violet /
   gold gradient, so the map's own colors are irrelevant and it composites as
   a single rasterized layer (cheap). */
.iagd-hero2__map {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
  background: linear-gradient(115deg, var(--color-accent-text), var(--color-accent) 45%, var(--color-gold));
  -webkit-mask: url("../images/map.svg") no-repeat center / cover;
  mask: url("../images/map.svg") no-repeat center / cover;
}

.iagd-hero2__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}
@media (min-width: 900px) {
  .iagd-hero2__inner {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 32px;
  }
}

.iagd-hero2__title {
  font-size: clamp(30px, 5.4vw, 54px);
  letter-spacing: -0.5px;
  margin-top: 8px;
  max-width: 12ch;
}
.iagd-hero2__sub {
  margin-top: 14px;
  max-width: 46ch;
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.55;
}

/* Counters row. */
.iagd-hero2__figures {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 40px);
  margin-top: clamp(24px, 4vw, 34px);
}
.iagd-figure {
  display: flex;
  flex-direction: column;
}
.iagd-figure__num {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-gold);
  text-shadow: 0 0 30px rgba(230, 201, 122, 0.22);
}
.iagd-figure__num--alt {
  color: var(--color-accent-text);
  text-shadow: 0 0 30px rgba(124, 58, 237, 0.32);
}
.iagd-figure__label {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-dim-2);
}

/* Species composition bar + legend. */
.iagd-compo {
  margin-top: clamp(22px, 4vw, 30px);
  max-width: 460px;
}
.iagd-compo__bar {
  display: flex;
  height: 10px;
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid var(--color-layer-stroke);
  background: var(--color-layer);
}
.iagd-compo__seg {
  flex: none;
  min-width: 4px;
  height: 100%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform-origin: left center;
  animation: iagdSegGrow 900ms var(--ease-fluent-out) both;
}
@keyframes iagdSegGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.iagd-compo__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
}
.iagd-compo__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-dim-1);
}
.iagd-compo__key i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.iagd-compo__key b {
  color: var(--color-text-on-dark);
  font-variant-numeric: tabular-nums;
}

/* Drifting gene particles. Small divs, no per-element layer promotion. */
.iagd-hero2__particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.iagd-hero2__particles span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--color-accent-text);
  opacity: 0.26;
  animation: iagdDrift 14s var(--ease-fluent) infinite;
}
.iagd-hero2__particles span:nth-child(odd) { background: var(--color-gold); opacity: 0.2; }
.iagd-hero2__particles span:nth-child(1)  { left: 8%;  top: 20%; animation-duration: 15s; }
.iagd-hero2__particles span:nth-child(2)  { left: 18%; top: 70%; animation-duration: 18s; animation-delay: -3s; }
.iagd-hero2__particles span:nth-child(3)  { left: 30%; top: 35%; animation-duration: 13s; animation-delay: -6s; }
.iagd-hero2__particles span:nth-child(4)  { left: 42%; top: 82%; animation-duration: 20s; animation-delay: -1s; }
.iagd-hero2__particles span:nth-child(5)  { left: 55%; top: 15%; animation-duration: 16s; animation-delay: -8s; }
.iagd-hero2__particles span:nth-child(6)  { left: 63%; top: 60%; animation-duration: 19s; animation-delay: -2s; }
.iagd-hero2__particles span:nth-child(7)  { left: 74%; top: 30%; animation-duration: 14s; animation-delay: -5s; }
.iagd-hero2__particles span:nth-child(8)  { left: 84%; top: 74%; animation-duration: 17s; animation-delay: -9s; }
.iagd-hero2__particles span:nth-child(9)  { left: 90%; top: 45%; animation-duration: 21s; animation-delay: -4s; }
.iagd-hero2__particles span:nth-child(10) { left: 48%; top: 48%; animation-duration: 15s; animation-delay: -7s; }
@keyframes iagdDrift {
  0%   { transform: translate3d(0, 0, 0); opacity: 0.05; }
  50%  { transform: translate3d(6px, -22px, 0); opacity: 0.3; }
  100% { transform: translate3d(-4px, -44px, 0); opacity: 0.05; }
}

/* ---- DNA helix of real pets ---------------------------------------- */

.iagd-hero2__helix {
  display: flex;
  justify-content: center;
}
/* Fixed 300 x 480 so offset-path coordinates (px) match the SVG viewBox. */
.iagd-helix {
  position: relative;
  width: 300px;
  height: 480px;
}
.iagd-helix__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.iagd-helix__strand {
  fill: none;
  stroke: url(#iagdStrand);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.7;
  filter: drop-shadow(0 0 5px rgba(124, 58, 237, 0.45));
  stroke-dasharray: 6 10;
  animation: iagdStrandFlow 2.6s linear infinite;
}
@keyframes iagdStrandFlow {
  to { stroke-dashoffset: -16; }
}
.iagd-helix__rung {
  stroke: var(--color-accent-text);
  stroke-width: 1.5;
  opacity: 0.2;
}

/* Pets ride the strands. offset-path is set per element (strand A or B).
   They fade in on entry and out on exit; a negative animation-delay spreads
   them along the strand. */
.iagd-helix__flows {
  position: absolute;
  inset: 0;
}
.iagd-helix__flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  offset-rotate: 0deg;
  offset-distance: calc(var(--i, 0) * 16.6%);
  opacity: 1;
}
.iagd-helix__flow img {
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(196, 168, 255, 0.6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  background: var(--color-base-alt);
  transition: transform 200ms var(--ease-spring), border-color 200ms var(--ease-fluent);
}
.iagd-helix__flow:hover { z-index: 6; }
.iagd-helix__flow:hover img { border-color: var(--color-gold); transform: scale(1.08); }

/* Sci-fi targeting frame: four corner ticks around the pet. */
.iagd-helix__frame {
  position: absolute;
  inset: -7px;
  pointer-events: none;
  --c: rgba(196, 168, 255, 0.75);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 11px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 1.5px 11px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 11px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1.5px 11px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 11px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 1.5px 11px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 11px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1.5px 11px no-repeat;
}
.iagd-helix__flow:hover .iagd-helix__frame { --c: var(--color-gold); }

/* Breed HUD tag: monospace readout below the pet, with a connector tick. */
.iagd-helix__tag {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 132px;
  padding: 2px 8px;
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 5px;
  background: rgba(16, 12, 38, 0.72);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-text-on-dark);
}
.iagd-helix__tag::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 1px;
  height: 9px;
  background: rgba(124, 58, 237, 0.55);
}
.iagd-helix__tag-k {
  color: var(--color-accent-text);
  opacity: 0.7;
}
.iagd-helix__tag-v {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@supports (offset-path: path("M0 0")) {
  .iagd-helix__flow {
    animation: iagdFlow 30s linear infinite;
  }
}
/* No motion-path support: hide the riders, keep the strands. */
@supports not (offset-path: path("M0 0")) {
  .iagd-helix__flow { display: none; }
}
@keyframes iagdFlow {
  0%   { offset-distance: 0%;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* ---- Immersive wall (marquee) -------------------------------------- */

.iagd-wall {
  margin-top: clamp(28px, 5vw, 48px);
}
.iagd-marquee {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.iagd-marquee__track {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
  animation: iagdMarquee 55s linear infinite;
}
.iagd-marquee:hover .iagd-marquee__track {
  animation-play-state: paused;
}
@keyframes iagdMarquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

.iagd-petcard {
  position: relative;
  flex: 0 0 auto;
  width: 170px;
  height: 210px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-layer-stroke);
  color: inherit;
  background: var(--color-base-alt);
}
.iagd-petcard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.iagd-petcard__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 12px 10px;
  background: linear-gradient(transparent, rgba(10, 7, 26, 0.9) 65%);
}
.iagd-petcard__cap b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iagd-petcard__cap i {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--color-accent-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Section head -------------------------------------------------- */

.iagd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.iagd-section-head .iagd-eyebrow { margin: 0; }

/* ---- Discover tiles ------------------------------------------------ */

.iagd-card.iagd-home-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}
.iagd-home-tile svg {
  color: var(--color-accent-text);
  transition: transform 300ms var(--ease-spring);
}
.iagd-home-tile:hover svg { transform: translateY(-2px) scale(1.12); }

/* ---- Shine sweep (hover) ------------------------------------------- */

.iagd-shine::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 42%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.10), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}
.iagd-shine > * { position: relative; z-index: 1; }
.iagd-shine:hover::before { animation: iagdShine 720ms var(--ease-fluent-out); }
@keyframes iagdShine {
  from { left: -60%; opacity: 0; }
  30% { opacity: 1; }
  to { left: 120%; opacity: 0; }
}

.iagd-count { font-variant-numeric: tabular-nums; }

/* ---- Reduced motion ------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .iagd-hero2__particles span,
  .iagd-helix__strand,
  .iagd-helix__flow,
  .iagd-compo__seg,
  .iagd-marquee__track {
    animation: none !important;
  }
  /* Riders sit distributed and visible when not animating. */
  .iagd-helix__flow { opacity: 1; }
  .iagd-compo__seg { transform: scaleX(1); }
  .iagd-home-tile svg,
  .iagd-helix__flow { transition: none !important; }
  .iagd-shine:hover::before { animation: none !important; }
}
