/* ============================================================
   UnBanMe — full site
   Palette preserved from the original brand gamma.
   ============================================================ */

:root {
  color-scheme: light;

  /* brand gamma (unchanged) */
  --navy: #06214a;
  --blue-800: #0647a8;
  --blue-600: #0a6fe8;
  --blue-500: #0a84ff;
  --cyan-400: #1cc8ff;
  --green-500: #1fbf75;

  --ink: #102033;
  --muted: #5f6f84;
  --faint: #8598ad;
  --line: #d8e6f7;
  --line-soft: #e9f2fc;
  --surface: #ffffff;
  --surface-soft: #f3f8ff;
  --tint: #eef6ff;

  --grad-brand: linear-gradient(135deg, var(--blue-600) 0%, var(--cyan-400) 100%);

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft: cubic-bezier(0.34, 1.2, 0.4, 1);

  --shadow-sm: 0 2px 8px rgba(6, 33, 74, 0.05);
  --shadow-md: 0 16px 40px -18px rgba(6, 33, 74, 0.28);
  --shadow-lg: 0 40px 80px -32px rgba(6, 33, 74, 0.35);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-pill: 999px;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --shell: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss01";
}

.dim {
  color: var(--faint);
}

.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

/* shared eyebrow — restrained, mono, meaningful */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-600);
}
.kicker::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease;
}
.btn--sm {
  height: 42px;
  padding: 0 18px;
  font-size: 0.9rem;
}
.btn--lg {
  height: 56px;
  padding: 0 30px;
  font-size: 1.05rem;
}
.btn--primary {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 14px 26px -12px rgba(10, 132, 255, 0.7);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -14px rgba(10, 132, 255, 0.75);
}
.btn--ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--blue-800);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--blue-500);
  box-shadow: var(--shadow-sm);
}
.btn__arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}
.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 248, 255, 0.82);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand__mark {
  display: inline-flex;
}
.brand__mark svg {
  width: 30px;
  height: 32px;
  filter: drop-shadow(0 4px 10px rgba(10, 111, 232, 0.28));
}
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}
.nav a:hover {
  color: var(--navy);
  background: var(--tint);
}
.site-header .btn--primary {
  flex: none;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0 clamp(48px, 6vw, 88px);
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(28, 200, 255, 0.16), transparent 60%),
    radial-gradient(760px 460px at 6% 4%, rgba(10, 111, 232, 0.1), transparent 55%),
    var(--surface-soft);
}
/* faint ledger grid, true to on-chain data, kept very quiet */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 71, 168, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 71, 168, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(80% 80% at 50% 20%, #000 30%, transparent 100%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero__title {
  font-size: clamp(2.5rem, 4.6vw, 3.9rem);
  font-weight: 600;
}
.hero__title-accent {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.hero__lead {
  max-width: 30rem;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.08rem;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}
.hero__trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}
.hero__trust span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue-800);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
}

/* ── Case record (signature) ── */
.case-stage {
  position: relative;
}
/* ambient glow drifting behind the card for depth */
.case-stage::before {
  content: "";
  position: absolute;
  inset: 8% 4%;
  z-index: -1;
  background: radial-gradient(60% 55% at 62% 32%, rgba(28, 200, 255, 0.4), transparent 70%);
  filter: blur(44px);
  opacity: 0.85;
  animation: glowDrift 9s ease-in-out 1.2s infinite;
}
.case {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: floatCard 8s ease-in-out 1.2s infinite;
  transition: box-shadow 0.4s ease;
  will-change: transform;
}
.case:hover {
  animation-play-state: paused;
  box-shadow: 0 48px 90px -30px rgba(6, 33, 74, 0.42);
}
@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-13px);
  }
}
@keyframes glowDrift {
  0%,
  100% {
    transform: translateY(6px) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-8px) scale(1.05);
    opacity: 0.95;
  }
}
.case__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.case__id {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
}
.badge--usdt {
  background: #2aa17d;
}
.badge--usdc {
  background: #2775ca;
}

.case__facts {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}
.case__facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.case__facts dt {
  font-size: 0.86rem;
  color: var(--muted);
}
.case__facts dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}
.case__addr {
  color: var(--blue-800);
}

.case__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}
.case__status-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.case__lock svg {
  width: 40px;
  height: 44px;
}
.case__body {
  fill: var(--faint);
  transition: fill 0.5s ease;
}
.case__keyhole {
  fill: #fff;
}
.case__shackle {
  color: var(--faint);
  transform-box: fill-box;
  transform-origin: 88% 100%;
  transition: transform 0.7s var(--ease-soft), color 0.5s ease;
}
.case.play .case__body {
  fill: var(--green-500);
  transition-delay: 0.85s;
}
.case.play .case__shackle {
  color: var(--green-500);
  transform: translateY(-3px) rotate(-26deg);
  transition-delay: 0.85s;
}

