@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #050505;
  --card: #121212;
  --card-2: #171717;
  --line: #1e1e1e;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --faint: #6d6d6d;
  --accent: #00e5ff;
  --ink: #041018;
  --green: #17c964;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 20px;
  --page: 520px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: dark; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  letter-spacing: -0.011em;
}

body {
  min-height: 100dvh;
  overflow-x: clip;
}

button, a { -webkit-tap-highlight-color: transparent; }

::selection { background: rgba(0, 229, 255, 0.28); color: #fff; }

button, a { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { text-decoration: none; }
img { display: block; max-width: 100%; }
svg { overflow: visible; display: block; flex: none; }

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 280px at 18% 0%, rgba(255, 255, 255, 0.07), transparent 62%),
    radial-gradient(420px 240px at 78% -8%, rgba(0, 229, 255, 0.06), transparent 58%);
  animation: glow-in 1.4s var(--ease) both;
}

.page {
  position: relative;
  width: min(var(--page), calc(100% - 40px));
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top))
    0
    max(40px, env(safe-area-inset-bottom));
}

.rise {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.72s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

.top {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.45s var(--ease);
}

.brand:hover img { transform: rotate(-8deg) scale(1.06); }

.top__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn,
.os__btn,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 999px;
  background: #111;
  border: 1px solid #242424;
  color: #fff;
  transition:
    background 0.22s var(--ease),
    border-color 0.22s,
    transform 0.22s var(--ease),
    box-shadow 0.22s;
}

.icon-btn {
  width: 40px;
  border-radius: 14px;
  padding: 0;
}

.icon-btn svg,
.os__btn svg { width: 16px; height: 16px; }

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover,
  .os__btn:hover,
  .chip:hover {
    background: #171717;
    border-color: #333;
    transform: translateY(-1px);
  }
}

.icon-btn:active,
.os__btn:active,
.chip:active { transform: translateY(0) scale(0.97); }

.os {
  position: relative;
  z-index: 2;
}

.os.is-open { z-index: 50; }

.os__btn {
  padding: 0 12px 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.os__btn b { font-weight: 600; }

.os__btn .chev {
  width: 14px;
  height: 14px;
  color: #8a8a8a;
  transition: transform 0.32s var(--ease), color 0.22s;
}

.os.is-open .os__btn {
  background: #1a1a1a;
  border-color: #353535;
}

.os.is-open .os__btn .chev {
  transform: rotate(180deg);
  color: #fff;
}

.os__icon {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease);
}

.os.is-open .os__icon { transform: scale(1.08); }

.os__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 50;
  min-width: 176px;
  padding: 6px;
  border-radius: 16px;
  background: #121212;
  border: 1px solid #262626;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px) scale(0.94);
  transition:
    opacity 0.22s ease,
    transform 0.32s var(--ease),
    visibility 0.32s,
    border-color 0.22s;
}

.os.is-open .os__menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.os__menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: #d7d7d7;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  opacity: 0;
  transform: translateY(-8px);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.os.is-open .os__menu button {
  animation: item-in 0.34s var(--ease) forwards;
}

.os.is-open .os__menu button:nth-child(1) { animation-delay: 0.03s; }
.os.is-open .os__menu button:nth-child(2) { animation-delay: 0.06s; }
.os.is-open .os__menu button:nth-child(3) { animation-delay: 0.09s; }
.os.is-open .os__menu button:nth-child(4) { animation-delay: 0.12s; }
.os.is-open .os__menu button:nth-child(5) { animation-delay: 0.15s; }

.os__menu button:hover {
  background: #1a1a1a;
  color: #fff;
  transform: translateX(2px);
}

.os__menu button.is-on {
  background: #1a1a1a;
  color: #fff;
}

.apps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 18px;
  background: #101010;
  border: 1px solid #1c1c1c;
}

.apps__pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  transition: transform 0.38s var(--ease), width 0.38s var(--ease), opacity 0.25s;
}

