@font-face {
  font-family: "Geist Local";
  src: url("/static/fonts/Geist-200.ttf") format("truetype");
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Geist Local";
  src: url("/static/fonts/Geist-300.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Geist Local";
  src: url("/static/fonts/Geist-400.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Geist Local";
  src: url("/static/fonts/Geist-500.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Geist Local";
  src: url("/static/fonts/Geist-600.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Geist Local";
  src: url("/static/fonts/Geist-700.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #000;
  --text: #f7f5f2;
  --muted: #d2ceca;
  --soft: #8f8b88;
  --line: rgba(255, 255, 255, 0.55);
  --cta-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  font-family: "Geist Local", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #000;
  color: var(--text);
}

body {
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.stage {
  width: 100vw;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

.phone-shell {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 360ms ease, transform 460ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.screen.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.home-copy {
  padding-top: 86px;
  text-align: center;
}

.home-copy h1 {
  margin: 0;
  font-size: clamp(47px, 8.9vw, 58px);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: 0;
}

.home-copy p {
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 300;
}

.coin-wrap {
  position: absolute;
  top: 260px;
  left: 50%;
  width: min(92vw, 440px);
  height: min(92vw, 440px);
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}

.coin-wrap img,
.coin-wrap picture,
.coin-wrap div {
  width: 100%;
  height: 100%;
  display: block;
}

.coin-gif {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  pointer-events: none;
  overflow: hidden;
}

.coin-gif canvas {
  width: 100% !important;
  height: 100% !important;
}

.orientation-lock {
  display: none;
}

.coin-fallback {
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 68% 45%, #28b9ff 0 22%, #0b57db 45%, #10113f 70%),
    #1657df;
  box-shadow:
    -22px 34px 0 -18px #ff3e60,
    18px -20px 0 -17px #eaff5d,
    0 0 42px rgba(26, 122, 255, 0.44);
  filter: saturate(1.3);
}

.home-footer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: var(--cta-bottom);
  text-align: center;
}

.agreement-copy {
  margin: 0 0 28px;
  color: #88837f;
  font-size: 14px;
  line-height: 1.34;
  font-weight: 600;
}

.agreement-copy button {
  padding: 0;
  background: transparent;
  color: #9a9692;
  font-size: inherit;
  line-height: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.primary-btn,
.secondary-btn {
  min-height: 58px;
  border-radius: 999px;
  color: #070707;
  background: #fff;
  font-weight: 700;
  font-size: 17px;
  transition: transform 140ms ease, filter 180ms ease;
}

.primary-btn:active,
.secondary-btn:active,
.pin-keypad button:active,
.close-pin:active {
  transform: scale(0.965);
}

.primary-btn {
  width: 100%;
  max-width: 394px;
}

.progress-track {
  position: absolute;
  top: 62px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.43);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: var(--progress);
  height: 100%;
  background: #fff;
  transition: width 550ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.key-hero {
  position: absolute;
  top: 180px;
  left: 50%;
  width: 113px;
  height: 163px;
  transform: translateX(-50%);
}

.key-hero img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.08) contrast(1.05);
}

.protect-copy {
  position: absolute;
  left: 27px;
  right: 27px;
  top: 432px;
  text-align: center;
}

.protect-copy h2,
.import-content h2,
.pin-copy h2 {
  margin: 0;
  color: #f7f5f2;
  font-size: clamp(36px, 7.4vw, 45px);
  line-height: 1.04;
  font-weight: 500;
  letter-spacing: 0;
}

.protect-copy h2 {
  font-weight: 700;
}

.protect-copy p {
  max-width: 375px;
  margin: 26px auto 0;
  color: #d4d0cc;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 500;
}

.bottom-btn {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: var(--cta-bottom);
  width: auto;
  max-width: none;
}

.import-content {
  position: absolute;
  top: 112px;
  left: 22px;
  right: 22px;
}

.import-content h2 {
  max-width: none;
  white-space: nowrap;
  font-size: clamp(34px, 10.7vw, 43px);
  font-weight: 500;
}

.import-content p {
  width: auto;
  max-width: 100%;
  white-space: normal;
  margin: 24px 0 18px;
  color: #f2eeee;
  font-size: 17px;
  line-height: 1.36;
  font-weight: 700;
}

.phrase-field {
  display: block;
  width: 100%;
  height: 104px;
  border: 1.5px solid #fff;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.phrase-field textarea {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 28px 18px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
}

.phrase-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.import-content .phrase-error {
  display: none;
  width: auto;
  margin: 11px 0 0;
  color: #ff2d2d;
  white-space: normal;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
}

.import-content .phrase-error.is-visible {
  display: block;
}

.import-actions {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: var(--cta-bottom);
  display: grid;
  grid-template-columns: 1fr;
}

.secondary-btn {
  min-height: 57px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
}

.import-btn {
  background: #fff;
  color: #070707;
}

.import-btn:disabled {
  opacity: 0.38;
  cursor: default;
  transform: none;
}

.pin-panel {
  position: absolute;
  z-index: 50;
  inset: 0;
  background: #000;
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 360ms ease;
}

.pin-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.agreement-panel {
  position: absolute;
  z-index: 70;
  inset: 0;
  background: #000;
  transform: translateY(105%);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 360ms ease;
}

.agreement-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.close-agreement {
  position: absolute;
  z-index: 3;
  top: 38px;
  left: 23px;
  width: 34px;
  height: 34px;
  background: transparent;
}

.close-agreement::before,
.close-agreement::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 2px;
  width: 30px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

.close-agreement::before {
  transform: rotate(45deg);
}

.close-agreement::after {
  transform: rotate(-45deg);
}

.agreement-document {
  width: 100%;
  max-width: 430px;
  height: 100%;
  overflow-y: auto;
  padding: 112px 24px 54px;
  color: #f4f1ee;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  scrollbar-width: none;
}

.agreement-document::-webkit-scrollbar {
  display: none;
}

.agreement-document h2 {
  max-width: 390px;
  margin: 0 0 62px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue",
    Arial, sans-serif;
  font-size: 46px;
  line-height: 1.12;
  font-weight: 300;
  letter-spacing: 0;
}

.agreement-date {
  margin: 0 0 26px;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.agreement-document p {
  margin: 0 0 22px;
  color: #ece8e4;
  font-size: 18px;
  line-height: 1.48;
  font-weight: 300;
}

.close-pin {
  position: absolute;
  z-index: 4;
  top: 58px;
  left: 23px;
  width: 27px;
  height: 27px;
  background: transparent;
}

.close-pin::before,
.close-pin::after,
.close-pin span::before,
.close-pin span::after {
  content: "";
}

.close-pin::before,
.close-pin::after {
  position: absolute;
  top: 13px;
  left: 2px;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.close-pin::before {
  transform: rotate(45deg);
}

.close-pin::after {
  transform: rotate(-45deg);
}

.pin-copy {
  position: absolute;
  top: 148px;
  left: 20px;
  right: 20px;
  text-align: center;
  pointer-events: none;
}

.pin-copy h2 {
  font-size: clamp(32px, 6.9vw, 40px);
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 29px;
  margin-top: 52px;
}

.pin-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #e9e6e2;
  transform: scale(1);
  transition:
    background 140ms ease,
    transform 180ms cubic-bezier(0.2, 1.5, 0.35, 1),
    border-color 140ms ease;
}

.pin-dots span.is-filled {
  background: #eeeae5;
  border-color: #eeeae5;
  transform: scale(1.08);
}

.pin-dots.is-error {
  animation: shake 320ms ease;
}

.pin-keypad {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 43px;
  width: 342px;
  max-width: calc(100% - 52px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 29px;
  column-gap: 44px;
  pointer-events: auto;
}

.pin-keypad button,
.pin-keypad span {
  height: 45px;
  display: grid;
  place-items: center;
}

.pin-keypad button {
  background: transparent;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  font-weight: 400;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.pin-keypad .delete-key {
  font-size: 34px;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-11px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-7px);
  }
  80% {
    transform: translateX(5px);
  }
}

@media (max-width: 540px) {
  .home-copy {
    padding-top: 86px;
  }

  .coin-wrap {
    top: 260px;
  }
}

@media (max-width: 390px) {
  .agreement-document h2 {
    font-size: 46px;
    line-height: 1.11;
  }

  .agreement-date,
  .agreement-document p {
    font-size: 18px;
  }

  .import-content h2 {
    font-size: clamp(30px, 10vw, 36px);
  }

  .import-content p {
    font-size: 17px;
  }
}

@media (max-height: 720px) {
  .home-copy {
    padding-top: 74px;
  }

  .coin-wrap {
    top: 230px;
    width: min(90vw, 400px);
    height: min(90vw, 400px);
  }

  .protect-copy {
    top: 406px;
  }

  .key-hero {
    top: 161px;
    width: 100px;
    height: 147px;
  }

  .pin-copy {
    top: 132px;
  }

  .pin-keypad {
    row-gap: 22px;
    bottom: 36px;
  }
}

@media (min-height: 880px) and (max-width: 540px) {
  .home-copy {
    padding-top: calc(86px + clamp(18px, calc((100dvh - 852px) * 0.35), 34px));
  }

  .coin-wrap {
    top: calc(260px + clamp(24px, calc((100dvh - 852px) * 0.45), 44px));
    width: min(94vw, 460px);
    height: min(94vw, 460px);
  }

  .progress-track {
    top: calc(62px + clamp(8px, calc((100dvh - 852px) * 0.15), 16px));
  }

  .key-hero {
    top: calc(180px + clamp(28px, calc((100dvh - 852px) * 0.45), 42px));
  }

  .protect-copy {
    top: calc(432px + clamp(30px, calc((100dvh - 852px) * 0.55), 50px));
  }

  .import-content {
    top: calc(112px + clamp(24px, calc((100dvh - 852px) * 0.45), 44px));
  }

  .close-pin {
    top: calc(58px + clamp(10px, calc((100dvh - 852px) * 0.2), 18px));
  }

  .pin-copy {
    top: calc(148px + clamp(28px, calc((100dvh - 852px) * 0.5), 48px));
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .phone-shell {
    visibility: hidden;
  }

  .orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: block;
    background: #000;
  }
}
