:root {
  --bg: #eef2fb;
  --surface: #ffffff;
  --surface-2: #f1f5fd;
  --surface-3: #e6ecfa;
  --text: #0f172a;
  --muted: #5a6678;
  --brand: #4f46e5;
  --brand-2: #4338ca;
  --brand-bright: #6366f1;
  --cyan: #06b6d4;
  --cyan-deep: #0e7490;
  --violet: #8b5cf6;
  --violet-deep: #6d28d9;
  --sky: #0ea5e9;
  --link: #4338ca;
  --link-hover: #312e9e;
  --border: #dbe3f2;
  --border-strong: #c4d0ea;
  --code-bg: #0f1830;
  --code-bg-2: #14213f;
  --header-height: 96px;
  --shadow: 0 12px 30px rgba(30, 41, 99, 0.12);
  --shadow-strong: 0 20px 44px rgba(30, 41, 99, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.8;
  color: var(--text);
  background:
    radial-gradient(1100px circle at 88% -4%, rgba(6, 182, 212, 0.12), transparent 42%),
    radial-gradient(900px circle at 2% 6%, rgba(139, 92, 246, 0.12), transparent 40%),
    linear-gradient(180deg, #f7f9ff, var(--bg) 45%, #e7ecf9);
  background-attachment: fixed;
}

:target {
  scroll-margin-top: calc(var(--header-height) + 12px);
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0.65rem;
  z-index: 20;
  height: var(--header-height);
  width: min(1460px, calc(100% - 1rem));
  margin: 0.65rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.05rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 242, 253, 0.92) 50%, rgba(224, 231, 250, 0.92));
  border: 1px solid rgba(79, 70, 229, 0.18);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(30, 41, 99, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  overflow: hidden;
  isolation: isolate;
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
}

.site-header::before {
  top: -1.5rem;
  left: 10%;
  width: 13rem;
  height: 13rem;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22), rgba(99, 102, 241, 0));
}

.site-header::after {
  right: -2rem;
  bottom: -3rem;
  width: 16rem;
  height: 16rem;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.35rem 0.45rem;
  border-radius: 18px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  transition: transform 0.18s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 26px rgba(30, 41, 99, 0.12);
}

.brand-mark-shell {
  width: 3.15rem;
  height: 3.15rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(238, 242, 253, 0.95));
  border: 1px solid rgba(79, 70, 229, 0.22);
  box-shadow: 0 14px 30px rgba(30, 41, 99, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brand:hover .brand-mark-shell {
  transform: rotate(-4deg) scale(1.04);
  box-shadow: 0 18px 34px rgba(30, 41, 99, 0.2);
}

.brand-mark {
  width: 2.45rem;
  height: 2.45rem;
  display: block;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.brand-kicker {
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}

.brand-text {
  font-size: 1rem;
  line-height: 1.15;
  color: #1f2440;
}

.site-nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: #25304a;
  font-size: 0.92rem;
  border: 1px solid rgba(79, 70, 229, 0.16);
  padding: 0.52rem 0.82rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 18px rgba(30, 41, 99, 0.07);
  transition: transform 0.16s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.site-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.3));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.site-nav a:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, 0.36);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 26px rgba(30, 41, 99, 0.13);
}

.site-nav a:hover::before {
  opacity: 1;
}

.site-nav a.is-active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(30, 41, 99, 0.22);
}

.site-nav a:nth-child(1).is-active {
  background: linear-gradient(135deg, #6366f1, #4338ca);
}

.site-nav a:nth-child(2).is-active {
  background: linear-gradient(135deg, #22d3ee, #0e7490);
}

.site-nav a:nth-child(3).is-active {
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
}

.site-nav a:nth-child(4).is-active {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.nav-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
}

.nav-home { background: var(--brand); }
.nav-core { background: var(--cyan); }
.nav-mono { background: var(--violet); }
.nav-pub { background: var(--sky); }

.site-main {
  width: min(1320px, 100% - 2rem);
  margin: 1.2rem auto 2rem;
  flex: 1;
}

.breadcrumbs {
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumbs a {
  color: var(--brand);
}

.page-cta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem 1.05rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 253, 0.98));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 24px rgba(30, 41, 99, 0.18);
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-pill:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: var(--shadow-strong);
  filter: saturate(1.08);
  color: #fff;
}

.cta-pill-icon {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
}

