/* getbuck.me shared look: a near-white sheet on warm grey (after sz.ws), set in Allo.
   Every page puts class="page" on <body>. */

/* Allo by Josh Puckett (OFL, fonts/Allo-OFL.txt): roundness pinned at 100, weights 400–700, Latin only */
@font-face {
  font-family: 'Allo Display';
  src: url('/fonts/allo-display.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Allo';
  src: url('/fonts/allo-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

.page {
  --font-body: 'Allo', ui-rounded, system-ui, sans-serif;
  --font-display: 'Allo', ui-rounded, system-ui, sans-serif;
  --edge: clamp(16px, 4.5vw, 88px);
  --gap-section: clamp(40px, 7vw, 96px);
  --gap-block: clamp(20px, 3vw, 32px);
  --fs-h2: clamp(24px, 1rem + 1.7vw, 44px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  background: var(--ground);
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- top bar, on the grey ground ---------- */

.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px max(clamp(16px, 3vw, 40px), var(--safe-r)) 14px max(clamp(16px, 3vw, 40px), var(--safe-l));
}
.top .brand {
  color: var(--ink);
  gap: 8px;
}
.top .brand-mark {
  width: 22px;
  height: 26px;
}
.top .brand-word {
  width: 80px;
  height: 16px;
}
.top-note {
  margin: 0;
  font-size: 13px;
  color: var(--soft);
}
.top nav {
  justify-self: end;
  display: flex;
  gap: 4px;
}
.top nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.top nav a:hover {
  background: var(--veil);
}

/* ---------- the sheet ---------- */

.sheet {
  margin: 0 max(clamp(4px, 0.8vw, 12px), var(--safe-l)) 0 max(clamp(4px, 0.8vw, 12px), var(--safe-r));
  padding: clamp(0px, 0.8vw, 12px);
  border-radius: 28px;
  background: var(--sheet);
  box-shadow: 0 1px 0 var(--sheet-edge) inset, 0 1px 3px rgb(34 28 39 / 0.06);
}

.page h1,
.page h2 {
  font-family: var(--font-body);
  font-weight: 650;
  color: var(--ink);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.pill {
  display: inline-flex;
  align-items: center;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--veil);
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.12s var(--ease-out);
}
.pill:hover {
  background: var(--veil-strong);
  color: var(--ink);
}
.pill:active {
  transform: scale(0.97);
}
.pill.solid {
  background: var(--ink);
  color: var(--sheet);
}
.pill.solid:hover {
  background: var(--pill-hover);
  color: var(--sheet);
}

/* ---------- footer, on the grey ground ---------- */

.end {
  display: grid;
  gap: 4px;
  padding: 28px max(clamp(16px, 3vw, 40px), var(--safe-r)) calc(36px + var(--safe-b)) max(clamp(16px, 3vw, 40px), var(--safe-l));
  font-size: 13px;
  color: var(--soft);
  text-align: center;
}
.end p {
  margin: 0;
}
.end a {
  color: var(--soft);
}

/* ---------- the code, coloured like an editor ---------- */

.snippet {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: 0 30px 60px -36px rgb(34 28 39 / 0.6);
}
.snippet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  font-size: 13px;
  color: rgb(239 232 242 / 0.55);
}
.snippet .copy {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.08);
  color: #efe8f2;
  font: 500 13px/1 var(--font-body);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.snippet .copy:hover {
  background: rgb(255 255 255 / 0.16);
}
.snippet pre {
  margin: 0;
  padding: 22px 24px 26px;
  overflow-x: auto;
  color: #efe8f2;
  font-size: 13.5px;
  line-height: 1.75;
}
.tk-t {
  color: #c9a7ff;
}
.tk-a {
  color: #ffb88a;
}
.tk-s {
  color: #ff8fb8;
}
.tk-c {
  color: rgb(239 232 242 / 0.4);
}
.tk-k {
  color: #9fd0ff;
}
.tk-n {
  color: #ffd27a;
}

@media (max-width: 560px) {
  .top {
    grid-template-columns: 1fr auto;
  }
  .top-note,
  .top > span[aria-hidden='true'] {
    display: none;
  }
}

/* ---------- developers ---------- */

.docs-page {
  --muted: var(--soft);
  --line: var(--hair);
}
.docs-page .docs-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  align-items: end;
  gap: 40px clamp(32px, 6vw, 96px);
  max-width: none;
  margin: 0;
  padding: clamp(32px, 9vw, 128px) var(--edge) clamp(28px, 7vw, 88px);
}
.docs-page .docs-head h1 {
  font-size: clamp(36px, 1.1rem + 5.2vw, 108px);
  line-height: 0.94;
  letter-spacing: -0.035em;
}
.docs-page .docs-head p {
  max-width: 40ch;
  color: var(--soft);
}

/* the live pay button, so the docs open on the thing they describe */
.try {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 24px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--hair), 0 26px 44px -32px rgb(34 28 39 / 0.4);
}
.docs-page .try p {
  margin: 0;
}
.docs-page .try-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--buck);
}
.docs-page .try-note {
  font-size: 13.5px;
  line-height: 1.45;
}

