:root {
  color-scheme: dark;
  --bg: #080808;
  --surface: #0a0a0d;
  --text: #fffff0;
  --muted: #aaa2af;
  --quiet: #726a78;
  --accent: #c084fc;
  --border: #2a1d35;
  --max: 76rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 240, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 240, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
  color: var(--text);
  font: 16px/1.75 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

a:hover {
  color: #e2c5ff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  transform: translateY(-200%);
  border: 1px solid var(--accent);
  background: var(--bg);
  padding: 0.7rem 1rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.page,
.site-footer {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem 1.25rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
}

.page {
  padding-block: clamp(4rem, 9vw, 8rem);
}

.hero {
  max-width: 68rem;
  padding-bottom: clamp(3rem, 8vw, 7rem);
  border-bottom: 1px solid var(--border);
}

.eyebrow,
.meta {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

h1 {
  max-width: 18ch;
  margin-top: 1.3rem;
  font-size: clamp(2.6rem, 6vw, 5rem);
}

h2 {
  margin-top: clamp(4rem, 9vw, 7rem);
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
}

h3 {
  margin-top: 2.75rem;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

p,
li {
  color: var(--muted);
}

.lead {
  max-width: 68ch;
  margin-top: 2rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.answer,
.prose,
.prose p,
.prose ul,
.prose ol {
  max-width: 72ch;
}

.answer {
  margin-top: 1.5rem;
  color: #ddd6e1;
  font-size: 1.08rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1px;
  margin-top: 2rem;
  background: var(--border);
  border: 1px solid var(--border);
}

.card {
  min-height: 100%;
  background: var(--surface);
  padding: clamp(1.4rem, 3vw, 2.25rem);
}

.card h3 {
  margin-top: 0;
}


.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1px;
  margin: 2rem 0;
  background: var(--border);
  border: 1px solid var(--border);
}

.fact {
  background: var(--surface);
  padding: 1.25rem;
}

.fact dt {
  color: var(--quiet);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.fact dd {
  margin: 0.45rem 0 0;
  color: var(--text);
}

.callout {
  max-width: 72ch;
  margin-top: 2.5rem;
  border-left: 2px solid var(--accent);
  background: rgba(192, 132, 252, 0.06);
  padding: 1.2rem 1.4rem;
}

.case-media {
  margin: clamp(2.5rem, 7vw, 6rem) 0;
  border: 1px solid var(--border);
  background: var(--surface);
}

.case-media picture,
.case-media img {
  display: block;
  width: 100%;
}

.case-media img {
  height: auto;
}

.case-media figcaption {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border);
  color: var(--quiet);
  font-size: 0.82rem;
}

.chapter-list {
  display: grid;
  gap: 0;
  max-width: 72ch;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.chapter-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--border);
}

.chapter-list strong {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1px;
  margin-top: 2rem;
  border: 1px solid var(--border);
  background: var(--border);
}

.related-link {
  display: block;
  min-height: 10rem;
  background: var(--surface);
  padding: 1.4rem;
  color: var(--text);
  text-decoration: none;
}

.related-link span {
  display: block;
  margin-bottom: 0.8rem;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.related-link strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.cta {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  margin-top: 1.5rem;
  border: 1px solid var(--accent);
  padding: 0.65rem 1rem;
  text-decoration: none;
}

.faq details {
  max-width: 72ch;
  border-top: 1px solid var(--border);
  padding-block: 1.3rem;
}

.faq details:last-child {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--quiet);
  font-size: 0.86rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 44rem) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Character pages (generated by scripts/generate-oc-pages.ts) */
.breadcrumbs {
  margin-bottom: 1.5rem;
  color: rgb(255 255 240 / 0.62);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: inherit;
}

.figure {
  margin: 2rem 0;
  text-align: center;
}

.figure img {
  max-width: min(320px, 70%);
  height: auto;
}

.figure figcaption,
.gallery figcaption {
  margin-top: 0.5rem;
  color: rgb(255 255 240 / 0.62);
  font-size: 0.9rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.gallery figure {
  margin: 0;
}

.gallery img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #e8e2d2;
}

.related {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 240 / 0.12);
}

/* Case studies: full-width screenshots. */
.figure--wide img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.cta-inline {
  overflow-wrap: anywhere;
}

/* Notes */
.note-list {
  display: grid;
  gap: 0;
  padding-top: 2rem;
}

.note-item {
  padding-block: 1.8rem;
  border-bottom: 1px solid var(--border);
}

.note-item h2 {
  margin: 0.4rem 0 0.6rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
}

.note-item h2 a {
  color: var(--text);
  text-decoration: none;
}

.note-item h2 a:hover {
  color: var(--accent);
}

.note-item p {
  max-width: 64ch;
  margin: 0;
  color: var(--muted);
}

.note-body {
  max-width: 68ch;
  padding-top: 2.5rem;
}

.note-body h2 {
  margin-top: 2.6rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.25;
}

.note-body pre {
  overflow-x: auto;
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  font: 0.86rem/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: #e9dcf7;
}
