/* Fonts are self-hosted Latin subsets (SIL OFL 1.1, see fonts/LICENSE.md). */
@font-face { font-family: 'Kalam'; src: url('fonts/kalam-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Kalam'; src: url('fonts/kalam-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('fonts/caveat.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('fonts/newsreader.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }

/* Paper notebook (light) */
:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --paper-dot: #d3ccb8;
  --card: #fffdf6;
  --ink: #1f2433;
  --ink-2: #4a4f5e;
  --ink-3: #80838c;
  --blue: #2d5ea8;
  --green: #2c7a55;
  --red: #c2402f;
  --amber: #9a5f12;
  --marker: rgba(255, 210, 60, 0.55);
  --rule: rgba(70, 130, 200, 0.14);
  --rule-margin: rgba(200, 70, 60, 0.38);
  --hatch: rgba(31, 36, 51, 0.32);
  --code-bg: rgba(31, 36, 51, 0.045);
  --note-yellow: #fff1a6;
  --note-pink: #ffd9df;
  --note-blue: #d5eafe;
  --note-ink: #2a2a28;
  --note-shadow: rgba(60, 50, 20, 0.28);
  --smudge-1: transparent;
  --smudge-2: transparent;

  --font-hand: 'Kalam', 'Comic Sans MS', cursive;
  --font-note: 'Caveat', 'Kalam', cursive;
  --font-body: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

/* Chalkboard (dark) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #1d2a26;
    --paper-dot: rgba(236, 235, 226, 0.05);
    --card: #24332e;
    --ink: #ecebe2;
    --ink-2: #c3c7bc;
    --ink-3: #8d978f;
    --blue: #9fc6ee;
    --green: #9fd9b5;
    --red: #f2a093;
    --amber: #ecc27e;
    --marker: rgba(244, 226, 120, 0.26);
    --rule: rgba(160, 200, 240, 0.07);
    --rule-margin: rgba(240, 150, 140, 0.28);
    --hatch: rgba(236, 235, 226, 0.2);
    --code-bg: rgba(0, 0, 0, 0.2);
    --note-yellow: #3b3d2c;
    --note-pink: #3f3133;
    --note-blue: #2b3a44;
    --note-ink: #ecebe2;
    --note-shadow: rgba(0, 0, 0, 0.45);
    --smudge-1: rgba(236, 235, 226, 0.05);
    --smudge-2: rgba(236, 235, 226, 0.035);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #1d2a26;
  --paper-dot: rgba(236, 235, 226, 0.05);
  --card: #24332e;
  --ink: #ecebe2;
  --ink-2: #c3c7bc;
  --ink-3: #8d978f;
  --blue: #9fc6ee;
  --green: #9fd9b5;
  --red: #f2a093;
  --amber: #ecc27e;
  --marker: rgba(244, 226, 120, 0.26);
  --rule: rgba(160, 200, 240, 0.07);
  --rule-margin: rgba(240, 150, 140, 0.28);
  --hatch: rgba(236, 235, 226, 0.2);
  --code-bg: rgba(0, 0, 0, 0.2);
  --note-yellow: #3b3d2c;
  --note-pink: #3f3133;
  --note-blue: #2b3a44;
  --note-ink: #ecebe2;
  --note-shadow: rgba(0, 0, 0, 0.45);
  --smudge-1: rgba(236, 235, 226, 0.05);
  --smudge-2: rgba(236, 235, 226, 0.035);
}

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

/* Outlines and pencil shading reach past the cards; never let them widen the page on phones. */
html { overflow-x: hidden; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  background-color: var(--paper);
  /* chalk smudges (transparent on paper) + dot grid */
  background-image:
    radial-gradient(ellipse 60% 40% at 18% 8%, var(--smudge-1), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 55%, var(--smudge-2), transparent 70%),
    radial-gradient(circle, var(--paper-dot) 1.1px, transparent 1.4px);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  background-position: 0 0, 0 0, 11px 11px;
  background-repeat: no-repeat, no-repeat, repeat;
  background-attachment: fixed, fixed, scroll;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--marker); }
:focus-visible { outline: 2px dashed var(--red); outline-offset: 4px; border-radius: 4px; }

.page {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}
/* Notebook margin line, only where there is room for it */
@media (min-width: 1220px) {
  .page::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: -14px;
    width: 5px;
    border-left: 1.5px solid var(--rule-margin);
    border-right: 1px solid var(--rule-margin);
    pointer-events: none;
  }
}

/* ---------- Sketch overlays (drawn by site.js) ---------- */
[data-sketch] { position: relative; }
/* With JS on, the drawn outline replaces the plain CSS border (kept as the no-JS fallback). */
.js [data-sketch] { border-color: transparent !important; }
.sketch-svg {
  position: absolute;
  pointer-events: none;
  overflow: visible;
  color: var(--sketch-color, var(--ink));
}
.sketch-svg path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.sketch-svg .pass-2 { opacity: 0.55; }
.sketch-svg .hatch { stroke: var(--hatch); }
.sketch-svg.animate path:not(.hatch) { stroke-dasharray: 1 2; stroke-dashoffset: 1; }
.sketch-svg.animate .hatch { opacity: 0; }
.sketch-svg.animate.drawn path:not(.hatch) {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--dur, 0.4s) cubic-bezier(0.5, 0.1, 0.3, 1) var(--delay, 0s);
}
.sketch-svg.animate.drawn .hatch { opacity: 1; transition: opacity var(--dur, 0.6s) ease var(--delay, 0s); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 8px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; align-self: center; }
.brand-mark path { fill: none; stroke: var(--blue); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-family: var(--font-hand); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.02em; }
.brand-sub { font-family: var(--font-note); font-size: 1.35rem; color: var(--ink-3); }

.nav { display: flex; align-items: center; gap: 22px; font-family: var(--font-hand); font-size: 1.05rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); text-decoration: underline wavy var(--red) 1.5px; text-underline-offset: 6px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
  transition: rotate 0.2s ease, background-color 0.2s ease;
}
.theme-toggle:hover { rotate: -2deg; background: var(--marker); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle .icon path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 40px;
  padding: 56px 0 36px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-family: var(--font-hand);
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}
.eyebrow-star { width: 20px; height: 20px; rotate: -12deg; }
.eyebrow-star path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