/* stepper timeline */
.stepper {
  position: relative;
  list-style: none;
  margin: 22px 0 0;
  padding: 4px 0 0;
}
.stepper::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 22px;
  width: 2px;
  background: var(--line);
}
.stepper::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  width: 2px;
  height: 0;
  background: linear-gradient(var(--blue-500), var(--green-500));
  border-radius: 2px;
  transition: height 1s var(--ease-out) 0.1s;
}
.case.play .stepper::after {
  height: calc(100% - 36px);
}
.step {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 8px 0;
}
.step__dot {
  position: relative;
  z-index: 1;
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  transition: border-color 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
}
.step__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.step__text b {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--faint);
  transition: color 0.4s ease;
}
.step__text em {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--faint);
}
/* resolved (restored) resting state, revealed on .play */
.case.play .step__dot {
  border-color: var(--green-500);
  background: var(--green-500);
}
.case.play .step[data-state="restored"] .step__dot {
  box-shadow: 0 0 0 4px rgba(31, 191, 117, 0.18);
}
.case.play .step b {
  color: var(--navy);
}
.case.play .step[data-state="restored"] b {
  color: var(--green-500);
}
/* dots light up top-to-bottom as the line fills */
.case.play .step:nth-child(1) .step__dot,
.case.play .step:nth-child(1) b {
  transition-delay: 0.2s;
}
.case.play .step:nth-child(2) .step__dot,
.case.play .step:nth-child(2) b {
  transition-delay: 0.5s;
}
.case.play .step:nth-child(3) .step__dot,
.case.play .step:nth-child(3) b {
  transition-delay: 0.8s;
}

.case__foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.72rem;
  color: var(--faint);
}

/* ============================================================
   Generic section
   ============================================================ */
.section {
  padding: clamp(64px, 8vw, 110px) 0;
}
.section--tint {
  background: var(--tint);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.section__head {
  max-width: 620px;
  margin: 0 auto clamp(40px, 5vw, 64px);
  text-align: center;
}
.section__head--left {
  margin-inline: 0;
  text-align: left;
}
.section__title {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 600;
}
.section__intro {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ── Process steps ── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.stepcard {
  position: relative;
  padding: 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
/* connector arrow between steps */
.stepcard:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 44px;
  right: -14px;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--line);
  border-right: 2px solid var(--line);
  transform: rotate(45deg);
  z-index: 1;
}
.stepcard__no {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-500);
  background: var(--tint);
  border-radius: 8px;
  padding: 4px 10px;
}
.stepcard h3 {
  margin: 18px 0 8px;
  font-size: 1.12rem;
}
.stepcard p {
  color: var(--muted);
  font-size: 0.94rem;
}

/* ── Assets ── */
.assets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.asset {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.asset__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.asset__head h3 {
  font-size: 1.4rem;
}
.asset p {
  color: var(--muted);
  font-size: 1rem;
}
.asset__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.asset__list li {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--blue-800);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 6px 12px;
}

