@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/inter-latin-var.woff2") format("woff2");
}

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url("assets/inter-tight-latin-var.woff2") format("woff2");
}

:root {
  --navy-900:#06132B;
  --navy-800:#0A1E3F;
  --navy-700:#0E2A55;
  --navy-600:#163A6E;
  --teal-700:#0E7C8B;
  --teal-500:#1FA3B8;
  --teal-300:#5BD0DE;
  --ivory:#F6F2EA;
  --paper:#FCFAF5;
  --ink:#0A1322;
  --ink-mute:#7A8294;
  --amber:#FFB454;
  --ruby:#E25A4F;
  --jade:#27B27A;
  color-scheme: dark;
}

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

html {
  min-height: 100%;
  background: var(--navy-900);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 50% -8%, rgba(31,163,184,.23), transparent 35rem),
    linear-gradient(180deg, var(--navy-800) 0, var(--navy-900) 33rem);
  color: var(--paper);
  font-family: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.pay-page {
  width: min(100%, 31rem);
  min-height: 100svh;
  margin: 0 auto;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.brand {
  display: flex;
  justify-content: center;
  min-height: 3rem;
}


/* Living-logo container: the animated mark is an inline SVG wider than the
   PNG it replaces, and it renders with overflow:visible (tokens stream in
   from beyond the viewBox). Centre the MARK, not the box — a fixed-width
   container made the SVG overflow to one side and sit off-centre against
   the amount below it. */
#brand-mark {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
}
#brand-mark svg {
  display: block;
  width: min(17rem, 72vw);
  height: auto;
  overflow: visible;
}
#brand-mark img { width: 9.25rem; height: auto; }

.brand__logo {
  display: block;
  width: 9.25rem;
  height: auto;
  object-fit: contain;
  animation: ks-breathe 4.4s ease-in-out infinite;
}

@keyframes ks-breathe {
  0%,100% { filter: drop-shadow(0 0 16px rgba(91,208,222,.40)); }
  50%     { filter: drop-shadow(0 0 42px rgba(91,208,222,.85)); }
}

.amount-hero {
  padding: 1.1rem 0 1.25rem;
  text-align: center;
}

.amount-hero__eyebrow,
.result__eyebrow {
  margin: 0;
  color: var(--teal-300);
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.amount-hero__amount {
  margin: .25rem 0 .15rem;
  color: var(--paper);
  font-size: clamp(3.6rem, 18vw, 5.25rem);
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: .98;
}

.amount-hero__note {
  margin: .65rem 0 0;
  color: var(--ivory);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.checkout {
  overflow: hidden;
  border: 1px solid rgba(91,208,222,.28);
  border-radius: 1.5rem;
  background: var(--paper);
  box-shadow: 0 1.5rem 4rem rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.04);
}

.checkout__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.9rem;
  padding: .7rem 1rem;
  background: var(--navy-700);
  color: var(--paper);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .04em;
}

.checkout__status {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  color: var(--teal-300);
}

.checkout__status::before {
  width: .46rem;
  height: .46rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 .22rem rgba(91,208,222,.13);
  content: "";
}

body[data-state="approved"] .checkout__status { color: var(--jade); }
body[data-state="declined"] .checkout__status,
body[data-state="error"] .checkout__status { color: var(--ruby); }
body[data-state="processing"] .checkout__status { color: var(--amber); }

.checkout__stage {
  position: relative;
  /* No floor in the ready state: the stage hugs the (collapsed) checkout frame
     so a wallets-only view has no dead space beneath it. The result/loading
     panels are absolutely positioned, so they need the floor restored — scoped
     per state below rather than applied globally. */
  min-height: 0;
  background: var(--paper);
}

body[data-state="loading"] .checkout__stage,
body[data-state="processing"] .checkout__stage,
body[data-state="approved"] .checkout__stage,
body[data-state="declined"] .checkout__stage,
body[data-state="error"] .checkout__stage { min-height: 27.5rem; }

.checkout__frame {
  display: block;
  width: 100%;
  height: 31rem;
  border: 0;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: height .34s cubic-bezier(.2,.8,.2,1), opacity .28s ease;
}

body[data-state="ready"] .checkout__frame {
  opacity: 1;
  pointer-events: auto;
}

body:not([data-state="loading"]):not([data-state="ready"]) .checkout__frame {
  display: none;
}

.checkout__alternative {
  display: flex;
  min-height: 4rem;
  align-items: center;
  gap: .8rem;
  padding: .55rem 1rem .8rem;
  background: var(--paper);
}

.checkout__alternative[hidden] { display: none; }

.checkout__alternative-rule {
  height: 1px;
  flex: 1;
  background: rgba(10,19,34,.14);
}

.checkout__alternative-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  padding: .65rem .15rem;
  border: 0;
  background: transparent;
  color: var(--teal-700);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 780;
}

.checkout__alternative-chevron {
  width: .55rem;
  height: .55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-.1rem, .1rem);
  transition: transform .24s ease;
}

.checkout__alternative.is-expanded .checkout__alternative-chevron {
  transform: rotate(225deg) translate(-.05rem, -.05rem);
}

.loading-panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.35rem 1.15rem;
  background: var(--paper);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

body[data-state="loading"] .loading-panel {
  opacity: 1;
  pointer-events: auto;
}

.loading-panel__wallet {
  width: 100%;
  height: 3.35rem;
  border-radius: .9rem;
}

.loading-panel__wallet + .loading-panel__wallet { margin-top: .7rem; }

.loading-panel__divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 1.3rem 0;
  gap: .7rem;
}

.loading-panel__divider span {
  height: 1px;
  flex: 1;
  background: rgba(10,19,34,.12);
}

