/* TTF Bot website. Colours come from the bot's own PnL card: the standard "TTF" look (dark) and the "Paper" preset
   (light), utility/card_style.py. One type family (Archivo, self-hosted), its width axis carries the headlines. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --bg-alt: #eaeff7;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --line: #d6dce7;
  --line-strong: #b9c3d4;
  --text: #131a28;
  --muted: #536074;
  --accent: #1d62d8;
  --accent-hover: #174fb0;
  --on-accent: #ffffff;
  --accent-soft: #e3ecfc;
  --pass: #0d8465;
  --fail: #bf3328;
  --warn: #8a5a00;
  --shadow: 0 1px 2px rgb(19 26 40 / 6%), 0 8px 24px -12px rgb(19 26 40 / 18%);
  --ring: 0 0 0 3px rgb(29 98 216 / 35%);

  /* Telegram (light) */
  --tg-wall: linear-gradient(160deg, #d7e3c4 0%, #b7d0a3 45%, #cfd9a8 100%);
  --tg-head: #ffffff;
  --tg-head-text: #000000;
  --tg-sub: #66737e;
  --tg-in: #ffffff;
  --tg-out: #effdde;
  --tg-text: #000000;
  --tg-link: #1171b0;
  --tg-time: #66737e;
  --tg-time-out: #2f7a2d;
  --tg-btn: rgb(40 60 38 / 66%);
  --tg-btn-text: #ffffff;
  --tg-quote: #1171b0;
  --tg-code: #c2185b;
  --tg-code-out: #a8124b;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --tg-font: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;

  --gutter: 16px;
  --max: 1200px;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 18px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d111c;
    --bg-alt: #111727;
    --surface: #151c2e;
    --surface-2: #1a2236;
    --line: #283250;
    --line-strong: #3a4770;
    --text: #edf1f9;
    --muted: #93a5c9;
    --accent: #6a9dff;
    --accent-hover: #8ab2ff;
    --on-accent: #0d111c;
    --accent-soft: #19254a;
    --pass: #3fe08f;
    --fail: #ff6b6b;
    --warn: #f2c04b;
    --shadow: 0 1px 0 rgb(255 255 255 / 3%) inset, 0 18px 40px -24px rgb(0 0 0 / 80%);
    --ring: 0 0 0 3px rgb(106 157 255 / 45%);

    --tg-wall: linear-gradient(160deg, #0e1621 0%, #0f1c2a 60%, #0e1621 100%);
    --tg-head: #17212b;
    --tg-head-text: #f5f5f5;
    --tg-sub: #8496a6;
    --tg-in: #182533;
    --tg-out: #2b5278;
    --tg-text: #f5f5f5;
    --tg-link: #6ab3f3;
    --tg-time: #8496a6;
    --tg-time-out: #a9c9ea;
    --tg-btn: rgb(255 255 255 / 9%);
    --tg-btn-text: #f5f5f5;
    --tg-quote: #6ab3f3;
    --tg-code: #e9a1ab;
  --tg-code-out: #ffd0d6;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d111c;
  --bg-alt: #111727;
  --surface: #151c2e;
  --surface-2: #1a2236;
  --line: #283250;
  --line-strong: #3a4770;
  --text: #edf1f9;
  --muted: #93a5c9;
  --accent: #6a9dff;
  --accent-hover: #8ab2ff;
  --on-accent: #0d111c;
  --accent-soft: #19254a;
  --pass: #3fe08f;
  --fail: #ff6b6b;
  --warn: #f2c04b;
  --shadow: 0 1px 0 rgb(255 255 255 / 3%) inset, 0 18px 40px -24px rgb(0 0 0 / 80%);
  --ring: 0 0 0 3px rgb(106 157 255 / 45%);

  --tg-wall: linear-gradient(160deg, #0e1621 0%, #0f1c2a 60%, #0e1621 100%);
  --tg-head: #17212b;
  --tg-head-text: #f5f5f5;
  --tg-sub: #8496a6;
  --tg-in: #182533;
  --tg-out: #2b5278;
  --tg-text: #f5f5f5;
  --tg-link: #6ab3f3;
  --tg-time: #8496a6;
  --tg-time-out: #a9c9ea;
  --tg-btn: rgb(255 255 255 / 9%);
  --tg-btn-text: #f5f5f5;
  --tg-quote: #6ab3f3;
  --tg-code: #e9a1ab;
  --tg-code-out: #ffd0d6;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1280px) {
  :root { --gutter: 48px; }
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--on-accent); }
code, kbd, .mono { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin: 0.25rem 0; }

h1, h2, h3, h4 {
  font-family: var(--font);
  line-height: 1.08;
  margin: 0 0 0.75rem;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.35rem, 1.4rem + 4.6vw, 4.6rem); font-weight: 820; font-stretch: 122%; letter-spacing: -0.03em; line-height: 0.98; }
