:root {
  color-scheme: light;
  --cream: #fff7e7;
  --paper: #fffcf4;
  --purple: #241b35;
  --violet: #6f4daf;
  --coral: #ff765f;
  --lime: #c9f05d;
  --yellow: #fff0a8;
  --ink: #30283c;
  --muted: #716979;
  --line: #d8ccb9;
  --display: "Bricolage Grotesque", Impact, sans-serif;
  --body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--violet);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration-color: color-mix(in srgb, var(--violet) 45%, transparent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover { color: #4c2e86; text-decoration-color: currentColor; }
a:focus-visible {
  border-radius: 4px;
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}

.doc-masthead {
  background: var(--purple);
  border-bottom: 4px solid var(--lime);
  color: var(--cream);
}
.masthead-inner {
  width: min(1120px, 100%);
  min-height: 86px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.doc-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 11px;
  color: var(--cream);
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  text-decoration: none;
}
.doc-brand:hover { color: var(--lime); }
.doc-brand img { width: 42px; height: 42px; }
.doc-brand span span { color: var(--coral); }
.doc-nav { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.doc-nav a {
  min-height: 42px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 247, 231, .22);
  border-radius: 999px;
  color: var(--cream);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}
.doc-nav a:hover,
.doc-nav a[aria-current="page"] { background: var(--lime); border-color: var(--lime); color: var(--purple); }

.wrap {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 48px 32px 64px;
}
.crumb {
  margin: 0 0 28px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .025em;
}
.crumb a { color: var(--violet); }
.crumb > span:not(:last-child) { color: var(--coral); }

h1, h2, h3, h4 {
  color: var(--purple);
  font-family: var(--display);
  font-weight: 800;
  text-wrap: balance;
}
h1 {
  max-width: 19ch;
  margin: 0 0 20px;
  font-size: clamp(2rem, 5vw, 3.15rem);
  letter-spacing: -.045em;
  line-height: 1.08;
}
h2 {
  margin: 48px 0 14px;
  padding-top: 6px;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  letter-spacing: -.025em;
  line-height: 1.25;
}
h2::before { content: "✳"; margin-right: .5em; color: var(--coral); font-size: .66em; vertical-align: .16em; }
h3 { margin: 32px 0 8px; font-size: 1.12rem; line-height: 1.4; }
h4 { margin: 26px 0 8px; font-size: 1rem; line-height: 1.45; }
p { max-width: 74ch; margin: 0 0 18px; }
ul, ol {
  max-width: 76ch;
  margin: 0 0 22px;
  padding-left: 1.45rem;
}
li { padding-left: .24rem; }
li + li { margin-top: 8px; }
li::marker { color: var(--coral); font-weight: 800; }
strong { color: var(--purple); font-weight: 600; }
em { color: var(--ink); }
code {
  padding: .12em .36em;
  border: 1px solid #d8c99d;
  border-radius: 5px;
  background: #fff4c9;
  color: #4b3569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  overflow-wrap: anywhere;
}
hr { height: 1px; margin: 38px 0; border: 0; background: var(--line); }
blockquote {
  max-width: 76ch;
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid #e2ce72;
  border-left: 6px solid var(--coral);
  border-radius: 12px;
  background: var(--yellow);
  color: #493d35;
}
blockquote p:last-child { margin-bottom: 0; }

table {
  width: 100%;
  margin: 24px 0 30px;
  border-collapse: separate;
  border-spacing: 0;
  display: block;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: .9rem;
  line-height: 1.55;
}
th, td { min-width: 145px; padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eee5ff; color: var(--purple); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child { border-right: 0; }

footer {
  margin-top: 56px;
  padding: 24px;
  border: 2px solid var(--purple);
  border-radius: 14px;
  background: var(--coral);
  color: var(--purple);
  font-size: .88rem;
  font-weight: 600;
}
footer a { color: var(--purple); text-decoration-color: rgba(36, 27, 53, .45); }
footer a:hover { color: var(--purple); text-decoration-color: currentColor; }
.footer-back {
  margin: 0 0 12px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--purple);
  color: var(--cream);
  text-decoration: none;
}
.footer-back:hover { color: var(--lime); }

@media (max-width: 640px) {
  .masthead-inner { min-height: 0; padding: 15px 20px; align-items: flex-start; flex-direction: column; gap: 14px; }
  .doc-brand { font-size: 1.2rem; }
  .doc-brand img { width: 36px; height: 36px; }
  .doc-nav { width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .doc-nav a { flex: 0 0 auto; min-height: 40px; padding-inline: 12px; }
  .wrap { padding: 36px 20px 48px; }
  .crumb { margin-bottom: 22px; }
  h1 { font-size: clamp(1.9rem, 9vw, 2.5rem); }
  h2 { margin-top: 40px; }
  blockquote { padding: 17px; }
  footer { margin-top: 44px; padding: 20px; }
}

@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  .doc-masthead, .crumb, .footer-back { display: none; }
  .wrap { width: 100%; max-width: none; padding: 0; }
  a { color: inherit; text-decoration: underline; }
  h1, h2, h3, h4, strong { color: #111; }
  h2 { break-after: avoid; }
  p, li, blockquote, table { break-inside: avoid; }
  blockquote { border-color: #999; background: #f4f4f4; }
  table { display: table; overflow: visible; }
  footer { margin-top: 32px; padding: 14px 0 0; border: 0; border-top: 1px solid #999; border-radius: 0; background: none; }
}

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