:root {
  color-scheme: dark;
  --night: #090d18;
  --night-raised: #10182a;
  --night-soft: #16213a;
  --starlight: #eef3ff;
  --silver: #aebbd2;
  --line: #2a3857;
  --violet: #9b87f5;
  --scarlet: #ff6b73;
  --amber: #f0c36a;
  --cyan: #7bc9d8;
  --shadow: 0 24px 60px rgba(0, 0, 0, .28);
  --radius: 1rem;
  --measure: 72rem;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--starlight); font: 17px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .22; background: radial-gradient(circle at 12% 8%, transparent 0 5rem, #27365a 5.08rem 5.14rem, transparent 5.2rem 9rem, #27365a 9.08rem 9.14rem, transparent 9.2rem), radial-gradient(circle at 88% 76%, transparent 0 10rem, #3b2f6e 10.08rem 10.14rem, transparent 10.2rem 16rem, #3b2f6e 16.08rem 16.14rem, transparent 16.2rem); z-index: -1; }
a { color: #aeb8ff; text-underline-offset: .18em; }
a:hover { color: white; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
.skip-link { position: fixed; left: 1rem; top: -6rem; z-index: 100; padding: .7rem 1rem; background: var(--starlight); color: var(--night); border-radius: .5rem; }
.skip-link:focus { top: 1rem; }
.site-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: .9rem max(1rem, calc((100vw - var(--measure))/2)); border-bottom: 1px solid rgba(174, 187, 210, .18); background: rgba(9, 13, 24, .9); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: .8rem; color: var(--starlight); text-decoration: none; min-width: 15rem; }
.brand small { display: block; color: var(--silver); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { position: relative; width: 2.35rem; aspect-ratio: 1; display: grid; place-items: center; }
.brand-mark i { position: absolute; border: 1px solid var(--violet); border-radius: 50%; }
.brand-mark i:nth-child(1) { inset: 0; }
.brand-mark i:nth-child(2) { inset: .34rem; border-color: var(--cyan); }
.brand-mark i:nth-child(3) { inset: .78rem; background: var(--scarlet); border: 0; }
.primary-nav { display: flex; align-items: center; justify-content: flex-end; gap: .18rem; flex-wrap: wrap; }
.primary-nav a { color: var(--silver); text-decoration: none; padding: .45rem .65rem; border-radius: .6rem; font-size: .92rem; }
.primary-nav a:hover { color: var(--starlight); background: var(--night-soft); }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--night-raised); color: var(--starlight); border-radius: .6rem; padding: .55rem .75rem; }
.noscript { margin: 0; padding: .6rem 1rem; text-align: center; color: var(--silver); background: #211b0f; border-bottom: 1px solid #5b4823; }
.site-main { max-width: var(--measure); min-height: 65vh; margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) 1rem 6rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(17rem, .6fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; min-height: 66vh; }
.eyebrow { color: var(--cyan); font: 700 .72rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .14em; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(2.65rem, 7vw, 6.4rem); margin: .5rem 0 1rem; letter-spacing: -.045em; }
h2 { font-size: clamp(1.7rem, 4vw, 3rem); margin-top: 3.5rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.lede { max-width: 62ch; color: var(--silver); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero-field { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.hero-field::before, .hero-field::after, .hero-field span { content: ""; position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.hero-field::before { inset: 4%; }
.hero-field::after { inset: 19%; border-color: var(--violet); }
.hero-field span { inset: 35%; border-color: var(--cyan); box-shadow: 0 0 80px rgba(155, 135, 245, .22); }
.hero-field strong { position: relative; z-index: 2; width: 7rem; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--scarlet); color: var(--night); font: 800 1rem/1 ui-monospace, monospace; text-align: center; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.8rem; padding: .7rem 1rem; border: 1px solid var(--violet); border-radius: .75rem; color: var(--starlight); background: rgba(155, 135, 245, .1); text-decoration: none; font-weight: 700; }
.button.secondary { border-color: var(--line); background: transparent; color: var(--silver); }
.copy-field { position: relative; }
.copy-button { float: right; min-height: 2.2rem; margin: 0 0 .75rem .75rem; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .55rem; color: var(--silver); background: var(--night); font: 700 .73rem/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; cursor: pointer; }
.copy-button:hover { color: var(--starlight); border-color: var(--violet); background: var(--night-soft); }
.copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.copy-field-link { position: relative; min-width: 0; }
.copy-field-link > .card { height: 100%; }
.copy-field-link > .copy-button { position: absolute; z-index: 2; top: .75rem; right: .75rem; float: none; margin: 0; }
details.copy-field { padding-top: 1.2rem; }
details.copy-field > .copy-button { position: absolute; top: .65rem; right: .65rem; float: none; margin: 0; }
details.copy-field > summary { padding-right: 4.75rem; }
.section-intro { max-width: 65ch; color: var(--silver); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; margin: 1.4rem 0 3rem; }
.card { display: block; position: relative; padding: 1.25rem; color: inherit; text-decoration: none; background: linear-gradient(145deg, rgba(22, 33, 58, .9), rgba(16, 24, 42, .86)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 0 0 rgba(0,0,0,0); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card:hover { color: inherit; transform: translateY(-3px); border-color: var(--violet); box-shadow: var(--shadow); }
.card h2, .card h3 { margin: .25rem 0 .55rem; font-size: 1.45rem; }
.card p { color: var(--silver); }
.card .eyebrow { margin-bottom: .55rem; }
.status-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .65rem 0; }
.status { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--silver); font: 700 .72rem/1.5 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .05em; }
.status-canon { border-color: var(--cyan); color: var(--cyan); }
.status-interpretation { border-color: var(--violet); color: #c2b7ff; }
.status-research { border-color: #85d3a6; color: #9ce2b9; }
.status-implemented, .status-public { border-color: #7bc9d8; color: #9ee8f6; }
.status-frontier, .status-hmmm { border-color: var(--amber); color: var(--amber); }
.status-risk, .status-archived { border-color: var(--scarlet); color: #ff9ca2; }
.panel, .provenance, .hmmm, .reading, details { padding: 1.2rem; background: rgba(16, 24, 42, .88); border: 1px solid var(--line); border-radius: var(--radius); }
.hmmm { border-left: .35rem solid var(--amber); }
.hmmm > :first-child { margin-top: 0; color: var(--amber); }
.narrative-boundary { border-left: .35rem solid var(--violet); }
.narrative-boundary > :first-child { margin-top: 0; }
.character-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.character-card { position: relative; overflow: hidden; }
.character-card::after { content: ""; position: absolute; inset: auto -3rem -4rem auto; width: 9rem; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; opacity: .6; }
.character-card[data-character="jack"] { border-top: .25rem solid var(--cyan); }
.character-card[data-character="diane"] { border-top: .25rem solid var(--violet); }
.criteria-list { display: grid; gap: .7rem; margin: 1.5rem 0 3rem; }
.criterion { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; padding: 1rem 1.15rem; border: 1px solid var(--line); border-radius: .75rem; background: rgba(16, 24, 42, .78); }
.criterion h3 { margin: 0 0 .25rem; }
.criterion p { margin: 0; color: var(--silver); }
.journal-list { display: grid; gap: 1.2rem; padding: 0; list-style: none; }
.journal-entry { max-width: 58rem; padding: clamp(1.15rem, 4vw, 2.2rem); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16, 24, 42, .96), rgba(9, 13, 24, .94)); box-shadow: var(--shadow); }
.journal-list li:nth-child(even) .journal-entry { margin-left: auto; }
.journal-entry[data-author="jack"] { border-left: .35rem solid var(--cyan); }
.journal-entry[data-author="diane"] { border-left: .35rem solid var(--violet); }
.journal-entry h3 { margin: .3rem 0 1rem; font-size: clamp(1.45rem, 3vw, 2.15rem); }
.journal-entry > p:not(.eyebrow) { max-width: 68ch; }
.journal-meta { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); color: var(--silver); font: 700 .75rem/1.4 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; }
.journal-entry details { margin-top: 1.25rem; padding: .85rem 1rem; background: rgba(9, 13, 24, .72); }
.journal-entry summary { cursor: pointer; color: var(--cyan); font-weight: 700; }
.continuation-list { columns: 2 20rem; column-gap: 2rem; }
.continuation-list li { break-inside: avoid; margin-bottom: .85rem; }
.breadcrumb { margin-bottom: 2rem; color: var(--silver); font-size: .9rem; }
.breadcrumb a { color: var(--silver); }
.page-head { max-width: 62rem; margin-bottom: 3rem; }
.page-head h1 { font-size: clamp(2.5rem, 6vw, 5rem); }
.index-list { display: grid; gap: .7rem; padding: 0; list-style: none; }
.index-list a { display: grid; grid-template-columns: 7rem 1fr auto; gap: 1rem; align-items: baseline; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .75rem; background: rgba(16,24,42,.75); color: inherit; text-decoration: none; }
.index-list a:hover { border-color: var(--violet); }
.index-list small { color: var(--silver); }
.canon-outline .canon-unit { margin: 0; padding: 0; overflow: hidden; background: rgba(16,24,42,.75); }
.canon-unit-summary { padding: .9rem 1rem; }
.canon-unit-summary:hover { background: rgba(22,33,58,.72); }
.canon-unit > .source-block { margin: 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 0; }
.canon-unit-lab { margin: 0; padding: .8rem 1rem; border-top: 1px solid var(--line); }
.canon-unit-lab a { display: inline; padding: 0; border: 0; border-radius: 0; background: none; color: var(--cyan); font-weight: 800; }
.canon-unit-lab a:hover { text-decoration: underline; }
.canon-outline .unit-level-3 { margin-left: clamp(1rem, 3vw, 2.5rem); }
.canon-outline .unit-level-4 { margin-left: clamp(2rem, 6vw, 5rem); }
.canon-outline .unit-level-3 .canon-unit { border-left: .25rem solid var(--violet); }
.canon-outline .unit-level-4 .canon-unit { border-left: .25rem solid var(--cyan); background: rgba(9, 13, 24, .76); }
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; padding: 0; margin: 1.5rem 0 3rem; list-style: none; }
.chapter-grid li { min-width: 0; }
.chapter-card { height: 100%; }
.chapter-number { display: block; margin-bottom: .4rem; color: rgba(174, 187, 210, .42); font: 800 clamp(2.8rem, 7vw, 5rem)/1 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
.chapter-card small { display: block; margin-top: 1rem; color: var(--silver); overflow-wrap: anywhere; }
.chapter-head { margin-bottom: 1.5rem; }
.chapter-provenance { margin: 0 0 2rem; }
.textbook-chapter { max-width: 55rem; margin: 3rem auto; padding: clamp(1.1rem, 4vw, 3.2rem); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(16,24,42,.96), rgba(7,10,18,.96)); box-shadow: var(--shadow); }
.textbook-chapter > :first-child { margin-top: 0; }
.textbook-chapter h1 { font-size: clamp(2.2rem, 5vw, 4.6rem); }
.textbook-chapter h1 + h1 { margin-top: .6rem; color: var(--cyan); font-size: clamp(1.55rem, 3.5vw, 2.9rem); letter-spacing: -.025em; }
.textbook-chapter h2 { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.textbook-chapter h3 { margin-top: 2.2rem; }
.textbook-chapter p, .textbook-chapter li { max-width: 76ch; }
.textbook-chapter blockquote { margin: 1.5rem 0; padding: .2rem 1.2rem; border-left: .3rem solid var(--violet); color: var(--silver); }
.textbook-chapter pre { max-width: 100%; padding: 1rem; overflow: auto; border: 1px solid var(--line); border-radius: .7rem; background: #05070c; }
.textbook-chapter code { overflow-wrap: anywhere; }
.textbook-chapter table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.textbook-chapter th, .textbook-chapter td { padding: .65rem .8rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.textbook-chapter th { background: var(--night-soft); }
.textbook-chapter hr { margin: 3rem 0; border: 0; border-top: 1px solid var(--line); }
.chapter-pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin: 3rem 0; }
.source-block { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #070a12; color: #dce6fa; font: .92rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
dl.meta { display: grid; grid-template-columns: minmax(9rem, .35fr) 1fr; gap: .45rem 1rem; }
dl.meta dt { color: var(--silver); }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }
.turn { margin: 1rem 0; border-left: .3rem solid var(--violet); }
.turn.note { border-left-color: var(--amber); }
details { margin: 1rem 0; }
summary { cursor: pointer; font-weight: 800; }
.category { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.artifact-frame { width: 100%; min-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: #111; }
.site-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 3rem max(1rem, calc((100vw - var(--measure))/2)); border-top: 1px solid var(--line); background: #070a12; color: var(--silver); }
.footer-provenance { display: flex; flex-direction: column; font: .78rem/1.7 ui-monospace, monospace; overflow-wrap: anywhere; }
.hmmm-boundary { grid-column: 1 / -1; display: grid; grid-template-columns: 5rem 1fr; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.hmmm-boundary strong { color: var(--amber); }
@media (max-width: 780px) {
  .site-header { align-items: flex-start; flex-wrap: wrap; }
  .nav-toggle { display: block; margin-left: auto; }
  .primary-nav { width: 100%; align-items: stretch; flex-direction: column; }
  .js .primary-nav { display: none; }
  .js .primary-nav[data-open="true"] { display: flex; }
  .primary-nav a { padding: .7rem; border: 1px solid var(--line); }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-field { max-width: 22rem; width: 78%; margin: 1rem auto; }
  .index-list a { grid-template-columns: 1fr; gap: .15rem; }
  .canon-unit-summary { padding: .9rem .75rem; }
  .canon-outline .unit-level-3 { margin-left: .65rem; }
  .canon-outline .unit-level-4 { margin-left: 1.3rem; }
  .textbook-chapter { padding: 1rem; }
  .chapter-pagination .button { flex: 1 1 100%; }
  .character-grid { grid-template-columns: 1fr; }
  .criterion { grid-template-columns: 1fr; }
  .criterion .status { justify-self: start; }
  .journal-list li:nth-child(even) .journal-entry { margin-left: 0; }
  .continuation-list { columns: 1; }
  .site-footer { grid-template-columns: 1fr; }
  .hmmm-boundary { grid-column: auto; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media print { body { background: white; color: black; } body::before, .site-header, .actions, .noscript, .copy-button { display: none; } .site-main { max-width: none; padding: 0; } .card, .panel, .provenance, .hmmm, details, .textbook-chapter { background: white; color: black; box-shadow: none; } a { color: black; } }
