@font-face { font-family: "Bricolage"; src: url("/static/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Instrument"; src: url("/static/fonts/instrument.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #0b1412; --side: #111e1a; --card: #14231f; --card-2: #1a2d27; --rule: #263d36; --ink: #eef5f1; --text: #c5d3cc; --quiet: #93a89e;
  --pine: #6fd3bf; --gold: #f2c14e; --gold-ink: #1c1503; --caution-bg: #3d2c08; --caution-ink: #fde3ae; --danger: #ff9d92;
  --code-bg: #07100e; --code-ink: #dbe7e1; --code-str: #f6d98e; --code-com: #7f968b; --inline: #1f342e;
  --display: "Bricolage", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: "Instrument", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef3f0; --side: #fbfcf8; --card: #fbfcf8; --card-2: #e6edea; --rule: #d2ddd7; --ink: #15302a; --text: #33473f; --quiet: #55695f;
  --pine: #0b5f52; --caution-bg: #fbe9c8; --caution-ink: #6b3f00; --danger: #a3271c; --inline: #dfe8e3;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16.5px/1.65 var(--body); }
h1, h2, h3, p, ul, ol { margin: 0; }
a { color: var(--pine); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 650 22px/1 var(--display); letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo img { display: block; border-radius: 8px; }
.btn { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 16px; border-radius: 10px; font-weight: 650; font-size: 15px; text-decoration: none; }
.btn.gold { background: var(--gold); color: var(--gold-ink); transition: filter .15s ease; }
.btn.gold:hover { filter: brightness(1.07); }

.top { position: sticky; top: 0; z-index: 20; height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 clamp(14px, 2.6vw, 34px); background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.top nav { display: flex; align-items: center; gap: clamp(10px, 1.8vw, 22px); font-size: 15px; }
.top nav a:not(.btn) { color: var(--text); text-decoration: none; }
.top nav a:not(.btn):hover { color: var(--ink); }
.theme { display: inline-flex; padding: 3px; gap: 2px; background: var(--card-2); border-radius: 999px; }
.theme button { display: grid; place-items: center; width: 32px; height: 30px; background: none; border: 0; border-radius: 999px; color: var(--quiet); cursor: pointer; }
.theme .icon { width: 17px; height: 17px; }
.theme button[aria-pressed="true"] { background: var(--bg); color: var(--ink); }
:root[data-theme="light"] .theme { background: #dbe5e0; }
:root[data-theme="light"] .theme button[aria-pressed="true"] { background: #fff; }

.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; }
.toc { position: sticky; top: 66px; height: calc(100dvh - 66px); overflow-y: auto; padding: 28px 14px; background: var(--side); border-right: 1px solid var(--rule); }
.toc p { padding: 0 12px 10px; color: var(--quiet); font-size: 14px; }
.toc-nav, .toc-mobile nav { display: grid; gap: 2px; }
.toc-nav a, .toc-mobile nav a { position: relative; display: block; padding: 8px 12px; border-radius: 10px; color: var(--quiet); font-size: 15.5px; line-height: 1.35; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.toc-nav a:hover, .toc-mobile nav a:hover { background: var(--card-2); color: var(--ink); }
.toc-nav a[aria-current="true"] { background: var(--card-2); color: var(--ink); font-weight: 650; }
.toc-nav a[aria-current="true"]::before { content: ""; position: absolute; left: -6px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--gold); }
.toc-mobile { display: none; }

.guide { width: 100%; max-width: 860px; padding: clamp(28px, 4vw, 52px) clamp(16px, 4vw, 52px) 96px; min-width: 0; }
.intro { padding-bottom: 8px; }
h1 { color: var(--ink); font: 680 clamp(36px, 5vw, 54px)/1.05 var(--display); letter-spacing: -.03em; }
.lead { margin-top: 14px; font-size: clamp(17px, 1.6vw, 19px); max-width: 38em; }
section { padding-top: 44px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
h2 { color: var(--ink); font: 660 clamp(25px, 3vw, 31px)/1.15 var(--display); letter-spacing: -.02em; }
h3 { color: var(--ink); font: 640 18px/1.3 var(--display); margin-top: 8px; }
strong { color: var(--ink); }
section > ul { padding-left: 1.3em; display: grid; gap: 6px; }

:not(pre) > code { padding: 1px 6px; background: var(--inline); color: var(--ink); border-radius: 5px; font: 14px var(--mono); overflow-wrap: anywhere; }
td code { white-space: nowrap; overflow-wrap: normal; }
.code-box { position: relative; min-width: 0; }
pre { margin: 0; padding: 18px 20px; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--rule); border-radius: 14px; overflow-x: auto; }
pre code { font: 14px/1.65 var(--mono); }
.s { color: var(--code-str); }
.c { color: var(--code-com); font-style: italic; }
.copy { position: absolute; top: 10px; right: 10px; min-height: 32px; padding: 4px 11px; background: #14231f; color: #dbe7e1; border: 1px solid #2d4a42; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.copy:hover { background: #1f342e; }
.copy[data-done] { background: #6fd3bf; border-color: #6fd3bf; color: #07100e; }

.warn { display: flex; gap: 11px; padding: 13px 15px; background: var(--caution-bg); color: var(--caution-ink); border-radius: 12px; font-weight: 550; line-height: 1.5; }
.warn .icon { margin-top: 1px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
th, td { padding: 11px 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--quiet); font-weight: 500; font-size: 14px; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 600 13px var(--mono); white-space: nowrap; }
.b-ok { background: color-mix(in srgb, var(--pine) 18%, transparent); color: var(--pine); }
.b-warn { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--caution-ink); }
:root:not([data-theme="light"]) .b-warn { color: var(--gold); }
.b-bad { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.b-off { background: var(--card-2); color: var(--quiet); }

/* Language tabs: without JavaScript every example simply shows, one after another. */
.tabs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 4px; }
.tab-fallback { margin: 0 0 8px; }
.tabs-ready .tab-fallback { display: none; }
.tabs-ready .tab-panel:not(.on) { display: none; }
.tab-list { display: inline-flex; width: max-content; max-width: 100%; padding: 4px; gap: 2px; background: var(--card-2); border-radius: 11px; }
.tab-list button { min-height: 34px; padding: 4px 14px; background: none; border: 0; border-radius: 8px; color: var(--quiet); font-weight: 600; font-size: 14px; cursor: pointer; transition: color .15s ease, background-color .15s ease; }
.tab-list button[aria-selected="true"] { background: var(--bg); color: var(--ink); }
:root[data-theme="light"] .tab-list button[aria-selected="true"] { background: #fff; }
.tabs:not(.tabs-ready) .tab-panel + .tab-panel { margin-top: 12px; }

/* The payment's route, the same picture as on the home page. */
.flow { position: relative; padding: 24px 18px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; container-type: inline-size; overflow: hidden; }
.flow ol { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; }
.flow ol::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 25px; border-top: 2px dashed var(--rule); }
.flow li { position: relative; display: grid; justify-items: center; gap: 10px; text-align: center; font-size: 14.5px; line-height: 1.35; color: var(--ink); }
.flow-ic { display: grid; place-items: center; width: 52px; height: 52px; background: var(--card-2); border: 2px solid var(--pine); color: var(--pine); border-radius: 50%; position: relative; z-index: 1; }
.flow-ic .icon { width: 24px; height: 24px; }
.flow-coin { display: none; position: absolute; left: 0; top: 40px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px 2px color-mix(in srgb, var(--gold) 60%, transparent); z-index: 2; }

.toc-mobile { margin-top: 18px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; }
.toc-mobile summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; color: var(--ink); font-weight: 600; cursor: pointer; list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile[open] summary .icon { rotate: 180deg; }
.toc-mobile nav { padding: 0 8px 8px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; }
  .n-hide { display: none !important; }
}
@media (max-width: 560px) {
  .flow ol { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .flow ol::before { display: none; }
  .flow li { grid-template-columns: 52px minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; gap: 12px; }
}
/* Motion is added only for people who haven't asked for less. */
@media (prefers-reduced-motion: no-preference) {
  .intro, .toc-mobile { animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes rise { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
  @media (min-width: 561px) {
    .flow-coin { display: block; animation: travel 6s cubic-bezier(.45, .05, .55, .95) infinite; }
    @keyframes travel { 0%, 6% { translate: 12.5cqw 0; opacity: 0; } 10% { opacity: 1; } 34% { translate: 37.5cqw 0; } 40% { translate: 37.5cqw 0; } 64% { translate: 62.5cqw 0; } 70% { translate: 62.5cqw 0; } 90% { translate: 87.5cqw 0; opacity: 1; } 96%, 100% { translate: 87.5cqw 0; opacity: 0; } }
  }
}

.btn.gold-outline { border: 1.5px solid var(--gold); color: var(--ink); }
.btn.gold-outline:hover { background: var(--card-2); }
.menu { position: relative; }
.menu summary { display: flex; align-items: center; gap: 7px; min-height: 40px; cursor: pointer; list-style: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.menu summary::-webkit-details-marker { display: none; }
.menu .chev { width: 17px; height: 17px; transition: rotate .15s ease; }
.menu[open] .chev { rotate: 180deg; }
.flag { width: 24px; height: 16px; border-radius: 3px; flex: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px; padding: 6px; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); display: grid; z-index: 30; }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; background: none; border: 0; border-radius: 8px; color: var(--ink); text-align: left; cursor: pointer; }
.menu-pop button:hover { background: var(--card-2); }
@media (max-width: 480px) {
  .top nav { gap: 8px; }
  .top .logo span { display: none; }
}
