:root {
  --bg: #05060b;
  --panel: rgba(9, 12, 20, 0.72);
  --text: #f7f7fb;
  --accent: #43f3ff;
  --accent-soft: rgba(67, 243, 255, 0.3);
  --ember: #ff8f29;
  --ember-soft: rgba(255, 143, 41, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family: "Bahnschrift", "Trebuchet MS", "Segoe UI Variable", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 18%, rgba(67, 243, 255, 0.12), transparent 22%),
    radial-gradient(circle at 62% 64%, rgba(255, 143, 41, 0.16), transparent 26%),
    radial-gradient(circle at 18% 50%, rgba(118, 43, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #090a13 0%, #04050b 44%, #020208 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black 28%, transparent 82%);
  opacity: 0.5;
}

body::after {
  background:
    radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.74) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.5;
}

.phone-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.4vh, 26px);
  padding: max(14px, env(safe-area-inset-top)) 24px 18px;
  perspective: 1800px;
}

.phone-row {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(34px, 5vw, 92px);
  width: min(100%, 1500px);
  max-width: 100%;
  margin: 0 auto;
  margin-top: clamp(6px, 1.2vh, 18px);
}

.phone-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 4vh, 44px);
  width: min(92vw, 1240px);
  height: min(28vw, 320px);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(67, 243, 255, 0.18), transparent 46%),
    radial-gradient(circle at 75% 40%, rgba(255, 143, 41, 0.2), transparent 42%),
    rgba(4, 6, 14, 0.9);
  filter: blur(44px);
  transform: translateX(-50%) rotateX(78deg);
  pointer-events: none;
}

.page-head {
  position: relative;
  z-index: 2;
  width: min(100%, 920px);
  text-align: center;
  margin-top: 70px;
  flex: 0 0 auto;
}

.page-kicker {
  margin: 0 0 10px;
  color: rgba(255, 143, 41, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 800;
}

.page-title {
  margin: 0;
  font-family: "Baskerville Old Face", "Book Antiqua", Georgia, serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 22px rgba(67, 243, 255, 0.12),
    0 0 40px rgba(255, 143, 41, 0.08);
}

.page-subtitle {
  margin: 14px auto 0;
  max-width: 44ch;
  color: rgba(247, 247, 251, 0.74);
  font-size: clamp(0.95rem, 2vw, 1.12rem);
  line-height: 1.45;
}

.phone-float {
  --phone-accent: var(--accent);
  --phone-accent-soft: var(--accent-soft);
  flex: 0 0 auto;
  position: relative;
  width: clamp(340px, 33vw, 500px);
  animation: float-idle 5.8s ease-in-out infinite;
}

.phone-float--ember {
  --phone-accent: var(--ember);
  --phone-accent-soft: var(--ember-soft);
  animation-delay: -1.9s;
}

.phone-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 438 / 790;
  transform-style: preserve-3d;
  transition: transform 360ms ease;
  filter: drop-shadow(0 34px 80px rgba(0, 0, 0, 0.58));
  touch-action: none;
}

.phone-shell::before {
  content: "";
  position: absolute;
  inset: auto 10% -10% 10%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--phone-accent-soft), transparent 68%);
  filter: blur(20px);
  transform: translateZ(-120px);
}

.phone-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1480ms cubic-bezier(0.22, 0.74, 0.16, 1);
}

.phone-card.is-flipped {
  transform: rotateY(180deg);
}

.phone-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.phone-face--back {
  transform: rotateY(180deg);
}

.phone-face--back .device-crop {
  z-index: 0;
}

.device-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: clamp(26px, 3vw, 36px);
}

.device-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.phone-sticker {
  position: absolute;
  left: 50%;
  bottom: 18%;
  z-index: 3;
  width: 62%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 240, 0.96), rgba(241, 232, 208, 0.94));
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(0, 0, 0, 0.03) inset;
  color: #201914;
  text-align: center;
  transform: translateX(-50%) translateZ(80px) rotate(-3deg);
}

.phone-sticker::before,
.phone-sticker::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 58px;
  height: 18px;
  border-radius: 7px;
  background: rgba(255, 246, 202, 0.54);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.phone-sticker::before {
  left: 16px;
  transform: rotate(-9deg);
}

.phone-sticker::after {
  right: 16px;
  transform: rotate(8deg);
}

.phone-float--ember .phone-sticker {
  transform: translateX(-50%) translateZ(80px) rotate(3deg);
}

.phone-sticker__label {
  display: block;
  margin-bottom: 6px;
  color: rgba(32, 25, 20, 0.68);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phone-sticker__number {
  display: block;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.scan-badge {
  position: absolute;
  top: 3%;
  right: -4%;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(6, 10, 18, 0.78);
  color: #f6fbff;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 18px var(--phone-accent-soft),
    0 12px 30px rgba(0, 0, 0, 0.34);
  transform: translateZ(140px);
  animation: badge-pop 2.6s ease-in-out infinite;
  cursor: pointer;
}

.scan-badge__label {
  white-space: nowrap;
}

.scan-badge__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--phone-accent);
  box-shadow: 0 0 18px var(--phone-accent);
  animation: beacon 1.4s ease-in-out infinite;
}

.qr-shell {
  position: absolute;
  left: 55%;
  top: 50%;
  z-index: 4;
  width: 70%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 8%;
  border: 0;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(4, 8, 16, 0.92);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 34px var(--phone-accent-soft),
    0 24px 52px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  transform: translate(-50%, -50%) translateZ(90px);
  cursor: pointer;
  isolation: isolate;
}

.qr-shell::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--phone-accent) 78%, white 22%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--phone-accent) 38%, transparent);
}

