* {
  box-sizing: border-box;
}

html,
body,
#ar {
  width: 100%;
  height: 100%;
  margin: 0;
}

html {
  overflow: hidden;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(132, 112, 255, .24), transparent 34%),
    radial-gradient(circle at 12% 86%, rgba(95, 231, 255, .18), transparent 32%),
    linear-gradient(155deg, #05070b, #111626 54%, #070910);
  color: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at 50% 45%, black, transparent 72%);
}

.ar-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: transparent;
}

.landing-shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(34px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

.landing-card {
  position: relative;
  width: min(92vw, 560px);
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(28px, 5vw, 44px) clamp(18px, 4vw, 34px) clamp(18px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045)),
    rgba(8, 10, 18, .76);
  box-shadow:
    0 36px 110px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .12);
  text-align: center;
  backdrop-filter: blur(24px);
}

.landing-card::before {
  position: absolute;
  inset: 14px;
  z-index: -1;
  border-radius: 26px;
  content: "";
  background: radial-gradient(circle at 50% 0, rgba(112, 232, 255, .12), transparent 44%);
}

.eyebrow {
  margin: 0;
  color: #aeb8ff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(34px, 11vw, 68px);
  line-height: .92;
  letter-spacing: -.065em;
}

p {
  margin: 0;
  color: #d9def6;
  font-size: 15px;
  line-height: 1.55;
}

.lead {
  max-width: 32rem;
  color: #c7cdeb;
}

.photo-preview {
  position: relative;
  width: min(72vw, 340px);
  margin: 4px 0 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 26px;
  background: rgba(255, 255, 255, .07);
  box-shadow:
    0 18px 55px rgba(0, 0, 0, .42),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  transform: rotate(-1deg);
}

.photo-preview img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: min(46vh, 420px);
  object-fit: contain;
  border-radius: 18px;
  background: #111827;
}

.photo-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-height: min(46vh, 420px);
  aspect-ratio: 1 / 1.5;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 36%, rgba(126, 242, 255, .18), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035)),
    #101522;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.modern-spinner,
.ar-loader {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, .16);
  border-top-color: rgba(126, 242, 255, .95);
  border-right-color: rgba(169, 147, 255, .74);
  border-radius: 999px;
  filter: drop-shadow(0 0 18px rgba(126, 242, 255, .22));
  animation: spinner-rotate .82s linear infinite;
}

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

.photo-preview figcaption {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  color: rgba(255, 255, 255, .55);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.debug-video-card {
  display: grid;
  width: min(78vw, 420px);
  gap: 10px;
  margin-top: 2px;
  padding: 12px;
  border: 1px solid rgba(126, 240, 255, .24);
  border-radius: 20px;
  background: rgba(6, 10, 19, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  text-align: left;
}

.debug-video-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #7ef2ff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.debug-video-card__header--secondary {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .11);
}

.debug-video-card__header span {
  color: rgba(255, 255, 255, .48);
  font-size: 10px;
}

.debug-video-card video {
  display: block;
  width: 100%;
  max-height: min(28vh, 260px);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
  background: #000;
}

.debug-video-card p {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 750;
}

.preview-aura {
  position: absolute;
  inset: -22px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 42%, rgba(105, 234, 255, .34), transparent 58%),
    radial-gradient(circle at 70% 20%, rgba(149, 118, 255, .24), transparent 46%);
  filter: blur(16px);
  opacity: .9;
}

.primary-action,
.icon-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.primary-action {
  min-width: min(72vw, 310px);
  margin-top: 2px;
  padding: 17px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7af0ff, #a993ff 54%, #ff7d62);
  color: #071018;
  box-shadow:
    0 18px 42px rgba(122, 240, 255, .16),
    0 10px 38px rgba(255, 125, 98, .18);
  font-size: 17px;
  font-weight: 950;
}

.primary-action:disabled {
  cursor: wait;
  opacity: .62;
}

.landing-actions {
  display: grid;
  width: min(72vw, 310px);
  gap: 10px;
  margin-top: 2px;
}

.landing-actions .primary-action {
  width: 100%;
  min-width: 0;
  margin-top: 0;
}

.secondary-action {
  appearance: none;
  width: 100%;
  padding: 15px 22px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  backdrop-filter: blur(14px);
}

.secondary-action:active {
  transform: translateY(1px);
}

.desktop-notice {
  max-width: 32rem;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 17px;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .72);
}

.share-button {
  position: fixed;
  z-index: 30;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: rgba(13, 17, 29, .68);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .32);
  color: #fff;
  backdrop-filter: blur(18px);
}