.loading-panel__divider i {
  width: 1.3rem;
  height: .55rem;
  border-radius: 999px;
  background: rgba(10,19,34,.1);
}

.loading-panel__line {
  width: 72%;
  height: 3.5rem;
  border-radius: .9rem;
}

.loading-panel p {
  margin: 2.1rem 0 0;
  color: #535d70;
  font-size: .95rem;
  font-weight: 650;
}

.skeleton {
  background: linear-gradient(100deg, #e2dfd8 25%, #f6f2ea 45%, #e2dfd8 65%);
  background-size: 220% 100%;
  animation: skeleton-sweep 1.45s ease-in-out infinite;
}

.skeleton--offset { animation-delay: .15s; }

@keyframes skeleton-sweep {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

.result {
  position: absolute;
  inset: 0;
  z-index: 3;
  min-height: 27.5rem;
  padding: 3.35rem 1.6rem 2.1rem;
  background:
    radial-gradient(circle at 50% 22%, rgba(39,178,122,.12), transparent 11rem),
    var(--paper);
  color: var(--ink);
  text-align: center;
  animation: result-settle .42s cubic-bezier(.2,.8,.2,1) both;
}

.result__icon {
  display: grid;
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.6rem;
  place-items: center;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 .55rem rgba(39,178,122,.12);
  color: var(--paper);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
}

.result__title {
  margin: .55rem 0 .7rem;
  font-size: 2.25rem;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.result__message {
  max-width: 20rem;
  margin: 0 auto;
  color: #3b4659;
  font-size: 1.05rem;
  font-weight: 540;
  line-height: 1.5;
}

.result__action {
  width: 100%;
  min-height: 3.4rem;
  margin-top: 1.8rem;
  border: 0;
  border-radius: 1rem;
  background: var(--teal-700);
  color: var(--paper);
  cursor: pointer;
  font-weight: 750;
}

body[data-state="processing"] .result {
  background: radial-gradient(circle at 50% 22%, rgba(255,180,84,.14), transparent 11rem), var(--paper);
}

body[data-state="processing"] .result__icon {
  border: .28rem solid rgba(10,19,34,.12);
  border-top-color: var(--amber);
  background: transparent;
  box-shadow: none;
  color: transparent;
  animation: processing-turn .8s linear infinite;
}

body[data-state="declined"] .result,
body[data-state="error"] .result {
  background: radial-gradient(circle at 50% 22%, rgba(226,90,79,.12), transparent 11rem), var(--paper);
}

body[data-state="declined"] .result__icon,
body[data-state="error"] .result__icon {
  background: var(--ruby);
  box-shadow: 0 0 0 .55rem rgba(226,90,79,.11);
}

@keyframes processing-turn { to { transform: rotate(360deg); } }

@keyframes result-settle {
  from { opacity: 0; transform: translateY(.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: .55rem;
  max-width: 27rem;
  margin: 1rem auto 0;
  color: var(--ivory);
  font-size: .79rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.privacy-note__lock {
  position: relative;
  width: .72rem;
  height: .6rem;
  flex: 0 0 auto;
  margin-top: .23rem;
  border-radius: .12rem;
  background: var(--teal-300);
}

.privacy-note__lock::before {
  position: absolute;
  left: .16rem;
  bottom: .42rem;
  width: .4rem;
  height: .42rem;
  border: .11rem solid var(--teal-300);
  border-bottom: 0;
  border-radius: .4rem .4rem 0 0;
  content: "";
}

.demo-controls {
  margin: 1rem auto 0;
  color: var(--ivory);
  font-size: .78rem;
}

.demo-controls summary {
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  color: var(--teal-300);
}

.demo-controls__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  margin-top: .7rem;
}

.demo-controls button {
  min-height: 2rem;
  padding: .35rem .65rem;
  border: 1px solid rgba(91,208,222,.34);
  border-radius: 999px;
  background: var(--navy-700);
  color: var(--paper);
  cursor: pointer;
  font-size: .73rem;
}

:focus-visible {
  outline: 3px solid var(--teal-300);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(6,19,43,.5);
}

@media (max-height: 46rem) {
  .pay-page { padding-top: max(.75rem, env(safe-area-inset-top)); }
  .brand__logo { width: 7.5rem; }
  .amount-hero { padding: .7rem 0 .9rem; }
  .amount-hero__amount { font-size: 3.55rem; }
  .amount-hero__note { margin-top: .35rem; font-size: .9rem; }
  .checkout__stage, .result { min-height: 24rem; }
}

@media (min-width: 48rem) {
  body { padding: 2.5rem 0; }
  .pay-page {
    min-height: auto;
    padding: 2rem;
    border: 1px solid rgba(91,208,222,.15);
    border-radius: 2.25rem;
    background: rgba(6,19,43,.72);
    box-shadow: 0 2rem 8rem rgba(0,0,0,.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  /* Match Tide: kill perpetual decorative loops. */
  .brand__logo,
  .skeleton,
  body[data-state="processing"] .result__icon {
    animation: none !important;
  }

  .brand__logo {
    filter: drop-shadow(0 0 16px rgba(91,208,222,.40)) !important;
  }

  .skeleton { background: #e2dfd8 !important; }

  body[data-state="processing"] .result__icon {
    border-color: rgba(10,19,34,.12);
    border-top-color: var(--amber);
  }

  /* Keep one-shot transaction feedback, but make it near-instant. */
  .result {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  .checkout__frame,
  .checkout__alternative-chevron,
  .loading-panel {
    transition: none !important;
  }

  *, *::before, *::after {
    scroll-behavior: auto !important;
  }
}