.qr-halo {
  position: absolute;
  left: 55%;
  top: 50%;
  width: 158%;
  height: 158%;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--phone-accent) 48%, white 8%) 0%,
    color-mix(in srgb, var(--phone-accent) 24%, transparent) 34%,
    transparent 68%
  );
  filter: blur(30px);
  transform: translate(-50%, -50%);
  z-index: 0;
}

.qr-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 28px rgba(255, 255, 255, 0.14),
    0 0 32px color-mix(in srgb, var(--phone-accent) 26%, transparent);
}

.qr-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-unavailable {
  position: absolute;
  inset: 14%;
  z-index: 3;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 22, 33, 0.96), rgba(10, 12, 20, 0.96));
  color: #f7f7fb;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.qr-unavailable__title {
  display: block;
  font-size: clamp(1rem, 1.8vw, 1.36rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.qr-unavailable__copy {
  display: block;
  color: rgba(247, 247, 251, 0.72);
  font-size: clamp(0.76rem, 1.1vw, 0.94rem);
  line-height: 1.4;
}

.qr-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.scan-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: -6%;
  height: 16%;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0),
    color-mix(in srgb, var(--phone-accent) 82%, white 18%) 55%,
    rgba(255, 255, 255, 0)
  );
  filter: blur(4px);
  opacity: 0.9;
  animation: scan-sweep 2.8s linear infinite;
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: color-mix(in srgb, var(--phone-accent) 84%, white 16%);
  border-style: solid;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--phone-accent) 88%, white 12%));
  z-index: 2;
}

.corner--tl {
  top: 10px;
  left: 10px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 10px;
}

.corner--tr {
  top: 10px;
  right: 10px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 10px;
}

.corner--bl {
  bottom: 10px;
  left: 10px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 10px;
}

.corner--br {
  right: 10px;
  bottom: 10px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 10px;
}

.phone-float.is-active .qr-shell,
.phone-float:hover .qr-shell {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 44px color-mix(in srgb, var(--phone-accent) 42%, transparent),
    0 26px 58px rgba(0, 0, 0, 0.46);
}

.phone-float.is-disabled .device-art--front {
  filter: saturate(0.62) brightness(0.84);
}

.phone-float.is-disabled .scan-badge {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 33, 0.9);
}

.phone-float.is-disabled .scan-badge__dot {
  background: #ffd66d;
  box-shadow: 0 0 18px rgba(255, 214, 109, 0.84);
}

.phone-float.is-disabled .qr-shell {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    rgba(6, 8, 14, 0.96);
}

.phone-float.is-disabled .qr-halo,
.phone-float.is-disabled .qr-art,
.phone-float.is-disabled .scan-line,
.phone-float.is-disabled .corner {
  opacity: 0;
}

.phone-float.is-disabled .qr-unavailable {
  opacity: 1;
  transform: scale(1);
}

@keyframes float-idle {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-16px);
  }
}

@keyframes badge-pop {
  0%,
  100% {
    transform: translateZ(140px) scale(1);
  }

  50% {
    transform: translateY(-6px) translateZ(140px) scale(1.04);
  }
}

@keyframes beacon {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

@keyframes scan-sweep {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  92% {
    opacity: 1;
  }

  100% {
    transform: translateY(520%);
    opacity: 0;
  }
}

@keyframes phone-vibe {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-2px);
  }

  40% {
    transform: translateX(3px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(2px);
  }
}

.phone-float.is-active {
  animation:
    float-idle 5.8s ease-in-out infinite,
    phone-vibe 0.36s linear 2;
}

@media (max-width: 900px) {
  .page-head {
    width: min(100%, 620px);
  }

  .phone-float {
    width: min(43vw, 380px);
  }

  .qr-shell {
    width: 72%;
  }
}

@media (max-width: 640px) {
  body {
    overflow-y: auto;
  }

  .phone-stage {
    gap: 18px;
    padding: max(10px, env(safe-area-inset-top)) 10px 14px;
  }

  .phone-row {
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    gap: 14px;
    justify-content: center;
    margin-top: 0;
  }

  .phone-float {
    width: calc((100vw - 34px) / 2);
    max-width: 240px;
    min-width: 158px;
  }

  .scan-badge {
    top: 0;
    right: -2%;
    min-height: 38px;
    padding: 0 10px;
    gap: 8px;
    font-size: 0.58rem;
  }

  .corner {
    width: 18px;
    height: 18px;
  }

  .qr-shell {
    width: 74%;
    border-radius: 20px;
  }

  .phone-sticker {
    width: 68%;
    bottom: 16%;
    padding: 10px 10px;
    border-radius: 12px;
  }

  .phone-sticker::before,
  .phone-sticker::after {
    width: 42px;
    height: 14px;
  }

  .phone-sticker__label {
    margin-bottom: 4px;
    font-size: 0.58rem;
  }

  .phone-sticker__number {
    font-size: 0.84rem;
  }

  .page-kicker {
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
  }

  .page-title {
    font-size: clamp(1.7rem, 8.4vw, 2.5rem);
  }

  .page-subtitle {
    margin-top: 10px;
    max-width: 30ch;
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .phone-stage {
    padding-inline: 8px;
  }

  .phone-row {
    gap: 10px;
  }

  .phone-float {
    width: calc((100vw - 26px) / 2);
    min-width: 142px;
  }

  .scan-badge {
    min-height: 34px;
    padding: 0 8px;
    gap: 6px;
    font-size: 0.54rem;
  }

  .qr-shell {
    width: 76%;
  }

  .phone-sticker {
    width: 72%;
    bottom: 15%;
    padding: 9px 8px;
  }

  .phone-sticker__number {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone-float,
  .phone-card,
  .phone-shell,
  .scan-badge,
  .scan-line,
  .scan-badge__dot {
    animation: none !important;
    transition: none !important;
  }
}