.share-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.back-button {
  position: fixed;
  z-index: 31;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: rgba(13, 17, 29, .68);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .32);
  color: #fff;
  pointer-events: auto;
  backdrop-filter: blur(18px);
}

.back-button svg {
  width: 23px;
  height: 23px;
  fill: currentColor;
}

.made-with {
  position: fixed;
  z-index: 30;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, .46);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .07em;
  text-decoration: none;
  text-transform: uppercase;
}

.made-with:hover {
  color: rgba(255, 255, 255, .82);
}

.ar-chrome {
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
}

.ar-hint {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  display: inline-flex;
  align-items: center;
  max-width: min(86vw, 560px);
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(7, 10, 18, .68);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .38);
  color: rgba(255, 255, 255, .86);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.hint-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ffcf6f;
  box-shadow: 0 0 18px rgba(255, 207, 111, .8);
}

.ar-loader {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.is-starting-ar .hint-dot {
  display: none;
}

.target-found .hint-dot {
  background: #73f3a6;
  box-shadow: 0 0 22px rgba(115, 243, 166, .9);
}

.scan-reticle {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(70vw, 420px);
  aspect-ratio: 1.42;
  opacity: .58;
  transform: translate(-50%, -50%);
}

.target-found .scan-reticle {
  opacity: .12;
}

.scan-reticle span {
  position: absolute;
  width: 54px;
  height: 54px;
  border-color: rgba(126, 240, 255, .92);
  filter: drop-shadow(0 0 16px rgba(126, 240, 255, .48));
}

.scan-reticle span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 4px solid;
  border-left: 4px solid;
  border-top-left-radius: 18px;
}

.scan-reticle span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 4px solid;
  border-right: 4px solid;
  border-top-right-radius: 18px;
}

.scan-reticle span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 4px solid;
  border-bottom: 4px solid;
  border-bottom-right-radius: 18px;
}

.scan-reticle span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-bottom: 4px solid;
  border-left: 4px solid;
  border-bottom-left-radius: 18px;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(58px, calc(env(safe-area-inset-bottom) + 52px));
  max-width: min(86vw, 420px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(10, 13, 23, .82);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .38);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.debug-panel {
  position: fixed;
  z-index: 70;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: grid;
  width: min(92vw, 520px);
  max-height: min(45vh, 420px);
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(126, 240, 255, .28);
  border-radius: 18px;
  background: rgba(4, 8, 16, .88);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .52);
  color: rgba(255, 255, 255, .9);
  backdrop-filter: blur(18px);
}

.debug-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: #7ef2ff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.debug-panel__header span {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(126, 240, 255, .12);
  color: #fff;
  text-align: center;
}

.debug-panel pre {
  min-height: 0;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: rgba(255, 255, 255, .82);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.qr-scanner {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding:
    max(22px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: rgba(4, 7, 13, .72);
  backdrop-filter: blur(22px);
}

.qr-scanner-card {
  position: relative;
  display: grid;
  width: min(92vw, 520px);
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0, rgba(122, 240, 255, .13), transparent 42%),
    rgba(9, 12, 22, .9);
  box-shadow: 0 38px 120px rgba(0, 0, 0, .58);
}

.qr-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.qr-close-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.qr-scanner h2 {
  max-width: calc(100% - 52px);
  margin: 0 0 6px;
  font-size: clamp(26px, 8vw, 42px);
  line-height: 1;
  letter-spacing: -.055em;
}

.qr-scanner p {
  max-width: 32rem;
}

.qr-video-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 25px;
  background:
    radial-gradient(circle at 50% 45%, rgba(126, 242, 255, .12), transparent 45%),
    #060912;
}

.qr-video-shell video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qr-frame {
  position: absolute;
  inset: 15%;
  border: 2px solid rgba(126, 240, 255, .76);
  border-radius: 24px;
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, .2),
    0 0 32px rgba(126, 240, 255, .28);
}

.qr-frame::after {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 18%;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(126, 240, 255, .9), transparent);
  box-shadow: 0 0 18px rgba(126, 240, 255, .72);
  animation: qr-scan-line 1.8s ease-in-out infinite;
}

@keyframes qr-scan-line {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(220px);
  }
}

.qr-status {
  min-height: 1.4em;
  color: rgba(255, 255, 255, .78);
  font-weight: 800;
  text-align: center;
}

.is-ar-running .made-with {
  opacity: .56;
}

.is-ar-running .share-button {
  background: rgba(7, 10, 18, .58);
}

.hidden {
  display: none !important;
}

@media (max-width: 520px) {
  .landing-card {
    gap: 13px;
    border-radius: 28px;
  }

  .photo-preview {
    width: min(78vw, 320px);
  }

  .made-with {
    font-size: 10px;
  }
}
