/* =========================================================
   GraphiQ universe prototype (test page only): S1 base layer
   Every visual rule below is scoped to html.u3d, which
   js/universe.js adds ONLY when 3D starts successfully.
   Without that class the page looks exactly like index.html.
   ========================================================= */

/* ---------- Hidden unless 3D is active ---------- */
.u3d-stage,
.u3d-scenes { display: none; }

/* ---------- 3D backdrop: behind everything, never clickable ---------- */
.u3d .u3d-stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;            /* clicks and taps always pass through */
}
.u3d .u3d-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}
.u3d.u3d-ready .u3d-stage canvas { opacity: 1; }

/* Keep all real content above the backdrop */
.u3d main,
.u3d .site-footer { position: relative; z-index: 1; }

/* Let the backdrop show through section backgrounds (the colours stay on-brand) */
.u3d .hero {
  background:
    radial-gradient(60% 50% at 80% 40%, rgba(154, 123, 255, 0.10), transparent 70%),
    radial-gradient(50% 40% at 15% 80%, rgba(233, 184, 114, 0.08), transparent 70%);
}
.u3d .section-alt { background: rgba(13, 13, 19, 0.55); }
.u3d .cta {
  background: radial-gradient(50% 60% at 50% 100%, rgba(233, 184, 114, 0.12), transparent 70%), rgba(13, 13, 19, 0.45);
}

/* ---------- Readability over the 3D world ---------- */
/* Soft shade behind the hero text so the headline stays crisp over the gateway */
.u3d .hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(5, 5, 7, 0.78) 0%, rgba(5, 5, 7, 0.45) 45%, rgba(5, 5, 7, 0) 75%);
  pointer-events: none;
}
.u3d .hero > .container { position: relative; z-index: 1; }

/* Dark-glass panels with gold hairlines for cards that sit over the scenes */
.u3d .service {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent), rgba(16, 15, 22, 0.72);
  border-color: rgba(233, 184, 114, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.u3d .why {
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid rgba(233, 184, 114, 0.14);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.u3d .section-head h2,
.u3d .cta h2,
.u3d .work-info { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85); }
.u3d .cta-inner {
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  background: radial-gradient(70% 80% at 50% 50%, rgba(5, 5, 7, 0.72), rgba(5, 5, 7, 0.35) 70%, transparent);
}

@media (max-width: 760px) {
  .u3d .hero::before { background: linear-gradient(0deg, rgba(5, 5, 7, 0.85), rgba(5, 5, 7, 0.2) 60%); }
  .u3d .why { padding: 1.5rem; }
}

/* ---------- Scene indicator (persistent navigation) ---------- */
.u3d .u3d-scenes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: fixed;
  z-index: 55;                      /* above content, below header menu (50 + open menu) and WhatsApp button (60) */
  right: max(18px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
}
.u3d .u3d-scenes a {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(233, 184, 114, 0.6);
  background: transparent;
  transition: background 0.3s ease, transform 0.3s ease;
}
.u3d .u3d-scenes a:hover,
.u3d .u3d-scenes a[aria-current="true"] { background: var(--accent); transform: scale(1.15); }
.u3d .u3d-scenes a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

@media (max-width: 760px) {
  /* Phones: a slim horizontal row at the bottom-left, clear of the WhatsApp button */
  .u3d .u3d-scenes {
    flex-direction: row;
    gap: 10px;
    top: auto;
    right: auto;
    left: max(16px, env(safe-area-inset-left));
    bottom: max(30px, env(safe-area-inset-bottom));
    transform: none;
  }
  .u3d .u3d-scenes a { width: 10px; height: 10px; }
}

/* ---------- Optional review overlay (?debug) ---------- */
.u3d-debug {
  position: fixed; z-index: 70; left: 8px; top: 80px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.75); color: #e9b872;
  font: 12px/1.4 ui-monospace, Consolas, monospace;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .u3d .u3d-stage canvas { transition: none; }
}
