:root {
  color-scheme: dark;
  --void: #070d24;
  --void-lift: #0e1a44;
  --paper: #f4f9fc;
  --haze: #9fb4d6;
  --cobalt: #2349c8;
  --cobalt-bright: #5b86ff;
  --hairline: rgba(159, 180, 214, 0.22);
  --glass: rgba(255, 255, 255, 0.08);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --block: #8ea9e8;
  --lamp: #ffd999;
  --error: #ffb4a8;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --gutter: clamp(16px, 4vw, 48px);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--void);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--paper); text-decoration-color: var(--cobalt-bright); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button { color: inherit; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cobalt-bright); outline-offset: 3px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 20; padding: 8px 12px; border-radius: 8px; background: var(--paper); color: var(--void); }
.skip-link:focus { left: 8px; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; font-family: var(--serif); font-size: 1.2rem; line-height: 1.1; text-decoration: none; }
.brand img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--glass-edge); }
.brand em { color: var(--haze); }
.controls { display: flex; flex: none; align-items: center; gap: 8px; }

.wallet, .quiet {
  padding: 9px 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.8);
  font-size: 0.88rem;
  font-weight: 500;
  transition: transform 0.35s var(--spring), background 0.2s;
}
.quiet { border-color: transparent; background: none; color: var(--haze); backdrop-filter: none; }
.wallet:hover { background: rgba(255, 255, 255, 0.14); }
.wallet:active, .quiet:active { transform: scale(0.95); }
.wallet.is-connected { font-variant-numeric: tabular-nums; }

/* The stage: the relief fills the viewport, the words sit over its right side. */
.stage { position: relative; display: grid; min-height: 100svh; align-items: end; overflow: hidden; background: radial-gradient(120% 80% at 30% 60%, var(--void-lift), var(--void) 70%); }
#relief { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.2s ease; }
.has-stage #relief { opacity: 1; }
.stage::after { position: absolute; inset: auto 0 0 0; z-index: 1; height: 22%; background: linear-gradient(transparent, var(--void)); content: ""; pointer-events: none; }
.still { display: none; }
.no-stage .still { position: absolute; top: 50%; left: 30%; display: block; width: min(44vw, 62vh); border-radius: 6px; box-shadow: 0 30px 90px rgba(35, 73, 200, 0.45); transform: translate(-50%, -50%); }

.panel {
  position: relative;
  z-index: 2;
  width: min(100%, 30rem);
  margin-left: auto;
  padding: 0 var(--gutter) clamp(40px, 9vh, 96px) 0;
  pointer-events: none;
}
.panel > * { pointer-events: auto; }
.panel h1 { margin: 0 0 6px; font-family: var(--serif); font-size: clamp(3rem, 6.4vw, 5.6rem); font-weight: 400; line-height: 0.95; letter-spacing: -0.01em; text-wrap: balance; }
.medium { margin: 0; color: var(--haze); }
.description { max-width: 34ch; margin: 18px 0 0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; }
.price { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 16px; font-family: var(--serif); font-size: 2.4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.price small { color: var(--haze); font-family: var(--sans); font-size: 0.92rem; }

.buy {
  --mx: 0px; --my: 0px; --sheen: 50%;
  position: relative;
  display: block;
  width: 100%;
  padding: 18px 24px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--cobalt);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 14px 40px rgba(35, 73, 200, 0.55);
  color: var(--paper);
  font-size: 1.06rem;
  font-weight: 600;
  transform: translate(var(--mx), var(--my));
  transition: transform 0.45s var(--spring), box-shadow 0.3s, background 0.3s;
}
.buy::before { position: absolute; inset: 0; background: radial-gradient(120px circle at var(--sheen) 0%, rgba(255, 255, 255, 0.4), transparent 70%); content: ""; opacity: 0; transition: opacity 0.25s; }
.buy:hover:not(:disabled)::before { opacity: 1; }
.buy:hover:not(:disabled) { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 20px 56px rgba(91, 134, 255, 0.7); }
.buy:active:not(:disabled) { transform: translate(var(--mx), var(--my)) scale(0.955); transition-duration: 0.08s; }
.buy:disabled { cursor: default; background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 1px var(--glass-edge) inset; color: var(--haze); }
.buy[hidden] { display: none; }
.buy span { position: relative; }
.buy[data-phase="confirm"], .buy[data-phase="mining"] { color: var(--paper); }
.buy[data-phase="confirm"]::after, .buy[data-phase="mining"]::after {
  position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(91, 134, 255, 0.55) 50%, transparent 80%);
  content: ""; transform: translateX(-100%); animation: sweep 1.6s linear infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

.status { min-height: 3.2em; margin: 14px 0 0; color: var(--haze); font-size: 0.95rem; }
.status.is-error { color: var(--error); }
.status.is-mine { color: var(--paper); font-size: 1.05rem; }
.status strong { display: block; font-family: var(--serif); font-size: 2.6rem; font-weight: 400; line-height: 1.05; }
.celebrate .status strong { animation: arrive 0.9s var(--spring) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(18px) scale(0.9); } }

.flash { position: absolute; inset: 0; z-index: 1; background: radial-gradient(60% 60% at 32% 50%, rgba(140, 175, 255, 0.55), transparent 70%); opacity: 0; pointer-events: none; }
.celebrate .flash { animation: flash 1.4s ease-out; }
@keyframes flash { 12% { opacity: 0.4; } 100% { opacity: 0; } }

/* Below the stage: the steps climb like the stair in the model, one more block each, the last one lit. */
.how { display: grid; gap: 32px clamp(40px, 8vw, 128px); grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); max-width: 1180px; margin: 0 auto; padding: clamp(64px, 10vw, 136px) var(--gutter) 0; }
.how h2 { margin: 0; font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 4rem); font-weight: 400; line-height: 1; letter-spacing: -0.01em; text-wrap: balance; }
.how ol { display: grid; gap: 44px; margin: 0; padding: 0; list-style: none; }
.how li { max-width: 46ch; color: var(--haze); font-size: 1.06rem; }
.how li::before {
  display: block; width: 10px; height: 10px; margin-bottom: 16px; content: "";
  background: linear-gradient(var(--lamp), var(--lamp)) right / 10px 10px no-repeat, repeating-linear-gradient(90deg, var(--block) 0 10px, transparent 10px 14px);
}
.how li:nth-child(2)::before { width: 24px; }
.how li:nth-child(3)::before { width: 38px; }
.how strong { display: block; margin-bottom: 6px; color: var(--paper); font-family: var(--serif); font-size: 1.7rem; font-weight: 400; line-height: 1.15; }

.colophon { display: flex; flex-wrap: wrap; gap: 8px 40px; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: clamp(72px, 10vw, 136px) var(--gutter) 40px; color: var(--haze); font-size: 0.9rem; }
.colophon p { margin: 0; }
.colophon a { color: var(--haze); font-variant-numeric: tabular-nums; }
.colophon a:hover { color: var(--paper); }

@media (max-aspect-ratio: 115/100), (max-width: 760px) {
  .stage { align-items: end; }
  .panel { width: 100%; margin: 0; padding: 60svh var(--gutter) 40px; background: linear-gradient(180deg, transparent 52svh, rgba(7, 13, 36, 0.9) 66svh, var(--void) 80svh); }
  .panel h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
  .no-stage .still { top: 30svh; left: 50%; width: min(78vw, 46svh); }
  .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .how { grid-template-columns: minmax(0, 1fr); }
  .flash { background: radial-gradient(70% 45% at 50% 30%, rgba(140, 175, 255, 0.55), transparent 70%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