.apps.is-one {
  background: #fff;
  border-color: #fff;
}

.apps.is-one .apps__pill { opacity: 0; }

.apps button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  color: #8d8d8d;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  background: transparent;
  transition: color 0.25s, transform 0.25s var(--ease);
}

.apps button i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.apps button.is-on { color: #111; }

.apps.is-one button.is-on {
  width: 100%;
  color: #111;
}

.apps button:active { transform: scale(0.98); }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.steps {
  display: grid;
  gap: 12px;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 18px 20px 16px;
  background: var(--card);
  border: 1px solid #1c1c1c;
  border-radius: 24px;
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s;
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
    border-color: #2d2d2d;
    background: #151515;
  }

  .card:hover .card__ico {
    transform: scale(1.06);
    border-color: #3a3a3a;
  }

  .btn:hover { transform: translateY(-1px); }
  .btn--light:hover { box-shadow: 0 10px 24px rgba(255, 255, 255, 0.12); }
  .modal__x:hover {
    background: #1a1a1a;
    color: #fff;
    transform: rotate(90deg);
  }
}

.card__ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #2c2c2c;
  background: transparent;
  color: #ececec;
  flex: none;
  transition: transform 0.4s var(--ease), border-color 0.3s, color 0.3s;
}

.card__ico svg { width: 18px; height: 18px; }

.card__body { min-width: 0; flex: 1; padding-top: 2px; }

.card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  animation: chip-in 0.42s var(--ease) both;
}

.chip:nth-child(2) { animation-delay: 0.05s; }
.chip:nth-child(3) { animation-delay: 0.1s; }

.chip svg { width: 11px; height: 11px; opacity: 0.85; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.35s var(--ease), filter 0.3s, box-shadow 0.35s, background 0.3s;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(0) scale(0.98); }

.btn--light {
  margin-top: 16px;
  border-radius: 999px;
  background: #fff;
  color: #111;
}

.btn--copy {
  width: 100%;
  margin-top: 16px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #2a2a2a;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    visibility 0.28s,
    backdrop-filter 0.32s ease,
    -webkit-backdrop-filter 0.32s ease;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.modal {
  position: relative;
  width: min(380px, 100%);
  padding: 28px 22px 22px;
  border-radius: 24px;
  background: #121212;
  border: 1px solid #242424;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.36s var(--ease);
}

.overlay.is-open .modal {
  opacity: 1;
  transform: none;
}

.modal__x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #8a8a8a;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}

.modal__x svg { width: 16px; height: 16px; margin: 0 auto; }

.modal__tag {
  display: inline-flex;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #cfcfcf;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.modal h2 {
  margin: 12px 0 8px;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.modal p {
  margin: 0 auto 16px;
  max-width: 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.qr {
  width: 196px;
  height: 196px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.45s var(--ease) 0.08s, opacity 0.35s ease 0.08s;
}

.overlay.is-open .qr {
  transform: none;
  opacity: 1;
}

.qr img { width: 100%; height: 100%; }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 70;
  min-height: 40px;
  padding: 0 16px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.25s ease, transform 0.35s var(--ease), visibility 0.25s;
}

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

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes item-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes chip-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes glow-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 560px) {
  .page {
    width: min(100% - 24px, var(--page));
    padding:
      max(16px, env(safe-area-inset-top))
      0
      max(32px, env(safe-area-inset-bottom));
  }
  .brand span { font-size: 16px; }
  .card { padding: 16px 14px; }
  .apps button { font-size: 13px; padding: 0 8px; }
  .badge { display: none; }
  .apps button.is-on .badge { display: inline-flex; }
}

@media (min-width: 700px) and (max-width: 1180px) {
  :root { --page: 600px; }
  .page {
    padding-top: max(36px, env(safe-area-inset-top));
    padding-bottom: max(56px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .rise,
  .os__menu button,
  .chip,
  .glow,
  .modal,
  .qr { opacity: 1; transform: none; }
}
