/* Solana Kit docs: paper, plum ink, and marker colours from skribble.dev.
 *
 * Ink drawn on the server by skribble_jaspr reads --skribble-* properties,
 * which are mapped onto this palette below, so every rough border follows
 * the light and dark themes. */

/* ---------- Lettering ---------- */

@font-face {
  font-family: "SkribbleNotoSketch";
  src: url("fonts/SkribbleNotoSketch-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "SkribbleMonoPlayful";
  src: url("fonts/SkribbleMonoPlayful-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SkribbleMonoPlayful";
  src: url("fonts/SkribbleMonoPlayful-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Palette ---------- */

:root {
  --paper: #fffaf0;
  --paper-2: #fdf3e4;
  --paper-3: #f6e6d8;
  --ink: #34283f;
  --quiet: #6f6273;
  --coral: #e2674d;
  --sun: #ffcc4d;
  --lilac: #9c7bd4;
  --mint: #3fb3a4;
  --sky: #4e8fda;
  --pink: #e57aa0;
  --rule: #d9cdc1;
  --on-accent: #2a2033;
  --code-bg: #fdf3e4;
  --dots: color-mix(in srgb, var(--ink) 13%, transparent);
  --glow: 0;

  --tok-k: #784175;
  --tok-s: #35634b;
  --tok-t: #315c83;
  --tok-f: #9c482b;
  --tok-n: #9a5d0f;
  --tok-c: #877a89;
  --tok-a: #b0457a;

  --font-body: "SkribbleNotoSketch", "Skribble Noto Sketch", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --font-mono: "SkribbleMonoPlayful", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --page: min(1180px, 100% - 32px);
  --header-height: 4.25rem;
  --wobbly: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M0 4 Q5 0.5 10 4 T20 4 T30 4 T40 4' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E");

  --skribble-ink: var(--ink);
  --skribble-paper: var(--paper);
  --skribble-accent: var(--coral);
  --skribble-on-accent: var(--on-accent);
  --skribble-font: var(--font-body);
  --skribble-stroke-width: 2px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1720;
    --paper-2: #241e2b;
    --paper-3: #32283a;
    --ink: #f3ebdf;
    --quiet: #b9adbd;
    --coral: #f08e76;
    --sun: #f2c14e;
    --lilac: #b89ce6;
    --mint: #5cc8b8;
    --sky: #79aef0;
    --pink: #f09bbb;
    --rule: #463c4d;
    --on-accent: #1d1722;
    --code-bg: #141017;
    --dots: color-mix(in srgb, var(--ink) 8%, transparent);
    --glow: 1;
    --tok-k: #d7a6d3;
    --tok-s: #9fd1a8;
    --tok-t: #9cc1ea;
    --tok-f: #f0a785;
    --tok-n: #f2c14e;
    --tok-c: #8f8494;
    --tok-a: #f09bbb;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #1b1720;
  --paper-2: #241e2b;
  --paper-3: #32283a;
  --ink: #f3ebdf;
  --quiet: #b9adbd;
  --coral: #f08e76;
  --sun: #f2c14e;
  --lilac: #b89ce6;
  --mint: #5cc8b8;
  --sky: #79aef0;
  --pink: #f09bbb;
  --rule: #463c4d;
  --on-accent: #1d1722;
  --code-bg: #141017;
  --dots: color-mix(in srgb, var(--ink) 8%, transparent);
  --glow: 1;
  --tok-k: #d7a6d3;
  --tok-s: #9fd1a8;
  --tok-t: #9cc1ea;
  --tok-f: #f0a785;
  --tok-n: #f2c14e;
  --tok-c: #8f8494;
  --tok-a: #f09bbb;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body.site-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(var(--dots) 1px, transparent 1.5px) 0 0 / 24px 24px,
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
  /* Noto Sketch has one weight; a hairline stroke reads as a heavier pen. */
  -webkit-text-stroke: 0.035em currentColor;
}

p {
  margin: 0;
  text-wrap: pretty;
}

strong,
b {
  font-weight: 400;
  -webkit-text-stroke: 0.03em currentColor;
}

a {
  color: inherit;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--coral);
}

:focus-visible {
  outline: 2px dashed var(--coral);
  outline-offset: 4px;
  border-radius: 4px;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: color-mix(in srgb, var(--sun) 65%, transparent);
  color: var(--on-accent);
}

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

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--coral);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: var(--wobbly);
  background: var(--coral);
  color: var(--on-accent);
}

.skip-link:focus {
  top: 12px;
}

.doodle {
  display: inline-block;
  overflow: visible;
  vertical-align: middle;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-height);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1.5px dashed var(--rule);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 100%;
  width: var(--page);
  margin: 0 auto;
}