h2 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); font-weight: 780; font-stretch: 116%; }
h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 108%; line-height: 1.2; }
h4 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 8px; font-weight: 600;
}
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(760px + 2 * var(--gutter)); }
.lede { font-size: clamp(1.12rem, 1rem + 0.5vw, 1.32rem); line-height: 1.5; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; line-height: 1.5; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.75rem; font-size: clamp(1.45rem, 1.2rem + 1vw, 1.9rem); }
.prose h3 { margin-top: 2rem; }

/* ---------------------------------------------------------------- header */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-row { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-stretch: 118%; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; border-radius: 50%; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-list { display: flex; list-style: none; margin: 0; padding: 0; gap: 2px; }
.nav-list a {
  display: block; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 560; font-size: 0.96rem;
}
.nav-list a:hover { color: var(--text); background: var(--surface-2); }
.nav-list a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 0 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
.menu-btn { display: none; }
.head-cta { margin-left: 6px; }

@media (max-width: 1099px) {
  .menu-btn { display: inline-grid; }
  .nav { gap: 8px; }
  .nav-list {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-list a { padding: 12px 8px; font-size: 1.05rem; border-radius: 8px; }
  .nav-list a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 8px 8px 0; }
  .site-head[data-open="true"] .nav-list { display: flex; }
}
@media (max-width: 479px) {
  .nav .head-cta { display: none; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 650; font-size: 1rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, color .15s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-s { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 0.94rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions + p { margin-top: 1rem; }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(56px, 7vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.page-head { padding: clamp(48px, 7vw, 96px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.9rem); max-width: 18ch; }
.page-head .lede { margin-top: 1rem; }

/* ---------------------------------------------------------------- hero */
.hero { padding: clamp(36px, 6vw, 88px) 0 clamp(48px, 6vw, 96px); position: relative; }
.hero-grid { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}
.hero h1 { max-width: 13ch; }
.hero .lede { margin: 1.25rem 0 2rem; }
.hero-note { margin-top: 1.25rem; color: var(--muted); font-size: 0.92rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 2.25rem 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }
.hero-facts li { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.hero-facts b { color: var(--text); font-weight: 700; font-stretch: 110%; }

/* ---------------------------------------------------------------- Telegram mock */
.tg {
  --w: 420px;
  width: 100%; max-width: var(--w); margin-inline: auto;
  border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  background: var(--tg-wall); box-shadow: var(--shadow);
  font-family: var(--tg-font); color: var(--tg-text);
  font-size: 14.5px; line-height: 1.36;
  font-stretch: 100%;
  letter-spacing: 0;
}
.tg-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--tg-head); border-bottom: 1px solid rgb(0 0 0 / 8%); }
.tg-head img { width: 38px; height: 38px; border-radius: 50%; }
.tg-title { color: var(--tg-head-text); font-weight: 600; font-size: 15px; line-height: 1.2; }
.tg-sub { color: var(--tg-sub); font-size: 13px; line-height: 1.2; min-height: 16px; }
.tg-sub .typing { color: var(--tg-link); }
.tg-log { height: var(--tg-h, 560px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 10px 16px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.tg-static .tg-log { height: auto; overflow: visible; }
.tg-msg { max-width: 92%; display: flex; flex-direction: column; gap: 3px; }
.tg-msg.out { align-self: flex-end; }
.tg-bubble {
  position: relative; padding: 7px 10px 7px 11px; border-radius: 14px 14px 14px 4px;
  background: var(--tg-in); box-shadow: 0 1px 1px rgb(0 0 0 / 12%);
  overflow-wrap: anywhere; white-space: normal;
}
.tg-msg.out .tg-bubble { background: var(--tg-out); border-radius: 14px 14px 4px 14px; }
.tg-bubble .t { float: right; margin: 6px 0 -4px 10px; font-size: 11.5px; color: var(--tg-time); line-height: 1; user-select: none; }
.tg-msg.out .t { color: var(--tg-time-out); }
.tg-bubble .l { color: var(--tg-link); }
.tg-bubble b { font-weight: 600; }
.tg-bubble code { font-family: var(--mono); font-size: 13px; background: none; border: 0; padding: 0; color: var(--tg-code); }
.tg-msg.out .tg-bubble code { color: var(--tg-code-out); }
.tg-bubble blockquote { margin: 3px 0; padding: 2px 8px; border-left: 3px solid var(--tg-quote); background: color-mix(in srgb, var(--tg-quote) 10%, transparent); border-radius: 4px; }
.tg-bubble .ln { display: block; min-height: 1.36em; border-radius: 4px; transition: background-color .2s ease; }
.tg-bubble .ln.on { background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tg-photo { padding: 3px; }
.tg-photo img { border-radius: 11px; width: 100%; }
.tg-kb { display: grid; gap: 4px; }
.tg-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.tg-btn {
  display: grid; place-items: center; min-height: 36px; padding: 4px 6px; border-radius: 8px;
  background: var(--tg-btn); color: var(--tg-btn-text); font-size: 13.5px; font-weight: 500; text-align: center;
  transition: transform .15s ease, background-color .15s ease;
}
.tg-btn.press { transform: scale(0.94); background: color-mix(in srgb, var(--tg-btn-text) 26%, transparent); }
.tg-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--tg-in); border-radius: 14px 14px 14px 4px; }
.tg-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--tg-time); animation: tgdot 1s infinite ease-in-out; }
.tg-typing i:nth-child(2) { animation-delay: .15s; }
.tg-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tgdot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.tg-msg.enter { animation: tgin .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tgin { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.tg-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--tg-head); color: var(--tg-sub); font-size: 13px; border-top: 1px solid rgb(0 0 0 / 8%); }
.tg-foot button { font: inherit; font-weight: 600; color: var(--tg-link); background: none; border: 0; padding: 6px 4px; cursor: pointer; border-radius: 6px; }
.demo-cap { margin-top: 12px; text-align: center; font-size: 0.85rem; color: var(--muted); }

@media (max-width: 479px) {
  .tg { font-size: 13.5px; border-radius: 16px; }
  .tg-log { --tg-h: 500px; padding: 10px 6px 12px; }
  .tg-msg { max-width: 96%; }
  .tg-btn { font-size: 12.5px; }
}

/* ---------------------------------------------------------------- decoded report (home) */
.decode { display: grid; gap: 32px; align-items: start; }
@media (min-width: 1000px) {
  .decode { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 64px; }
  .decode .tg { position: sticky; top: 88px; }
}
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.note {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 4px 12px; padding: 14px 14px 14px 10px;
  border-radius: var(--radius-m); border: 1px solid transparent; cursor: default;
  transition: background-color .15s ease, border-color .15s ease;
}
.note:hover, .note:focus-within, .note.on { background: var(--surface); border-color: var(--line); }
.note .k { font-size: 1.35rem; line-height: 1.2; text-align: center; font-family: var(--tg-font); }
.note h3 { font-size: 1.06rem; margin: 0; font-stretch: 104%; }
.note p { grid-column: 2; margin: 0; color: var(--muted); font-size: 0.98rem; }
.note button { all: unset; cursor: pointer; }
.note button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

/* ---------------------------------------------------------------- spec rows (features) */
.spec { display: grid; gap: clamp(24px, 4vw, 56px); align-items: start; padding: clamp(40px, 5vw, 72px) 0; border-top: 1px solid var(--line); }
.spec:first-of-type { border-top: 0; padding-top: 0; }
@media (min-width: 1000px) {
  .spec { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .spec.flip > :first-child { order: 2; }
}
.spec h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); }
.spec .lede { margin-bottom: 1.25rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.checks li { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1.4rem 1fr; gap: 10px; }
.checks li::before { content: ""; width: 10px; height: 10px; margin-top: 0.55em; border-radius: 50%; border: 2px solid var(--pass); }
.checks b { font-weight: 680; }
.checks span { color: var(--muted); }
.cmds { display: flex; flex-wrap: wrap; gap: 6px; margin: 1rem 0 0; padding: 0; list-style: none; }
.cmds li { margin: 0; }
.cmds code { display: inline-block; padding: 3px 8px; font-size: 0.86rem; }
.figure { margin: 0; }
.figure > img, .cards-2 .figure > img { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%; }
.figure figcaption { margin-top: 10px; font-size: 0.86rem; color: var(--muted); }
.stack { display: grid; gap: 16px; }
.cards-2 { display: grid; gap: 16px; }
@media (min-width: 640px) { .cards-2 { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- generic blocks */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: clamp(20px, 3vw, 32px); }
.grid-3 { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.callout { border-left: 3px solid var(--warn); background: var(--surface); padding: 14px 18px; border-radius: 0 var(--radius-m) var(--radius-m) 0; margin: 1.5rem 0; }
.callout.info { border-left-color: var(--accent); }
.callout p { margin: 0 0 0.4rem; }
.callout p:last-child { margin: 0; }
.placeholder { border: 2px dashed var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); padding: 14px 18px; border-radius: var(--radius-m); margin: 1.25rem 0; }
.placeholder strong { color: var(--warn); }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag.grey { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* steps: a real sequence (how to start) */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.steps li { counter-increment: s; margin: 0; padding: 22px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; margin-bottom: 12px; }
.steps h3 { font-size: 1.12rem; }
.steps p { margin: 0; color: var(--muted); }

/* chains */
.chain-groups { display: grid; gap: 40px; }
.chain-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 8px; }
.chain-list li { margin: 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); display: flex; flex-direction: column; gap: 2px; }
.chain-list .n { font-weight: 680; }
.chain-list .d { font-size: 0.85rem; color: var(--muted); }
.count { font-stretch: 125%; font-weight: 820; font-size: clamp(3rem, 2rem + 4vw, 5.4rem); line-height: 0.9; letter-spacing: -0.04em; }
.count-row { display: grid; gap: 20px; margin-top: 2rem; }
@media (min-width: 768px) { .count-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.count-row > div { border-top: 2px solid var(--text); padding-top: 14px; }
.count-row p { margin: 10px 0 0; color: var(--muted); }

/* compare table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
thead th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; font-stretch: 108%; white-space: nowrap; }
tbody th { font-weight: 600; min-width: 190px; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr.group th { background: var(--bg-alt); color: var(--muted); font-size: 0.82rem; font-weight: 700; padding-top: 16px; }
.compare td { min-width: 180px; }
.compare td.us { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.yes::before { content: "✓"; color: var(--pass); font-weight: 800; margin-right: 6px; }
.no::before { content: "✗"; color: var(--fail); font-weight: 800; margin-right: 6px; }
.nd { color: var(--muted); font-style: italic; }
.compare tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.after-table { margin: 40px 0 8px; }
.after-table h2, #sources { font-size: 1.15rem; font-stretch: 105%; margin-top: 0; }
#sources { margin-top: 32px; }
sup a { text-decoration: none; font-size: 0.75em; padding: 0 1px; }
.sources { font-size: 0.82rem; color: var(--muted); }
.sources li { overflow-wrap: anywhere; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.faq summary { cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 650; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq .a { padding: 0 18px 16px; color: var(--muted); }
.faq .a p:last-child { margin: 0; }

/* before / after */
.ba { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .ba { grid-template-columns: 1fr 1fr; } }
.ba h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.chapters { columns: 2 260px; column-gap: 32px; padding-left: 1.4rem; }
.chapters li { break-inside: avoid; margin: 0 0 12px; }
.chapters b { display: block; }
.scopes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 1.25rem 0; padding: 0; list-style: none; }
.scopes li { margin: 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; }
.scopes li.gt { border: 0; background: none; padding: 0 2px; color: var(--muted); font-weight: 700; }

/* token */
.addr { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-m); }
.addr code { background: none; border: 0; padding: 0; font-size: 0.95rem; flex: 1 1 280px; overflow-wrap: anywhere; }
.linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.linklist li { margin: 0; }
.linklist a { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); text-decoration: none; color: var(--text); font-weight: 600; }
.linklist a:hover { border-color: var(--accent); color: var(--text); }
.linklist a span { color: var(--muted); font-weight: 400; font-size: 0.9rem; overflow-wrap: anywhere; text-align: right; }

/* team */
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 768px) { .people { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.people li { margin: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.people .who { font-size: 1.25rem; font-weight: 760; font-stretch: 112%; }
.people .role { color: var(--muted); margin-bottom: 10px; }

/* CTA band */
.cta-band { display: grid; gap: 24px; align-items: center; padding: clamp(28px, 4vw, 48px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band h2 { margin: 0 0 6px; }
.cta-band p { margin: 0; color: var(--muted); }

/* docs */
.doc-link { display: block; text-decoration: none; color: var(--text); transition: border-color .15s ease; }
.doc-link:hover { color: var(--text); border-color: var(--accent); }
.doc-link .muted { margin: 0; }
.h3 { font-size: 1.3rem; font-weight: 700; font-stretch: 108%; line-height: 1.2; }
.guide h2 { border-top: 1px solid var(--line); padding-top: 2rem; }
.guide .table-wrap { margin: 1rem 0 1.5rem; }
td code { white-space: nowrap; }

/* ---------------------------------------------------------------- footer */
.site-foot { border-top: 1px solid var(--line); padding: 56px 0 40px; background: var(--bg-alt); font-size: 0.95rem; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); } }
.foot-brand { grid-column: 1 / -1; }
@media (min-width: 900px) { .foot-brand { grid-column: auto; } }
.foot-grid h2 { font-size: 0.95rem; font-stretch: 100%; letter-spacing: 0; margin-bottom: 10px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin: 0 0 6px; }
.foot-grid a { color: var(--muted); text-decoration: none; }
.foot-grid a:hover { color: var(--text); text-decoration: underline; }
.foot-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* render long pages lazily: sections below the fold are laid out when they come near the viewport */
.spec, main > .section:not(:first-child) { content-visibility: auto; contain-intrinsic-size: auto 900px; }

/* alignment and small-screen table */
.ba .tg, .decode .tg { margin-inline: 0; }
@media (max-width: 599px) {
  tbody th { min-width: 132px; }
  .compare td { min-width: 150px; }
  th, td { padding: 10px; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
