/*
 * Universal Panpsychism Wiki
 *
 * These values are the approved design. Colors, type sizes, spacing, and
 * radii are deliberate: change them only on purpose.
 *
 *   Ground      #F3F5F7     Surface   #FFFFFF     Ink        #17212B
 *   Body grey   #36434F     Muted     #4A5866     Rule       #D5DBE1
 *   Accent      #0B6468     Accent hover #084A4D  Accent tint #E3F0F0
 *
 *   Headings and article text: Source Serif 4
 *   Interface: IBM Plex Sans        Labels: IBM Plex Mono
 */

/* ---------- Fonts (served from this site, no third-party requests) ---------- */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-ext-opsz-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-opsz-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-ext-opsz-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-opsz-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-400-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-400-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

/* ---------- Tokens ---------- */

:root {
  --ground: #F3F5F7;
  --surface: #FFFFFF;
  --ink: #17212B;
  --body: #36434F;
  --muted: #4A5866;
  --rule: #D5DBE1;
  --rule-soft: #E4E8EC;
  --field-border: #B9C2CB;
  --accent: #0B6468;
  --accent-hover: #084A4D;
  --accent-tint: #E3F0F0;
  --footer: #17212B;
  --footer-text: #E4E8EC;

  --serif: 'Source Serif 4', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 6px;
  --wrap: 1200px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

img, svg { max-width: 100%; }

[id] { scroll-margin-top: 24px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 10;
  background: var(--accent);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: 8px; color: #FFFFFF; }

/* ---------- Status labels ---------- */

.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.status-scholarship { background: #E1E8F5; color: #1F3A6E; }
.status-research { background: #DDEFE6; color: #14532D; }
.status-framework { background: #F6E7C8; color: #6B4A00; }
.status-open { background: #EFE1F0; color: #5B2A66; }

/* ---------- Header ---------- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }

.header-inner {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 600; }
.brand-tag {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 1px 6px;
}

.header-toggles { display: none; }

.site-search { flex: 1 1 280px; position: relative; margin: 0; }
.site-search svg { position: absolute; left: 14px; top: 13px; pointer-events: none; }
.site-search input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--ground);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.site-search input::placeholder { color: var(--muted); opacity: 1; }

.main-nav { display: flex; flex-wrap: wrap; gap: 0 22px; font-size: 15px; font-weight: 500; }
.main-nav a { padding: 10px 0; text-decoration: none; color: var(--ink); border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--accent); }
.main-nav a.current { color: var(--accent); border-bottom-color: var(--accent); }

.admin-bar { background: var(--ink); color: #FFFFFF; font-size: 14px; }
.admin-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 6px; padding-bottom: 6px; }
.admin-bar a { color: #FFFFFF; padding: 6px 0; }
.admin-bar .flash { margin-left: auto; color: #BFE8D2; }

/* ---------- Shared page pieces ---------- */

.band { background: var(--surface); border-bottom: 1px solid var(--rule); }

.section { padding-top: 56px; }
.section:last-of-type { padding-bottom: 64px; }

.section-title { margin: 0 0 6px; font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.25; }
.section-title.is-alone { margin-bottom: 24px; }
.section-sub { margin: 0 0 24px; color: var(--muted); }

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.small-caps {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.breadcrumb { font-size: 14px; color: var(--muted); padding-bottom: 12px; }

.page-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lede { margin: 0; font-size: 18px; line-height: 1.6; color: var(--body); }

.cards { display: flex; flex-wrap: wrap; gap: 20px; }

.card {
  flex: 1 1 320px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #FFFFFF; }
.btn-secondary { background: var(--surface); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-tint); color: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- Home ---------- */

.hero-inner {
  padding-top: 56px;
  padding-bottom: 60px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px 56px;
  align-items: flex-start;
}
.hero-text { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero-text .lede { max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }

.brief {
  flex: 1 1 320px;
  background: var(--ground);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.brief h2 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.brief dl { margin: 0; display: flex; flex-direction: column; font-size: 15px; }
.brief dl > div { display: flex; gap: 16px; padding: 10px 0; border-top: 1px solid var(--rule); }
.brief dl > div:last-child { padding-bottom: 0; }
.brief dt { flex: 0 0 96px; color: var(--muted); }
.brief dd { margin: 0; }

.start-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); }
.start-card:hover { color: var(--ink); border-color: var(--accent); }
.start-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.start-q { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.25; }
.start-text { color: var(--body); }
.start-go { font-weight: 600; color: var(--accent); margin-top: 4px; }

.cat-card { padding: 22px 24px 10px; }
.cat-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.cat-card h3 a { color: var(--ink); text-decoration: none; }
.cat-card h3 a:hover { color: var(--accent); }
.cat-card > p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.cat-card ul { list-style: none; margin: 0; padding: 0; }
.cat-card li a { display: block; padding: 10px 0; border-top: 1px solid var(--rule-soft); text-decoration: none; }
.cat-card li a.more { font-weight: 600; }

.legend { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 32px; }
.legend .section-sub { max-width: 720px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 24px; }
.legend-item { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-size: 15px; color: var(--body); }

.names-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.names-head .section-sub { margin-bottom: 0; }
.names-head > a { font-weight: 600; padding: 10px 0; }
.name-card { display: flex; flex-direction: column; gap: 10px; }
.name-card h3 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.name-card h3 a { color: var(--ink); text-decoration: none; }
.name-card h3 a:hover { color: var(--accent); }
.name-card p { margin: 0; color: var(--body); }

/* ---------- Article ---------- */

.article-layout {
  padding-top: 32px;
  padding-bottom: 64px;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 260px;
  grid-template-areas:
    'toc head aside'
    'toc lead aside'
    'toc rest aside';
  grid-template-rows: auto auto 1fr;
  column-gap: 32px;
  align-items: start;
}

.article-head { grid-area: head; }
.article-lead { grid-area: lead; }
.article-rest { grid-area: rest; align-self: stretch; }
.toc { grid-area: toc; }
.article-aside { grid-area: aside; }

/* The three middle pieces read as one white card. */
.article-head, .article-lead, .article-rest {
  background: var(--surface);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  padding-left: 40px;
  padding-right: 40px;
  min-width: 0;
}
.article-head { border-top: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0; padding-top: 36px; }
.article-rest { border-bottom: 1px solid var(--rule); border-radius: 0 0 var(--radius) var(--radius); padding-bottom: 44px; }

.article-head .page-title { margin-bottom: 14px; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}

.toc { font-size: 15px; position: sticky; top: 24px; }
.toc summary {
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
  cursor: default;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary svg { display: none; }
.toc a { display: block; padding: 10px 0; border-top: 1px solid var(--rule); text-decoration: none; }

.article-aside, .extras-wide, .article-extras { display: flex; flex-direction: column; gap: 20px; }
.article-extras { display: none; }

.infobox { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.infobox-title { background: var(--accent); color: #FFFFFF; padding: 14px 18px; font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.3; }
.infobox-title-short { display: none; }
.infobox-figure { background: var(--accent-tint); display: flex; align-items: center; justify-content: center; padding: 26px 0; }
.infobox dl { margin: 0; padding: 4px 18px 10px; font-size: 14px; }
.infobox dl > div { padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.infobox dl > div:last-child { border-bottom: 0; }
.infobox dt { color: var(--muted); font-size: 13px; }
.infobox dd { margin: 0; }

.side-box { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; }
.side-box .small-caps { padding-bottom: 6px; }
.side-box p { margin: 0 0 12px; font-size: 14px; color: var(--body); }
.side-box ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.side-box li a { display: block; padding: 8px 0; border-top: 1px solid var(--rule-soft); text-decoration: none; }

/* Article text */

.prose { font-family: var(--serif); font-size: 18px; line-height: 1.65; color: var(--ink); }
.prose > p { margin: 16px 0 0; }
.article-lead.prose > p:first-child { margin-top: 22px; }
.article-lead.prose > :last-child { margin-bottom: 0; }

.prose .section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.prose h2 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.25; }
.prose h3 { margin: 28px 0 0; font-size: 21px; font-weight: 600; line-height: 1.3; }
.prose h4 { margin: 24px 0 0; font-size: 18px; font-weight: 600; }

.prose ul, .prose ol { margin: 16px 0 0; padding-left: 24px; display: flex; flex-direction: column; gap: 10px; }
.prose li > ul, .prose li > ol { margin-top: 10px; }
.prose li > p { margin: 0; }

.prose blockquote {
  margin: 20px 0 0;
  padding: 14px 20px;
  background: var(--ground);
  border-radius: var(--radius);
  color: var(--body);
}
.prose blockquote > :first-child { margin-top: 0; }

.prose code { font-family: var(--mono); font-size: 0.85em; background: var(--ground); padding: 1px 5px; border-radius: 3px; }
.prose pre { margin: 20px 0 0; padding: 14px 16px; background: var(--ground); border-radius: var(--radius); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }

.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0 0; }

.prose sup.cite { font-family: var(--sans); font-size: 12px; line-height: 0; }
.prose sup.cite a { text-decoration: none; padding: 0 1px; }

.prose .table-scroll { overflow-x: auto; margin-top: 20px; border: 1px solid var(--rule); border-radius: var(--radius); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-family: var(--sans); font-size: 15px; line-height: 1.45; }
.prose thead tr { background: var(--ground); text-align: left; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; }
.prose th { font-weight: 600; }
.prose tbody tr { border-top: 1px solid var(--rule); }
.prose tbody td:first-child { font-weight: 600; }

.prose ol.references { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--body); gap: 8px; }
.prose ol.references li:target { background: var(--accent-tint); outline: 6px solid var(--accent-tint); border-radius: 2px; }

.see-also { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-top: 10px; font-family: var(--sans); font-size: 16px; }
.see-also a { padding: 10px 0; }

.review-note {
  margin-top: 20px;
  padding: 12px 16px;
  background: #F6E7C8;
  color: #4D3500;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 14px;
}

/* Standalone pages (About and so on) */

.page-layout { padding-top: 32px; padding-bottom: 64px; }
.page-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 36px 40px 44px;
}
.page-card .page-title { margin-bottom: 14px; }
.page-card .article-meta { margin-bottom: 6px; }

/* ---------- Connections ---------- */

.intro-band .wrap { padding-top: 44px; padding-bottom: 48px; }
.intro-band .page-title { margin-bottom: 16px; }
.intro-band .lede { max-width: 760px; }

.step-card { flex: 1 1 240px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.step-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.step-card h3 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.25; }
.step-card h3 a { color: inherit; text-decoration: none; }
.step-role { font-weight: 600; color: var(--accent); }
.step-card p { margin: 0; font-size: 15px; color: var(--body); }
.step-card.is-focus { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.step-card.is-focus .step-num { color: #D6ECEC; }
.step-card.is-focus .step-role { color: #FFFFFF; }
.step-card.is-focus p { color: #EEF7F7; }
.step-card.is-focus a:focus-visible { outline-color: #FFFFFF; }

.detail-cards { align-items: stretch; }
.detail-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.detail-head { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.detail-card h3 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.detail-card h3 a { color: var(--ink); text-decoration: none; }
.detail-card h3 a:hover { color: var(--accent); }
.detail-card h4 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.detail-card h4 + p { margin: 4px 0 0; font-size: 15px; color: var(--body); }
.detail-link { margin-top: auto; padding: 10px 0; font-weight: 600; }

.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.relations { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 15px; }
.relations thead tr { background: var(--ground); text-align: left; }
.relations th { padding: 14px 18px; font-weight: 600; }
.relations td { padding: 14px 18px; }
.relations tbody tr { border-top: 1px solid var(--rule); }
.relations td:first-child, .relations td:last-child { font-weight: 600; }
.relations td:nth-child(2) { color: var(--body); }

/* ---------- Listings and search ---------- */

.list-layout { padding-top: 40px; padding-bottom: 64px; }
.list-head { margin-bottom: 28px; }
.list-head .page-title { margin-bottom: 12px; }
.list-head .lede { max-width: 760px; }

.article-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.article-list li { padding: 18px 24px; border-top: 1px solid var(--rule-soft); display: flex; flex-direction: column; gap: 6px; }
.article-list li:first-child { border-top: 0; }
.article-list .row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.article-list .row-title { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.article-list p { margin: 0; color: var(--body); font-size: 15px; }
.article-list mark { background: #F6E7C8; color: inherit; padding: 0 2px; border-radius: 2px; }

.az-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; }
.az-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}
.az-group { margin-top: 28px; }
.az-group h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 26px; font-weight: 600; }

.search-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; max-width: 760px; }
.search-form input {
  flex: 1 1 280px;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
}

.empty {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 32px;
  color: var(--body);
}
.empty h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink); }
.empty p { margin: 0 0 16px; max-width: 620px; }
.empty p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--footer); color: var(--footer-text); }
.footer-inner { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 28px 56px; }
.footer-about { flex: 2 1 420px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.footer-name { font-family: var(--serif); font-size: 18px; font-weight: 600; color: #FFFFFF; }
.footer-links { flex: 1 1 200px; display: flex; flex-direction: column; font-size: 15px; }
.footer-links a { color: #FFFFFF; padding: 10px 0; }
.footer-links a:hover { color: #D6ECEC; }
.footer-links span { padding: 10px 0; color: #C3CBD3; }
.site-footer a:focus-visible { outline-color: #FFFFFF; }

/* ---------- Narrower screens ---------- */

@media (max-width: 1099px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'head' 'lead' 'toc' 'aside' 'rest' 'extras';
    grid-template-rows: auto;
    max-width: 808px;
  }
  .extras-wide { display: none; }
  .article-extras { display: flex; grid-area: extras; margin-top: 20px; }
  .article-lead { padding-bottom: 20px; }
  .toc, .article-aside {
    background: var(--surface);
    border-left: 1px solid var(--rule);
    border-right: 1px solid var(--rule);
    padding: 0 40px 20px;
  }
  .toc { position: static; }
  .toc details { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--ground); }
  .toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 14px;
    font-size: 15px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    cursor: pointer;
  }
  .toc summary svg { display: block; transition: transform 0.15s ease; }
  .toc details[open] summary svg { transform: rotate(180deg); }
  .toc details a { padding: 12px 14px; }
  .infobox-figure { display: none; }
  .article-rest .section-head:first-child { margin-top: 12px; }
}

@media (max-width: 639px) {
  .wrap { padding-left: 20px; padding-right: 20px; }

  /* Compact header: logo, then search and menu buttons. */
  .header-inner { padding: 6px 8px 6px 16px; gap: 0 8px; justify-content: space-between; }
  .brand { gap: 8px; }
  .brand svg { width: 24px; height: 24px; }
  .brand-name { font-size: 17px; }
  .brand-tag { display: none; }
  .js .header-toggles { display: flex; }
  .header-toggles button {
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--radius);
  }
  .site-search, .main-nav { flex: 1 1 100%; padding: 6px 8px 10px 0; }
  .js .site-search, .js .main-nav { display: none; }
  .js .site-search.is-open { display: block; }
  .js .main-nav.is-open { display: flex; }
  .main-nav { flex-direction: column; }
  .main-nav a { padding: 12px 0; border-bottom: 0; border-top: 1px solid var(--rule-soft); }

  .hero-inner { padding-top: 36px; padding-bottom: 40px; }
  .hero-title, .page-title { font-size: 30px; }
  .section { padding-top: 40px; }
  .section-title { font-size: 24px; }
  .legend { padding: 24px 20px; }
  .card { padding: 20px; }
  .cat-card { padding: 20px 20px 8px; }

  /* Articles run edge to edge on a white page, as in the phone design. */
  body.is-article { background: var(--surface); }
  .article-layout { padding: 16px 0 40px; }
  .article-head, .article-lead, .article-rest, .toc, .article-aside {
    border: 0;
    border-radius: 0;
    padding-left: 20px;
    padding-right: 20px;
  }
  .article-head { padding-top: 0; }
  .article-head .page-title { margin-bottom: 12px; }
  .article-meta { border-bottom: 0; padding-bottom: 0; font-size: 13px; gap: 6px 12px; }
  .article-meta .status { font-size: 11px; }
  .breadcrumb { font-size: 13px; }
  .prose { font-size: 17px; line-height: 1.6; }
  .article-lead.prose > p:first-child { margin-top: 12px; }
  .article-lead { padding-bottom: 12px; }
  .toc, .article-aside { padding-bottom: 12px; }
  .article-extras { padding: 0 20px; margin-top: 8px; }
  .infobox-title { padding: 10px 14px; font-size: 16px; }
  /* The article title is directly above on a phone, so the box is headed "At a glance". */
  .infobox-title-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .infobox-title-short { display: inline; }
  .infobox dl { padding: 0 14px; }
  .infobox dl > div { display: flex; gap: 12px; padding: 9px 0; }
  .infobox dt { flex: 0 0 88px; font-size: 14px; }
  .prose h2 { font-size: 22px; }
  .prose .section-head { margin-top: 28px; padding-bottom: 6px; }
  .article-rest .section-head:first-child { margin-top: 6px; }

  .page-layout { padding-top: 0; padding-bottom: 0; }
  .page-card { border: 0; border-radius: 0; padding: 24px 20px 40px; }
  .page-layout.wrap { padding-left: 0; padding-right: 0; }

  .intro-band .wrap { padding-top: 28px; padding-bottom: 32px; }
  .article-list li { padding: 16px 18px; }
  .footer-inner { padding-top: 32px; padding-bottom: 32px; gap: 16px 40px; }
}

@media print {
  .site-header, .site-footer, .toc, .side-box, .admin-bar, .skip-link { display: none; }
  body { background: #FFFFFF; }
  .article-layout { display: block; padding: 0; }
  .article-head, .article-lead, .article-rest { border: 0; padding: 0; }
  a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
