:root {
  color-scheme: dark;
  --bg: #070707;
  --ink: #fff8ef;
  --muted: rgba(255, 248, 239, 0.72);
  --line: rgba(255, 248, 239, 0.22);
  --accent: #f3c37a;
  --accent-strong: #b24e31;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.landing {
  min-height: 100vh;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto auto auto;
  gap: 18px;
  align-items: center;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff8ef;
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 22px;
}

.eyebrow,
.launch-copy p,
.micro-copy,
.bottom-tools p,
.guide-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.launch-preview {
  align-self: stretch;
  display: grid;
  place-items: center;
}

.camera-glass {
  width: min(82vw, 390px);
  aspect-ratio: 9 / 13;
  border: 1px solid rgba(255, 248, 239, 0.16);
  border-radius: 26px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(243, 195, 122, 0.16), transparent 33%),
    linear-gradient(180deg, rgba(255, 248, 239, 0.08), rgba(255, 248, 239, 0.02));
  box-shadow: inset 0 0 60px rgba(255, 248, 239, 0.05);
}

.ghost-target {
  position: relative;
  width: 72%;
  aspect-ratio: 1;
  border: 2px dashed rgba(255, 248, 239, 0.62);
  border-radius: 8px;
  opacity: 0.72;
}

.ghost-target span {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--accent);
  border-style: solid;
}

.ghost-target span:nth-child(1) {
  top: -2px;
  left: -2px;
  border-width: 3px 0 0 3px;
}

.ghost-target span:nth-child(2) {
  top: -2px;
  right: -2px;
  border-width: 3px 3px 0 0;
}

.ghost-target span:nth-child(3) {
  right: -2px;
  bottom: -2px;
  border-width: 0 3px 3px 0;
}

.ghost-target span:nth-child(4) {
  left: -2px;
  bottom: -2px;
  border-width: 0 0 3px 3px;
}

.target-lines {
  position: absolute;
  inset: 24%;
  border-top: 1px solid rgba(255, 248, 239, 0.44);
  border-bottom: 1px solid rgba(255, 248, 239, 0.28);
}

.target-lines::before,
.target-lines::after {
  content: "";
  position: absolute;
  inset: 28% 0 auto;
  border-top: 1px solid rgba(255, 248, 239, 0.24);
}

.target-lines::after {
  inset: auto 0 28%;
}

.launch-copy {
  display: grid;
  gap: 4px;
  text-align: center;
}

.primary-button,
.secondary-button,
.ghost-button,
.primary-link {
  border: 1px solid var(--line);
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 248, 239, 0.08);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button,
.primary-link {
  border: none;
  background: linear-gradient(135deg, #fff6e8, #f3c37a);
  color: #2a160f;
}

.micro-copy {
  font-size: 13px;
  text-align: center;
}

.ar-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

#sceneMount {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  z-index: 0;
  isolation: isolate;
}

.ar-stage a-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}

.ar-stage canvas {
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent !important;
}

.ar-stage video {
  object-fit: cover;
  z-index: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #000;
}

.a-enter-vr,
.a-enter-ar,
.a-loader-title,
.mindar-ui-loading,
.mindar-ui-scanning {
  display: none !important;
}

.topbar,
.bottom-tools,
.guide-box {
  position: fixed;
  left: 16px;
  right: 16px;
  z-index: 20;
  pointer-events: none;
}

.topbar {
  top: max(16px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.status-pill,
.ghost-button {
  pointer-events: auto;
  backdrop-filter: blur(18px);
  background: rgba(0, 0, 0, 0.54);
}

.status-pill {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.status-pill span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffc247;
}

.status-pill.found span {
  background: #24d17e;
}

.guide-box {
  top: 22vh;
  bottom: 26vh;
  display: grid;
  place-items: center;
  text-align: center;
  transition: opacity 180ms ease;
}

.guide-box.hidden {
  opacity: 0;
}

.scan-frame {
  position: relative;
  width: min(76vw, 360px);
  aspect-ratio: 1;
  border: 2px dashed rgba(255, 248, 239, 0.78);
  border-radius: 8px;
  background: rgba(255, 248, 239, 0.05);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.1);
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  border-top: 1px solid rgba(255, 248, 239, 0.42);
}

.scan-frame::before {
  top: 38%;
}

.scan-frame::after {
  bottom: 38%;
}

.scan-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 248, 239, 0.38);
  font-weight: 700;
}

.guide-box p {
  margin-top: 14px;
  font-weight: 700;
}

.bottom-tools {
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  justify-items: center;
  gap: 10px;
}

.capture-button {
  pointer-events: auto;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 4px solid rgba(255, 248, 239, 0.88);
  background: radial-gradient(circle, #fff8ef 0 42%, rgba(255, 248, 239, 0.16) 44% 100%);
}

.capture-button:disabled {
  opacity: 0.42;
}

.capture-button.recording {
  border-color: #ff6d62;
}

.result-sheet,
.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.82);
}

.loading-mask {
  z-index: 70;
  align-content: center;
  gap: 14px;
}

.loading-mask[hidden],
.result-sheet[hidden],
.toast[hidden],
[hidden] {
  display: none !important;
}

.loader {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(255, 248, 239, 0.24);
  border-top-color: var(--accent);
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-panel {
  width: min(100%, 430px);
  display: grid;
  gap: 14px;
}

.result-panel img,
.result-panel video {
  width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: max(122px, calc(env(safe-area-inset-bottom) + 110px));
  z-index: 80;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--ink);
  text-align: center;
  line-height: 1.45;
}
