/* Reading pages for the plan's documents: paper, ink, and the site's type. */

:root {
  --paper: #f4eee2;
  --paper-2: #ebe3d2;
  --ink: #2a2118;
  --ink-2: rgba(42, 33, 24, 0.78);
  --ink-3: rgba(42, 33, 24, 0.5);
  --rule: rgba(42, 33, 24, 0.14);
  --accent: #8a3e1c;
  --link: #2f5f8f;
  --serif: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --display: 'Gloock', 'Didot', Georgia, serif;
  --mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12100d;
    --paper-2: #1b1813;
    --ink: #ece4d6;
    --ink-2: rgba(236, 228, 214, 0.78);
    --ink-3: rgba(236, 228, 214, 0.48);
    --rule: rgba(236, 228, 214, 0.13);
    --accent: #e3a06b;
    --link: #8ec1f0;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.25vw, 1.12rem);
  line-height: 1.68;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
a.dead { color: var(--ink-3); text-decoration-style: dotted; pointer-events: none; }
:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em;
}
.home { color: var(--accent); text-decoration: none; white-space: nowrap; }
.crumb { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-t { display: none; margin-left: auto; font: inherit; color: var(--ink); background: none; border: 1px solid var(--rule); border-radius: 1rem; padding: 0.45rem 0.9rem; cursor: pointer; }

/* three columns: documents, text, contents */
.wrap {
  display: grid;
  grid-template-columns: 15rem minmax(0, 46rem) 14rem;
  gap: clamp(2rem, 4vw, 4rem);
  justify-content: center;
  padding: 0 clamp(1rem, 3vw, 2rem);
}
.nav, .toc {
  position: sticky; top: 3.6rem;
  align-self: start;
  max-height: calc(100vh - 3.6rem);
  overflow-y: auto;
  padding: 2.2rem 0 3rem;
  font-size: 0.86rem;
  line-height: 1.4;
  scrollbar-width: thin;
}
.nav ul, .toc ul { list-style: none; margin: 0 0 1.6rem; padding: 0; }
.nav li, .toc li { margin: 0; }
.nav a, .toc a { display: block; padding: 0.3rem 0 0.3rem 0.8rem; color: var(--ink-2); text-decoration: none; border-left: 1px solid var(--rule); }
.nav a:hover, .toc a:hover { color: var(--ink); border-left-color: var(--ink-3); }
.nav a[aria-current] { color: var(--accent); border-left: 2px solid var(--accent); font-weight: 400; }
.toc li.h3 a { padding-left: 1.6rem; font-size: 0.92em; }
.nav-g { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.6rem; }

/* the text */
.doc { padding: 2.6rem 0 6rem; min-width: 0; }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 1.5rem + 3vw, 3.6rem); line-height: 1.02; letter-spacing: -0.01em; margin: 0 0 1.6rem; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); line-height: 1.12; margin: 3.2rem 0 1rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.doc h3 { font-family: var(--serif); font-weight: 600; font-size: 1.18em; margin: 2.2rem 0 0.6rem; }
.doc h4 { font-family: var(--mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 1.8rem 0 0.5rem; }
.doc h2 a, .doc h3 a { color: inherit; }
.doc p, .doc li { color: var(--ink-2); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc em { color: var(--ink); }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin: 0.25rem 0; }
.doc li::marker { color: var(--ink-3); }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.doc blockquote { margin: 1.6rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 2px solid var(--accent); font-style: italic; }
.doc img { max-width: 100%; height: auto; }

.doc code {
  font-family: var(--mono); font-size: 0.78em; font-weight: 400;
  padding: 0.08em 0.35em; border-radius: 0.35em;
  background: var(--paper-2);
}
.doc pre {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 0.6rem;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  line-height: 1.55;
}
.doc pre code { background: none; padding: 0; font-size: 0.74rem; }

/* tables scroll sideways on narrow screens instead of breaking the page */
.tbl { overflow-x: auto; margin: 1.6rem 0 2rem; border: 1px solid var(--rule); border-radius: 0.6rem; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.86em; line-height: 1.45; }
.doc th { font-family: var(--mono); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; text-align: left; color: var(--ink-3); background: var(--paper-2); }
.doc th, .doc td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc tr:last-child td { border-bottom: 0; }
.doc td { color: var(--ink-2); min-width: 7rem; }
.doc td:first-child { color: var(--ink); }

@media (max-width: 1220px) {
  .wrap { grid-template-columns: 14rem minmax(0, 46rem); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .nav-t { display: inline-block; }
  .nav {
    display: none;
    position: fixed; inset: 3.1rem 0 0 0; max-height: none; z-index: 4;
    padding: 1.5rem 1.25rem 4rem;
    background: var(--paper);
  }
  .nav.open { display: block; }
  .crumb { display: none; }
  .doc { padding-top: 1.6rem; }
}
@media print {
  .bar, .nav, .toc { display: none; }
  .wrap { display: block; }
}
