/* Shared styles for docs.html, terms.html and 404.html. */
:root {
  --bg: #0c0c0d;
  --paper: #f3f1ec;
  --ink: #0c0c0d;
  --muted: #f3f1ec8f;
  --line: #f3f1ec17;
  --green: #22d36b;
  --green-soft: #9df0bf;
  --surface-2: #1a1a1c;
  --tick-down: #ff5c7a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  background: var(--bg);
  color: var(--paper);
  font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
.num { font-variant-numeric: tabular-nums; }

.bg-glow { pointer-events: none; position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-glow span { position: absolute; border-radius: 50%; background: var(--green); filter: blur(140px); }
.bg-glow .g1 { top: -10%; left: 4%; width: 460px; height: 460px; opacity: .12; }

.page { position: relative; z-index: 10; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 767px) { .wrap { padding: 0 16px; } }

/* ---------- header ---------- */
header.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(12, 12, 13, .85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
header.top .wrap {
  display: flex; align-items: center; gap: 40px;
  height: 72px; border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo svg { height: 28px; width: auto; }
.logo .word { font-size: 27px; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.logo .word em { font-style: normal; color: var(--green); }
nav.main { display: none; flex: 1; align-items: center; justify-content: center; gap: 20px; }
nav.main a { font-size: 15px; font-weight: 500; color: var(--muted); transition: color .15s; }
nav.main a:hover, nav.main a.on { color: var(--paper); }
@media (min-width: 1024px) { nav.main { display: flex; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px; border-radius: 12px; margin-left: auto;
  font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap;
  background: var(--green); color: var(--ink); transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
@media (min-width: 1024px) { .btn { margin-left: 0; } }

.kicker { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--green-soft); }

/* ---------- intro ---------- */
.intro { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.intro h1 { margin: 14px 0 16px; font-size: 52px; font-weight: 800; line-height: .95; letter-spacing: -.04em; }
.intro h1 span { color: var(--green); }
@media (min-width: 768px) { .intro h1 { font-size: 76px; } }
.intro p { max-width: 640px; font-size: 18px; line-height: 1.5; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
@media (min-width: 768px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fact { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); }
.fact b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.fact span { font-size: 13px; color: var(--muted); }

/* ---------- layout ---------- */
.docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 40px 0 24px; }
@media (min-width: 960px) { .docs { grid-template-columns: 220px minmax(0, 1fr); } }
.toc { display: none; }
@media (min-width: 960px) {
  .toc { display: block; position: sticky; top: 104px; align-self: start; }
}
.toc p { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); font-size: 14px; color: var(--muted); transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--paper); }
.toc a.on { color: var(--paper); border-left-color: var(--green); }

/* ---------- article ---------- */
article { max-width: 720px; }
article section { padding: 8px 0 40px; }
article section + section { border-top: 1px solid var(--line); padding-top: 40px; }
article h2 { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; margin-bottom: 14px; }
article h2 span { color: var(--green); }
article h3 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin: 24px 0 8px; }
article p { font-size: 16px; line-height: 1.7; color: var(--muted); }
article p + p { margin-top: 12px; }
article strong { color: var(--paper); font-weight: 600; }
article ul { margin: 12px 0 0 0; padding-left: 20px; display: grid; gap: 8px; }
article li { font-size: 16px; line-height: 1.6; color: var(--muted); }
article li::marker { color: var(--green); }
article a.inl { color: var(--green-soft); font-weight: 600; }
article a.inl:hover { color: var(--paper); }

.sides { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 20px; }
@media (min-width: 640px) { .sides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.side {
  padding: 20px; border-radius: 18px;
  background: linear-gradient(rgba(255, 255, 255, .067), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px rgba(255, 255, 255, .1);
}
.side .tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.side.long .tag { background: var(--green); color: var(--ink); }
.side.short .tag { background: var(--paper); color: var(--ink); }
.side h3 { margin: 12px 0 6px; }
.side p { font-size: 15px; line-height: 1.6; }
.side dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.side dt { color: var(--muted); }
.side dd { text-align: right; font-weight: 600; }

.steps { list-style: none; padding: 0 !important; counter-reset: s; gap: 0 !important; margin-top: 20px !important; }
.steps li { position: relative; padding: 0 0 22px 48px; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; color: var(--ink); background: var(--green);
}
.steps li::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps b { display: block; color: var(--paper); font-weight: 700; }

table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 0; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
td { color: var(--paper); }
th:last-child, td:last-child { text-align: right; }
td.m { color: var(--muted); }

.note {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid rgba(34, 211, 107, .25); background: rgba(34, 211, 107, .06);
  font-size: 14px; line-height: 1.6; color: var(--paper);
}

.up { color: var(--green) !important; }
.down { color: var(--tick-down) !important; }
.formula {
  margin-top: 18px; padding: 16px 18px; border-radius: 14px;
  background: rgba(12, 12, 13, .6); border: 1px solid var(--line);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.formula p { font-size: 14px; color: var(--paper); line-height: 1.8; }
.formula p + p { margin-top: 0; }
.formula span { color: var(--green-soft); }
.formula em { font-style: normal; color: var(--muted); }

.calc {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 14px; padding: 20px; border-radius: 18px;
  background: linear-gradient(rgba(255, 255, 255, .067), rgba(255, 255, 255, .02));
  border: 1px solid rgba(255, 255, 255, .09);
}
@media (min-width: 640px) { .calc { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.calc-in { display: grid; gap: 16px; }
.calc label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.calc label b { float: right; color: var(--paper); }
.calc .field { position: relative; }
.calc .field i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--muted); }
.calc input[type=number] {
  width: 100%; height: 44px; padding: 0 52px 0 14px; border-radius: 12px;
  font: inherit; font-size: 15px; color: var(--paper);
  background: rgba(12, 12, 13, .6); border: 1px solid var(--line);
}
.calc input[type=number]:focus { outline: none; border-color: rgba(34, 211, 107, .6); }
.calc input[type=range] { width: 100%; accent-color: var(--green); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.seg button {
  height: 36px; border: 0; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); background: none;
}
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); }
.calc-out { display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 10px 16px; font-size: 15px; }
.calc-out dt { color: var(--muted); }
.calc-out dd { text-align: right; font-weight: 700; }
#cNet { font-size: 20px; }

details { border-bottom: 1px solid var(--line); }
details:first-of-type { margin-top: 12px; }
summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0; cursor: pointer; list-style: none;
  font-size: 16px; font-weight: 700; letter-spacing: -.01em;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 22px; font-weight: 500; color: var(--muted); transition: transform .15s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding-bottom: 16px; }

/* ---------- footer ---------- */
footer { padding: 40px 0 64px; }
footer .inner { border-top: 1px solid var(--line); padding-top: 40px; display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; }
footer .about { max-width: 300px; }
footer .about p { font-size: 14px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
footer .about .x { display: inline-block; margin-top: 18px; font-size: 14px; color: var(--muted); }
footer .about .x:hover { color: var(--paper); }
footer .cols { display: flex; gap: 56px; }
footer h4 { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
footer ul { list-style: none; display: grid; gap: 10px; }
footer ul a { font-size: 14px; color: var(--muted); transition: color .15s; }
footer ul a:hover { color: var(--paper); }

@media (max-width: 380px) {
  header.top .wrap { gap: 16px; }
  .logo svg { height: 22px; }
  .logo .word { font-size: 21px; }
  .btn { padding: 0 12px; font-size: 14px; }
  .intro h1 { font-size: 40px; }
  .fact b { font-size: 19px; }
}

/* ---------- docs menu on small screens: a sticky row of chips ---------- */
@media (max-width: 959px) {
  .toc {
    display: flex; gap: 6px; position: sticky; top: 72px; z-index: 30;
    margin: -40px -16px 0; padding: 10px 16px; overflow-x: auto; scrollbar-width: none;
    background: rgba(12, 12, 13, .92); border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc p { display: none; }
  .toc a { flex-shrink: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; white-space: nowrap; }
  .toc a.on { border-color: var(--green); }
  html { scroll-padding-top: 136px; }
}

/* ---------- footer legal line ---------- */
footer .legal { width: 100%; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: var(--muted); }
footer .legal a { text-decoration: underline; }

/* ---------- 404 ---------- */
.lost { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 64px 0; text-align: center; }
.lost h1 { font-size: 96px; font-weight: 800; letter-spacing: -.05em; line-height: .9; }
.lost h1 span { color: var(--green); }
.lost p { max-width: 420px; font-size: 17px; color: var(--muted); }
.lost .btn { margin: 10px 0 0; height: 48px; padding: 0 24px; }

@media (max-width: 480px) { footer .cols { gap: 32px; } }