h1 {
  margin: 0 0 22px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  line-height: 1.18;
  letter-spacing: 0.005em;
}
.marker {
  padding: 0 0.12em;
  background-image: linear-gradient(100deg, transparent 0.2em, var(--marker) 0.35em, var(--marker) calc(100% - 0.3em), transparent calc(100% - 0.12em));
  background-repeat: no-repeat;
  background-size: 100% 0.48em;
  background-position: 0 86%;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lead { margin: 0 0 22px; max-width: 32em; color: var(--ink-2); font-size: 1.12rem; }
.tally { margin: 0 0 30px; font-family: var(--font-hand); font-size: 1.12rem; color: var(--ink-2); }
.tally-item { white-space: nowrap; }
.circled {
  display: inline-block;
  margin: 0 0.45em;
  padding: 0 1px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
  --sketch-color: var(--red);
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px 8px 22px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.12rem;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  transition: background-color 0.2s ease, rotate 0.2s ease;
}
.cta .icon { width: 22px; height: 22px; transition: translate 0.2s ease; }
.cta .icon path, .more .icon path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cta:hover { background: var(--marker); rotate: 1deg; }
.cta:hover .icon { translate: 0 3px; }
.text-link {
  font-family: var(--font-hand);
  font-size: 1.08rem;
  color: var(--ink-2);
  text-decoration: underline wavy var(--ink-3) 1px;
  text-underline-offset: 6px;
}
.text-link:hover { color: var(--ink); text-decoration-color: var(--red); }

.hero-doodle { position: relative; margin: 0; }
.hero-doodle svg { display: block; width: 100%; height: auto; }
.hero-doodle path, .hero-doodle circle { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.doodle-ink path, .doodle-ink circle { stroke: var(--ink); stroke-width: 2.2; }
.doodle-ink .faint { stroke-width: 1.2; opacity: 0.45; }
.doodle-box path { stroke: var(--amber); stroke-width: 2; }
.doodle-box .tape { stroke: var(--red); stroke-width: 1.6; }
.doodle-red path { stroke: var(--red); stroke-width: 1.8; }
.doodle-check { stroke: var(--green) !important; stroke-width: 2.4 !important; }
.doodle-star { stroke: var(--blue) !important; stroke-width: 2; fill: var(--marker) !important; }
.doodle-cursor { fill: var(--ink); opacity: 0.75; }
.js .doodle-cursor { animation: blink 1.1s steps(1) 3.2s infinite; }
.doodle-term text { font-family: var(--font-note); font-size: 25px; fill: var(--ink); }
.doodle-term .ok { fill: var(--green); }
.doodle-term .dim { fill: var(--ink-3); }
.doodle-label { font-family: var(--font-note); font-size: 20px; fill: var(--amber); }
.doodle-note { font-family: var(--font-note); font-size: 23px; fill: var(--red); }
.margin-note {
  margin: 4px 0 0 auto;
  max-width: 22em;
  font-family: var(--font-note);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--ink-3);
  text-align: right;
  rotate: -1.5deg;
}

/* Draw-on animation for inline doodles (paths use pathLength="1"). */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; scale: 0.2; } to { opacity: 1; scale: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 50% { opacity: 0; } }

