:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f7f8fa;
  --panel-2: #ffffff;
  --line: #e5e8ee;
  --muted: #667085;
  --muted-2: #98a2b3;
  --text: #090b10;
  --accent: #23bfd3;
  --accent-2: #3c7be6;
  --accent-3: #654dde;
  --accent-gradient: linear-gradient(100deg, #23bfd3 0%, #348ce9 44%, #654dde 100%);
  --soft-gradient: linear-gradient(100deg, rgba(35, 191, 211, 0.12), rgba(52, 140, 233, 0.1), rgba(101, 77, 222, 0.12));
  --shadow: rgba(52, 140, 233, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover,
.text-link:hover,
.sidebar a:hover,
.toc a:hover {
  color: var(--accent-3);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 34px var(--shadow);
}

.button.ghost {
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    var(--accent-gradient) border-box;
  color: var(--accent-3);
}

.button.large {
  min-height: 48px;
  padding: 0 24px;
}

.icon-link {
  font-weight: 800;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  min-height: calc(100vh - 64px);
}

.sidebar,
.toc {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 22px 12px;
  background: #fbfcfd;
}

.toc {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.side-group {
  margin-bottom: 28px;
}

.side-group p,
.toc p {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar a,
.toc a {
  display: block;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 14px;
  border-radius: 6px;
}

.sidebar a.active {
  color: var(--accent-3);
  background: var(--soft-gradient);
}

.content {
  width: min(820px, calc(100vw - 520px));
  margin: 0 auto;
  padding: 56px 36px 92px;
}

.section {
  scroll-margin-top: 96px;
  margin-bottom: 70px;
}

.hero {
  min-height: 760px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 30%, rgba(34, 184, 199, 0.14), transparent 28%),
    radial-gradient(circle at 76% 62%, rgba(107, 53, 215, 0.12), transparent 30%);
}

.eyebrow {
  width: fit-content;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(56px, 7vw, 92px);
  line-height: 1.05;
  letter-spacing: 0;
}

h1 .h1-line {
  display: block;
  color: var(--text);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  padding-bottom: 0;
}

h1 .h1-indent {
  padding-left: 0.18em;
}

h1 span:not(.h1-line) {
  padding-left: 0.18em;
  display: block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 0.1em;
}

h2 {
  width: fit-content;
  margin-bottom: 22px;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: 0;
  border-bottom: 1px solid var(--accent-3);
}

h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

p {
  color: var(--muted);
  font-size: 16px;
}

.lead {
  max-width: 650px;
  font-size: 19px;
}

.hero-banner {
  display: block;
  width: min(600px, 100%);
  aspect-ratio: 3 / 1;
  object-fit: cover;
  margin: 18px 0 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
}

.text-link {
  color: var(--muted);
  font-weight: 700;
}

.signal-grid,
.info-row,
.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 38px;
}

.signal-grid div,
.info-row div,
.stat-strip div,
.step,
.code-card,
.callout,
.panel-preview,
.table,
details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.signal-grid div,
.stat-strip div {
  padding: 20px;
}

.signal-grid strong,
.stat-strip strong {
  display: block;
  color: var(--text);
  font-size: 23px;
  line-height: 1.1;
}

.signal-grid span,
.stat-strip span {
  color: var(--muted);
  font-size: 13px;
}

.steps {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.step {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  padding: 18px;
}

.step > span {
  color: #d5dae3;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.step p,
.info-row p {
  margin-bottom: 0;
}

.callout {
  margin: 24px 0;
  padding: 20px;
  border-color: rgba(107, 53, 215, 0.28);
  background: var(--soft-gradient);
}

.callout strong {
  color: var(--accent-3);
}

.callout.warning {
  border-color: rgba(101, 77, 222, 0.38);
  background: linear-gradient(100deg, rgba(35, 191, 211, 0.08), rgba(101, 77, 222, 0.1));
}

.callout.warning strong {
  color: var(--accent-3);
}

.code-card {
  margin: 18px 0;
  overflow: hidden;
}

.code-title {
  padding: 12px 16px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 13px;
  font-weight: 800;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  color: #202632;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}

code {
  color: var(--accent-3);
  font-size: 0.92em;
}

.info-row {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 22px;
}

.info-row div {
  padding: 18px;
}

.panel-preview {
  margin: 24px 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f4f7fa);
}

.panel-top {
  padding: 14px 18px;
  font-weight: 900;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 16px 18px;
}

.panel-body p {
  margin-bottom: 8px;
  font-size: 14px;
}

.panel-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.panel-buttons span {
  padding: 12px 10px;
  text-align: center;
  color: var(--accent-3);
  font-size: 12px;
  font-weight: 900;
  border-right: 1px solid var(--line);
}

.panel-buttons span:last-child {
  border-right: 0;
}

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.formula span {
  color: var(--accent-3);
  font-weight: 800;
}

.formula b {
  color: var(--muted);
}

.table {
  overflow: hidden;
  margin-top: 20px;
}

.table > div {
  display: grid;
  grid-template-columns: 190px 1fr;
  border-bottom: 1px solid var(--line);
}

.table > div:last-child {
  border-bottom: 0;
}

.table b,
.table span {
  padding: 12px 14px;
}

.table b {
  color: var(--accent-3);
  background: #ffffff;
}

.table span {
  color: var(--muted);
}

details {
  margin-top: 12px;
  padding: 16px 18px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }

  .content {
    width: min(820px, calc(100vw - 220px));
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
  }

  .topnav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }

  .topnav a:not(.button):not(.icon-link) {
    display: none;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-group {
    min-width: 180px;
    margin-bottom: 0;
  }

  .content {
    width: 100%;
    padding: 34px 18px 72px;
  }

  .hero {
    min-height: 560px;
  }

  h1 {
    font-size: 52px;
  }

  h2 {
    font-size: 30px;
  }

  .signal-grid,
  .info-row,
  .stat-strip,
  .panel-buttons {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .table > div {
    grid-template-columns: 1fr;
  }
}
