@font-face { font-family: 'Caveat'; src: url(fonts/Caveat.ttf); font-weight: 400 700; }
@font-face { font-family: 'Patrick Hand'; src: url(fonts/PatrickHand.ttf); }

/* ink and paper; the dots' colours match timeline.js */
:root { --paper: #f6f1e4; --ink: #2b2a33; --soft: #6f675c; --doc: #3b5ba5; --page: #d9572b; --thread: #3f8f5a; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body { font: 18px/1.3 'Patrick Hand', 'Comic Neue', cursive; display: flex; flex-direction: column; overflow: hidden; }
a { color: var(--doc); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

header { padding: 10px 24px 6px; display: grid; grid-template-columns: auto 1fr; gap: 0 26px; align-items: baseline; }
h1 { font: 700 52px/1 'Caveat', cursive; margin: 0; grid-row: span 2; transform: rotate(-1.5deg); }
.how { margin: 0; color: var(--soft); }
.links { margin: 2px 0 0; grid-column: 1 / -1; color: var(--soft); }
.kinds { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 4px; }
/* sketchy boxes: uneven corner radii read as hand-drawn */
.kinds button, .kinds input {
  font: inherit; font-size: 17px; color: var(--ink); background: rgba(255, 255, 255, 0.35); cursor: pointer;
  border: 1.6px solid var(--ink); border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; padding: 2px 11px;
}
.kinds button:nth-child(even) { border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px; }
.kinds button[aria-pressed='false'] { opacity: 0.4; text-decoration: line-through; }
.kinds [data-highlights] { background: #fff3c4; }
.kinds [data-highlights][aria-pressed='false'] { background: transparent; text-decoration: none; opacity: 1; }
.kinds i { display: inline-block; width: 11px; height: 11px; border-radius: 48% 52% 45% 55%; margin-right: 6px; }
.kinds [data-kind='0'] i { background: var(--doc); }
.kinds [data-kind='1'] i { background: var(--page); width: 15px; height: 15px; }
.kinds [data-kind='2'] i { background: var(--thread); width: 13px; height: 13px; }
.kinds span { color: var(--soft); }
.kinds input { cursor: text; width: 10em; }

main { position: relative; flex: 1; min-height: 0; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }
canvas.over { cursor: pointer; }
.overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.overlay div { position: absolute; white-space: nowrap; }
.lane { left: 14px; font: 700 26px/1 'Caveat', cursive; color: var(--soft); }
.tick { bottom: 4px; font: 22px/1 'Caveat', cursive; color: var(--soft); transform: translateX(-50%); }
.tick.major { color: var(--ink); font-weight: 700; }
.tick.month { transform: none; }
.label.left { text-align: right; }
.label { font-size: 15px; transform: translateY(-50%); overflow: hidden; text-overflow: ellipsis; color: var(--ink); text-shadow: 0 0 3px var(--paper), 0 0 2px var(--paper); }

.tip, .panel {
  position: absolute; background: #fffdf6; border: 1.6px solid var(--ink); box-shadow: 3px 4px 0 rgba(43, 42, 51, 0.15);
  border-radius: 6px 14px 8px 12px / 12px 6px 14px 8px;
}
.tip { max-width: 24em; padding: 8px 12px; pointer-events: none; font-size: 16px; transform: rotate(-0.4deg); }
.tip b { font: 700 24px/1.05 'Caveat', cursive; display: block; margin-bottom: 3px; }
.tip .meta, .panel .meta { color: var(--soft); }
.tip .few { color: var(--ink); font-size: 15px; margin: 2px 0; }
.tip .path { font-size: 14px; color: var(--soft); word-break: break-all; }
.k0 { color: var(--doc); } .k1 { color: var(--page); } .k2 { color: var(--thread); }
.label.k0, .label.k1, .label.k2 { color: var(--ink); }
.panel { right: 16px; top: 12px; bottom: 50px; width: min(30em, 80vw); overflow: auto; padding: 10px 18px; z-index: 2; }
.panel h2 { font: 700 30px/1.05 'Caveat', cursive; margin: 6px 30px 4px 0; }
.panel ol { padding-left: 1.4em; margin: 8px 0; }
.panel li { margin: 0 0 6px; }
.panel .close { position: absolute; right: 10px; top: 6px; font: 30px/1 'Caveat', cursive; background: none; border: 0; cursor: pointer; color: var(--ink); }
.fallback { padding: 24px; }
