/* getbuck.me — warm paper, violet ink. Colours follow app/src/theme/tokens.ts. */
:root {
  color-scheme: light;
  --paper: #f6f0e7;
  --paper-deep: #eee4d8;
  --lilac: #e4d4da;
  --lilac-soft: #efe5ea;
  --ink: #2a2330;
  --text: #42392f;
  --muted: #857b70;
  --line: #d9cfc3;
  --violet: #5a289a;
  --violet-ink: #653599;
  --violet-deep: #2e1650;
  --plum: #3f2c42;
  --orchid: #be57c8;
  --gold: #e2a849;
  --mint: #2f8f6b;
  --tomato: #c4473a;
  --ivory: #fff6e5;

  --font-display: 'Quicksand', 'Arial Rounded MT Bold', ui-rounded, system-ui, sans-serif;
  --font-body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;

  --text-hero: clamp(3rem, 1.6rem + 6vw, 6.5rem);
  --text-h1: clamp(2.4rem, 1.7rem + 3vw, 4rem);
  --text-h2: clamp(1.6rem, 1.3rem + 1.2vw, 2.15rem);
  --gutter: clamp(16px, 4vw, 48px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--violet);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--violet-deep);
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

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

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

:not(pre) > code {
  padding: 0.12em 0.36em;
  border-radius: 6px;
  background: var(--lilac-soft);
  color: var(--plum);
  overflow-wrap: anywhere;
}

/* ---------- top bar ---------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gutter);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.03em;
  color: var(--violet);
  text-decoration: none;
}

.bar nav {
  display: flex;
  gap: 4px;
}

.bar nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.bar nav a:hover {
  background: var(--lilac-soft);
  color: var(--ink);
}
.bar nav a[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  background: var(--violet);
  color: var(--ivory);
  font: 600 16px/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 10px 24px -10px rgb(90 40 154 / 0.7);
  transition: transform 0.14s var(--ease-out), box-shadow 0.14s ease, background-color 0.14s ease;
}
.btn:hover {
  background: var(--violet-ink);
  color: var(--ivory);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.18) inset, 0 14px 28px -10px rgb(90 40 154 / 0.75);
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.btn.quiet {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.btn.quiet:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn.small {
  min-height: 40px;
  padding: 0 16px;
  font-size: 15px;
  border-radius: 11px;
}

.arrow {
  transition: transform 0.18s var(--ease-out);
}
a:hover .arrow,
button:hover .arrow {
  transform: translateX(3px);
}

/* ---------- landing ---------- */