.docs-page .docs {
  max-width: none;
  margin: 0;
  padding: 0 var(--edge) clamp(48px, 10vw, 128px);
}
.docs-page .toc {
  top: clamp(96px, 16vh, 140px);
}
.docs-page .toc a:hover {
  color: var(--ink);
  border-left-color: var(--buck);
}
.docs-page .docs h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.03em;
}
.docs-page .docs h3 {
  font-family: var(--font-body);
  font-weight: 650;
}
.docs-page .docs .intro {
  color: var(--ink);
}
.docs-page :not(pre) > code {
  background: var(--tint);
  color: var(--code-ink);
}
.docs-page .code pre {
  border-radius: 18px;
  background: var(--code-bg);
}
.docs-page .callout {
  background: var(--tint);
}
.docs-page .callout strong {
  color: var(--buck);
}
.docs-page .table-wrap {
  border-color: var(--hair);
  background: var(--card);
}
.docs-page th {
  background: var(--table-head);
}
.docs-page th,
.docs-page td {
  border-color: var(--hair);
}
.docs-page .steps li::before {
  background: var(--buck);
  color: #fff6e5;
}

@media (max-width: 860px) {
  .docs-page .docs-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

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

.lost {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: calc(100svh - 120px);
  padding: 40px var(--edge);
  text-align: center;
}
.lost img {
  width: min(180px, 40vw);
  height: auto;
}
.page .lost h1 {
  max-width: 14ch;
  margin-top: 16px;
  font-size: clamp(36px, 1rem + 4vw, 64px);
  line-height: 1;
  letter-spacing: -0.03em;
}

/* ================================================================
   Fluid layout: one set of rules for every width, 320 to 1920.
   Headings come from the clamp() scale above, gaps from --gap-*,
   and long values (URLs, hex, ids) follow .tok below.
   ================================================================ */

.page h1,
.page h2,
.page h3 {
  text-wrap: balance;
}

/* the page is never wider than the screen */
.page {
  overflow-x: clip;
}

/* ---------- long values: URLs, addresses, hex, ids ----------
   Mono, never broken mid-word. A value may only wrap where an <wbr> says so;
   if even that doesn't fit, it scrolls inside its own box instead of tearing apart. */
.tok {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
  overflow-wrap: normal;
  word-break: normal;
  white-space: normal;
  hyphens: none;
}
:not(pre) > code.tok {
  overflow-wrap: normal;
}

/* ---------- label and value lists ---------- */
.kv {
  display: grid;
  margin: 0;
}
.kv > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 11rem) minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 20px;
  padding: 10px 0;
  border-top: 1px solid var(--hair);
}
.kv > div:first-child {
  border-top: 0;
  padding-top: 0;
}
.kv dt {
  color: var(--soft);
  font-size: 15px;
}
.kv dd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-weight: 500;
}

.copy-inline {
  align-self: center;
  margin-left: auto;
  padding: 3px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--veil);
  color: var(--ink);
  font: 550 12.5px/1.4 var(--font-body);
  cursor: pointer;
}
.copy-inline:hover,
.copy-inline[data-done] {
  background: var(--veil-strong);
}

/* label above value when the card is narrow */
@container chain (max-width: 30rem) {
  .kv > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
  }
  .kv dt {
    font-size: 13px;
  }
}

.docs-page .chain-card {
  container: chain / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 18px;
  padding: clamp(16px, 3.4vw, 24px);
  border-radius: 20px;
}
.docs-page .chain-card .kv {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
}