.docs-page .site-header-inner {
  width: calc(100% - 32px);
  max-width: 1480px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: inherit;
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.05);
}

.brand-mark {
  transition: transform 0.2s ease-out;
}

.brand-name {
  font-size: 1.45rem;
  -webkit-text-stroke: 0.035em currentColor;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 0.8rem;
  border-radius: var(--wobbly);
  text-decoration: none;
  font-size: 1.08rem;
}

.site-nav a:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.3rem;
  height: 6px;
  background: var(--coral);
  -webkit-mask: var(--squiggle) repeat-x left center / 20px 6px;
  mask: var(--squiggle) repeat-x left center / 20px 6px;
}

.site-header-tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover .doodle {
  transform: rotate(18deg) scale(1.1);
}

.theme-toggle .doodle {
  grid-area: 1 / 1;
  transition: transform 0.3s ease-out, opacity 0.2s ease;
}

.theme-sun {
  opacity: 0;
}

:root[data-theme="dark"] .theme-sun {
  opacity: 1;
}

:root[data-theme="dark"] .theme-moon {
  opacity: 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-sun {
    opacity: 1;
  }

  :root:not([data-theme="light"]) .theme-moon {
    opacity: 0;
  }
}

.menu-button {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.6rem;
  border: 0;
  background: none;
  cursor: pointer;
}

.menu-button span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--ink);
}

.menu-button span:nth-child(1) {
  transform: rotate(-2deg);
}

.menu-button span:nth-child(2) {
  width: 80%;
  transform: rotate(1.5deg);
}

.menu-button span:nth-child(3) {
  transform: rotate(-1deg);
}

/* ---------- Search ---------- */

.site-search-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 0.45rem 0 0.75rem;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--paper);
  color: var(--quiet);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease-out;
}

.site-search-button:hover {
  transform: rotate(-1deg);
  color: var(--ink);
}

.site-search-button .site-search-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.site-search-button kbd {
  padding: 0.15rem 0.4rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--wobbly);
  font-size: 0.72rem;
  color: var(--quiet);
}

.site-search-dialog[hidden] {
  display: none;
}

.site-search-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.site-search-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #120e15 55%, transparent);
  backdrop-filter: blur(3px);
}

.site-search-panel {
  position: absolute;
  top: 6rem;
  left: 50%;
  width: 100%;
  max-width: min(44rem, calc(100vw - 1.5rem));
  max-height: min(42rem, calc(100vh - 2rem));
  overflow: hidden;
  transform: translateX(-50%) rotate(-0.4deg);
  border: 2.5px solid var(--ink);
  border-radius: 18px 6px 16px 8px / 8px 16px 6px 18px;
  background: var(--paper);
  box-shadow: 6px 7px 0 color-mix(in srgb, var(--ink) 85%, transparent);
}

.site-search-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1.5px dashed var(--rule);
}

.site-search-panel .site-search-icon {
  font-size: 1.4rem;
  color: var(--coral);
}

.site-search-input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.15rem;
}

.site-search-close {
  padding: 0.25rem 0.55rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--wobbly);
  background: none;
  color: var(--quiet);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.site-search-results {
  display: flex;
  flex-direction: column;
  max-height: min(32rem, calc(100vh - 10rem));
  overflow-y: auto;
  padding: 0.5rem;
}

.site-search-result {
  display: block;
  padding: 0.7rem 0.9rem;
  border-radius: var(--wobbly);
  color: inherit;
  text-decoration: none;
}

.site-search-result:hover,
.site-search-result:focus-visible,
.site-search-result[aria-selected="true"] {
  background: color-mix(in srgb, var(--sun) 32%, transparent);
  outline: none;
}