.js .draw { stroke-dasharray: 1 2; stroke-dashoffset: 1; animation: draw 0.9s cubic-bezier(0.45, 0.1, 0.2, 1) forwards; }
.js .pop { opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop 0.3s ease-out forwards; }
.js .fade { opacity: 0; animation: fade 0.5s ease-out forwards; }
.js .d1 { animation-delay: 0.1s; }
.js .d2 { animation-delay: 0.6s; }
.js .d3 { animation-delay: 1.1s; }
.js .d4 { animation-delay: 1.5s; }
.js .d5 { animation-delay: 1.9s; }
.js .d6 { animation-delay: 2.3s; }
.js .d7 { animation-delay: 2.7s; }
.js .doodle-note { opacity: 0; animation: fade 0.6s ease-out 2.9s forwards; }
.js .eyebrow-star .draw { animation-delay: 0.2s; animation-duration: 1.2s; }

/* ---------- Shelf index ---------- */
.shelf-index {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.shelf-index a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 14px 3px 12px;
  font-family: var(--font-hand);
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--ink-2);
  border: 1.5px solid var(--accent);
  border-radius: 7px;
  --sketch-color: var(--accent);
  transition: background-color 0.2s ease, rotate 0.2s ease;
}
.shelf-index a b { font-family: var(--font-note); font-size: 1.15em; color: var(--accent); }
.shelf-index a small { font-family: var(--font-note); font-size: 1.1em; color: var(--ink-3); }
.shelf-index a:hover { background: var(--marker); color: var(--ink); rotate: -1.5deg; }

/* ---------- Sections ---------- */
.section { padding: 48px 0 20px; scroll-margin-top: 12px; }
h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 12px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  line-height: 1.3;
}
.section-no {
  font-family: var(--font-note);
  font-weight: 700;
  font-size: 1.15em;
  color: var(--accent, var(--red));
  rotate: -6deg;
}
h2 small {
  font-family: var(--font-note);
  font-weight: 500;
  font-size: 0.7em;
  color: var(--ink-3);
}
.section-intro { margin: 0 0 44px; max-width: 40em; color: var(--ink-2); }

/* ---------- Project index cards ---------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 58px 40px;
  padding-top: 14px;
}
.proj {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 22px;
  background-color: var(--card);
  /* index card: red header rule + faint blue lines */
  background-image:
    linear-gradient(transparent 0, transparent 70px, var(--rule-margin) 70px, var(--rule-margin) 71.5px, transparent 71.5px),
    repeating-linear-gradient(transparent 0, transparent 29px, var(--rule) 29px, var(--rule) 30px);
  background-position: 0 0, 0 72px;
  background-size: 100% 100%, 100% calc(100% - 72px);
  background-repeat: no-repeat;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  --sketch-color: var(--ink);
  rotate: var(--tilt, 0deg);
  transition: rotate 0.3s ease, translate 0.3s ease;
}
.proj:nth-child(3n + 1) { --tilt: -0.6deg; }
.proj:nth-child(3n + 2) { --tilt: 0.45deg; }
.proj:nth-child(3n) { --tilt: -0.25deg; }
.proj:hover { rotate: 0deg; translate: 0 -4px; }

.proj-tab {
  position: absolute;
  top: -29px;
  left: 18px;
  padding: 2px 14px 1px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--card);
  background: var(--accent);
  border-radius: 9px 12px 0 0;
}
.stamp {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 1px 9px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--red);
  border: 2px solid currentColor;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3.5px currentColor;
  rotate: 6deg;
  opacity: 0.85;
}
.proj-title {
  margin: 2px 0 22px;
  padding-right: 92px;
  min-height: 1.3em;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.proj-title a { text-decoration: none; }
.proj-title a:hover { text-decoration: underline wavy var(--accent) 1.5px; text-underline-offset: 5px; }
.proj-desc { margin: 0 0 16px; color: var(--ink-2); line-height: 1.6; }

.install {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 0 16px;
  border: 1.5px dashed var(--ink-3);
  border-radius: 6px;
  background: var(--code-bg);
  overflow: hidden;
}
.install code {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.install code::before { content: '$ '; color: var(--ink-3); }
.copy {
  flex: none;
  padding: 0 11px;
  font-family: var(--font-hand);
  font-size: 0.9rem;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-left: 1.5px dashed var(--ink-3);
  cursor: pointer;
}
.copy:hover { background: var(--marker); color: var(--ink); }
.copy[data-done] { color: var(--green); }
.get-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 4px 14px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--accent);
  border: 1.5px dashed currentColor;
  border-radius: 6px;
}
.get-link:hover { background: var(--marker); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin: 0 0 14px;
  padding: 8px 0 6px;
  list-style: none;
  font-family: var(--font-hand);
  font-size: 0.92rem;
  color: var(--ink-3);
  border-top: 1.5px dashed var(--rule-margin);
}
.meta .star { color: var(--ink); font-weight: 700; }
.meta .star::before { content: '\2605\00a0'; color: var(--amber); }