.cta-pill-gold {
  background: linear-gradient(135deg, #6366f1, #4338ca);
}

.cta-pill-olive {
  background: linear-gradient(135deg, #22d3ee, #0e7490);
}

.cta-pill-pumpkin {
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
}

.cta-pill-plum {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.crumb-sep {
  color: #9aa6bd;
}

.content-card,
.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 2.4vw, 2.6rem);
}

.content-card {
  line-height: 1.8;
}

/* Vertical rhythm — give the prose room to breathe */
.content-card p {
  margin: 0 0 1.3rem;
}

.content-card ul,
.content-card ol {
  margin: 0 0 1.4rem;
  padding-left: 1.5rem;
}

.content-card li {
  margin: 0.55rem 0;
}

.content-card li > ul,
.content-card li > ol {
  margin: 0.55rem 0 0.3rem;
}

.content-card pre,
.content-card .table-wrap,
.content-card blockquote {
  margin-top: 1.5rem;
  margin-bottom: 1.6rem;
}

.content-card td,
.content-card th {
  line-height: 1.7;
}

.related-card {
  margin-top: 1.25rem;
}

.related-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.related-card li {
  margin: 0.5rem 0;
}

h1, h2, h3 {
  line-height: 1.22;
  color: #131a30;
}

.content-card > h1:first-child {
  position: relative;
  margin-top: 0;
  margin-bottom: 1rem;
  padding: clamp(1.2rem, 2vw, 1.8rem);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 253, 0.98));
  box-shadow: var(--shadow);
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.03em;
  overflow: hidden;
}

.content-card > h1:first-child::before {
  content: "";
  position: absolute;
  inset: auto -3rem -3rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0));
}

.content-card > h1:first-child::after {
  content: "";
  display: block;
  width: 6rem;
  height: 0.4rem;
  margin-top: 0.9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--cyan), var(--violet));
}

.content-card > h1:first-child + p {
  margin-top: 0;
  margin-bottom: 1.75rem;
  padding: 1.2rem 1.3rem;
  border-left: 4px solid var(--brand);
  border-radius: 0 16px 16px 0;
  background: linear-gradient(135deg, rgba(241, 245, 253, 0.96), rgba(230, 236, 250, 0.96));
  font-size: 1.06rem;
  line-height: 1.8;
  color: #3a4259;
}

.content-card h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 2.6rem;
  margin-bottom: 1.2rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(219, 227, 242, 0.95);
  border-radius: 18px;
  background: linear-gradient(135deg, #f6f8ff, #e9eefb);
  box-shadow: 0 8px 18px rgba(30, 41, 99, 0.07);
}

.content-card h2::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.14);
}

.content-card h3 {
  margin-top: 2rem;
  margin-bottom: 0.9rem;
  padding-left: 1rem;
  border-left: 4px solid var(--violet);
  font-size: 1.2rem;
}

a {
  color: var(--link);
}