/* ── FAQ ── */
.faq {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.faq .section__head {
  margin: 0;
}
.faq__list {
  display: grid;
  gap: 12px;
}
.qa {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 4px 22px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qa[open] {
  border-color: var(--blue-500);
  box-shadow: var(--shadow-sm);
}
.qa summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker {
  display: none;
}
.qa summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-right: 2px solid var(--blue-500);
  border-bottom: 2px solid var(--blue-500);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.qa[open] summary::after {
  transform: rotate(-135deg);
}
.qa p {
  padding: 0 0 20px;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ============================================================
   CTA + footer
   ============================================================ */
.cta {
  padding: clamp(56px, 7vw, 96px) 0;
}
.cta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(36px, 5vw, 56px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(600px 300px at 90% 0%, rgba(28, 200, 255, 0.35), transparent 60%),
    linear-gradient(135deg, var(--navy), var(--blue-800));
  box-shadow: var(--shadow-lg);
}
.cta__title {
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 600;
}
.cta__text {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
}
.cta .btn--primary {
  background: #fff;
  color: var(--blue-800);
  box-shadow: 0 16px 30px -14px rgba(0, 0, 0, 0.5);
}
.cta .btn--primary:hover {
  box-shadow: 0 22px 40px -16px rgba(0, 0, 0, 0.55);
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-soft);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 40px;
}
.site-footer__note {
  flex: 1;
  min-width: 260px;
  color: var(--faint);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 940px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .case {
    max-width: 460px;
  }
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .stepcard:not(:last-child)::after {
    display: none;
  }
  .faq {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .nav {
    display: none;
  }
  .assets {
    grid-template-columns: 1fr;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .hero__title-accent {
    white-space: normal;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .btn {
    width: 100%;
  }
  .cta__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .cta .btn {
    width: 100%;
  }
}

/* ============================================================
   Start-a-case modal
   ============================================================ */
.modal {
  width: min(100% - 32px, 440px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  /* The card must be able to scroll — on short screens (and inside the
     Telegram webview) the form is taller than the viewport. */
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal::backdrop {
  background: rgba(6, 33, 74, 0.5);
  backdrop-filter: blur(5px);
}
.modal[open] {
  animation: modalIn 0.32s var(--ease-out);
}
.modal[open]::backdrop {
  animation: backdropIn 0.32s ease;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
@keyframes backdropIn {
  from {
    opacity: 0;
  }
}
.modal__card {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 30px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal__close:hover {
  background: var(--tint);
  color: var(--navy);
}
.modal__form,
.modal__done {
  display: grid;
  gap: 15px;
}
.modal__form[hidden],
.modal__done[hidden] {
  display: none;
}
.modal__title {
  font-size: 1.5rem;
}
.modal__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

.field {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: none;
}
.field legend,
.field__label {
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.seg__opt {
  position: relative;
  display: block;
}
.seg__opt input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seg__opt span {
  display: block;
  padding: 11px 8px;
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.seg__opt input:checked + span {
  background: var(--surface);
  color: var(--blue-800);
  box-shadow: var(--shadow-sm);
}
.seg__opt input:focus-visible + span {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}
.seg__opt.is-disabled {
  opacity: 0.4;
}
.seg__opt.is-disabled input {
  cursor: not-allowed;
}

.input {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.input:focus-within {
  background: var(--surface);
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.14);
}
.input.is-locked {
  opacity: 0.75;
}
.input__at {
  color: var(--faint);
  font-weight: 600;
}
.input input {
  flex: 1;
  min-width: 0;
  padding: 13px 4px;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  color: var(--ink);
}
.field__hint {
  font-size: 0.8rem;
  color: var(--faint);
}

/* ── Wallet ownership proof ── */
.wallet__row {
  display: grid;
  gap: 9px;
}
/* Same size and colour as the submit button — .btn .btn--primary .btn--lg
   carry the look; only the full width and the busy state are added here. */
.wallet__btn {
  width: 100%;
}
.wallet__btn:disabled {
  cursor: progress;
  opacity: 0.8;
  transform: none;
}
.wallet__note {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--faint);
  text-align: center;
}
.wallet__spin {
  display: none;
  flex: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
}
.wallet[data-state="busy"] .wallet__spin {
  display: block;
  animation: wallet-spin 0.7s linear infinite;
}
@keyframes wallet-spin {
  to {
    transform: rotate(1turn);
  }
}

/* verified — a single chip that replaces the button row */
.wallet[data-state="verified"] .wallet__row {
  display: none;
}
.wallet__proof {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  background: rgba(31, 191, 117, 0.1);
  border: 1px solid rgba(31, 191, 117, 0.38);
  border-radius: var(--r-pill);
}
.wallet__proof[hidden] {
  display: none;
}
.wallet__stamp {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #128a53;
  white-space: nowrap;
}
.wallet__stamp-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgba(31, 191, 117, 0.2);
}
.wallet__addr {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallet__reset {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--faint);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.wallet__reset:hover {
  background: rgba(6, 33, 74, 0.08);
  color: var(--navy);
}

/* Shrink-wrapped so the dot stays next to the words when the line wraps —
   .modal__done is a centering grid, so inline-flex is enough to place it. */
.wallet__stamp--done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 30ch;
  text-align: center;
  white-space: normal;
}
.wallet__stamp--done[hidden],
.modal__done .wallet__addr[hidden] {
  display: none;
}
.modal__done .wallet__addr {
  flex: none;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ── Toasts — status lives here, not in body text ── */
/* A [popover] gets its own top-layer entry, which outranks the modal's backdrop
   no matter what z-index anything else uses. The UA popover defaults (inset,
   border, padding, background, overflow) all have to be unset by hand. */
.toasts {
  position: fixed;
  inset: auto;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(92vw, 400px);
  max-width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  overflow: visible;
  /* Fallback for browsers without the Popover API. */
  z-index: 2147483647;
  pointer-events: none;
}
.toasts::backdrop {
  background: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--navy);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.26s var(--ease-soft);
}
.toast::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.toast--ok {
  background: #0f7f4d;
}
.toast--err {
  background: #b83a30;
}
.toast.is-out {
  animation: toastOut 0.22s var(--ease-out) forwards;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-out {
    animation: none;
  }
}

.modal__submit {
  width: 100%;
  margin-top: 2px;
}
.modal__note {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--faint);
  text-align: center;
}

.modal__done {
  justify-items: center;
  padding: 14px 6px 6px;
  text-align: center;
}
.modal__check {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(31, 191, 117, 0.14);
  color: var(--green-500);
  font-size: 30px;
  font-weight: 700;
}
.modal__done-msg {
  max-width: 30ch;
  color: var(--muted);
}
.modal__done .btn {
  width: 100%;
}

/* ============================================================
   Entrance reveals (only active when JS is present)
   ============================================================ */
.js .rv > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.js .rv.in > * {
  opacity: 1;
  transform: none;
}
.js .rv.in > *:nth-child(2) {
  transition-delay: 0.07s;
}
.js .rv.in > *:nth-child(3) {
  transition-delay: 0.14s;
}
.js .rv.in > *:nth-child(4) {
  transition-delay: 0.21s;
}
.js .rv.in > *:nth-child(5) {
  transition-delay: 0.28s;
}

.js .case-stage {
  opacity: 0;
  transform: translateY(28px) scale(0.965);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: 0.12s;
}
.js .case-stage.in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   A11y
   ============================================================ */
:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .case,
  .case-stage::before {
    animation: none !important;
    transform: none !important;
  }
}
