/* ============================================================
   confusedbutinspired.com
   Dark, single column, one sans-serif. That's the whole design.
   Edit the tokens below to change the feel of everything.
   ============================================================ */

:root {
  --bg:      #0a0a0a;
  --bg-soft: #131313;
  --fg:      #ededed;
  --muted:   #9b9b9b;   /* 8.4:1 on --bg */
  --faint:   #808080;   /* 5.0:1 */
  --line:    #242424;
  --line-lit:#3a3a3a;
  --accent:  #78a9ff;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --col:  46rem;   /* page column */
  --text: 38rem;   /* reading measure */
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.011em;
  margin: 0;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

strong { font-weight: 600; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-lit);
    text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

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

code, pre { font-family: var(--mono); font-size: 0.875em; }
code { background: var(--bg-soft); border: 1px solid var(--line);
       border-radius: 3px; padding: 0.05em 0.35em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg-soft);
              border: 1px solid var(--line-lit); padding: 0.5rem 0.75rem; z-index: 10; }

/* ---------- shell ---------- */

.wrap {
  width: 100%;
  max-width: var(--col);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

header.site {
  padding-block: 2rem 0;
}
header.site .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}
.site-name { font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--fg); }
.site-name:hover { color: var(--accent); }

nav.site { display: flex; gap: 1.1rem; flex-wrap: wrap; }
nav.site a {
  font-size: 0.9375rem;
  color: var(--muted);
  text-decoration: none;
}
nav.site a:hover { color: var(--fg); }
nav.site a[aria-current="page"] { color: var(--fg); }

main { flex: 1 0 auto; padding-block: 2.5rem 0; }

footer.site {
  flex: none;
  margin-top: 5rem;
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.875rem;
}
footer.site .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
footer.site a { color: var(--faint); text-decoration: none; }
footer.site a:hover { color: var(--fg); }

/* ---------- text ---------- */

.page-title { margin-bottom: 1rem; }

.intro { max-width: var(--text); }
.intro p { color: var(--muted); }

.prose { max-width: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2rem 0 0.6rem; }
.prose h3 { margin: 1.5rem 0 0.4rem; }
.prose ul { padding-left: 1.1rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.3rem; }
.prose blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line-lit);
  color: var(--muted);
}
.prose ol { padding-left: 1.1rem; margin: 0 0 1rem; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 1rem 0.5rem 0;
  border-top: 1px solid var(--line);
}
.prose th { font-weight: 500; color: var(--muted); border-top: 0; padding-top: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.prose .num { text-align: right; white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 1px solid var(--line); }

/* Every block of content on every page is a .section, so the vertical
   rhythm is identical whether or not the page has an intro. */
.section { margin-top: 2.75rem; }
.section > h2 { margin-bottom: 0.75rem; }

/* ---------- lists of things ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding-block: 0.7rem; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }

.item { display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.item a { text-decoration: none; }
.item a:hover { color: var(--accent); }
.item .when { color: var(--faint); font-size: 0.875rem; flex: none; font-variant-numeric: tabular-nums; }
.item-desc { color: var(--muted); font-size: 0.9375rem; margin: 0.15rem 0 0; max-width: var(--text); }

.empty { color: var(--faint); font-size: 0.9375rem; max-width: var(--text); }

/* ---------- themes ---------- */

.group { margin-top: 1.9rem; scroll-margin-top: 1.5rem; }
.group:first-of-type { margin-top: 0; }
.group > h3 { display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.35rem; }
.group .gloss { font-size: 0.875rem; font-weight: 400; color: var(--faint); }
.group .empty { margin: 0; }

/* ---------- notes: sticky cards ---------- */

.tag { font-size: 0.8125rem; color: var(--faint); }

.stickies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stickies > li { display: flex; }
.sticky {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 9rem;
  padding: 0.9rem 1.05rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--fg);
  text-decoration: none;
  transition: border-color 140ms, background-color 140ms;
}
.sticky:hover { color: var(--fg); border-color: var(--line-lit); background: #171717; }
.sticky:hover .sticky__title { color: var(--accent); }
.sticky__title { margin: 0.45rem 0 0.4rem; font-weight: 500; line-height: 1.35; transition: color 140ms; }
.sticky__text { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.sticky__when { margin-top: auto; padding-top: 0.75rem; font-size: 0.8125rem; color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- map ---------- */

.map__canvas { margin-top: 0.5rem; }

.map__canvas { display: none; }
.map__canvas svg { display: block; width: 100%; height: auto; overflow: visible; }

.map__edge { fill: none; stroke: var(--line); stroke-width: 1; }
.map__node circle { fill: var(--bg); stroke: var(--faint); stroke-width: 1; }
.map__node text { font-family: var(--sans); font-size: 12px; fill: var(--muted); }
.map__node--root circle { fill: var(--fg); stroke: var(--fg); }
.map__node--root text { fill: var(--fg); font-size: 13px; }
.map__node--branch text { fill: var(--fg); font-size: 12.5px; }
.map__node--leaf text { font-size: 11.5px; fill: var(--faint); }
.map__node--essay circle { fill: var(--fg); stroke: var(--fg); }
.map__node--essay text { font-size: 12px; fill: var(--fg); }

.map__node a { text-decoration: none; }
.map__node a:hover circle { fill: var(--accent); stroke: var(--accent); }
.map__node a:hover text { fill: var(--accent); }
.map__node a:focus-visible circle { stroke: var(--accent); stroke-width: 2.5; }

.map__edge, .map__node circle, .map__node text { transition: stroke 140ms, fill 140ms, opacity 140ms; }
.map.is-lit .map__node:not(.map__node--root) { opacity: 0.45; }
.map.is-lit .map__node--lit { opacity: 1; }
.map.is-lit .map__edge--lit { stroke: var(--line-lit); }

/* Outline fallback: no JS, or narrow screens. */
.map__list { list-style: none; margin: 0; padding: 0; max-width: var(--text); }
.map__list > li { padding-block: 0.7rem; border-top: 1px solid var(--line); }
.map__list > li:first-child { border-top: 0; padding-top: 0; }
.map__list > li > a { text-decoration: none; }
.map__list ul { list-style: none; margin: 0.2rem 0 0; padding: 0; }
.map__list ul li { display: inline; color: var(--faint); font-size: 0.9375rem; }
.map__list ul li + li::before { content: " · "; }

@media (min-width: 800px) {
  .map.is-drawn .map__canvas { display: block; }
  .map.is-drawn .map__list { display: none; }
}

/* ---------- small screens ---------- */

@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 1.4rem; }
  .wrap { padding-inline: 1.25rem; }
  header.site { padding-block: 1.5rem 0; }
  .item { flex-direction: column; gap: 0.15rem; }
  .item .when { font-size: 0.8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