/* ---------- docs on a phone ---------- */
@media (max-width: 900px) {
  .docs-page .docs {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-page .toc {
    min-width: 0;
  }
  .docs-page .toc ol {
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 calc(-1 * var(--edge));
    padding: 2px var(--edge);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .docs-page .toc ol::-webkit-scrollbar {
    display: none;
  }
  .docs-page .toc a {
    white-space: nowrap;
  }
}

/* tables become stacked rows: the name on top, what it does underneath */
@media (max-width: 640px) {
  .docs-page .table-wrap {
    overflow: visible;
  }
  .docs-page table,
  .docs-page tbody,
  .docs-page tr,
  .docs-page td {
    display: block;
    width: 100%;
  }
  .docs-page thead {
    display: none;
  }
  .docs-page tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--hair);
  }
  .docs-page tr:last-child {
    border-bottom: 0;
  }
  .docs-page td {
    padding: 0 16px;
    border: 0;
  }
  .docs-page td:first-child {
    white-space: normal;
    margin-bottom: 4px;
    font-weight: 550;
    color: var(--ink);
  }
  .docs-page td code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .docs-page .code pre {
    padding: 16px 16px;
    font-size: 12.5px;
  }
  .snippet pre {
    padding: 16px;
    font-size: 12.5px;
  }
  .docs-page .callout {
    padding: 14px 16px;
  }
}

/* copy buttons sit above the code on touch screens, so they never cover a line */
@media (hover: none) {
  .docs-page .code pre {
    padding-top: 44px;
  }
}

/* ---------- the chain page: prose ---------- */
.prose-head {
  padding: clamp(32px, 8vw, 112px) var(--edge) clamp(24px, 5vw, 64px);
}
.page .prose-head h1 {
  font-size: clamp(36px, 1.1rem + 5.2vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
}
.prose-head p {
  max-width: 40ch;
  margin: clamp(14px, 2vw, 24px) 0 0;
  font-size: clamp(17px, 1rem + 0.4vw, 21px);
  line-height: 1.5;
  color: var(--soft);
}
.prose {
  padding: 0 var(--edge) clamp(48px, 10vw, 128px);
}
.prose section {
  max-width: 40rem;
  margin-bottom: var(--gap-section);
}
.prose section:last-child {
  margin-bottom: 0;
}
.prose h2 {
  margin-bottom: 14px;
  font-size: var(--fs-h2);
  letter-spacing: -0.03em;
}
.prose p,
.prose li {
  max-width: 62ch;
}
.prose .facts {
  display: grid;
  gap: 12px;
  margin: 16px 0 20px;
  padding: 0;
  list-style: none;
}
.prose .facts li {
  padding-left: 16px;
  border-left: 2px solid var(--hair);
}
.prose .facts strong {
  display: block;
  color: var(--ink);
  font-weight: 650;
}
/* Wide screens: heading on the left, text on the right, so a section uses the page width
   instead of hugging the left edge. Phones keep the single column. */
@media (min-width: 960px) {
  .prose section {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(0, 2.2fr);
    column-gap: clamp(40px, 5vw, 96px);
    max-width: 78rem;
  }
  .prose section > h2 {
    grid-column: 1;
    grid-row: 1 / span 40;
    align-self: start;
    position: sticky;
    top: 24px;
  }
  .prose section > :not(h2) {
    grid-column: 2;
  }
  .prose .facts {
    grid-template-columns: 1fr 1fr;
    gap: 24px 40px;
  }
}
.prose .code {
  margin: 20px 0;
}

/* ---------- the download page ---------- */
.docs-page .get-card {
  margin: 0;
}
.get-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.prose .get-note {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--soft);
}

/* ---------- phones ---------- */
@media (max-width: 480px) {
  .top nav {
    gap: 0;
  }
  .top nav a {
    padding: 6px 9px;
    font-size: 13.5px;
  }
  .top .brand-word {
    display: none;
  }
  .btn {
    padding: 0 18px;
  }
  .docs-page .try {
    padding: 18px;
  }
  .pill {
    min-height: 42px;
    padding: 0 18px;
  }
}

.top nav a[aria-current='page'] {
  background: var(--veil);
}