.site-search-result-title {
  font-size: 1.1rem;
  -webkit-text-stroke: 0.03em currentColor;
}

.site-search-result-route {
  margin-top: 0.1rem;
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.site-search-result-description {
  margin-top: 0.3rem;
  color: var(--quiet);
  font-size: 0.95rem;
  line-height: 1.45;
}

.site-search-empty {
  padding: 1.5rem;
  color: var(--quiet);
  text-align: center;
}

html.site-search-open {
  overflow: hidden;
}

/* ---------- Shared pieces ---------- */

/* A filled box sets --skribble-fill for its own ink; buttons and badges
   nested inside it must not inherit that tint. */
.skribble-button--primary {
  --skribble-fill: var(--coral);
}

.copy-button {
  padding: 0.2rem 0.65rem;
  border: 1.5px dashed color-mix(in srgb, var(--ink) 40%, transparent);
  border-radius: var(--wobbly);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease-out, background-color 0.15s ease;
}

.copy-button:hover {
  transform: rotate(-2deg);
  background: color-mix(in srgb, var(--sun) 35%, var(--paper));
}

.copy-button[data-copied] {
  border-style: solid;
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint) 25%, var(--paper));
}

.code-frame {
  display: block;
  margin: 1.5rem 0;
  min-width: 0;
}

.code-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: -2;
  border-radius: 6px;
  background: var(--code-bg);
}

.code-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.9rem 0.2rem 1.1rem;
}

.code-frame-label {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.code-frame-bar .copy-button {
  margin-left: auto;
}

pre.code {
  /* Inset the scroll area so long lines never run under the frame. */
  margin: 0 6px 6px;
  padding: 0.4rem 1.05rem 1.1rem;
  overflow-x: auto;
  background: none;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.7;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

pre.code code {
  font: inherit;
}

.tok-k { color: var(--tok-k); }
.tok-s { color: var(--tok-s); }
.tok-t { color: var(--tok-t); }
.tok-f { color: var(--tok-f); }
.tok-n { color: var(--tok-n); }
.tok-a { color: var(--tok-a); }
.tok-c { color: var(--tok-c); font-style: italic; }

/* ---------- Landing ---------- */

.landing main {
  overflow-x: clip;
}

.landing main > section {
  width: var(--page);
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 3rem;
  min-height: calc(100vh - var(--header-height));
  max-height: 60rem;
  padding: 3.5rem 0 4rem;
}

/* On dark paper the hero glows faintly in Solana's gradient. */
.hero::before {
  content: "";
  position: absolute;
  inset: 10% -10% 10% 35%;
  z-index: -1;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--mint) 55%, transparent), transparent) 20% 30% / 60% 60% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--lilac) 55%, transparent), transparent) 80% 70% / 65% 65% no-repeat;
  filter: blur(40px);
  opacity: calc(var(--glow) * 0.45);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hero h1 {
  font-size: clamp(2.9rem, 6.4vw, 5.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.hero h1 .skribble-highlight {
  white-space: nowrap;
}

/* Over dark paper a translucent marker turns muddy; ink it solid. */
:root[data-theme="dark"] .skribble-highlight--marker .skribble-ink-solid {
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .skribble-highlight--marker .skribble-ink-solid {
    opacity: 1;
  }
}

.hero-lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--quiet);
  font-size: 1.28rem;
}

.hero-lede code {
  color: var(--ink);
  font-size: 0.9em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.25rem;
}

.hero-actions .skribble-button {
  min-height: 3.2rem;
  padding: 0.6em 1.6em;
  font-size: 1.15rem;
}

.install-command {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding: 0.7rem 0.7rem 0.7rem 1.1rem;
}

.install-command code {
  font-size: 1rem;
}

.install-prompt {
  color: var(--coral);
  font-family: var(--font-mono);
}

.hero-art {
  display: flex;
  justify-content: center;
}

.pipeline {
  position: relative;
  margin: 0;
  width: min(100%, 27rem);
}

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

.pipeline-step {
  position: relative;
}

.pipeline-step-0 { transform: rotate(-1.6deg); }
.pipeline-step-1 { margin-left: 3.5rem; transform: rotate(1.2deg); }
.pipeline-step-2 { margin-left: 0.8rem; transform: rotate(-0.8deg); }
.pipeline-step-3 { margin-left: 4rem; transform: rotate(1.6deg); }

