/* ═══════════════════════════════════════════════════════════════════════════
   style.css — AR Exhibition Experience
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── Reset & Base ─────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #472166;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/*
  On the AR page, overflow: hidden on body clips MindAR's position:fixed video
  container on iOS Safari. Remove it here — A-Frame manages its own fullscreen
  rendering and no scrollable content exists on this page.
*/
body.page-ar {
  overflow: visible;
  overscroll-behavior: none; /* stop iOS toggling browser chrome on hold/scroll */
  background: transparent; /* don't let body colour bleed through the WebGL canvas */
}


/* ── Shared utilities ────────────────────────────────────────────────────── */

/* Universal hide — works on any element, not just .overlay children */
.hidden {
  display: none !important;
}


/* ── Shared Button ────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
}

.btn-primary:active {
  opacity: 0.65;
}


/* ══════════════════════════════════════════════════════════════════════════
   Landing Page  (index.html)
   ══════════════════════════════════════════════════════════════════════════ */

.page-landing {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #380A64;
  overflow: hidden;
}

.page-landing::before {
  content: '';
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='40'%3E%3Ctext x='26' y='26' text-anchor='middle' font-family='system-ui,sans-serif' font-size='23' fill='rgba(255,255,255,.18)'%3E?%3C/text%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='40'%3E%3Ctext x='26' y='26' text-anchor='middle' font-family='system-ui,sans-serif' font-size='23' fill='rgba(255,255,255,.18)'%3E!%3C/text%3E%3C/svg%3E");
  background-repeat: repeat, repeat;
  background-size: 52px 40px, 52px 40px;
  background-position: 0 0, 26px 20px;
  animation: landing-bg-in 10s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.landing-card {
  position: relative;
  z-index: 1;
  max-width: 360px;
  width: 90%;
  text-align: center;
  padding: 2.5rem 2rem;
  animation: landing-card-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.landing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(56, 10, 100, 0.65);
  mask-image: radial-gradient(ellipse 95% 95% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 95% 95% at 50% 50%, black 30%, transparent 100%);
}

.landing-card > * {
  position: relative;
  z-index: 1;
}

.landing-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.landing-description {
  font-size: 1rem;
  color: #fff;
  line-height: 1.65;
  margin-bottom: 2.2rem;
}

.landing-footnote {
  margin-top: 1.1rem;
  font-size: 0.75rem;
  color: #bb94c6;
  letter-spacing: 0.01em;
}

.page-landing .btn-primary {
  animation: landing-btn-pulse 2.4s ease-in-out 1.6s infinite;
}

@keyframes landing-bg-in {
  from { transform: scale(1.15); }
  to   { transform: scale(1); }
}

@keyframes landing-card-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes landing-btn-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}


/* ══════════════════════════════════════════════════════════════════════════
   AR Page  (ar.html)
   ══════════════════════════════════════════════════════════════════════════ */

/* A-Frame positions and sizes the canvas itself — no override needed. */


/* ── Overlay base ────────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;   /* pass through to A-Frame by default */
}


/* ── Loading Overlay ─────────────────────────────────────────────────────── */

#overlay-loading {
  background: #1a0729;
  pointer-events: all;    /* block interaction while loading */
 /* animation: loading-glow 2.4s ease-in-out infinite;*/
  justify-content: flex-start;  /* text at top, clear of the iOS permission sheet */
  padding-top: 3.5rem;
}

/* Pulsating edge glow — thin lilac border along all four sides */
@keyframes loading-glow {
  0%, 100% { box-shadow: inset 0 0 10px 4px rgba(196, 148, 255, 0.35); }
  50%       { box-shadow: inset 0 0 30px 8px rgba(196, 148, 255, 0.80); }
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Step status line */
.loading-step {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.03em;
  margin-top: -0.6rem;
}

/* Spinner hidden — replaced by the page-edge glow above */
.spinner {
  display: none;
}


/* ── Guidance Overlay ────────────────────────────────────────────────────── */

/* Sits at the bottom-centre so it doesn't obscure the AR object */
.overlay-guidance {
  justify-content: flex-end;
  padding-bottom: 3rem;
}

.guidance-label {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.45rem 1.1rem;
  border-radius: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


/* ── Error Overlay ───────────────────────────────────────────────────────── */

.overlay-error {
  background: transparent;
  pointer-events: all;
}

.error-box {
  text-align: center;
  max-width: 310px;
  padding: 2rem;
}

.error-box p {
  margin-bottom: 1.6rem;
  line-height: 1.65;
  color: #ccc;
  font-size: 0.95rem;
}


/* ── Debug Overlay ────────────────────────────────────────────────────────── */
/* Activated by ?debug URL param or triple-tap. Not shown in production.      */

#overlay-debug {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0.6rem;
}

.debug-panel {
  pointer-events: all;
  background: rgba(0, 0, 0, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  min-width: 210px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.debug-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.debug-section {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.debug-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.debug-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.debug-sub {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
}

.debug-slider {
  width: 100%;
  accent-color: #fff;
  margin: 0.1rem 0;
  cursor: pointer;
  height: 18px;
}

.debug-hint {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.22);
}

.debug-close {
  margin-top: 0.15rem;
  padding: 0.28rem 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  align-self: flex-start;
}

.debug-close:active {
  background: rgba(255, 255, 255, 0.18);
}

.debug-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: #fff;
  font-family: inherit;
  font-size: 0.72rem;
  padding: 0.22rem 0.4rem;
  margin: 0.1rem 0;
  -webkit-appearance: none;
}

.debug-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
}

.debug-btn {
  padding: 0.32rem 0.6rem;
  background: rgba(255, 200, 80, 0.15);
  border: 1px solid rgba(255, 200, 80, 0.3);
  border-radius: 6px;
  color: rgba(255, 200, 80, 0.9);
  font-family: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  align-self: flex-start;
}

.debug-btn:active {
  background: rgba(255, 200, 80, 0.28);
}
