:root {
  --board: #dde4e7;      /* cool cutting-mat grey-blue */
  --grid: #c9d3d8;
  --ink: #14213d;        /* navy ink */
  --muted: #4a5873;
  --bembel: #2f5d8a;     /* Apfelwein stoneware blue */
  --paper: #ffffff;
  --note-yellow: #ffe27a;
  --note-blue: #cfe3f5;
  --focus: #e0430f;

  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--board);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- Canvas ---------- */
.viewport {
  position: fixed; inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background-color: var(--board);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
}
.viewport.is-panning { cursor: grabbing; }
.board {
  position: absolute; left: 0; top: 0;
  width: 3000px; height: 1900px;
  transform-origin: 0 0;
}
.wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.wires path { fill: none; stroke: var(--bembel); stroke-width: 2.5; stroke-dasharray: 2 9; stroke-linecap: round; }
.wires circle { fill: var(--bembel); }

/* ---------- Frames: areas drawn straight onto the mat ---------- */
.frame {
  position: absolute;
  border: 2px solid var(--ink);
  border-radius: 28px;
  pointer-events: none;
}
.frame h2 {
  position: absolute; left: 24px; top: -28px; margin: 0;
  padding: 0 14px;
  background: var(--board);
  font: 800 40px/1.1 var(--display);
  letter-spacing: -0.02em;
}
.frame p {
  position: absolute; left: 40px; top: 24px; margin: 0;
  font: 400 15px/1.3 var(--display);
  color: var(--muted);
}

/* ---------- Cards ---------- */
.card {
  position: absolute;
  padding: 18px 20px 20px;
  background: var(--paper);
  color: var(--ink);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.card.is-dragging { cursor: grabbing; z-index: 50; box-shadow: 0 18px 30px -12px rgba(20, 33, 61, .45); }
.card h3 { margin: 0 0 6px; font: 600 21px/1.2 var(--display); letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 15.5px; line-height: 1.55; color: var(--muted); }

/* the big name, set right onto the mat */
.card--title { background: none; padding: 0; cursor: default; }
.card--title h1 {
  margin: 0;
  font: 800 132px/0.88 var(--display);
  letter-spacing: -0.045em;
  color: var(--ink);
}
.card--title p { margin-top: 22px; max-width: 34ch; font-size: 21px; line-height: 1.45; color: var(--ink); }

/* sticky notes */
.card--note { box-shadow: 0 2px 0 rgba(20, 33, 61, .08), 0 12px 18px -14px rgba(20, 33, 61, .5); }
.card--note.yellow { background: var(--note-yellow); }
.card--note.blue { background: var(--note-blue); }
.card--note.white { background: var(--paper); }
.card--note::before { /* tape */
  content: ""; position: absolute; top: -11px; left: 50%;
  width: 84px; height: 22px; margin-left: -42px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(20, 33, 61, .08);
  transform: rotate(-3deg);
}
.card--note p { color: var(--ink); }

/* projects: index cards with a data glyph */
.card--project {
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 5px 0 var(--ink);
}
.card--project .glyph { display: block; width: 72px; height: 40px; margin-bottom: 12px; }
.card--project .glyph * { stroke: var(--bembel); fill: none; stroke-width: 2; }
.card--project .glyph .fill { fill: var(--bembel); stroke: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li { font: 400 13px/1 var(--display); padding: 5px 9px; border-radius: 99px; background: var(--board); color: var(--ink); }
.card .more {
  display: inline-block; margin-top: 14px;
  font: 600 15px/1 var(--display);
  color: var(--bembel); text-underline-offset: 4px;
}

/* posts & links: plain paper slips */
.card--post, .card--link { border-radius: 4px; border-left: 6px solid var(--bembel); box-shadow: 0 10px 18px -14px rgba(20, 33, 61, .6); }
.card--link h3 a, .card--post h3 a { text-decoration: none; }
.card--link h3 a:hover, .card--post h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.card time { display: block; margin-bottom: 6px; font: 400 13px/1 var(--display); color: var(--muted); }

/* ---------- Toolbar ---------- */
.toolbar {
  position: fixed; left: 16px; bottom: 16px; z-index: 100;
  display: flex; align-items: center; gap: 4px;
  padding: 6px;
  background: var(--ink);
  border-radius: 14px;
}
.toolbar button, .toolbar output {
  font: 600 14px/1 var(--display);
  color: #fff;
}
.toolbar button {
  min-width: 36px; height: 36px; padding: 0 12px;
  border: 0; border-radius: 9px;
  background: transparent;
  cursor: pointer;
}
.toolbar button:hover { background: rgba(255, 255, 255, .14); }
.toolbar button[aria-pressed="true"] { background: var(--note-yellow); color: var(--ink); }
.toolbar output { min-width: 48px; text-align: center; opacity: .8; }

/* ---------- List view ---------- */
.list { max-width: 720px; margin: 0 auto; padding: 56px 20px 120px; }
.list[hidden] { display: none; }
body.view-list { overflow: auto; }
body.view-list .viewport { display: none; }
body.view-list .toolbar [data-action="zoom-in"],
body.view-list .toolbar [data-action="zoom-out"],
body.view-list .toolbar [data-action="fit"],
body.view-list .toolbar [data-action="tidy"],
body.view-list .toolbar output { display: none; }
.list h1 { margin: 0; font: 800 clamp(56px, 13vw, 104px)/0.9 var(--display); letter-spacing: -0.045em; }
.list .lede { font-size: 20px; margin: 18px 0 32px; max-width: 34ch; }
.list section { margin-top: 56px; }
.list h2 { margin: 0 0 4px; font: 800 32px/1.1 var(--display); letter-spacing: -0.02em; }
.list .caption { margin: 0 0 18px; color: var(--muted); font-family: var(--display); }
.list .card { position: relative; left: auto !important; top: auto !important; width: auto !important; margin: 0 0 18px; cursor: auto; user-select: text; -webkit-user-select: text; transform: none !important; }

.noscript { position: fixed; inset: 40px; font-size: 20px; }

@media (max-width: 640px) {
  .toolbar { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; overflow-x: auto; }
  .toolbar [data-action="tidy"] { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .board.is-animating { transition: transform .45s cubic-bezier(.2, .7, .2, 1); }
}