.landing {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: clip;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(8px, 3vh, 40px) var(--gutter) clamp(24px, 5vh, 56px);
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.hero h1 {
  font-size: var(--text-hero);
  line-height: 0.94;
  letter-spacing: -0.045em;
}
.hero h1 em {
  font-style: normal;
  color: var(--violet);
}

.lede {
  max-width: 34ch;
  margin: 28px 0 0;
  font-size: clamp(18px, 1rem + 0.45vw, 21px);
  line-height: 1.5;
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 36px;
}

.play-money {
  max-width: 40ch;
  margin: 28px 0 0;
  font-size: 15px;
  color: var(--muted);
}

/* the wallet, drawn with type: a balance card and a receipt tucked under it */
.wallet {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
}

.card {
  position: relative;
  z-index: 1;
  aspect-ratio: 1.58;
  padding: 26px 28px;
  border-radius: 24px;
  color: var(--ivory);
  background:
    radial-gradient(120% 140% at 100% 0%, rgb(202 106 202 / 0.85), transparent 55%),
    linear-gradient(150deg, #702cb3 0%, var(--violet) 45%, var(--violet-deep) 100%);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 30px 60px -22px rgb(46 22 80 / 0.55), 0 8px 18px -8px rgb(46 22 80 / 0.35);
  transform: rotate(-3deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card .who {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  opacity: 0.85;
}

.card .label {
  font-size: 14px;
  opacity: 0.8;
}

.card .amount {
  font-family: var(--font-display);
  font-size: clamp(40px, 3rem + 1vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.card .amount small {
  font-size: 0.42em;
  letter-spacing: 0;
  margin-left: 6px;
  opacity: 0.85;
}

.receipt {
  position: relative;
  margin: -44px -4% 0 8%;
  padding: 58px 22px 14px;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: 0 1px 0 var(--line), 0 22px 44px -22px rgb(66 57 47 / 0.45);
  transform: rotate(2deg);
}

.receipt ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.receipt li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.receipt li:last-child {
  border-bottom: 0;
}
.receipt .what {
  color: var(--ink);
  font-weight: 500;
}
.receipt .memo {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
}
.receipt .delta {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.receipt .in {
  color: var(--mint);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px var(--gutter) 28px;
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.foot p {
  margin: 0;
}
.foot a {
  color: var(--muted);
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .wallet {
    width: min(100%, 340px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero > * {
    animation: settle 0.7s var(--ease-out) both;
  }
  .hero > :nth-child(2) {
    animation-delay: 0.08s;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ---------- docs ---------- */

.docs-head {
  padding: clamp(24px, 6vh, 72px) var(--gutter) clamp(28px, 5vh, 56px);
  max-width: 1240px;
  margin: 0 auto;
}
.docs-head h1 {
  font-size: var(--text-h1);
}
.docs-head p {
  max-width: 52ch;
  margin: 18px 0 0;
  font-size: clamp(18px, 1rem + 0.3vw, 20px);
}

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
}

.toc {
  position: sticky;
  top: 24px;
  align-self: start;
  font-size: 15px;
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1.5px solid var(--line);
}
.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  margin-left: -1.5px;
  border-left: 1.5px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
.toc a:hover {
  color: var(--ink);
  border-left-color: var(--ink);
}
.toc .sub a {
  padding-left: 28px;
  font-size: 14px;
}

.docs article {
  max-width: 780px;
  min-width: 0;
}

.docs section {
  padding-top: 8px;
  margin-bottom: 72px;
}

.docs h2 {
  font-size: var(--text-h2);
  margin-bottom: 14px;
}
.docs h3 {
  margin: 44px 0 10px;
  font-family: var(--font-body);
  font-size: 19px;
  letter-spacing: -0.01em;
}

.docs p,
.docs li {
  max-width: 68ch;
}

.docs .intro {
  font-size: 19px;
  color: var(--ink);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin: 14px 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
}

.code {
  position: relative;
  margin: 18px 0 24px;
}
.code pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  border-radius: 16px;
  background: var(--ink);
  color: #f1e9f3;
  line-height: 1.6;
  tab-size: 2;
}
.code .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgb(255 255 255 / 0.1);
  color: #f1e9f3;
  font: 500 13px/1 var(--font-body);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.code:hover .copy,
.code .copy:focus-visible,
.code .copy[data-done] {
  opacity: 1;
}
.code .copy:hover {
  background: rgb(255 255 255 / 0.18);
}
@media (hover: none) {
  .code .copy {
    opacity: 1;
  }
}

.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--lilac-soft);
  color: var(--ink);
}
.callout strong {
  color: var(--violet-deep);
}
.callout p {
  margin: 0;
}
.callout ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf8;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
tr:last-child td {
  border-bottom: 0;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  background: var(--paper-deep);
}
td:first-child {
  white-space: nowrap;
}
td code {
  white-space: nowrap;
}

.chain-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px;
  margin: 20px 0;
  padding: 24px;
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -28px rgb(66 57 47 / 0.5);
}
.chain-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 0;
}
.chain-card dt {
  color: var(--muted);
  font-size: 15px;
}
.chain-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.status-line {
  min-height: 1.6em;
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--muted);
}
.status-line[data-tone='ok'] {
  color: var(--mint);
}
.status-line[data-tone='error'] {
  color: var(--tomato);
}

@media (max-width: 900px) {
  .docs {
    grid-template-columns: 1fr;
  }
  .toc {
    position: static;
  }
  .toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border: 0;
  }
  .toc .sub {
    display: none;
  }
  .toc a {
    padding: 6px 12px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
  }
  .chain-card {
    grid-template-columns: 1fr;
  }
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-content: center;
  gap: 16px;
  min-height: 70vh;
  padding: var(--gutter);
  text-align: center;
}
.lost h1 {
  font-size: var(--text-h1);
}

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