:root {
  color-scheme: light;
  --bg-top: #ffffff;
  --bg-bottom: #ffffff;
  --ink: #1a1a1c;
  --muted: rgba(26, 26, 28, 0.34);
  --card-border: rgba(255, 255, 255, 0.98);
  --card-shadow: rgba(16, 24, 40, 0.055);
  --glow-blue: rgba(116, 160, 255, 0.1);
  --glow-cyan: rgba(185, 225, 255, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: #ffffff;
  color: var(--ink);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(26, 26, 28, 0.022) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  opacity: 0.14;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: calc(env(safe-area-inset-top) + 20px) 18px calc(env(safe-area-inset-bottom) + 28px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 34px;
}

.brand-logo {
  position: relative;
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.cards {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.code-card {
  position: relative;
  overflow: visible;
  min-height: 116px;
  padding: 24px 18px 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.52));
  border: 1px solid var(--card-border);
  box-shadow:
    0 10px 24px var(--card-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.99),
    inset 0 -10px 22px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(26px) saturate(128%);
  -webkit-backdrop-filter: blur(26px) saturate(128%);
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(20px);
  opacity: 0;
  animation: card-enter 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.code-card:nth-child(2) {
  animation-delay: 0.08s;
}

.code-card:nth-child(3) {
  animation-delay: 0.16s;
}

.code-card:nth-child(4) {
  animation-delay: 0.24s;
}

.code-card::before,
.code-card::after,
.card-chrome::before,
.card-chrome::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.code-card::before {
  inset: 1px;
  border-radius: 25px;
  background:
    linear-gradient(122deg, rgba(255, 255, 255, 0.99), rgba(255, 255, 255, 0.5) 28%, rgba(255, 255, 255, 0.16) 48%, transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.02));
  z-index: -1;
}

.code-card::after {
  inset: -1px;
  border-radius: 26px;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.84), rgba(236, 243, 255, 0.2));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.95;
}

.card-chrome::before {
  inset: auto -8% -20% auto;
  width: 150px;
  height: 150px;
  background:
    radial-gradient(circle at 42% 42%, var(--glow-blue), transparent 34%),
    radial-gradient(circle at 60% 60%, var(--glow-cyan), transparent 50%);
  filter: blur(28px);
  opacity: 0.56;
  z-index: -2;
}

.card-chrome::after {
  inset: -8% auto auto 8%;
  width: 58%;
  height: 44%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 40% 50%, rgba(255, 255, 255, 0.24), transparent 68%);
  transform: rotate(-7deg);
  filter: blur(12px);
  opacity: 0.76;
}

.code-card:nth-child(2) .card-chrome::before {
  inset: auto auto -18% -6%;
}

.code-card:nth-child(3) .card-chrome::before {
  inset: -10% -8% auto auto;
}

.code-card:nth-child(4) .card-chrome::before {
  inset: auto -10% -18% auto;
}

.card-note {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.card-code {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(2rem, 7.8vw, 2.45rem);
  font-weight: 600;
  letter-spacing: 0.045em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.98);
  word-break: break-word;
  text-align: center;
}

.card-note {
  margin-top: 8px;
  max-width: 100%;
  text-align: center;
}

.background-glow {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(46px);
  pointer-events: none;
  opacity: 0.28;
}

.background-glow-a {
  top: 120px;
  right: -100px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(125, 175, 255, 0.045), transparent 70%);
}

.background-glow-b {
  bottom: 80px;
  left: -110px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(163, 228, 255, 0.04), transparent 72%);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 28px);
  transform: translateX(-50%) translateY(18px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(23, 38, 40, 0.88);
  color: #f9fcfc;
  font-size: 13px;
  letter-spacing: 0.03em;
  box-shadow: 0 18px 40px rgba(23, 38, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes card-enter {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (min-width: 700px) {
  .page-shell {
    max-width: 520px;
    margin: 0 auto;
  }
}
