@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --ink: #15120f;
  --muted: #777067;
  --line: #e6ded3;
  --paper: #ffffff;
  --canvas: #f4f0e9;
  --panel: #efebe4;
  --gold: #d0a35a;
  --gold-light: #f2ddb2;
  --card: #1b1713;
  --shadow: 0 28px 72px rgba(42, 31, 18, 0.11);
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'DM Mono', monospace;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.loading-screen {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--canvas);
  opacity: 1;
  transition: opacity 480ms ease, visibility 480ms ease;
}

.loading-screen.is-leaving {
  visibility: hidden;
  opacity: 0;
}

.loader-orbit {
  position: relative;
  width: 56px;
  aspect-ratio: 1;
  border: 1px solid rgba(208, 163, 90, 0.28);
  border-radius: 50%;
  animation: orbit-spin 1.2s linear infinite;
}

.loader-orbit::before,
.loader-orbit span {
  position: absolute;
  content: '';
  border-radius: 50%;
}

.loader-orbit::before {
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(208, 163, 90, 0.9);
}

.loader-orbit span {
  inset: 12px;
  border: 1px solid rgba(21, 18, 15, 0.16);
}

.app-shell {
  min-height: 100svh;
  padding: clamp(14px, 3vw, 42px);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: calc(100svh - clamp(28px, 6vw, 84px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.page-view { animation: page-in 540ms cubic-bezier(.2, .82, .26, 1) both; }

.brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: clamp(36px, 8vw, 104px);
  overflow: hidden;
  isolation: isolate;
  background: var(--panel);
}

.brand-panel::before,
.brand-panel::after,
.brand-halo {
  position: absolute;
  z-index: -1;
  content: '';
  border-radius: 50%;
  pointer-events: none;
}

.brand-panel::before {
  width: min(66vw, 590px);
  aspect-ratio: 1;
  border: 1px solid rgba(208, 163, 90, 0.32);
}

.brand-panel::after {
  width: min(50vw, 440px);
  aspect-ratio: 1;
  border: 1px dashed rgba(21, 18, 15, 0.13);
  animation: slow-spin 44s linear infinite;
}

.brand-halo {
  width: min(28vw, 220px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(208, 163, 90, 0.17), transparent 68%);
  filter: blur(8px);
  animation: breathe 4.6s ease-in-out infinite;
}

.logo-frame {
  position: relative;
  display: grid;
  width: min(100%, 390px);
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(208, 163, 90, 0.7);
  border-radius: 24px;
  background: #050505;
  box-shadow: 0 24px 52px rgba(31, 23, 14, 0.25);
  animation: logo-in 640ms 100ms cubic-bezier(.2, .82, .26, 1) both;
}

.logo-frame::after {
  position: absolute;
  inset: 0;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: inherit;
  pointer-events: none;
}

.logo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(38px, 8vw, 104px);
}

.flow-card { width: min(100%, 470px); }

.home-card,
.payment-card,
.success-card { animation: card-in 620ms 110ms cubic-bezier(.2, .82, .26, 1) both; }

.eyebrow {
  display: block;
  margin: 0 0 20px;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.home-card h1,
.success-card p {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3rem, 5vw, 4.75rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 60px;
  margin-top: 44px;
  padding: 17px 22px 17px 25px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.095em;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.button-arrow {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.primary-button:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: 0 12px 24px rgba(208, 163, 90, 0.2);
  transform: translateY(-2px);
}

.primary-button:hover:not(:disabled) .button-arrow { transform: translateX(2px); }

.primary-button:focus-visible,
.copy-button:focus-visible {
  outline: 3px solid rgba(208, 163, 90, 0.45);
  outline-offset: 3px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.36;
}

.wallet-card {
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(208, 163, 90, 0.46);
  border-radius: 20px;
  background: linear-gradient(144deg, #252017 0%, var(--card) 65%);
  color: #fff;
  box-shadow: 0 22px 42px rgba(21, 18, 15, 0.17);
}

.wallet-card-topline,
.wallet-address-row,
.wallet-card-footer {
  display: flex;
  align-items: center;
}

.wallet-card-topline { justify-content: space-between; }

.network-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-light);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.network-pill span,
.active-dot {
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(208, 163, 90, 0.13);
}

.chain-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.wallet-label {
  margin: 28px 0 10px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wallet-address-row {
  gap: 12px;
  align-items: flex-start;
}

.wallet-address {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: clamp(0.91rem, 1.7vw, 1.08rem);
  font-weight: 500;
  line-height: 1.53;
  letter-spacing: 0.015em;
}

.copy-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-width: 82px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  cursor: pointer;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.copy-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
}

.copy-button:hover,
.copy-button.is-copied {
  border-color: var(--gold);
  background: var(--gold);
  color: #1e1811;
  transform: translateY(-1px);
}

.wallet-card-footer {
  gap: 10px;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.63rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.active-dot { width: 6px; box-shadow: 0 0 0 4px rgba(208, 163, 90, 0.12); }

.address-notice {
  margin: 19px 3px 31px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.65;
}

.amount-field { display: block; }

.amount-field > span {
  display: block;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fixed-amount {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 0 0 13px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.payment-card .primary-button { margin-top: 32px; }

.success-card { text-align: left; }
.success-card p { font-size: clamp(2.4rem, 4.3vw, 4rem); }

.success-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1.35rem;
  animation: check-in 500ms 150ms cubic-bezier(.2, .82, .26, 1) both;
}

@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.22); opacity: 0.56; } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes logo-in { from { opacity: 0; transform: scale(.93) rotate(-3deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes card-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes check-in { from { opacity: 0; transform: scale(.55) rotate(-18deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

@media (max-width: 760px) {
  .app-shell { padding: 12px; }

  .split-layout {
    grid-template-columns: 1fr;
    min-height: calc(100svh - 24px);
    border-radius: 24px;
  }

  .brand-panel {
    min-height: clamp(258px, 40svh, 350px);
    padding: 29px 32px;
  }

  .brand-panel::before { width: 360px; }
  .brand-panel::after { width: 270px; }
  .brand-halo { width: 160px; }
  .logo-frame { width: min(218px, 61vw); border-radius: 19px; }

  .action-panel {
    align-items: flex-start;
    min-height: auto;
    padding: 37px 24px max(42px, env(safe-area-inset-bottom));
  }

  .flow-card { width: 100%; }
  .eyebrow { margin-bottom: 15px; }
  .home-card h1 { font-size: clamp(3rem, 13vw, 4.3rem); }
  .home-card .primary-button { margin-top: 35px; }

  .wallet-card { padding: 17px; border-radius: 18px; }
  .wallet-label { margin-top: 24px; }
  .wallet-address-row { gap: 10px; }
  .wallet-address { font-size: 0.84rem; line-height: 1.52; }
  .copy-button { min-width: 44px; min-height: 44px; justify-content: center; padding: 10px; }
  .copy-button span { display: none; }
  .copy-button.is-copied { min-width: 80px; }
  .copy-button.is-copied span { display: inline; }
  .wallet-card-footer { margin-top: 20px; }

  .address-notice { margin: 17px 2px 28px; font-size: 0.68rem; }
  .fixed-amount { min-height: 56px; font-size: 16px; }
  .payment-card .primary-button { margin-top: 28px; }
  .success-card p { font-size: clamp(2.7rem, 12.5vw, 4rem); }
}

@media (max-width: 380px) {
  .brand-panel { min-height: 246px; }
  .logo-frame { width: min(200px, 58vw); }
  .action-panel { padding-inline: 20px; }
  .wallet-address { font-size: 0.79rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
