/* ============================================================
   Click the Button — warm minimal design system
   paper #FAF6F0 · ink #35281E · accent #E0731D · deep #C25A0E
   display: Baloo 2 · body: Nunito Sans · mono: IBM Plex Mono
   ============================================================ */

:root {
  --paper: #faf6f0;
  --paper-deep: #f3ece1;
  --ink: #35281e;
  --ink-soft: #7a6a58;
  --ink-faint: #a4937e;
  --accent: #ffffff;        /* logo hand fill */
  --accent-deep: #35281e;
  --accent-shadow: #d5ccbd;
  --accent-soft: #f5f5f5;   /* logo background gray */
  --outline: #000000;       /* logo outline */
  --card: #fffdf9;
  --line: #e7dccb;
  --green: #4c9a62;
  --radius: 18px;
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

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

button { font: inherit; color: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================ INTRO ============================ */

.intro {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--accent-soft) 0%, transparent 60%),
    var(--paper);
}

.intro-inner { width: min(640px, 100%); }

.typewriter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  line-height: 1.5;
  min-height: 9em;
  color: var(--ink);
}

.typewriter .tw-line { display: block; min-height: 1.5em; }
.typewriter .tw-line.dim { color: var(--ink-faint); }

.tw-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--ink);
  border-radius: 3px;
  vertical-align: -0.15em;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* wallet card */

.wallet-card {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  box-shadow: 0 18px 44px -22px rgba(53, 40, 30, 0.28);
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wallet-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.wallet-card-head h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }

.wallet-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(76, 154, 98, 0.18);
}

.wallet-sub { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 18px; }

.wallet-field { margin-bottom: 14px; }
.wallet-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
}

.wallet-value {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.wallet-value code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-all;
  flex: 1;
  color: var(--ink);
}

.copy-btn {
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.15s, transform 0.1s;
}
.copy-btn:hover { background: var(--accent-soft); }
.copy-btn:active { transform: scale(0.95); }

.wallet-warning {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin: 18px 0;
}

.save-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  user-select: none;
}
.save-check input { width: 18px; height: 18px; accent-color: var(--ink); cursor: pointer; }

.continue-btn {
  width: 100%;
  border: 2px solid var(--outline);
  border-radius: 14px;
  padding: 14px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--outline);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.2s, filter 0.2s;
}
.continue-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.continue-btn:not(:disabled):hover { background: var(--accent-soft); }
.continue-btn:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 var(--outline); }

/* ============================ APP SHELL ============================ */

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: 64px 1fr;
  grid-template-areas:
    "top top"
    "side main";
}

.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 246, 240, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-logo {
  width: 20px;
  height: auto;
  image-rendering: pixelated;
}

.login-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, transform 0.1s;
}
.login-pill:hover { background: var(--accent-soft); }
.login-pill:active { transform: scale(0.96); }

.pill-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(76, 154, 98, 0.2);
  animation: pill-breathe 2.6s ease-in-out infinite;
}
@keyframes pill-breathe { 50% { box-shadow: 0 0 0 5px rgba(76, 154, 98, 0.1); } }

/* sidebar */

.sidebar {
  grid-area: side;
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
a.nav-btn { text-decoration: none; }
.nav-btn:hover { background: var(--paper-deep); color: var(--ink); }
.nav-btn.is-active { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

.nav-ico { font-size: 0.85rem; width: 1.1em; text-align: center; }

.main { grid-area: main; min-width: 0; }

.view { animation: view-in 0.35s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================ HOME ============================ */

.stage {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 40px 20px 60px;
}

.button-wrap { position: relative; }

.button-halo {
  position: absolute;
  inset: -34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(53, 40, 30, 0.1) 0%, transparent 70%);
  animation: halo 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes halo {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1; }
}

/* the signature: a big physical 3D press-able button */
.the-button {
  position: relative;
  width: min(290px, 64vw);
  height: min(290px, 64vw);
  border: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  border-radius: 50%;
}

.the-button-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--outline);
  background:
    radial-gradient(circle at 32% 26%, #ffffff 0%, #ffffff 46%, var(--accent-soft) 100%);
  box-shadow:
    0 14px 0 var(--outline),
    0 30px 46px -14px rgba(53, 40, 30, 0.35),
    inset 0 4px 10px rgba(255, 255, 255, 0.9);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  animation: idle-pulse 3.2s ease-in-out infinite;
}

@keyframes idle-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.018); }
}

.the-button:active .the-button-face,
.the-button.is-pressed .the-button-face {
  transform: translateY(11px) scale(0.985);
  box-shadow:
    0 3px 0 var(--outline),
    0 14px 22px -12px rgba(53, 40, 30, 0.35),
    inset 0 4px 10px rgba(255, 255, 255, 0.7);
  animation: none;
}

.the-button-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 5.6vw, 2rem);
  line-height: 1.14;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-align: center;
  pointer-events: none;
}