.links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: auto 0 0; padding: 0; list-style: none; }
.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--accent);
}
.links a::after { content: '\2192'; transition: translate 0.2s ease; }
.links a:hover { text-decoration: underline wavy currentColor 1px; text-underline-offset: 5px; }
.links a:hover::after { translate: 3px 0; }

/* ---------- Sticky notes (agent skills) ---------- */
.notes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 36px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
}
.note {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 26px;
  color: var(--note-ink);
  background: var(--note-bg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05), 0 14px 20px -14px var(--note-shadow);
  rotate: var(--tilt);
  transition: rotate 0.3s ease;
}
/* adhesive strip and a lifted corner */
.note::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 26px;
  background: linear-gradient(rgba(0, 0, 0, 0.045), transparent);
}
.note::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--note-bg) 45%, rgba(0, 0, 0, 0.1) 50%, var(--paper) 56%);
}
.note:hover { rotate: 0deg; }
.note:nth-child(3n + 1) { --note-bg: var(--note-yellow); --tilt: -1.4deg; }
.note:nth-child(3n + 2) { --note-bg: var(--note-pink); --tilt: 1.1deg; margin-top: 16px; }
.note:nth-child(3n) { --note-bg: var(--note-blue); --tilt: -0.7deg; }
.note h3 { margin: 0 0 6px; font-family: var(--font-hand); font-weight: 700; font-size: 1.3rem; line-height: 1.25; }
.note h3 a { text-decoration: none; }
.note h3 a:hover { text-decoration: underline wavy currentColor 1px; text-underline-offset: 5px; }
.note p { margin: 0 0 12px; font-size: 1rem; line-height: 1.55; opacity: 0.88; }
.note .meta { margin: auto 0 0; padding-bottom: 0; color: inherit; opacity: 0.7; border-top-color: rgba(0, 0, 0, 0.15); }
:root[data-theme='dark'] .note { border: 1.5px dashed rgba(236, 235, 226, 0.22); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .note { border: 1.5px dashed rgba(236, 235, 226, 0.22); }
}
.skills-how {
  margin: 36px 0 0;
  font-family: var(--font-note);
  font-size: 1.3rem;
  line-height: 1.35;
  color: var(--ink-3);
}
.skills-how code { font-family: var(--font-mono); font-size: 0.72em; color: var(--ink-2); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 64px;
  padding: 0 0 44px;
  text-align: center;
  font-size: 0.98rem;
  color: var(--ink-3);
}
.footer-rule { display: block; width: min(420px, 80%); height: 14px; margin: 0 auto 18px; }
.footer-rule path { fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; }
.footer p { margin: 0; }
.footer-note { margin-top: 2px !important; font-family: var(--font-note); font-size: 1.2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 36px; }
  .hero-doodle { max-width: 460px; }
  .notes { grid-template-columns: 1fr; gap: 26px; max-width: 540px; }
  .note:nth-child(3n + 2) { margin-top: 0; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .page { padding: 0 16px; }
  .topbar { padding-top: 18px; }
  .brand-sub { display: none; }
  .eyebrow { font-size: 0.9rem; letter-spacing: 0.06em; }
  .nav { gap: 14px; }
  .nav a { display: none; }
  .proj { padding: 24px 18px 20px; }
  .proj-grid { gap: 52px; }
  .shelf-index { gap: 10px; }
  .margin-note { margin-right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .js .draw, .js .pop, .js .fade, .js .doodle-note, .js .doodle-cursor { animation: none !important; opacity: 1 !important; }
  .js .draw { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
  .proj, .note, .cta, .theme-toggle, .shelf-index a, .links a::after { transition: none; }
}
