/* mfc's place: the thoughts section. A graph-paper notebook. */

:root {
  --paper: #fbf8f1;
  --grid: rgba(26, 109, 212, 0.07);
  --ink: #1f1d18;
  --ink-soft: #5d584d;
  --rule: #d9d2c3;
  --blue: #1a6dd4;
  --pink: #e84d8a;
  --card: #fffdf8;
  --note: #f4efe2;
  --essay: #e6effa;
  --draft: #fde3ec;
  --code: #efe9db;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16171b;
    --grid: rgba(120, 170, 255, 0.06);
    --ink: #e9e5dc;
    --ink-soft: #a8a294;
    --rule: #34353c;
    --blue: #6fa8ff;
    --pink: #ff7fb0;
    --card: #1d1e23;
    --note: #26262b;
    --essay: #1d2a3d;
    --draft: #3d2230;
    --code: #24252b;
  }
}

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

html { background: var(--paper); }

body {
  margin: 0;
  padding: 1.5rem 1rem 3rem;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.2rem;
  line-height: 1.6;
}

main, .crumbs, footer.site { max-width: 40rem; margin: 0 auto; }

a { color: var(--blue); text-underline-offset: 3px; transition: color 0.2s ease; }
a:hover { color: var(--pink); }
a:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 2px; }

.crumbs {
  font-family: "Playpen Sans", cursive;
  font-size: 1rem;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.crumbs span { color: var(--ink-soft); }

h1, h2, h3, h4 { font-family: "Playpen Sans", cursive; line-height: 1.25; font-weight: 600; }
h1 { font-size: 2.1rem; margin: 0.3rem 0 1.5rem; }
h2 { font-size: 1.4rem; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; margin-top: 1.8rem; }

/* small pixel labels: number, kind, date */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: "Silkscreen", monospace;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: lowercase;
}
.meta .no { color: var(--pink); }
.kind { padding: 0.05rem 0.45rem; border: 1px solid var(--rule); border-radius: 3px; }
.kind-note { background: var(--note); }
.kind-essay { background: var(--essay); }
.kind-draft { background: var(--draft); border-style: dashed; }

/* a thought */
.body p { margin: 0 0 1.1rem; }
.body blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--pink);
  color: var(--ink-soft);
  font-style: italic;
}
.body code { font-size: 0.85em; background: var(--code); padding: 0.1em 0.3em; border-radius: 3px; }
.body pre { background: var(--code); padding: 1rem; overflow-x: auto; border-radius: 4px; font-size: 0.85rem; line-height: 1.45; }
.body pre code { background: none; padding: 0; }
.body hr { border: none; text-align: center; margin: 2rem 0; }
.body hr::after { content: "* * *"; color: var(--ink-soft); letter-spacing: 0.6rem; }
.body ul, .body ol { padding-left: 1.4rem; }

a.wiki { text-decoration-style: dotted; }
a.wiki::before { content: "\2197\FE0E"; font-size: 0.75em; margin-right: 0.1em; }
.unwritten {
  color: var(--ink-soft);
  text-decoration: underline dashed var(--rule);
  text-underline-offset: 3px;
}

/* a note reads like an index card on the notebook */
main.thought.note .body {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.4rem 1.5rem 0.4rem;
  box-shadow: 3px 3px 0 var(--rule);
}

.backlinks {
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--rule);
}
.backlinks h2 { font-family: "Silkscreen", monospace; font-size: 0.8rem; font-weight: 400; color: var(--ink-soft); }
.backlinks ul { padding-left: 1.2rem; margin: 0; }

.prevnext {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  font-family: "Playpen Sans", cursive;
  font-size: 0.95rem;
}
.prevnext .next { text-align: right; margin-left: auto; }

/* the list */
.lede { color: var(--ink-soft); margin-top: -0.6rem; }
ol.thoughts { list-style: none; padding: 0; margin: 2rem 0 0; }
ol.thoughts li {
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--card);
}
ol.thoughts li.essay { border-left: 4px solid var(--blue); }
ol.thoughts li > a { font-family: "Playpen Sans", cursive; font-size: 1.15rem; font-weight: 600; }
ol.thoughts li p { margin: 0.2rem 0 0; font-size: 1rem; color: var(--ink-soft); }

/* the thought web */
figure.web { margin: 1.5rem 0 0; }
figure.web svg {
  width: 100%;
  height: 260px;
  display: block;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
figure.web figcaption { font-family: "Silkscreen", monospace; font-size: 0.7rem; color: var(--ink-soft); margin-top: 0.4rem; }
#web line { stroke: var(--rule); stroke-width: 1.5; }
#web circle { fill: var(--blue); stroke: var(--card); stroke-width: 2; transition: r 0.15s ease; }
#web circle.note { fill: var(--pink); }
#web a:hover circle, #web a:focus circle { r: 9; }
#web text { font-family: "Playpen Sans", cursive; font-size: 11px; fill: var(--ink-soft); pointer-events: none; }

footer.site {
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  font-family: "Silkscreen", monospace;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

/* the kiwi cursor */
#cursor-head, #cursor-blob {
  position: fixed;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  pointer-events: none;
  z-index: 9999;
  image-rendering: pixelated;
  transform: translate(-200px, -200px);
}
#cursor-blob { opacity: 0.5; }

@media (hover: none), (pointer: coarse) {
  *, *::before, *::after { cursor: auto; }
  #cursor-head, #cursor-blob { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 1.1rem; }
  h1 { font-size: 1.7rem; }
  main.thought.note .body { padding: 1.1rem 1rem 0.2rem; }
}