.pipeline-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  transition: transform 0.2s ease-out;
}

.pipeline-step:hover .pipeline-card {
  transform: translateY(-3px) rotate(-1deg);
}

.pipeline-card strong {
  display: block;
  font-size: 1.3rem;
  line-height: 1.2;
}

.pipeline-card code {
  display: block;
  color: var(--quiet);
  font-size: 0.82rem;
}

.pipeline-number {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  color: var(--on-accent);
  font-size: 1.25rem;
}

.pipeline-arrow {
  display: block;
  margin: 0.15rem 0 0.15rem 1.8rem;
}

.pipeline-step-1 .pipeline-arrow {
  margin-left: 0.4rem;
}

.pipeline-step-2 .pipeline-arrow {
  margin-left: 2.6rem;
}

.handnote {
  position: absolute;
  top: -3.2rem;
  right: -1rem;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 0.3rem;
  color: var(--coral);
  font-size: 1.15rem;
  transform: rotate(4deg);
}

.handnote-arrow {
  margin-top: 0.9rem;
  transform: scaleX(-1);
}

/* Facts */

.facts ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem 1.25rem;
}

.facts li:nth-child(odd) .fact { transform: rotate(-0.8deg); }
.facts li:nth-child(even) .fact { transform: rotate(0.7deg); }

.fact-value {
  font-size: 2rem;
  line-height: 1.1;
  -webkit-text-stroke: 0.035em currentColor;
}

.facts li:nth-child(1) .fact-value { color: var(--coral); }
.facts li:nth-child(2) .fact-value { color: var(--lilac); }
.facts li:nth-child(3) .fact-value { color: var(--mint); }
.facts li:nth-child(4) .fact-value { color: var(--sky); }

.fact-label {
  color: var(--quiet);
  font-size: 0.98rem;
}

/* Section scaffolding */

.band {
  padding: 6.5rem 0 0;
}

.section-heading {
  max-width: 44rem;
  margin-bottom: 2.75rem;
}

.section-heading h2 {
  font-size: clamp(2.2rem, 4.2vw, 3.3rem);
}

.section-lede {
  margin-top: 1rem;
  color: var(--quiet);
  font-size: 1.2rem;
}

/* Examples */

.example-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.example-tab {
  position: relative;
  min-height: 2.6rem;
  padding: 0.35rem 1.05rem;
  border: 2px solid var(--ink);
  border-radius: var(--wobbly);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.15s ease-out, background-color 0.15s ease, box-shadow 0.15s ease;
}

.example-tab:nth-child(odd) { transform: rotate(-1deg); }
.example-tab:nth-child(even) { transform: rotate(0.8deg); }

.example-tab:hover {
  transform: rotate(0) translateY(-2px);
}

.example-tab[aria-selected="true"] {
  background: var(--sun);
  color: var(--on-accent);
  box-shadow: 3px 4px 0 var(--ink);
}

.example-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 2.5rem;
}

.js .example-panel[data-inactive] {
  display: none;
}

.example-panel + .example-panel {
  margin-top: 3rem;
}

.js .example-panel + .example-panel {
  margin-top: 0;
}

.example-copy h3 {
  font-size: 1.9rem;
}

.example-copy > p {
  margin-top: 0.8rem;
  color: var(--quiet);
}

.checklist {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  margin: 0.5rem 0;
  padding-left: 2rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0.15rem;
  top: -0.05rem;
  color: var(--mint);
  font-size: 1.25rem;
  transform: rotate(-8deg);
}

.example-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
}

.example-links a:last-child {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.example-code {
  margin: 0;
}

.example-code pre.code {
  max-height: 34rem;
}

/* Features */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-grid > li {
  display: flex;
}

.feature-card {
  flex: 1;
  padding: 1.6rem 1.6rem 1.75rem;
}

.feature-grid > li:nth-child(3n + 1) .feature-card { transform: rotate(-0.6deg); }
.feature-grid > li:nth-child(3n + 2) .feature-card { transform: rotate(0.5deg); }
.feature-grid > li:nth-child(3n) .feature-card { transform: rotate(-0.3deg); }

.feature-glyph {
  display: inline-grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
}

.feature-card h3 {
  font-size: 1.5rem;
}

.feature-card p {
  margin-top: 0.6rem;
  color: var(--quiet);
  font-size: 1.04rem;
}

/* Paths */

.path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}

