:root {
  color-scheme: dark;
  --ink: #0b0c0c;
  --ink-raised: #121515;
  --paper: #f4efe6;
  --paper-muted: #c7c0b4;
  --line: #363b39;
  --coral: #ff796c;
  --mint: #8fe3c4;
  --warning: #ffd49a;
  font-family: "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.68;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--paper);
  background:
    linear-gradient(90deg, transparent 0, transparent calc(50% - 0.5px), rgba(143, 227, 196, 0.045) 50%, transparent calc(50% + 0.5px)),
    repeating-linear-gradient(0deg, transparent 0, transparent 31px, rgba(244, 239, 230, 0.025) 32px),
    var(--ink);
}

a {
  color: var(--mint);
  text-decoration-color: rgba(143, 227, 196, 0.55);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--paper);
  text-decoration-color: var(--coral);
}

a:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 4px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 12, 12, 0.96);
}

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

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

.wordmark,
.eyebrow,
.notice-id,
.toc-title,
.section-number,
.meta-line {
  font-family: "Cascadia Mono", Consolas, monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.wordmark {
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.site-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 0.88rem;
}

.site-nav a[aria-current="page"] {
  color: var(--paper);
  text-decoration-color: var(--coral);
}

.page-shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 740px);
  justify-content: center;
  gap: 64px;
  padding-block: 72px 96px;
}

.notice-rail {
  align-self: start;
  position: sticky;
  top: 32px;
  border-top: 3px solid var(--coral);
  padding-top: 14px;
}

.notice-id {
  margin: 0;
  color: var(--coral);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
}

.rail-rule {
  width: 38px;
  height: 1px;
  margin: 20px 0;
  background: var(--line);
}

.meta-line {
  margin: 0 0 9px;
  color: var(--paper-muted);
  font-size: 0.68rem;
  line-height: 1.5;
}

.toc-title {
  margin: 28px 0 8px;
  color: var(--paper-muted);
  font-size: 0.65rem;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  border-top: 1px solid var(--line);
}

.toc a {
  display: block;
  padding: 9px 0;
  font-size: 0.78rem;
  line-height: 1.35;
  text-decoration: none;
}

main {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 700;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.lede {
  max-width: 62ch;
  margin: 30px 0 0;
  color: var(--paper-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.summary,
.callout {
  margin: 42px 0 0;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint);
  background: var(--ink-raised);
}

.callout {
  margin-bottom: 22px;
}

.mobile-toc {
  display: none;
}

.callout.warning {
  border-left-color: var(--warning);
}

.callout.coral {
  border-left-color: var(--coral);
}

.summary h2,
.callout h2,
.callout h3 {
  margin-top: 0;
}

section {
  padding-top: 52px;
  scroll-margin-top: 24px;
}

section + section {
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.section-number {
  display: block;
  margin-bottom: 9px;
  color: var(--coral);
  font-size: 0.68rem;
  font-weight: 700;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.55rem, 4vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h3 {
  margin: 32px 0 10px;
  font-size: 1.12rem;
  line-height: 1.35;
}

p,
ul,
ol {
  max-width: 74ch;
}

p {
  margin: 0 0 18px;
}

ul,
ol {
  margin: 14px 0 22px;
  padding-left: 1.35em;
}

li {
  margin-block: 8px;
  padding-left: 0.25em;
}

li::marker {
  color: var(--coral);
}

strong {
  color: #fffaf1;
  font-weight: 700;
}

code {
  overflow-wrap: anywhere;
  color: var(--mint);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.88em;
}

.site-footer {
  padding: 30px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--paper-muted);
  font-size: 0.83rem;
}

.site-footer p {
  margin: 0 0 8px;
}

@media (max-width: 820px) {
  :root {
    font-size: 16px;
  }

  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 32px, 740px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-block: 17px;
  }

  .site-nav {
    width: 100%;
    gap: 2px 22px;
  }

  .page-shell {
    display: block;
    padding-block: 38px 72px;
  }

  .notice-rail {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 18px;
    margin-bottom: 30px;
  }

  .notice-id,
  .rail-rule,
  .toc-title,
  .toc {
    grid-column: 1 / -1;
  }

  .notice-rail .toc-title,
  .notice-rail .toc {
    display: none;
  }

  .mobile-toc {
    display: block;
    margin: 22px 0 4px;
    border-block: 1px solid var(--line);
  }

  .mobile-toc summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--mint);
    cursor: pointer;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    list-style: none;
    text-transform: uppercase;
  }

  .mobile-toc summary::-webkit-details-marker {
    display: none;
  }

  .mobile-toc summary::after {
    content: "+";
    color: var(--coral);
    font-size: 1.15rem;
  }

  .mobile-toc[open] summary::after {
    content: "−";
  }

  .mobile-toc .toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
    padding-bottom: 10px;
  }

  .mobile-toc .toc a {
    width: 100%;
  }

  .rail-rule {
    margin: 11px 0;
  }

  .toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
  }

  .toc li {
    border-top: 0;
  }

  .toc a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  h1 {
    font-size: clamp(2.6rem, 14vw, 4.5rem);
  }

  .summary,
  .callout {
    padding: 20px;
  }
}

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

@media print {
  :root {
    color-scheme: light;
    font-size: 11pt;
    --ink: #fff;
    --ink-raised: #fff;
    --paper: #111;
    --paper-muted: #333;
    --line: #aaa;
    --coral: #7a1f18;
    --mint: #075842;
    --warning: #704000;
  }

  body,
  .site-header {
    background: #fff;
  }

  .site-nav,
  .toc {
    display: none;
  }

  .page-shell {
    display: block;
    width: 100%;
    padding: 24px 0;
  }

  .notice-rail {
    position: static;
    margin-bottom: 28px;
  }

  h1 {
    font-size: 40pt;
  }

  a {
    color: #075842;
    text-decoration: underline;
  }

  strong {
    color: inherit;
  }

  section,
  .callout,
  .summary {
    break-inside: avoid;
  }
}