/* +1 particles */
.particles { position: absolute; inset: 0; pointer-events: none; overflow: visible; }

.particle {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
  animation: float-up 0.9s ease-out forwards;
  pointer-events: none;
  will-change: transform, opacity;
}
@keyframes float-up {
  0%   { opacity: 0; transform: translateY(0) scale(0.6); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.15) rotate(var(--tilt, 0deg)); }
}

/* counter */

.counter-block { text-align: center; }

.odometer {
  display: flex;
  justify-content: center;
  gap: 3px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  line-height: 1;
  color: var(--ink);
}

.odo-digit {
  position: relative;
  width: 0.72em;
  height: 1.18em;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-deep);
  box-shadow: inset 0 2px 4px rgba(53, 40, 30, 0.08);
}

.odo-comma { width: 0.3em; text-align: center; align-self: end; padding-bottom: 0.06em; color: var(--ink-faint); }

.odo-reel {
  position: absolute;
  left: 0; right: 0; top: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.odo-reel span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.18em;
}

.counter-label {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* mini stats */

.mini-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 30px;
  box-shadow: 0 10px 26px -18px rgba(53, 40, 30, 0.3);
}

.mini-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.mini-num { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-faint); }
.mini-divider { width: 1px; height: 30px; background: var(--line); }

/* ============================ EXPLORER ============================ */

.explorer {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 24px 80px;
  text-align: center;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.big-timer {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(4rem, 15vw, 8.5rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.big-timer.is-ending { animation: urgency 1s ease-in-out infinite; }
@keyframes urgency { 50% { transform: scale(1.03); } }

.timer-caption { color: var(--ink-soft); font-weight: 600; margin-top: 8px; }
.timer-caption span { font-variant-numeric: tabular-nums; }

.round-flash {
  margin: 26px auto 0;
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 1.1rem;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 6px 0 var(--outline);
  animation: flash-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes flash-pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.history { margin-top: 56px; text-align: left; }
.history h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 14px; }
.history-empty { color: var(--ink-faint); font-style: italic; }

.history-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 30px -22px rgba(53, 40, 30, 0.3);
}

.history-table th {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr { animation: row-in 0.4s ease both; }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

.history-table .addr { font-family: var(--font-mono); font-size: 0.82rem; }
.history-table .you {
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* confetti */

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }

.confetti-piece {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall var(--dur, 2.6s) ease-in forwards;
  will-change: transform, opacity;
}
@keyframes confetti-fall {
  to {
    transform: translateY(110vh) rotate(var(--spin, 540deg));
    opacity: 0.6;
  }
}

/* ============================ DOCS ============================ */

.docs {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 44px;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 28px 90px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.toc-link {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.toc-link:hover { background: var(--paper-deep); color: var(--ink); }
.toc-link.is-active { color: var(--ink); border-left-color: var(--ink); background: var(--accent-soft); }

.docs-body { min-width: 0; }

.doc-section { margin-bottom: 52px; scroll-margin-top: 88px; }

.doc-section h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 10px;
}
.doc-section h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 44px; height: 4px;
  border-radius: 2px;
  background: var(--ink);
}

.doc-section p { margin-bottom: 14px; color: #4a3b2d; max-width: 65ch; }
.doc-section p:last-child { margin-bottom: 0; }

.doc-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

.doc-section a { color: var(--ink); font-weight: 700; }

.faq dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  margin-top: 20px;
}
.faq dt:first-child { margin-top: 0; }
.faq dd { color: #4a3b2d; margin-top: 4px; max-width: 65ch; }

/* ============================ TOAST ============================ */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 14px 34px -12px rgba(53, 40, 30, 0.5);
  z-index: 80;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: calc(100vw - 40px);
  text-align: center;
}
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.toast.is-leaving { transition: opacity 0.3s, transform 0.3s; opacity: 0; transform: translate(-50%, 14px); }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 720px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 64px auto 1fr;
    grid-template-areas:
      "top"
      "side"
      "main";
  }

  .sidebar {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    overflow-x: auto;
  }
  .nav-btn { width: auto; white-space: nowrap; padding: 8px 14px; }

  .stage { gap: 32px; min-height: calc(100vh - 128px); }

  .docs { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .toc {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .toc-title { width: 100%; }
  .toc-link { border-left: none; font-size: 0.82rem; }

  .history-table th:nth-child(4), .history-table td:nth-child(4) { display: none; }

  .mini-stats { gap: 18px; padding: 10px 22px; }
}

/* ============================ REDUCED MOTION ============================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .the-button-face, .button-halo, .pill-dot, .big-timer.is-ending { animation: none; }
  .odo-reel { transition: none; }
  .particle, .confetti-piece { display: none; }
  .view, .wallet-card, .round-flash, .toast, .history-table tbody tr { animation-duration: 0.01ms; }
}
