:root {
  --ink: #11120f;
  --muted: #777a72;
  --acid: #c9ff45;
  color-scheme: light;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #fff;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; -webkit-tap-highlight-color: transparent; }

.ar-page {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 480px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(201,255,69,.12), transparent 35%),
    #fff;
}

.ar-page::after {
  position: absolute;
  bottom: 15%;
  left: 50%;
  width: min(72vw, 520px);
  height: 8%;
  border-radius: 50%;
  background: rgba(18,20,15,.08);
  filter: blur(18px);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

model-viewer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  --progress-bar-height: 0;
}

model-viewer::part(default-progress-bar) { display: none; }

.model-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}

.model-poster img {
  width: min(86vw, 620px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 30px 24px rgba(36, 24, 10, .18));
  animation: poster-float 3.2s ease-in-out infinite, poster-turn 9s ease-in-out infinite;
  transform-origin: 50% 60%;
}

.top-label {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top));
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #5e6259;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

.top-label span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #80ae12;
  box-shadow: 0 0 0 4px rgba(128,174,18,.12);
}

.gesture-hint {
  position: fixed;
  bottom: calc(104px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 5px 24px rgba(0,0,0,.06);
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity .35s ease;
  white-space: nowrap;
}

.ar-button {
  position: absolute;
  right: 16px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 10;
  display: flex;
  width: calc(100% - 32px);
  max-width: 430px;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  padding: 9px 15px 9px 9px;
  border: 0;
  border-radius: 20px;
  background: var(--ink);
  box-shadow: 0 16px 42px rgba(0,0,0,.24);
  color: #fff;
  cursor: pointer;
  text-align: left;
  animation: button-in .45s .2s both ease-out;
}

.ar-button > span:nth-child(2) { display: grid; flex: 1; gap: 3px; }
.ar-button strong { font-size: 15px; letter-spacing: -.01em; }
.ar-button small { color: #aeb1a9; font-size: 10px; }
.ar-badge { display: grid; width: 50px; height: 50px; flex: 0 0 50px; place-items: center; border-radius: 14px; background: var(--acid); color: var(--ink); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.ar-button .arrow { color: var(--acid); font-size: 23px; }
.ar-button:focus-visible { outline: 3px solid #80ae12; outline-offset: 3px; }
.ar-button:active { transform: scale(.985); }

.loading {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top));
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgba(17,18,15,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 26px rgba(0,0,0,.07);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
  transition: opacity .35s ease, visibility .35s ease;
  white-space: nowrap;
}

.loading.done { visibility: hidden; opacity: 0; }
.loading strong { font-size: 11px; }
.loading > span { color: var(--muted); font-size: 11px; }
.loader-burger { display: grid; width: 24px; gap: 2px; animation: bounce 1.1s ease-in-out infinite; }
.loader-burger i { display: block; height: 4px; border-radius: 10px; background: #e49339; }
.loader-burger i:first-child { height: 7px; border-radius: 24px 24px 8px 8px; background: #f0a94f; }
.loader-burger i:nth-child(2) { background: var(--acid); }
.loader-burger i:last-child { background: #60331f; }

.error {
  position: fixed;
  right: 16px;
  bottom: calc(102px + env(safe-area-inset-bottom));
  left: 16px;
  z-index: 30;
  display: grid;
  max-width: 430px;
  gap: 4px;
  margin: 0 auto;
  padding: 12px 15px;
  border: 1px solid rgba(17,18,15,.08);
  border-radius: 15px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 32px rgba(0,0,0,.1);
  backdrop-filter: blur(14px);
  text-align: center;
}
.error[hidden] { display: none; }
.error strong { font-size: 13px; }
.error span { color: var(--muted); font-size: 12px; }
.error button { display: none; }

.ar-guide {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  left: 50%;
  z-index: 50;
  display: grid;
  min-width: 280px;
  gap: 3px;
  padding: 13px 17px;
  border-radius: 15px;
  background: rgba(15,16,13,.82);
  backdrop-filter: blur(14px);
  color: #fff;
  text-align: center;
  transform: translateX(-50%);
}
.ar-guide[hidden] { display: none; }
.ar-guide strong { font-size: 13px; }
.ar-guide span { color: #c7c9c2; font-size: 10px; }

@keyframes bounce { 50% { transform: translateY(-6px); } }
@keyframes button-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes poster-float { 50% { translate: 0 -10px; } }
@keyframes poster-turn { 0%, 100% { rotate: y -4deg; } 50% { rotate: y 4deg; } }

@media (min-width: 700px) {
  .ar-page { background: radial-gradient(circle at 50% 50%, rgba(201,255,69,.14), transparent 30%), #fff; }
  .ar-button { bottom: 28px; }
  .gesture-hint { bottom: 116px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
