/* ===============BATIK AR — Design tokens============== */
:root {
  --indigo-deep: #16233a;
  --indigo-mid: #223759;
  --soga-brown: #6b3410;
  --soga-warm: #8a4a1c;
  --wax-cream: #f3e9d2;
  --wax-cream-soft: #ece0c4;
  --gold-prada: #c9932e;
  --gold-prada-bright: #e0ac47;
  --clay-red: #9c3d28;
  --ink: #241a10;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
}

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

body {
  font-family: var(--font-body);
  overflow: hidden;
  color: var(--wax-cream);
  background: var(--indigo-deep);
}

.hidden {
  display: none !important;
}

/* ============================================================
   Pola latar — garis diagonal tipis terinspirasi motif parang,
   dipakai berulang di splash & instruction screen
   ============================================================ */
.batik-bg-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
      45deg,
      var(--gold-prada) 0px,
      var(--gold-prada) 1.5px,
      transparent 1.5px,
      transparent 26px
    ),
    repeating-linear-gradient(
      -45deg,
      var(--gold-prada) 0px,
      var(--gold-prada) 1.5px,
      transparent 1.5px,
      transparent 26px
    );
}

/* ============================================================
   LAYAR 1 — SPLASH
   ============================================================ */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 28px;
  background: radial-gradient(120% 90% at 50% 30%, var(--soga-warm) 0%, var(--soga-brown) 55%, var(--ink) 100%);
}

.splash-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 380px;
  gap: 40px;   /* <- ini yang kamu tambahin, atur angkanya sesuka hati */
}

.app-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 58px;
  line-height: 1;
  color: var(--wax-cream);
  letter-spacing: -0.01em;
}

.app-title-accent {
  color: var(--gold-prada-bright);
  font-style: italic;
  font-weight: 500;
}

/* ============================================================
   Tombol pil
   ============================================================ */
.pill-btn {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold-prada-bright), var(--gold-prada));
  border: none;
  border-radius: 999px;
  padding: 15px 46px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pill-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* ============================================================
   Top bar di mode kamera — tombol kembali + logo
   ============================================================ */
#ar-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(22, 15, 8, 0.55), transparent);
}

#back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(22, 15, 8, 0.5);
  color: var(--wax-cream);
  cursor: pointer;
}

.ar-topbar-logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--wax-cream);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.ar-topbar-logo em {
  font-style: italic;
  color: var(--gold-prada-bright);
  font-weight: 500;
}

/* ============================================================
   AR AKTIF
   ============================================================ */
#ar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  /* Matikan gesture bawaan browser (pinch-zoom halaman, scroll)
     biar gesture rotate/pinch kita yang jalan, bukan punya browser. */
  touch-action: none;
}

#ar-container video,
#ar-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#hint-text {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(22, 35, 58, 0.85);
  color: var(--wax-cream);
  font-family: var(--font-body);
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid rgba(201, 147, 46, 0.4);
  z-index: 15;
  transition: opacity 0.3s ease;
  display: none;
}

#hint-text.visible {
  display: block;
}

/* ============================================================
   TOMBOL INFO — mengambang, muncul saat motif terdeteksi
   ============================================================ */
#info-btn {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 21;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold-prada-bright), var(--gold-prada));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#info-btn:active {
  transform: scale(0.93);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   POPUP INFORMASI BATIK
   ============================================================ */
#info-popup {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 48vh;
  background: var(--wax-cream);
  border-top: 4px solid var(--gold-prada);
  border-radius: 22px 22px 0 0;
  padding: 22px 26px 32px;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
  z-index: 20;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#info-popup.hidden {
  transform: translateY(110%);
  pointer-events: none;
}

#info-popup h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--soga-brown);
  margin-bottom: 12px;
  font-size: 23px;
}

#info-popup p {
  margin-bottom: 9px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

#info-popup p strong {
  color: var(--soga-warm);
}

#close-popup {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--soga-brown);
  cursor: pointer;
  line-height: 1;
}

/* ============================================================
   HINT GESTURE — kasih tau user model bisa digeser/dicubit
   ============================================================ */
#gesture-hint {
  position: fixed;
  top: max(64px, calc(env(safe-area-inset-top) + 64px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;
  background: rgba(22, 15, 8, 0.6);
  color: var(--wax-cream-soft);
  font-family: var(--font-body);
  font-size: 11px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid rgba(201, 147, 46, 0.35);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0.9;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .scan-line {
    animation: none;
    top: 50%;
  }
}