.content-card a:not(.cta-card):not(.cta-pill),
.related-card a,
.breadcrumbs a,
.site-footer a {
  text-decoration: none;
  background-image: linear-gradient(transparent calc(100% - 0.12rem), rgba(79, 70, 229, 0.4) 0);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  transition: color 0.2s ease, background-image 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

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

.content-card a:not(.cta-card):not(.cta-pill):hover,
.related-card a:hover,
.breadcrumbs a:hover,
.site-footer a:hover {
  background-image: linear-gradient(transparent calc(100% - 0.12rem), rgba(6, 182, 212, 0.6) 0);
  box-shadow: inset 0 -0.7rem 0 rgba(6, 182, 212, 0.12);
}

code:not([class*="language-"]) {
  padding: 0.08rem 0.32rem;
  border-radius: 0.45rem;
  background: rgba(79, 70, 229, 0.09);
  border: 1px solid rgba(79, 70, 229, 0.12);
  color: #3f3aac;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.88em;
}

pre,
pre[class*="language-"] {
  position: relative;
  overflow: auto;
  border-radius: 18px;
  padding: 1.1rem 1rem;
  border: 1px solid rgba(79, 70, 229, 0.28);
  background: linear-gradient(180deg, var(--code-bg) 0%, var(--code-bg-2) 100%);
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 14px 30px rgba(15, 23, 42, 0.28);
}

pre code,
pre[class*="language-"] code[class*="language-"] {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.65;
  text-shadow: none;
  color: inherit;
  background: transparent;
}

pre[class*="language-"]::before {
  content: "code";
  position: absolute;
  top: 0.55rem;
  left: 0.8rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

pre[class*="language-"] {
  padding-top: 2.4rem;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6b7a99;
  font-style: italic;
}

.token.punctuation {
  color: #94a3b8;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #fb7185;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #34d399;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #38bdf8;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #c4b5fd;
}

.token.function,
.token.class-name {
  color: #60a5fa;
}

.token.regex,
.token.important,
.token.variable {
  color: #fcd34d;
}

.token.important,
.token.bold {
  font-weight: 700;
}

.token.italic {
  font-style: italic;
}

.copy-button {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 75, 0.85);
  color: #cbd5f5;
  border-radius: 7px;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.copy-button:hover {
  transform: translateY(-1px);
  background: rgba(49, 64, 110, 0.95);
  border-color: rgba(103, 232, 249, 0.6);
  color: #fff;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 22px rgba(30, 41, 99, 0.07);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  border: 1px solid var(--border);
  text-align: left;
  padding: 0.62rem 0.7rem;
  vertical-align: top;
}

th {
  background: linear-gradient(135deg, #eef2fd, #e3eafa);
  color: #1f2748;
  font-weight: 700;
}

tbody tr:nth-child(even) td {
  background: rgba(241, 245, 253, 0.6);
}

blockquote {
  border-left: 4px solid var(--brand);
  margin: 1rem 0;
  padding: 0.5rem 0.9rem;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(135deg, rgba(241, 245, 253, 0.9), rgba(230, 236, 250, 0.9));
  color: #39415a;
}

/* Custom inline diagrams authored in content */
.content-card figure.diagram {
  margin: 1.5rem 0;
  padding: clamp(1rem, 2vw, 1.6rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(700px circle at 12% -10%, rgba(99, 102, 241, 0.08), transparent 45%),
    linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
}

.content-card figure.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.content-card figure.diagram figcaption {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.content-card svg {
  max-width: 100%;
}

.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.cta-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(130deg, #ffffff, #eef2fd);
  box-shadow: 0 12px 26px rgba(30, 41, 99, 0.1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.2s ease;
}

.cta-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-strong);
  border-color: rgba(79, 70, 229, 0.5);
}

.cta-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff, #cffafe);
  color: var(--brand-2);
}

.cta-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
}

.cta-text {
  font-weight: 600;
  color: #1f2748;
}

.click-boxes {
  display: grid;
  gap: 0.8rem;
}

.click-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.2rem 0.8rem;
  background: linear-gradient(135deg, #ffffff, #f1f5fd);
}

.click-box summary {
  cursor: pointer;
  padding: 0.55rem 0;
  font-weight: 600;
  color: #1f2748;
}

.task-list {
  padding-left: 0;
  list-style: none;
}

.task-list-item {
  list-style: none;
  margin: 0.7rem 0;
}

.task-list-control {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(219, 227, 242, 0.95);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f1f5fd);
  box-shadow: 0 10px 22px rgba(30, 41, 99, 0.07);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.task-list-control:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(30, 41, 99, 0.11);
  border-color: rgba(79, 70, 229, 0.35);
}

.task-list-checkbox {
  margin-top: 0.15rem;
  inline-size: 1.15rem;
  block-size: 1.15rem;
  accent-color: var(--brand);
  cursor: pointer;
  flex: 0 0 auto;
}

.task-list-text {
  flex: 1;
  color: #2a3247;
}

.task-list-item.is-checked .task-list-control {
  background: linear-gradient(135deg, rgba(207, 250, 254, 0.55), rgba(224, 231, 255, 0.65));
  border-color: rgba(6, 182, 212, 0.32);
}

.task-list-item.is-checked .task-list-text {
  color: #5a6678;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.faq-heading {
  margin-bottom: 1rem;
}

.faq-item {
  margin: 1.1rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(219, 227, 242, 0.95);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f1f5fd);
  box-shadow: 0 10px 22px rgba(30, 41, 99, 0.07);
  line-height: 1.8;
}

.faq-question {
  display: block;
  margin-bottom: 0.65rem;
  color: #131a30;
  font-size: 1.04rem;
}

.faq-answer-label {
  display: inline-block;
  margin-right: 0.35rem;
  color: var(--brand);
}

.faq-section-content + .faq-item {
  margin-top: 0.85rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
}

@media (min-width: 1280px) {
  .site-main {
    width: min(1380px, 100% - 3rem);
  }

  .content-card,
  .related-card {
    padding: clamp(1.4rem, 2vw, 2.4rem);
  }
}

@media (max-width: 880px) {
  .site-header {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    width: calc(100% - 1rem);
  }

  :root {
    --header-height: 136px;
  }

  .brand {
    width: 100%;
  }

  .brand-text {
    font-size: 0.94rem;
  }

  .page-cta-strip {
    padding: 0.85rem;
  }

  .cta-pill {
    width: 100%;
    justify-content: center;
  }

  .content-card > h1:first-child {
    padding: 1rem 1rem 1.15rem;
    font-size: clamp(1.9rem, 8vw, 2.5rem);
  }

  .task-list-control {
    padding-inline: 0.85rem;
  }
}
