@font-face {
  font-family: "SB Sans";
  src: url("../../assets/fonts/sb-sans-display.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: "SB Sans", sans-serif;
  color: #000;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 280px;
  min-height: 100%;
  margin: 0;
  background: #fff;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

body.is-preview {
  background: #fff;
}

.onboarding {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  border-radius: 0;
  background: #fff;
  isolation: isolate;
  --mx: 0;
  --my: 0;
}

.soft-glow {
  position: absolute;
  inset: -10% -12%;
  background:
    radial-gradient(ellipse 36% 42% at 50% 18%, rgba(150, 94, 235, 0.24) 0%, transparent 76%),
    radial-gradient(ellipse 38% 48% at 50% 50%, rgba(13, 163, 253, 0.24) 0%, transparent 78%),
    radial-gradient(ellipse 40% 44% at 50% 82%, rgba(23, 208, 112, 0.24) 0%, transparent 78%);
}

.onboarding__flow {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 18px 20px max(28px, env(safe-area-inset-bottom));
}

.scene {
  position: relative;
  width: min(980px, calc(100vw - 24px), calc((100dvh - 238px) * 0.9318));
  min-width: 280px;
  aspect-ratio: 1230 / 1320;
  flex: 0 0 auto;
}

.layer {
  position: absolute;
  display: block;
  object-fit: contain;
  will-change: transform;
}

.layer--labels {
  z-index: 30;
  top: 4.55%;
  left: 0;
  width: 100%;
  height: 88.71%;
  transform: translate(calc(var(--mx) * 15.75px), calc(var(--my) * 13.5px));
  animation: label-float 6.4s ease-in-out infinite alternate;
}

.layer--market {
  z-index: 8;
  top: 21.36%;
  left: 4.72%;
  width: 56.5%;
  height: 68.03%;
  transform: translate(calc(var(--mx) * 24.75px), calc(var(--my) * 20.25px));
  animation: market-float 6.4s ease-in-out infinite alternate;
}

.layer--stroller-card {
  z-index: 6;
  top: 6.82%;
  left: 49.59%;
  width: 43.09%;
  height: 53.33%;
  transform: translate(calc(var(--mx) * 33.75px), calc(var(--my) * 29.25px));
  animation: stroller-card-float 6.4s ease-in-out infinite alternate;
}

.layer--sweater {
  z-index: 12;
  top: 55.68%;
  left: 61.38%;
  width: 19.11%;
  height: 23.86%;
  transform: translate(calc(var(--mx) * 45px), calc(var(--my) * 38.25px));
  animation: object-float 6.4s ease-in-out infinite alternate;
}

.layer--sneaker {
  z-index: 14;
  top: 78.18%;
  left: 26.42%;
  width: 40.65%;
  height: 21.52%;
  transform: translate(calc(var(--mx) * 51.75px), calc(var(--my) * 42.75px));
  animation: sneaker-float 6.4s ease-in-out infinite alternate;
}

.layer--stroller {
  z-index: 4;
  top: 0;
  left: 19.67%;
  width: 28.46%;
  height: 30.61%;
  transform: translate(calc(var(--mx) * 45px), calc(var(--my) * 38.25px));
  animation: object-float 6.4s ease-in-out infinite alternate;
}

.onboarding__content {
  z-index: 40;
  width: min(340px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.copy-panel {
  width: 100%;
  text-align: center;
}

.copy-panel h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  line-height: 26px;
  letter-spacing: -0.02em;
}

.copy-panel p {
  margin: 8px 0 0;
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.motion-action {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.motion-action__hint {
  margin: 0;
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}

.gyro-access-button {
  min-width: 44px;
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: 15px;
  background: #141414;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 22px;
  text-align: center;
  transition: transform 180ms ease-out, box-shadow 180ms ease-out, background-color 180ms ease-out;
  -webkit-tap-highlight-color: transparent;
}

.gyro-access-button:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.gyro-access-button:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.24);
  outline-offset: 3px;
}

.gyro-access-button:disabled {
  background: #242424;
  box-shadow: none;
}

.onboarding.is-preview .onboarding__flow {
  padding: 0;
}

.onboarding.is-preview {
  border-radius: 0;
}

.onboarding.is-preview .scene {
  width: min(88%, calc((100dvh - 24px) * 0.9318));
  min-width: 150px;
  transform: scale(0.76);
}

.onboarding.is-preview .copy-panel {
  display: none;
}

.onboarding.is-preview .onboarding__content {
  position: absolute;
  z-index: 50;
  right: 10px;
  bottom: 10px;
  left: auto;
  width: auto;
}

.onboarding.is-preview .motion-action {
  gap: 8px;
}

.onboarding.is-preview .motion-action__hint {
  display: none;
}

@keyframes label-float {
  from { translate: 0 5px; }
  to { translate: 0 -6px; }
}

@keyframes market-float {
  from { translate: 0 -7px; }
  to { translate: 0 7px; }
}

@keyframes stroller-card-float {
  from { translate: 0 8px; }
  to { translate: 0 -8px; }
}

@keyframes object-float {
  from { translate: 0 -5px; }
  to { translate: 0 6px; }
}

@keyframes sneaker-float {
  from { translate: 0 8px; }
  to { translate: 0 -8px; }
}

@media (max-width: 339px) {
  .onboarding__flow {
    gap: 14px;
    padding-inline: 12px;
  }

  .scene {
    width: min(calc(100vw - 16px), calc((100dvh - 306px) * 0.9318));
    min-width: 250px;
  }
}

@media (min-width: 800px) and (min-height: 720px) {
  .copy-panel h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .copy-panel p {
    font-size: 14px;
    line-height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .layer {
    animation: none;
    transform: none;
  }
}
