/* Accware 3D hero animation styles.
   NOTE: no :root variables here on purpose - they would override the site's
   global tokens (--ink etc). All colours are inlined. The caption class is
   .a3d-card (not .card) to avoid colliding with the site's .card component. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ================= HERO LAYERS ================= */
#scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .5) 26%, rgba(0, 0, 0, 0) 52%);
}

#glow {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(900px 500px at 82% -10%, rgba(244, 74, 34, .16), transparent 60%);
}

/* full-bleed stage: the canvas IS the hero background */
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

#ui canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* module panel (feature name + bullets during the tour).
   Anchored to the cube's axis (--stage-x, set on .hero by JS) so it always
   sits to the RIGHT of the cube with a safe gap, at every viewport width. */
#panel {
  position: absolute;
  left: calc(var(--stage-x, 63%) + 14%);
  right: 2.5%;
  top: 55%;
  transform: translateY(-50%);
  width: min(280px, 17.5vw);
  z-index: 4;
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
  color: #f44a22;
}

#panel.show {
  opacity: 1;
}

#panel .row {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .4s ease, transform .4s cubic-bezier(.22, 1, .36, 1);
}

#panel.show .row {
  opacity: 1;
  transform: none;
}

#panel.show .r1 { transition-delay: .04s; }
#panel.show .r2 { transition-delay: .1s; }
#panel.show .r3 { transition-delay: .16s; }
#panel.show .r4 { transition-delay: .22s; }

.p-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

#title {
  margin: 0 0 10px;
  font-size: clamp(22px, 2.2vw, 34px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -.02em;
}

#tagline {
  margin: 0 0 18px;
  font-size: clamp(13px, 1.05vw, 15.5px);
  line-height: 1.55;
  color: #b9bec4;
  max-width: 34ch;
}

#bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

#bullets li {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: #9da3a8;
}

#bullets li::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  margin-top: 6px;
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: .9;
}

/* intro/outro captions riding over the cube */
.a3d-card {
  position: absolute;
  left: var(--stage-x, 65%);
  top: 50%;
  width: min(430px, 26vw);
  z-index: 6;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 12px));
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.a3d-card.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

/* soft scrim so the caption keeps contrast sitting on top of the cube */
.a3d-card::before {
  content: "";
  position: absolute;
  inset: -45% -14%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .8) 32%, rgba(0, 0, 0, .38) 66%, rgba(0, 0, 0, 0));
}

.a3d-card h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 700;
  letter-spacing: -.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .85), 0 0 44px rgba(0, 0, 0, .75);
  color: #f7f7f5;
}

.a3d-card p {
  margin: 12px 0 0;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #9da3a8;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .9);
}

#fade {
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}

#link {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .45s ease;
}

#link.show { opacity: .85; }

#linkPath {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  opacity: .55;
}

#linkDot { fill: currentColor; }

/* ================= NO-WEBGL / CDN-FAIL FALLBACK ================= */
.no3d #ui {
  background: radial-gradient(620px 420px at 68% 32%, rgba(244, 74, 34, .12), transparent 65%);
}

.no3d .a3d-card#intro {
  opacity: 1;
  transform: translate(-50%, -50%);
  top: 50%;
}

.no3d .a3d-card#intro p { display: none; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  .a3d-card { width: min(340px, 24vw); }
}

@media (max-width: 820px) {
  /* 3D animation disabled on mobile for now (mobile layout TBD):
     the hero falls back to the site's standard dark hero */
  #ui, #panel, #scrim, #glow { display: none; }
  .hero {
    background: #000;
  }
  #mobile-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 3;
    pointer-events: none;
  }
}

/* hero text layer above Three.js canvas */
.hero > .container { position: relative; z-index: 6; }

.hero {
  background: #000 !important;
}

#mobile-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 5;
  pointer-events: none;
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
  #panel .row, .a3d-card { transition-duration: .01ms; }
}
