:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --ink: #0b0d12;
  --ink-2: #4a4f5a;
  --muted: #747b89;
  --line: #e8e9ed;
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --accent-soft: #eef0ff;
  --success: #047857;
  --carbon: #0e1016;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-dark);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--accent);
}

a:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.32);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  transform: translateY(-150%);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 251, 0.9);
  border-bottom: 1px solid rgba(232, 233, 237, 0.9);
  backdrop-filter: blur(14px);
}

.nav,
.page-shell,
.site-footer {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  color: var(--ink);
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.logo::after {
  content: ".";
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link svg {
  width: 17px;
  height: 17px;
}

.page-shell {
  padding: 72px 0 96px;
}

.document-header {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 64px);
  color: #fff;
  background:
    radial-gradient(circle at 92% 10%, rgba(129, 140, 248, 0.3), transparent 32%),
    linear-gradient(145deg, #171a25 0%, var(--carbon) 70%);
  border: 1px solid #1e2230;
  border-radius: 26px;
  box-shadow: 0 26px 70px -42px rgba(11, 13, 18, 0.55);
}

.document-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(90deg, transparent 28%, #000 100%);
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
  color: #a5b4fc;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
}

h1,
h2,
h3 {
  font-family: "Sora", system-ui, sans-serif;
  letter-spacing: -0.025em;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  line-height: 1.04;
  font-weight: 600;
}

.dek {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 24px 0 0;
  color: #c5c9d5;
  font-size: 1.05rem;
}

.meta-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid #303649;
  border-radius: 999px;
  color: #aeb5c5;
  background: rgba(14, 16, 22, 0.55);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
}

.document-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(40px, 7vw, 82px);
  align-items: start;
  margin-top: 56px;
}

.toc {
  position: sticky;
  top: 104px;
}

.toc-title {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 7px 0 7px 18px;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.42;
  text-decoration: none;
  border-left: 2px solid transparent;
  transform: translateX(-1px);
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--accent-dark);
  border-left-color: var(--accent);
}

.document {
  min-width: 0;
}

.notice {
  margin: 0 0 52px;
  padding: 24px 26px;
  background: var(--accent-soft);
  border: 1px solid #dfe2ff;
  border-radius: var(--radius);
}

.notice strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.98rem;
}

.notice p {
  margin: 0;
  color: #363b55;
  font-size: 0.95rem;
}

.document section {
  margin-top: 52px;
}

.document section:first-of-type {
  margin-top: 0;
}

.document h2 {
  margin: 0 0 18px;
  padding-top: 4px;
  color: var(--ink);
  font-size: clamp(1.42rem, 2.3vw, 1.85rem);
  line-height: 1.25;
  font-weight: 600;
}

.document h3 {
  margin: 30px 0 10px;
  font-size: 1.03rem;
  line-height: 1.4;
  font-weight: 600;
}

.document p,
.document li {
  color: var(--ink-2);
}

.document p {
  margin: 0 0 16px;
}

.document ul,
.document ol {
  margin: 14px 0 20px;
  padding-left: 1.35rem;
}

.document li {
  margin: 8px 0;
  padding-left: 0.25rem;
}

.document strong {
  color: var(--ink);
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.definition-card {
  padding: 19px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.definition-card strong {
  display: block;
  margin-bottom: 5px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 0.92rem;
}

.definition-card span {
  display: block;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
}

.callout {
  margin: 26px 0;
  padding: 20px 22px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 8px 28px -24px rgba(11, 13, 18, 0.35);
}

.callout p:last-child {
  margin-bottom: 0;
}

.contact-card {
  margin-top: 54px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact-card h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 0 44px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.footer-links a {
  color: var(--ink-2);
  text-decoration: none;
}

@media (max-width: 800px) {
  .nav,
  .page-shell,
  .site-footer {
    width: min(100% - 32px, 1120px);
  }

  .page-shell {
    padding: 36px 0 64px;
  }

  .document-header {
    border-radius: 20px;
  }

  .document-layout {
    grid-template-columns: 1fr;
    gap: 34px;
    margin-top: 38px;
  }

  .toc {
    position: static;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .toc ol {
    columns: 2;
    column-gap: 20px;
    border-left: 0;
  }

  .toc a {
    padding-left: 0;
    border-left: 0;
    transform: none;
  }

  .definition-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .nav {
    min-height: 66px;
  }

  .back-link span {
    display: none;
  }

  .document-header {
    padding: 30px 24px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .toc ol {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .toc,
  .site-footer {
    display: none;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .document-header {
    padding: 0 0 24px;
    color: #000;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .eyebrow,
  .dek,
  .pill {
    color: #333;
  }

  .document-layout {
    display: block;
    margin-top: 24px;
  }

  .document section {
    break-inside: avoid;
  }
}
