:root {
  --bg: #050505;
  --panel: #0F0F10;
  --line: #222224;
  --line-2: #2A2A2E;
  --text: #FFFFFF;
  --soft: #BDBDBD;
  --muted: #8C8C8C;
  --blue: #2F5BFF;
  --sky: #7EA0FF;
  --chip: #111A33;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Sora', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sky { color: var(--sky); }

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------------------------------------------------------------- nav */

.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 26px; }

.brand { display: flex; align-items: center; gap: 14px; }
.brand svg { width: 46px; height: 46px; }
.brand span { font-weight: 800; font-size: 38px; letter-spacing: -0.055em; line-height: 1; }

/* ---------------------------------------------------------------- hero */

.hero { flex: 1; display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 64px; padding-top: 32px; padding-bottom: 64px; }

.copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }

h1 { margin: 0; font-weight: 800; font-size: clamp(44px, 6vw, 86px); line-height: .98; letter-spacing: -0.055em; }
h1 .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
h1 .line > span { display: inline-block; }
h1 em { font-style: normal; color: var(--sky); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; }
.num { font-family: var(--mono); color: var(--sky); }

.actions { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }

.join { display: flex; flex-wrap: wrap; gap: 8px; }
.join input {
  flex: 1 1 220px; min-height: 54px; padding: 0 18px;
  border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text);
  font-family: var(--mono); font-size: 15px;
}
.join input::placeholder { color: var(--muted); }
.join input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.join button {
  min-height: 54px; padding: 0 26px;
  border-radius: 6px; border: 0;
  background: var(--blue); color: #fff;
  font-family: var(--sans); font-weight: 700; font-size: 15px;
  cursor: pointer; transition: filter .15s;
}
.join button:hover:not(:disabled) { filter: brightness(1.12); }
.join button:disabled { cursor: default; opacity: .8; }

.status { margin: -6px 0 0; min-height: 1.2em; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.status:empty { display: none; }
.status.ok { color: var(--sky); }
.status.err { color: #FF8A8A; }

.x-cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 6px;
  font-weight: 600; font-size: 13px; color: var(--soft);
  transition: background .15s, color .15s, border-color .15s;
}
.x-cta svg { width: 13px; height: 13px; fill: currentColor; flex: 0 0 auto; }
.x-cta:hover { background: #FFFFFF; border-color: #FFFFFF; color: var(--bg); }

/* ---------------------------------------------------------------- wallet card */

.wallet {
  flex: 1 1 440px; min-width: 0; max-width: 500px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 26px; display: flex; flex-direction: column; gap: 20px;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
}
.wallet:hover { transform: translateY(-4px); border-color: #2F5BFF66; box-shadow: 0 18px 40px -24px #2F5BFF; }

.wallet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wallet-head > div { display: flex; flex-direction: column; gap: 4px; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.addr { font-family: var(--mono); font-size: 24px; }
.age { padding: 6px 10px; border-radius: 4px; background: var(--chip); color: var(--sky); font-family: var(--mono); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.activity { position: relative; display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.grid i, .scale i { display: block; border-radius: 2px; }
.grid i { position: relative; cursor: default; }
.grid i::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: #FFFFFF; opacity: 0; pointer-events: none; }
.grid i:hover { outline: 2px solid #FFFFFF; outline-offset: 1px; z-index: 1; }

/* Hovering the card replays the wallet's history: a light sweep runs across the weeks, oldest to today. */
@keyframes sweep { 0% { opacity: 0; } 35% { opacity: .55; } 100% { opacity: 0; } }
.wallet:hover .grid i::after { animation: sweep .7s ease-out both; animation-delay: calc(var(--col) * 28ms); }

.tip {
  position: absolute; z-index: 2; pointer-events: none;
  padding: 6px 9px; border-radius: 4px;
  background: #FFFFFF; color: var(--bg);
  font-family: var(--mono); font-size: 12px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
  opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.l0 { background: #18181B; }
.l1 { background: #182452; }
.l2 { background: #2341B0; }
.l3 { background: #2F5BFF; }
.l4 { background: #7EA0FF; }

.legend { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.scale { display: flex; align-items: center; gap: 4px; }
.scale i { width: 10px; height: 10px; }

.stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column; gap: 4px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.wallet-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.wallet-foot span { font-size: 14px; color: var(--soft); }
.sell-btn {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 18px;
  border-radius: 6px; background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 700;
  transition: opacity .15s;
}
.sell-btn:hover { opacity: .88; }

/* ---------------------------------------------------------------- motion */

@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cell-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(126, 160, 255, .7); } 60% { box-shadow: 0 0 0 5px rgba(126, 160, 255, 0); } }

.motion h1 .line > span { animation: rise .9s var(--ease) both; }
.motion h1 .line:nth-child(2) > span { animation-delay: .08s; }
.motion h1 .line:nth-child(3) > span { animation-delay: .16s; }

.motion .steps li { animation: fade-up .6s var(--ease) both; }
.motion .steps li:nth-child(1) { animation-delay: .35s; }
.motion .steps li:nth-child(2) { animation-delay: .45s; }
.motion .steps li:nth-child(3) { animation-delay: .55s; }

.motion .actions { animation: fade-up .7s var(--ease) .6s both; }
.motion .wallet { animation: fade-up .8s var(--ease) .25s backwards; } /* backwards, not both: a held transform would block the hover lift */
.motion .grid i { animation: cell-in .35s var(--ease) both; animation-delay: calc(.7s + var(--col) * 55ms); }
.grid i.today { animation: cell-in .35s var(--ease) both, pulse 2.2s ease-out 2.4s infinite; animation-delay: calc(.7s + var(--col) * 55ms), 2.4s; }

@media (max-width: 560px) {
  .nav { padding-top: 18px; padding-bottom: 18px; }
  .brand svg { width: 36px; height: 36px; }
  .brand span { font-size: 30px; }
  .hero { padding-top: 12px; gap: 44px; }
  .scale { display: none; }
  .addr { font-size: 20px; }
  .join button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