.path-link {
  display: flex;
  color: inherit;
  text-decoration: none;
}

.path-link:hover {
  color: inherit;
}

.path-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.6rem 1.6rem 1.4rem;
}

.path-card h3 {
  font-size: 1.6rem;
}

.path-card p {
  flex: 1;
  margin-top: 0.6rem;
  color: var(--quiet);
}

.path-action {
  margin-top: 1.1rem;
  color: var(--coral);
  font-size: 1.1rem;
}

.path-link:hover .path-action {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.docs-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1.5px dashed var(--rule);
}

.docs-map h3 {
  font-size: 1.2rem;
}

.docs-map h3 a {
  text-decoration: none;
}

.docs-map h3 a:hover {
  text-decoration: underline;
}

.docs-map p {
  margin-top: 0.25rem;
  color: var(--quiet);
  font-size: 0.98rem;
}

/* Packages */

.package-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 2.5rem;
}

.package-group h3 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.package-group ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.package-chip {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1.5px solid color-mix(in srgb, var(--ink) 55%, transparent);
  border-radius: var(--wobbly);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  transition: transform 0.15s ease-out, background-color 0.15s ease;
}

.package-group li:nth-child(odd) .package-chip { transform: rotate(-1deg); }
.package-group li:nth-child(even) .package-chip { transform: rotate(1deg); }

.package-chip:hover {
  transform: rotate(0) translateY(-2px);
  background: color-mix(in srgb, var(--sun) 40%, transparent);
  color: var(--ink);
}

.packages-more {
  margin-top: 2.25rem;
  font-size: 1.15rem;
}

/* Closing */

.closing {
  padding: 7rem 0 5rem;
}

.closing-card {
  padding: 3.5rem 2rem 3rem;
  text-align: center;
}

.closing-card h2 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
}

.closing-card p {
  margin-top: 1rem;
  color: var(--quiet);
  font-size: 1.2rem;
}

.closing-card .hero-actions {
  justify-content: center;
}

/* Reveal on scroll, only when the script that reveals is running. */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Docs ---------- */

.docs-shell {
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
  width: calc(100% - 32px);
  max-width: 1480px;
  margin: 0 auto;
}

.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: 1.75rem 1.25rem 3rem 0;
  border-right: 1.5px dashed var(--rule);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.sidebar-group + .sidebar-group {
  margin-top: 1.6rem;
}

.sidebar-group h2 {
  margin: 0 0 0.4rem 0.6rem;
  color: var(--coral);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
}

.sidebar-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-group a {
  position: relative;
  display: block;
  padding: 0.28rem 0.6rem;
  border-radius: var(--wobbly);
  color: var(--quiet);
  font-size: 1.02rem;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sidebar-group a:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink);
}

.sidebar-group a[aria-current="page"] {
  color: var(--on-accent);
}

/* The current page is marked with a yellow marker stroke. */
.sidebar-group a[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: 0.15rem -0.1rem 0.1rem 0.1rem;
  z-index: -1;
  border-radius: 12px 4px 14px 3px / 4px 12px 3px 14px;
  background: var(--sun);
  transform: rotate(-0.8deg);
}

.sidebar-group a[aria-current="page"] {
  isolation: isolate;
}

.sidebar-scrim {
  display: none;
}

.docs-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  gap: 3rem;
  padding: 2.75rem 0 5rem 3.5rem;
}

.docs-article {
  min-width: 0;
  max-width: 48rem;
}

.docs-article-header {
  margin-bottom: 2.25rem;
}

.docs-article-header h1 {
  font-size: clamp(2.3rem, 4.2vw, 3.2rem);
}

.docs-article-header h1 .skribble-highlight {
  display: inline;
}

.docs-article-header .lede {
  margin-top: 1.1rem;
  color: var(--quiet);
  font-size: 1.25rem;
}

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

.docs-toc-inner {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  padding-left: 1rem;
  border-left: 1.5px dashed var(--rule);
}

