:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #0e0e12;
  --ink-2: #4b4b57;
  --ink-3: #777783;
  --line: #e9e7e1;
  --blue: #3d5afe;
  --yellow: #ffd23f;
  --yellow-ink: #1a1400;
  --grey-block: #efeeea;
  --shadow: 0 2px 6px rgba(14, 14, 18, 0.06), 0 18px 40px -20px rgba(14, 14, 18, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f13;
    --surface: #18181e;
    --ink: #f4f3ef;
    --ink-2: #bdbcc6;
    --ink-3: #9494a0;
    --line: #2a2a33;
    --blue: #6680ff;
    --yellow: #ffd23f;
    --grey-block: #1d1d24;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 40px -20px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  padding: 0 16px 40px;
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 520px) { body { padding-inline: 20px; } }
.wrap { max-width: 1040px; margin: 0 auto; }
h1, h2, h3 {
  margin: 0;
  font-family: "Bricolage Grotesque", "DM Sans", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
p { margin: 0; }
a { color: inherit; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #3d5afe;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
nav ul, footer ul {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav ul { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
nav a, footer a { text-decoration: none; }
nav ul a:hover, footer a:hover { color: var(--ink); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: #3d5afe;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

.pagehead { padding-block: clamp(30px, 5vw, 56px) 0; }
.eyebrow {
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pagehead h1 { max-width: 16ch; margin-top: 14px; font-size: clamp(34px, 6vw, 58px); }
.pagehead .lead { max-width: 56ch; margin-top: 18px; color: var(--ink-2); font-size: clamp(16.5px, 2vw, 19px); }
.chip {
  display: inline-block;
  margin-top: 22px;
  padding: 6px 15px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
}

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: clamp(28px, 4vw, 44px); }
@media (min-width: 940px) {
  .layout { grid-template-columns: minmax(0, 1fr) 244px; gap: 56px; align-items: start; }
  .doc { order: 1; }
  .toc { position: sticky; top: 24px; order: 2; }
}
.toc {
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.toc-title { color: var(--ink-3); font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.toc ul { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.toc a {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.toc a:hover { border-color: var(--ink-3); color: var(--ink); }
@media (min-width: 940px) {
  .toc ul { flex-flow: column nowrap; gap: 1px; }
  .toc a { display: block; padding: 6px 9px; border: 0; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
  .toc a:hover { background: var(--grey-block); }
}

.doc > section + section { margin-top: clamp(36px, 5vw, 54px); }
.doc h2 { font-size: clamp(22px, 2.8vw, 29px); scroll-margin-top: 20px; }
.doc h3 { margin-top: 22px; font-size: 18px; }
.doc p { max-width: 68ch; margin-top: 14px; color: var(--ink-2); }
.doc p strong, .doc li strong { color: var(--ink); font-weight: 700; }
.doc a { color: var(--blue); text-underline-offset: 3px; }
.doc ul, .doc ol { display: flex; max-width: 68ch; flex-direction: column; gap: 10px; margin: 16px 0 0; padding-left: 22px; }
.doc li { padding-left: 3px; color: var(--ink-2); }
.doc li::marker { color: var(--blue); font-weight: 700; }
.callout {
  padding: clamp(22px, 4vw, 34px);
  border-radius: 22px;
  background: var(--yellow);
  color: var(--yellow-ink);
  box-shadow: var(--shadow);
}
.callout h2 { font-size: clamp(21px, 2.6vw, 28px); }
.callout p, .callout li { color: inherit; }
.callout a { color: inherit; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card h3 { margin: 0; font-size: 18px; }
.card p { margin-top: 8px; font-size: 14.5px; }
.card a { font-weight: 700; }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: clamp(56px, 8vw, 88px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13.5px;
}
footer ul { gap: 18px; }
@media (max-width: 640px) {
  footer ul { flex-wrap: wrap; gap: 0 18px; }
  footer a { display: inline-block; padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}