.docs-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-toc ul ul {
  padding-left: 0.85rem;
}

.docs-toc a {
  display: block;
  padding: 0.18rem 0;
  color: var(--quiet);
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}

.docs-toc a:hover,
.docs-toc a[aria-current="true"] {
  color: var(--coral);
}

/* Prose */

.content {
  overflow-wrap: break-word;
}

.content > * + * {
  margin-top: 1.15rem;
}

.content h2 {
  position: relative;
  margin-top: 3.25rem;
  padding-bottom: 0.55rem;
  font-size: 2rem;
}

.content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(9rem, 60%);
  height: 8px;
  background: var(--coral);
  -webkit-mask: var(--squiggle) repeat-x left center / 24px 8px;
  mask: var(--squiggle) repeat-x left center / 24px 8px;
  opacity: 0.85;
}

.content h3 {
  margin-top: 2.25rem;
  font-size: 1.5rem;
}

.content h4 {
  margin-top: 1.75rem;
  font-size: 1.2rem;
}

.content h2 + *,
.content h3 + *,
.content h4 + * {
  margin-top: 0.85rem;
}

.content :is(h1, h2, h3, h4) a {
  color: inherit;
  text-decoration: none;
}

.content :is(h2, h3, h4) a::after {
  content: " #";
  color: var(--coral);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.content :is(h2, h3, h4):hover a::after {
  opacity: 1;
}

.content ul,
.content ol {
  padding-left: 1.6rem;
}

.content li + li {
  margin-top: 0.35rem;
}

.content li > ul,
.content li > ol {
  margin-top: 0.35rem;
}

.content ul > li::marker {
  color: var(--coral);
  content: "✦  ";
  font-size: 0.75em;
}

.content ol > li::marker {
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.content :not(pre) > code {
  padding: 0.08em 0.4em;
  border-radius: var(--wobbly);
  background: color-mix(in srgb, var(--lilac) 16%, transparent);
  color: var(--ink);
  font-size: 0.86em;
}

.content a code {
  color: inherit;
}

.content hr {
  height: 8px;
  margin: 3rem 0;
  border: 0;
  background: var(--rule);
  -webkit-mask: var(--squiggle) repeat-x left center / 24px 8px;
  mask: var(--squiggle) repeat-x left center / 24px 8px;
}

.content img {
  border-radius: 8px;
}

.content kbd {
  padding: 0.05em 0.4em;
  border: 1.5px solid var(--rule);
  border-bottom-width: 3px;
  border-radius: 6px;
  font-size: 0.85em;
}

/* Callouts and quotes */

.callout {
  display: flex;
  gap: 1rem;
  margin: 1.75rem 0;
  padding: 1.1rem 1.35rem 1.2rem 1.1rem;
}

.callout-glyph {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  color: var(--on-accent);
  font-size: 1.05rem;
}

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

.callout-title {
  font-size: 1.12rem;
  -webkit-text-stroke: 0.03em currentColor;
}

.callout-body > * + * {
  margin-top: 0.5rem;
}

.sketch-quote {
  display: block;
  margin: 1.75rem 0;
  padding: 1.1rem 1.4rem;
}

.sketch-quote > * + * {
  margin-top: 0.7rem;
}

/* Tables */

.table-frame {
  display: block;
  margin: 1.75rem 0;
  padding: 4px;
  overflow: hidden;
}

/* WiredBox draws its rough border into a 240x120 canvas and stretches it to
   the element. On a tall table the 3-unit canvas inset scales to tens of
   pixels, which draws the top stroke through the header row. Map the ink's
   3..117 vertical range onto the frame's edges instead. */
.table-frame > .skribble-ink {
  transform: translateY(-2.55%) scaleY(1.051);
  transform-origin: top center;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.table-scroll th,
.table-scroll td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.table-scroll td:first-child {
  min-width: 8.5rem;
}

.table-scroll th {
  background: color-mix(in srgb, var(--sun) 22%, transparent);
  font-weight: 400;
  -webkit-text-stroke: 0.03em currentColor;
}

.table-scroll tr + tr td {
  border-top: 1.5px dashed var(--rule);
}

/* Article footer */

.docs-article-footer {
  margin-top: 4rem;
}

.edit-link {
  color: var(--quiet);
  font-size: 0.98rem;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.pager-link {
  display: flex;
  color: inherit;
  text-decoration: none;
}

.pager-link:hover {
  color: inherit;
}

.pager-next {
  grid-column: 2;
  text-align: right;
}

.pager-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem 1.25rem;
}

.pager-direction {
  color: var(--coral);
  font-size: 0.92rem;
}

.pager-title {
  font-size: 1.3rem;
  -webkit-text-stroke: 0.03em currentColor;
}

/* Wallet demo */

.wallet-demo-frame {
  display: block;
  max-width: 940px;
  margin: 1.5rem 0 2rem;
  padding: 6px;
}

.wallet-demo-chrome {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1.5px dashed var(--rule);
}

.wallet-demo-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.wallet-demo-dot-coral { background: var(--coral); }
.wallet-demo-dot-sun { background: var(--sun); }
.wallet-demo-dot-mint { background: var(--mint); }

.wallet-demo-title {
  color: var(--quiet);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wallet-demo-link {
  margin-left: auto;
  font-size: 0.9rem;
}

.wallet-demo-frame iframe {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 4px;
  background: #070a14;
}

/* ---------- Footer ---------- */

.site-footer {
  width: var(--page);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.docs-page .site-footer {
  width: calc(100% - 32px);
  max-width: 1480px;
}

.site-footer-rule {
  margin: 0 0 2.5rem;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.site-footer-brand p {
  max-width: 22rem;
  margin-top: 0.75rem;
  font-size: 1rem;
}

.site-footer-column h2 {
  margin-bottom: 0.6rem;
  color: var(--coral);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-text-stroke: 0;
}

.site-footer-column ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer-column li + li {
  margin-top: 0.3rem;
}

.site-footer-column a {
  color: var(--quiet);
  text-decoration: none;
}

.site-footer-column a:hover {
  color: var(--coral);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  .docs-main {
    grid-template-columns: minmax(0, 1fr);
    padding-left: 2.5rem;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    max-height: none;
    padding-top: 3rem;
  }

  .hero-art {
    justify-content: flex-start;
    margin-top: 2rem;
  }

  .facts ul,
  .docs-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid,
  .package-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .example-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .menu-button {
    display: inline-flex;
  }

  .docs-shell {
    display: block;
  }

  .docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    z-index: 25;
    width: min(19rem, 85vw);
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem 1.25rem 3rem;
    border-right: 2px solid var(--ink);
    background: var(--paper);
    transform: translateX(-102%);
    transition: transform 0.25s ease-out;
  }

  .sidebar-open .docs-sidebar {
    transform: none;
    box-shadow: 6px 0 0 color-mix(in srgb, var(--ink) 18%, transparent);
  }

  .sidebar-scrim {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    z-index: 24;
    display: block;
    background: color-mix(in srgb, #120e15 45%, transparent);
  }

  .sidebar-scrim[hidden] {
    display: none;
  }

  .docs-main {
    padding: 2rem 0 4rem;
  }

  .site-footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body.site-page {
    font-size: 1.06rem;
  }

  .site-nav {
    display: none;
  }

  .site-header-tools {
    margin-left: auto;
  }

  .site-search-button-label,
  .site-search-button kbd {
    display: none;
  }

  .site-search-button {
    justify-content: center;
    width: 2.6rem;
    padding: 0;
  }

  .hero h1 .skribble-highlight {
    white-space: normal;
  }

  .handnote {
    display: none;
  }

  .pipeline-step-1,
  .pipeline-step-3 {
    margin-left: 1.5rem;
  }

  .facts ul,
  .feature-grid,
  .path-grid,
  .package-groups,
  .docs-map,
  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-next {
    grid-column: auto;
  }

  .band {
    padding-top: 4.5rem;
  }

  .install-command {
    max-width: 100%;
  }

  .install-command code {
    overflow-x: auto;
    white-space: nowrap;
  }

  .site-footer-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .brand-mark,
  .theme-toggle .doodle,
  .pipeline-card,
  .example-tab,
  .package-chip,
  .copy-button,
  .site-search-button,
  .docs-sidebar {
    transition: none;
  }
}
