/*
 * One stylesheet for the whole site. Deliberately plain: a book-like serif,
 * a narrow reading column, blue links, and almost nothing else.
 */

body {
  font-family: "Iowan Old Style", "Apple Garamond", "Palatino Linotype", "URW Palladio L", P052, Baskerville, serif;
  line-height: 1.5;
  color: #333;
  background: #fff;
  margin: 0;
  overflow-x: hidden;
}

/* The column drifts left on mid-sized screens and settles back to centre on wide ones. */
.container {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 45rem;
  box-sizing: border-box;
  padding: 0 1.5rem;
}
@media (45rem < width < 67rem) {
  .container { margin-left: calc((100vw - 45rem) * tan(atan2(67rem - 100vw, 44rem))); }
}
@media (67rem <= width < 89rem) {
  .container { margin-left: calc((100vw - 45rem) * tan(atan2(100vw - 67rem, 44rem))); }
}

/* Header nav */
.header ul { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; }
.header li { margin-right: 20px; }
.header li:last-child { margin-right: 0; }
.header a { color: #333; text-decoration: none; }
.header a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }

a { color: #337ab7; }

img { max-width: 100%; height: auto; }
figure { margin: 20px auto; width: 80%; display: flex; flex-direction: column; align-items: center; }
figcaption { text-align: center; margin-top: 8px; font-style: italic; font-size: .9em; }

code {
  background-color: #f5f5f5;
  padding: .1em .2em;
  border-radius: 3px;
  font-size: .8em;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

blockquote { padding: 0 .5rem; border-left: 4px solid #ccc; font-style: italic; margin-inline-start: 0; }

/* Two columns that stack on narrow screens */
.col { display: flex; flex-wrap: wrap; margin-left: -1rem; margin-right: -1rem; }
.col > div { flex: 1 1; margin: 1rem 0; min-width: 100px; max-width: 100%; padding: 0 1rem; }
.col .col-inner { margin-top: 0; margin-bottom: 0; }
.col figure { width: 100%; margin-top: 0; }
@media only screen and (max-width: 768px) {
  .col > div { flex-basis: 100%; }
}

/* Placeholder photo until a real one goes in img/ */
.photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-style: italic;
  font-size: .9em;
}

/* Bits of text still to be filled in. Delete the class once they're real. */
.todo { background: #fff6cc; }
.project-overlay .todo { background: none; color: #ffe27a; }


/* Now page */
.now-entries h2 { margin-top: .5em; margin-bottom: 0; }
.now-entries p { margin-top: 0; }
.now-time { margin-top: .25em; font-style: italic; color: #666; }
.now-entries article { margin-bottom: 2em; }
.now-archive { font-size: .95em; }

/* Projects grid: thumbnail with a dark overlay on hover/focus */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.project-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid #ccc;
}
.project-card:hover .project-overlay,
.project-card:focus-within .project-overlay { opacity: 1; }
.project-card:hover .project-thumbnail img { transform: scale(1.03); }
.project-thumbnail { width: 100%; height: 100%; }
.project-thumbnail img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s ease; }
.project-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
}
.project-placeholder span { font-size: 1.2rem; color: #333; }
.project-overlay {
  position: absolute;
  inset: 0;
  background: #333;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  text-align: center;
  opacity: 0;
  transition: opacity .5s ease;
}
.project-overlay h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.project-overlay p { margin: 0 0 .75rem; font-size: .85rem; line-height: 1.4; }
.project-links { display: flex; gap: 1rem; }
.project-links a { color: #fff; text-decoration: none; font-size: .85rem; }
.project-links a:hover { font-weight: 700; }
@media (max-width: 768px) {
  .projects-grid { grid-template-columns: 1fr; }
}

hr.dinkus { border: none; margin: 2rem 0; text-align: center; }
hr.dinkus::before { content: "* * *"; display: inline-block; font-size: 1.2rem; letter-spacing: .5em; text-indent: .5em; color: #333; }

/* Footer */
footer { text-align: center; padding: 20px 0; margin-top: 2rem; border-top: 3px solid #ccc; }
footer a { text-decoration: none; }

/* Flair (flair.js): one click-through canvas over the whole page */
canvas.flair { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

/* A little air under the nav for the paper plane to fly through */
.header ul { margin-bottom: 1.75rem; }

/* On critter pages, each block's top edge is a walkway: give them room to stand */
.has-critters .container > p,
.has-critters .col-inner > p,
.has-critters .col-inner > ul,
.has-critters .col figure { margin-top: 2.75rem; }
.has-critters .container > p,
.has-critters .col-inner > p { margin-bottom: 0; }
.has-critters .col > div { margin-top: 0; }
.has-critters footer { margin-top: 3rem; }

/* ── Section pages ───────────────────────────────────── */

:root {
  --ink: #1e1b2e;
  --amber: #f4b447;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* A page title and year headings underlined in amber, like a notebook heading */
.page-title { border-bottom: 2px solid var(--amber); padding-bottom: .15rem; margin-bottom: 1rem; }
.year { border-bottom: 2px solid var(--amber); padding-bottom: .1rem; margin: 2.25rem 0 .5rem; font-size: 1.5rem; }
.lede { color: #555; }

/* Small sans-serif labels: dates, tags, meta */
.post-date, .session-date, .tag, .startup-role, .startup-tags, .startup-link, .lift-best, .lift-sub, .sets .num {
  font-family: var(--sans);
}
.tag {
  display: inline-block;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .15em .55em;
  border-radius: 999px;
  margin-left: .45em;
  vertical-align: .2em;
}
.tag-essay { background: #e8edff; color: #3660ff; }
.tag-reading { background: #fdf0d5; color: #8a5a00; }
.tag-example { background: #fff6cc; color: #8a6d00; }

/* Thoughts: title, then the date underneath */
.post-list { padding-left: 1.2rem; margin: 1.5rem 0; }
.post-list li { margin-bottom: 1.1rem; }
.post-list a { font-size: 1.15em; text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
.post-date { display: block; font-size: .85rem; color: #666; margin-top: .1rem; }

/* Books: one line per book, grouped by year */
.book-list { list-style: none; padding: 0; margin: 0; }
.book-list li { margin: .7rem 0; }
.book-list a { text-decoration: none; }
.book-list a:hover { text-decoration: underline; }

/* Startups: chunky ink-outlined cards, BlueAcorn style */
.startups { display: grid; grid-template-columns: 1fr; gap: 2.5rem; margin: 2rem 0; }
.startup {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform .25s ease, box-shadow .25s ease;
}
@media (hover: hover) { .startup:hover { transform: translate(-2px, -3px); box-shadow: 8px 9px 0 var(--ink); } }
/* Full-width product shots, at their own shape */
.startup-shot { display: block; position: relative; overflow: hidden; border-bottom: 1.5px solid var(--ink); }
.startup-shot img { display: block; width: 100%; height: auto; transition: transform .6s ease; }
@media (hover: hover) { .startup:hover .startup-shot img { transform: scale(1.02); } }
/* A browser window for a website… */
.shot-browser { background: #f2eee8; padding-top: 26px; }
.shot-browser::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 26px;
  background: #fffdf8 radial-gradient(circle, #e0675a 4px, transparent 4.5px) 12px 50% / 14px 14px no-repeat;
  border-bottom: 1.5px solid var(--ink);
}
.shot-browser::after {
  content: "";
  position: absolute; top: 0; left: 26px; width: 40px; height: 26px;
  background: radial-gradient(circle, #f4b447 4px, transparent 4.5px) 0 50% / 14px 14px no-repeat,
              radial-gradient(circle, #00c78d 4px, transparent 4.5px) 14px 50% / 14px 14px no-repeat;
}
/* …and an iPad for an app */
/* Room above and below the iPad for Plumi's quill to write in */
/* (at least 40px above and below, so there's room on a phone too) */
.shot-ipad { background: linear-gradient(135deg, #e3eeff, #c4e6f6); padding: max(8%, 40px) max(7%, 16px); }
.shot-ipad img { border: 9px solid var(--ink); border-radius: 20px; box-shadow: 0 14px 30px rgba(30, 27, 46, .25); box-sizing: border-box; }
.startup-body { display: flex; flex-direction: column; gap: .65rem; flex: 1; padding: 1rem 1.25rem 1.25rem; }
.startup-head { display: flex; align-items: center; gap: .75rem; }
.startup-mark { flex: none; width: 44px; height: 44px; border-radius: 11px; overflow: hidden; }
.startup-mark img { display: block; width: 100%; height: 100%; }
.mark-ba { background: #3660ff; color: #fff; font: 800 15px/44px var(--sans); text-align: center; box-shadow: 0 4px 10px rgba(54, 96, 255, .35); }
.startup h2 { margin: 0; font-size: 1.25rem; line-height: 1.2; }
.startup-role { margin: .1rem 0 0; font-size: .8rem; color: #666; }
.startup-pitch { margin: 0; }
.startup-tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; font-size: .72rem; }
.startup-tags li { padding: .2em .65em; border-radius: 999px; background: #f2eee8; border: 1px solid #e3dccf; }
.startup-link { margin-top: auto; padding-top: .25rem; font-weight: 600; font-size: .9rem; text-decoration: none; }
.startup-link:hover { text-decoration: underline; }
/* On a computer the card's text sits in two columns under the shot:
   name and pitch on the left, the link and tags on the right */
@media (min-width: 640px) {
  .startup-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    grid-template-areas: "head link" "pitch tags";
    column-gap: 2rem;
    row-gap: .8rem;
    padding: 1.25rem 1.5rem 1.5rem;
  }
  .startup-head { grid-area: head; }
  .startup-pitch { grid-area: pitch; }
  .startup-link { grid-area: link; justify-self: end; align-self: center; margin: 0; padding: 0; }
  .startup-tags { grid-area: tags; align-content: start; justify-content: flex-end; }
}

/* Exercise log */
.lift-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.lift-card { border: 1.5px solid var(--ink); border-radius: 12px; padding: .8rem .95rem .7rem; box-shadow: 3px 3px 0 var(--ink); }
.lift-card h3 { margin: 0; font-size: 1rem; }
.lift-best { margin: .2rem 0 0; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.lift-sub { margin: 0; font-size: .75rem; color: #666; }
.lift-up { color: #00a676; font-weight: 600; }
.lift-chart { margin-top: .45rem; }
.lift-chart svg { display: block; width: 100%; height: 56px; overflow: visible; }
.session { margin: 0 0 2.25rem; }
.session-date { margin: 0; font-size: .85rem; color: #666; }
.session h3 { display: flex; align-items: center; gap: .5rem; margin: .1rem 0 .4rem; }
.session-icons { display: inline-flex; gap: .3rem; }
.session-icon { height: 24px; width: auto; flex: none; transition: transform .35s cubic-bezier(.34, 1.6, .64, 1); }
/* A little life on hover: the dumbbell gets lifted, the shoe takes a hop */
@media (hover: hover) {
  .session:hover .icon-gym { transform: translateY(-3px) rotate(-8deg); }
  .session:hover .icon-run { transform: translate(3px, -3px) rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) { .session-icon { transition: none; } }
.sets { list-style: none; padding: 0; margin: .25rem 0 .6rem; }
.sets li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px dashed #e2e2e2; }
.sets .num { font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.session-video { margin-top: .6rem; }
.session-video video { display: block; max-width: 100%; max-height: 75vh; border-radius: 12px; background: #000; }
.session-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }
.session-video iframe.vertical { width: min(100%, 340px); aspect-ratio: 9 / 16; }

/* While Plumi's quill is being dragged (flair.js) */
.quill-dragging, .quill-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* Written in by Plumi's quill when the Startups page loads (flair.js) */
.handwritten { font-family: Caveat, "Segoe Print", "Bradley Hand", cursive; font-weight: 700; color: var(--ink); }
h1.handwritten { font-size: 3.1rem; line-height: 1.1; }
p.handwritten { font-size: 1.55rem; line-height: 1.3; color: #333; }
html.plumi-intro [data-plumi-write] { clip-path: inset(0 100% 100% 0); }

/* Books: rating and reading time under each title (books/books.js) */
.book-list li { margin: .9rem 0; }
.book-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; margin-top: .15rem; font-family: var(--sans); font-size: .8rem; color: #666; }
.stars { display: inline-flex; gap: 1px; }
/* Hand-drawn stars, like the doodles: a slow bob and sway, and a pencil
   "boil" – books.js swaps each outline between three wobbly versions */
.star { width: 19px; height: 19px; overflow: visible; animation: star-sway 2.6s ease-in-out infinite; }
.star polygon { fill: rgba(244, 180, 71, 0.8); stroke: rgba(30, 27, 46, 0.5); stroke-width: 1.6; stroke-linejoin: miter; }
.star-empty polygon { fill: none; stroke: rgba(30, 27, 46, 0.3); }
.star-still { animation: none; }
@keyframes star-sway {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-1.5px) rotate(5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .star { animation: none; }
}

/* ── The library (books.js): a hand-drawn bookcase ───── */
.library { margin: 1.5rem 0 1rem; padding-top: 1rem; }
.bookcase {
  position: relative;
  padding: 14px 14px 2px;
  background: #c98a52 repeating-linear-gradient(90deg, transparent 0 46px, rgba(30, 27, 46, .06) 46px 48px, transparent 48px 97px);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
}
.shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 212px;
  padding: 0 12px;
  background: #f7ecdc;
  border: 2px solid var(--ink);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: inset 0 12px 18px -10px rgba(30, 27, 46, .25);
}
.board {
  position: relative;
  height: 12px;
  margin: 0 -8px 12px;
  background: #b5733c;
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 4px 0 rgba(30, 27, 46, .2);
}
.spine {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 20px;
  border: 2px solid var(--ink);
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  cursor: pointer;
  font: inherit;
  box-shadow: inset -5px 0 0 rgba(30, 27, 46, .12), inset 4px 0 0 rgba(255, 255, 255, .18);
  transform-origin: 50% 100%;
  transition: transform .3s cubic-bezier(.34, 1.6, .64, 1);
}
.spine:focus-visible, .spine.is-out { transform: translateY(-12px) rotate(-2deg); }
@media (hover: hover) { .spine:hover { transform: translateY(-12px) rotate(-2deg); } }
.spine:focus-visible { outline: 2px dashed var(--ink); outline-offset: 3px; }
/* Gold bands near the top and bottom, on some spines */
.spine-bands::before, .spine-bands::after {
  content: "";
  position: absolute; left: 4px; right: 4px; height: 3px;
  background: rgba(255, 255, 255, .55);
  border-radius: 2px;
}
.spine-bands::before { top: 9px; }
.spine-bands::after { bottom: 11px; }
.spine-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: Caveat, "Segoe Print", "Bradley Hand", cursive;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
}
.spine-star { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-size: 11px; color: #f4b447; text-shadow: 0 0 1px var(--ink); }
/* The book being read has a bookmark ribbon peeking out of the top */
.ribbon {
  position: absolute; top: -12px; left: 7px;
  width: 7px; height: 26px;
  background: #e0675a;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  animation: ribbon-sway 3s ease-in-out infinite;
  transform-origin: 50% 0;
}
@keyframes ribbon-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
/* Ornaments at the right-hand end of a shelf */
.decor { margin-left: auto; align-self: flex-end; pointer-events: none; }
.inkpot { position: relative; width: 62px; height: 112px; }
.inkpot svg { position: absolute; left: 1px; bottom: 0; width: 60px; height: 44px; }
.inkpot img { position: absolute; left: -14px; bottom: 22px; width: 96px; height: 96px; max-width: none; transform: rotate(-6deg); }
.plant svg { display: block; width: 50px; height: 66px; }
.shelf-note {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%) rotate(-2deg);
  font-family: Caveat, "Segoe Print", "Bradley Hand", cursive; font-weight: 700; font-size: 1.3rem; color: #a8957c;
  white-space: nowrap;
}
.book-card {
  position: absolute; z-index: 5;
  width: max-content; max-width: min(260px, 80vw);
  padding: .6rem .8rem .65rem;
  background: #fffdf8;
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}
.book-card::after {
  content: ""; position: absolute; left: calc(var(--tail, 50%) - 7px); bottom: -9px;
  width: 12px; height: 12px; background: #fffdf8;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
.book-card p { margin: 0; }
.book-card-title { font-weight: 700; line-height: 1.25; }
.book-card-author { color: #555; font-size: .9rem; }
.book-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; margin-top: .35rem !important; font-family: var(--sans); font-size: .75rem; color: #666; }
.book-card-meta .tag { margin-left: 0; }
.book-card-link { display: inline-block; margin-top: .4rem; font-family: var(--sans); font-size: .8rem; font-weight: 600; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .spine, .ribbon { transition: none; animation: none; }
}

/* A book found from the bookcase: a highlighter sweeps across its line, then fades */
.book-list li { position: relative; z-index: 0; scroll-margin: 6rem 0; }
.book-list li:focus { outline: none; }
.book-list li.is-found::before {
  content: "";
  position: absolute; inset: -5px -10px; z-index: -1;
  border-radius: 10px;
  background: rgba(244, 180, 71, .35);
  transform-origin: left center;
  animation: book-found 3s ease forwards;
}
@keyframes book-found {
  0% { transform: scaleX(0); opacity: 1; }
  15% { transform: scaleX(1); opacity: 1; }
  70% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .book-list li.is-found::before { animation: none; transform: none; opacity: .9; }
}

/* Home: the "Currently" box (currently.js) */
.currently {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem;
  margin: 2rem 0 0; padding: .65rem .95rem;
  background: #fffdf8;
  border: 1.5px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .95rem;
}
.currently[hidden] { display: none; }
.cur-label {
  font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .2em .6em; border-radius: 999px; background: #fdf0d5; color: #8a5a00;
}
.cur-item { display: inline-flex; align-items: center; gap: .4rem; }
.cur-item svg { height: 20px; width: auto; flex: none; }
.cur-item a { text-decoration: none; }
.cur-item a:hover { text-decoration: underline; }
.cur-sub { font-family: var(--sans); font-size: .75rem; color: #777; }

/* 404: a big handwritten number for the critters to stand on */
.big-404 {
  margin: 1.5rem 0 0 !important;
  font-family: Caveat, "Segoe Print", "Bradley Hand", cursive; font-weight: 700;
  font-size: 7rem; line-height: 1; color: var(--ink);
  text-shadow: 4px 4px 0 #f4b447;
}

/* ── Nav buttons: light/dark, and critters on/off (theme.js) ── */
.header li.nav-tools { margin-left: auto; margin-right: 0; display: flex; gap: .45rem; align-items: center; }
.nav-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 30px; padding: 0;
  color: var(--ink); background: transparent;
  border: 1.5px solid var(--ink); border-radius: 9px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34, 1.6, .64, 1), box-shadow .2s ease;
}
.nav-tool svg { width: 20px; height: 20px; }
@media (hover: hover) { .nav-tool:hover { transform: translate(-1px, -2px) rotate(-4deg); box-shadow: 3px 4px 0 var(--ink); } }
.nav-tool:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.nav-tool:focus-visible { outline: 2px dashed var(--amber); outline-offset: 3px; }

/* A soft cross-fade when the theme is flicked (not on page load) */
html.theme-fade body, html.theme-fade .startup, html.theme-fade .currently, html.theme-fade .book-card {
  transition: background-color .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease;
}

/* ── Dark mode ──────────────────────────────────────────
   The outlines and offset shadows turn from ink to chalk, like drawing on a
   blackboard; surfaces go dark; the colourful bits stay as they are. */
html[data-theme="dark"] { color-scheme: dark; --ink: #ece8f6; }
html[data-theme="dark"] body { background: #16141d; color: #e3dfeb; }
html[data-theme="dark"] .header a,
html[data-theme="dark"] hr.dinkus::before,
html[data-theme="dark"] p.handwritten { color: #e3dfeb; }
html[data-theme="dark"] a { color: #8db4ff; }
html[data-theme="dark"] code { background: #262333; }
html[data-theme="dark"] footer { border-top-color: #3a3646; }
html[data-theme="dark"] blockquote { border-left-color: #3a3646; }
html[data-theme="dark"] .lede,
html[data-theme="dark"] .book-card-author { color: #c2bdd0; }
html[data-theme="dark"] :is(.now-time, .post-date, .startup-role, .lift-sub, .session-date, .book-meta, .book-card-meta, .cur-sub) { color: #a8a3b8; }
html[data-theme="dark"] .todo { background: rgba(255, 214, 0, .18); }
html[data-theme="dark"] :is(.startup, .currently, .book-card) { background: #1f1c29; }
html[data-theme="dark"] .book-card::after { background: #1f1c29; }
html[data-theme="dark"] .startup-tags li { background: #2a2637; border-color: #3a3549; }
html[data-theme="dark"] .sets li { border-bottom-color: #34303f; }
html[data-theme="dark"] .shot-browser { background: #2a2637; }
html[data-theme="dark"] .shot-browser::before { background-color: #221f2d; }
html[data-theme="dark"] .shot-ipad img { border-color: #0d0c12; }
html[data-theme="dark"] .tag-essay { background: rgba(54, 96, 255, .22); color: #a9bfff; }
html[data-theme="dark"] :is(.tag-reading, .tag-example, .cur-label) { background: rgba(244, 180, 71, .18); color: #f6c873; }
html[data-theme="dark"] .star polygon { stroke: rgba(236, 232, 246, .55); }
html[data-theme="dark"] .star-empty polygon { stroke: rgba(236, 232, 246, .3); }
html[data-theme="dark"] .shelf { background: #2c2430; box-shadow: inset 0 12px 18px -10px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .shelf-note { color: #8d7e6c; }
html[data-theme="dark"] .lift-up { color: #35d6a0; }

/* ── Phones ─────────────────────────────────────────────
   Taps act at once (no double-tap-to-zoom wait), no grey tap flash, text that
   doesn't swell when the phone turns sideways, and fingertip-sized targets. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
a, button, .spine { -webkit-tap-highlight-color: transparent; }
footer { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  .header ul { row-gap: .15rem; }
  .header li { margin-right: 16px; }
  .header a { display: inline-block; padding: .45rem 0; }
  .nav-tool { width: 38px; height: 36px; }
  .nav-tool svg { width: 22px; height: 22px; }
  .big-404 { font-size: 5.5rem; }
  .currently { font-size: .9rem; }
  h1.handwritten { font-size: 2.7rem; }
  p.handwritten { font-size: 1.4rem; }
}

/* ── Essays (essay.js): reading time, readers, sharing ── */
.essay-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem;
  margin: -.35rem 0 1.75rem;
  font-family: var(--sans); font-size: .85rem; color: #666;
}
.essay-meta > span:not(:empty):not([hidden])::before { content: "·"; margin-right: .55rem; color: #aaa; }
.essay-reads.is-new { animation: reads-pop .7s cubic-bezier(.34, 1.6, .64, 1); }
@keyframes reads-pop { 0% { transform: scale(.85); color: #f4b447; } 100% { transform: scale(1); } }
.essay-body p { margin: 1.1em 0; }
.essay-body h2 { margin: 2em 0 .5em; font-size: 1.35rem; }
.essay-foot { margin-top: 2.5rem; text-align: center; }
.essay-foot p { margin: .6rem 0; }
.essay-back { margin-top: 1.5rem !important; }
.share-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .8rem;
  font: 600 .8rem var(--sans); color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink); border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34, 1.6, .64, 1), box-shadow .2s ease;
}
.essay-foot .share-btn { margin: .4rem auto 0; padding: .5rem 1.1rem; font-size: .9rem; }
.share-btn svg { width: 16px; height: 16px; }
.share-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
@media (hover: hover) { .share-btn:hover { transform: translate(-1px, -2px) rotate(-3deg); box-shadow: 3px 4px 0 var(--ink); } }
.share-menu {
  position: absolute; z-index: 40; min-width: 190px;
  display: flex; flex-direction: column;
  padding: .35rem;
  background: #fffdf8;
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
}
.share-menu a, .share-menu button {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .65rem;
  font: .88rem var(--sans); color: #333; text-decoration: none; text-align: left;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.share-menu a:hover, .share-menu button:hover, .share-menu :focus-visible { background: #fdf0d5; outline: none; }
.post-extra { color: #888; }
html[data-theme="dark"] .essay-meta { color: #a8a3b8; }
html[data-theme="dark"] .share-menu { background: #1f1c29; }
html[data-theme="dark"] .share-menu a, html[data-theme="dark"] .share-menu button { color: #e3dfeb; }
html[data-theme="dark"] .share-menu a:hover, html[data-theme="dark"] .share-menu button:hover { background: rgba(244, 180, 71, .18); }
@media (max-width: 600px) {
  .essay-meta .share-btn { margin-left: 0; }
}

/* ── The record player (music.js) ───────────────────────── */
.music-dock {
  position: fixed; z-index: 30;
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
.music-dock > * { pointer-events: auto; }
.vinyl {
  position: relative; flex: none;
  width: 66px; height: 66px; padding: 0;
  color: var(--ink); background: none; border: 0; border-radius: 50%;
  cursor: pointer;
  filter: drop-shadow(3px 3px 0 rgba(30, 27, 46, .85));
  transition: transform .25s cubic-bezier(.34, 1.6, .64, 1);
}
.vinyl > svg:first-child { width: 100%; height: 100%; display: block; }
.vinyl-disc { transform-box: fill-box; transform-origin: center; animation: vinyl-spin 2.4s linear infinite; animation-play-state: paused; }
.is-playing .vinyl-disc { animation-play-state: running; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
/* The tonearm swings onto the record while it plays */
.tonearm {
  position: absolute; top: -6px; right: -10px; width: 26px; height: 40px;
  transform-origin: 77% 13%; transform: rotate(-32deg);
  transition: transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.is-playing .tonearm { transform: rotate(0deg); }
.vinyl:active { transform: scale(.94); }
@media (hover: hover) { .vinyl:hover { transform: translateY(-3px) rotate(-6deg); } }
.vinyl:focus-visible { outline: 2px dashed var(--amber); outline-offset: 4px; }
html[data-theme="dark"] .vinyl { filter: drop-shadow(3px 3px 0 rgba(236, 232, 246, .55)); }

/* "tap for music ♪", until it's played */
.music-tip {
  position: absolute; right: 4px; bottom: 76px;
  padding: .15rem .6rem;
  font: 700 1.05rem Caveat, "Segoe Print", "Bradley Hand", cursive; white-space: nowrap;
  color: var(--ink); background: #fffdf8;
  border: 1.5px solid var(--ink); border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  animation: tip-bob 2.2s ease-in-out infinite;
}
.music-tip[hidden] { display: none; }
@keyframes tip-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
html[data-theme="dark"] .music-tip { background: #1f1c29; }

/* Spotify's player, in a small card beside the record while it plays */
.music-card {
  width: min(300px, calc(100vw - 112px));
  padding: 6px;
  background: #fffdf8;
  border: 1.5px solid var(--ink); border-radius: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.96); transform-origin: right bottom;
  transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.4, .64, 1), visibility 0s .35s;
}
.music-card.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s ease, transform .35s cubic-bezier(.34, 1.4, .64, 1); }
.music-card iframe { display: block; border-radius: 12px; border: 0; }
.music-note-line { margin: .4rem .3rem .15rem; font: .78rem var(--sans); color: #666; }
html[data-theme="dark"] .music-card { background: #1f1c29; }
html[data-theme="dark"] .music-note-line { color: #a8a3b8; }

/* Notes that float up from the record and fade away */
.music-notes { position: absolute; right: 40px; bottom: 54px; width: 0; height: 0; }
.note {
  position: absolute; left: 0; top: 0;
  font-weight: 700; line-height: 1;
  text-shadow: 1px 1px 0 rgba(30, 27, 46, .35);
  animation: note-float 2.8s ease-out forwards;
  pointer-events: none;
}
@keyframes note-float {
  0% { opacity: 0; transform: translate(0, 0) scale(.5) rotate(0); }
  12% { opacity: 1; }
  50% { transform: translate(calc(var(--dx) * .5 + var(--sway)), -55px) scale(1) rotate(calc(var(--rot) * -.5)); }
  100% { opacity: 0; transform: translate(var(--dx), -120px) scale(1.25) rotate(var(--rot)); filter: blur(1.5px); }
}

/* Room at the foot of the page so the record never sits on the footer */
body.has-music footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 600px) {
  /* Phones: no room for the card beside the record, so it sits above it,
     as wide as the screen allows */
  .music-card {
    position: absolute; right: 0; bottom: calc(100% + 12px);
    width: min(340px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    box-sizing: border-box;
  }
  .vinyl { width: 56px; height: 56px; }
  .music-tip { bottom: 66px; }
  .music-notes { right: 34px; bottom: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .vinyl-disc, .music-tip { animation: none; }
}

/* ── The Journey (journey/journey.js): a life in weeks ── */
.journey { position: relative; }
/* Where I am: three figures and a bar */
.journey-stats { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.6rem; margin: 0 0 1.1rem; font-family: var(--sans); }
.js-stat { display: flex; align-items: baseline; gap: .35rem; margin: 0; }
.js-stat b { font: 700 1.35rem "Iowan Old Style", Palatino, Georgia, serif; color: var(--ink); letter-spacing: -.01em; }
.js-stat span { font-size: .8rem; color: #777; }
.journey-bar { flex-basis: 100%; height: 8px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: rgba(30, 27, 46, .05); }
.journey-bar span { display: block; height: 100%; background: repeating-linear-gradient(135deg, #f4b447 0 6px, #f7c46a 6px 12px); border-right: 1.5px solid var(--ink); }
html[data-theme="dark"] .js-stat span { color: #a8a3b8; }
html[data-theme="dark"] .journey-bar { background: rgba(236, 232, 246, .06); }
.journey-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: .75rem; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: 2px 2px 0 var(--ink); overflow: hidden; }
.seg button { font: 600 .82rem var(--sans); padding: .38rem .95rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--ink); color: #fffdf8; }
html[data-theme="dark"] .seg button[aria-selected="true"] { color: #16141d; }
.year-step { display: inline-flex; align-items: center; gap: .4rem; font: 700 1rem var(--sans); }
.year-step[hidden] { display: none; }
.year-step button {
  width: 30px; height: 30px; border-radius: 50%;
  font: 700 1.1rem var(--sans); line-height: 1; color: var(--ink); background: transparent;
  border: 1.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.year-step button:disabled { opacity: .35; cursor: default; }
.year-label { min-width: 3.2rem; text-align: center; }
.compare-toggle { display: inline-flex; align-items: center; gap: .4rem; font: .85rem var(--sans); cursor: pointer; }
.compare-toggle input { accent-color: #f4b447; width: 16px; height: 16px; }
.giant-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .75rem; }
.giant-chips[hidden] { display: none; }
.giant-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem; font: 600 .75rem var(--sans); color: var(--ink);
  background: transparent; border: 1.5px solid var(--c); border-radius: 999px; cursor: pointer;
  opacity: .45; transition: opacity .2s ease;
}
.giant-chip i { width: 9px; height: 9px; border-radius: 50%; border: 2.5px solid var(--c); box-sizing: border-box; }
.giant-chip.is-on { opacity: 1; background: color-mix(in srgb, var(--c) 12%, transparent); }
.journey-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 0 0 .9rem; font: .72rem var(--sans); color: #777; }
.legend-item { display: inline-flex; align-items: center; gap: .3rem; }
.legend-item i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); }
.legend-item i.legend-ring { border: 2px solid #999; border-radius: 3px; background: none; }

.life-wrap { position: relative; }
.life-grid { display: block; width: 100%; cursor: crosshair; touch-action: manipulation; }
.now-marker, .hover-marker { position: absolute; box-sizing: border-box; pointer-events: none; border-radius: 4px; }
/* This week: an amber ring, centred on its square, with a soft pulse round it */
.now-marker { border: 2px solid #f4b447; animation: now-pulse 2s ease-in-out infinite; }
@keyframes now-pulse { 0% { box-shadow: 0 0 0 0 rgba(244, 180, 71, .7); } 70%, 100% { box-shadow: 0 0 0 7px rgba(244, 180, 71, 0); } }
.hover-marker { border: 2px solid var(--ink); background: rgba(255, 253, 248, .15); }
.hover-marker[hidden] { display: none; }
.is-still .now-marker { animation: none; }

.week-card {
  position: absolute; z-index: 20; width: min(300px, 86vw);
  padding: .65rem .85rem .7rem; background: #fffdf8;
  border: 2px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
  font-size: .9rem; animation: card-in .16s ease-out;
}
@keyframes card-in { from { opacity: 0; transform: translateY(4px); } }
.week-card[hidden] { display: none; }
.week-card p { margin: .15rem 0; }
.wc-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-weight: 700; }
.wc-sep { color: #bbb; }
.wc-badge { flex: none; padding: .05rem .5rem; font: 700 .68rem var(--sans); letter-spacing: .03em; text-transform: uppercase; color: #1e1b2e; background: #f4b447; border: 1.5px solid var(--ink); border-radius: 999px; }
.wc-badge.is-future { background: transparent; color: #888; border-color: #ccc; }
.wc-when { margin-bottom: .35rem !important; }
.wc-when, .wc-empty { font: .78rem var(--sans); color: #777; }
.wc-own, .wc-giant { display: flex; align-items: baseline; gap: .45rem; line-height: 1.35; }
.wc-own i, .wc-giant i { flex: none; width: 9px; height: 9px; border-radius: 50%; transform: translateY(1px); }
.wc-own i { border: 1px solid var(--ink); }
.wc-giant i { border: 2.5px solid; border-radius: 3px; }
html[data-theme="dark"] .week-card { background: #1f1c29; }



.race { display: flex; align-items: flex-start; }
.race svg { display: block; overflow: visible; }
.race-names { flex: none; }
.race-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; scrollbar-width: thin; }
.race-scroll.is-stretched { cursor: grab; }
.race-scroll.is-dragging { cursor: grabbing; user-select: none; }
.race-grid { stroke: rgba(30, 27, 46, .05); }
.race-grid.is-major { stroke: rgba(30, 27, 46, .12); }
.race-track { stroke: rgba(30, 27, 46, .18); stroke-width: 1.5; stroke-dasharray: 2 4; }
.race-tick, .race-name { font: 600 11px var(--sans); fill: #999; }
.race-tick { text-anchor: middle; }
.race-tick.is-major { fill: #666; }
.race-name { text-anchor: end; fill: var(--ink); }
.race-name.is-me { font-weight: 800; }
.race-dot { stroke: #fffdf8; stroke-width: 1.5; cursor: pointer; transition: transform .15s cubic-bezier(.34, 1.6, .64, 1); transform-box: fill-box; transform-origin: center; }
.race-dot.is-landmark { stroke: var(--ink); stroke-width: 1.8; }
.race-dot:hover, .race-dot.is-active { transform: scale(1.45); stroke: var(--ink); stroke-width: 2; }
.race-dot:focus { outline: none; }
.race-dot:focus-visible { stroke: var(--ink); stroke-width: 2.5; }
.race-now { stroke: #f4b447; stroke-width: 3; stroke-linecap: round; }
.race-now-label { font: 800 11px var(--sans); fill: #c88a12; text-anchor: middle; }
html[data-theme="dark"] .race-grid { stroke: rgba(236, 232, 246, .05); }
html[data-theme="dark"] .race-grid.is-major { stroke: rgba(236, 232, 246, .12); }
html[data-theme="dark"] .race-track { stroke: rgba(236, 232, 246, .2); }
html[data-theme="dark"] .race-dot { stroke: #16141d; }
html[data-theme="dark"] .race-tick.is-major { fill: #a8a3b8; }

/* Above the timeline: which milestones to show, and how stretched it is */
.race-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin: .2rem 0 .9rem; }
.tier-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .75rem; }
.race-tools .tier-filter { margin: 0; }
.tier-filter[hidden] { display: none; }
.tier-label { font: 700 .68rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #888; margin-right: .2rem; }
.tier-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .26rem .7rem; font: 600 .76rem var(--sans); color: var(--ink);
  background: transparent; border: 1.5px dashed rgba(30, 27, 46, .35); border-radius: 999px; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tier-chip i { flex: none; border-radius: 50%; background: currentColor; opacity: .35; }
.tier-landmark i { width: 11px; height: 11px; }
.tier-notable i { width: 8px; height: 8px; }
.tier-footnote i { width: 5px; height: 5px; }
.tier-chip.is-on { border: 1.5px solid var(--ink); background: #fdf0d5; box-shadow: 2px 2px 0 var(--ink); }
.tier-chip.is-on i { opacity: 1; }
.tier-chip:active { transform: translate(1px, 1px); }
html[data-theme="dark"] .tier-chip { border-color: rgba(236, 232, 246, .3); }
html[data-theme="dark"] .tier-chip.is-on { border-color: var(--ink); background: rgba(244, 180, 71, .2); }
.race-zoom { display: inline-flex; align-items: center; gap: .45rem; }
.race-zoom button {
  width: 28px; height: 28px; padding: 0; font: 700 1rem var(--sans); line-height: 1; color: var(--ink);
  background: transparent; border: 1.5px solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
}
.race-zoom button:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.race-zoom input { width: 120px; accent-color: #f4b447; cursor: pointer; }

/* The card for a dot on the timeline */
.race-tip {
  position: absolute; z-index: 20; width: min(280px, 86vw);
  padding: .6rem .8rem .65rem; background: #fffdf8;
  border: 2px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
  font-size: .9rem; pointer-events: none; animation: card-in .14s ease-out;
}
.race-tip[hidden] { display: none; }
.race-tip p { margin: 0; }
.rt-head { display: flex; align-items: center; gap: .45rem; margin-bottom: .25rem !important; }
.rt-head i { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink); }
.rt-tier { margin-left: auto; padding: .02rem .5rem; font: 700 .64rem var(--sans); letter-spacing: .05em; text-transform: uppercase; color: #777; border: 1.5px solid #ccc; border-radius: 999px; }
.rt-tier.tier-landmark { color: #1e1b2e; background: #f4b447; border-color: var(--ink); }
.rt-tier.tier-notable { color: var(--ink); border-color: var(--ink); }
.rt-label { line-height: 1.4; }
.rt-when { margin-top: .3rem !important; font: .76rem var(--sans); color: #777; }
html[data-theme="dark"] .race-tip { background: #1f1c29; }
html[data-theme="dark"] :is(.rt-when, .tier-label) { color: #a8a3b8; }
html[data-theme="dark"] .rt-tier { border-color: #4a4558; color: #a8a3b8; }
html[data-theme="dark"] .rt-tier.tier-notable { color: var(--ink); border-color: var(--ink); }

.by-now { margin-top: 1rem; }
.by-now-row { display: flex; gap: .55rem; align-items: baseline; margin: .45rem 0; font-size: .92rem; line-height: 1.45; }
.by-now-row i { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--c); transform: translateY(1px); }
html[data-theme="dark"] .journey-legend { color: #a8a3b8; }

/* Buttons and bits for life in weeks and the Lab */
.cta-btn, .pill-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  font: 700 .9rem var(--sans); color: var(--ink); text-decoration: none;
  padding: .55rem 1.05rem; background: #f4b447;
  border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34, 1.6, .64, 1), box-shadow .2s ease;
}
.pill-btn { padding: .38rem .85rem; font-size: .8rem; font-weight: 600; background: transparent; box-shadow: 2px 2px 0 var(--ink); }
.pill-btn.pill-strong { background: #f4b447; font-weight: 700; color: #1e1b2e; }
.cta-btn:active, .pill-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
@media (hover: hover) {
  .cta-btn:hover, .pill-btn:hover { transform: translate(-1px, -2px) rotate(-2deg); box-shadow: 4px 5px 0 var(--ink); }
}
html[data-theme="dark"] .cta-btn { color: #1e1b2e; }
.link-btn { font: .8rem var(--sans); color: #337ab7; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
html[data-theme="dark"] .link-btn { color: #8db4ff; }
.journey-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%);
  margin: 0; padding: .5rem 1rem; font: 600 .85rem var(--sans); color: #fffdf8; background: #1e1b2e;
  border-radius: 999px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.journey-toast[hidden] { display: none; }

.dob-form { margin: 1rem 0 2rem; padding: 1.2rem 1.3rem; border: 2px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); background: #fffdf8; }
.dob-fields { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1rem; }
.dob-field { display: flex; flex-direction: column; gap: .45rem; font-weight: 700; }
.dob-field input { font: 1rem var(--sans); padding: .45rem .6rem; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; color: #1e1b2e; }
.dob-years { display: inline-flex; align-items: center; gap: .5rem; font: 400 .95rem var(--sans); }
.dob-years input { width: 5.5rem; }
html[data-theme="dark"] .dob-field input { background: #16141d; color: #e3dfeb; color-scheme: dark; }
.dob-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.dob-row input { font: 1rem var(--sans); padding: .45rem .6rem; border: 1.5px solid var(--ink); border-radius: 10px; background: #fff; color: #1e1b2e; }
.dob-note { margin: .6rem 0 0; font: .8rem var(--sans); color: #777; }
html[data-theme="dark"] .dob-form { background: #1f1c29; }
html[data-theme="dark"] .dob-row input { background: #16141d; color: #e3dfeb; color-scheme: dark; }

.legend-item i.legend-split { background: linear-gradient(90deg, #f4b447 50%, #e0679a 50%); border-radius: 2px; }
.wc-workouts { display: flex; gap: .45rem; align-items: baseline; font-size: .88rem; }

/* Year view: twelve months of week tiles */
.yv-top { margin: .3rem 0 1.1rem; }
.yv-head { margin: 0 0 .5rem; font: .9rem var(--sans); color: var(--ink); }
.yv-head span { color: #777; }
.yv-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 1.2rem 1.4rem; }
.yv-month h4 { margin: 0 0 .4rem; font: 700 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #888; }
.yv-month.is-current h4 { color: #c88a12; }
.yv-weeks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.yv-week {
  --fill: rgba(30, 27, 46, .07); --rings: 0 0 0 0 transparent;
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  font: 600 .78rem var(--sans); color: #888;
  background: var(--fill); border-radius: 7px; cursor: pointer;
  box-shadow: var(--rings);
  transition: transform .15s cubic-bezier(.34, 1.6, .64, 1);
}
.yv-week.is-lived { --fill: rgba(30, 27, 46, .62); color: #fffdf8; }
.yv-week.has-own { color: #fff; font-weight: 800; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.yv-week.is-now { --fill: #f4b447; color: #1e1b2e; font-weight: 800; }
.yv-week.is-now::after { content: ""; position: absolute; inset: -3px; border: 2px solid #f4b447; border-radius: 9px; animation: now-pulse 2s ease-in-out infinite; pointer-events: none; }
.is-still .yv-week.is-now::after { animation: none; }
.yv-week.is-before { background: none; border: 1.5px dashed rgba(30, 27, 46, .2); color: #bbb; cursor: default; }
.yv-week.is-hover, .yv-week:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; z-index: 1; }
@media (hover: hover) { .yv-week:not(.is-before):hover { transform: scale(1.08); } }
.yv-cake { position: absolute; top: -10px; right: -8px; font-size: .95rem; line-height: 1; transform: rotate(12deg); }
.yv-gym { position: absolute; bottom: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: #00c78d; border: 1px solid #1e1b2e; }
.yv-key { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 1rem 0 0; font: .72rem var(--sans); color: #777; }
.yv-key span { display: inline-flex; align-items: center; gap: .3rem; }
.yv-key i { width: 10px; height: 10px; border-radius: 3px; }
.yv-key .k-lived { background: rgba(30, 27, 46, .62); }
.yv-key .k-now { background: #f4b447; }
.yv-key .k-gym { width: 7px; height: 7px; border-radius: 50%; background: #00c78d; border: 1px solid #1e1b2e; }
.yv-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.yv-panel { padding: .8rem 1rem .6rem; background: #fffdf8; border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
.yv-lists h3 { margin: 0 0 .45rem; font-size: 1rem; }
.yv-lists ul { list-style: none; padding: 0; margin: 0; }
.yv-lists li { display: flex; gap: .5rem; align-items: baseline; margin: .35rem 0; font-size: .88rem; line-height: 1.4; }
.yv-lists li i { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ink); transform: translateY(1px); }
.yv-lists i.ring { background: none; border: 2.5px solid; border-radius: 3px; }
.yv-when { font: 600 .75rem var(--sans); color: #888; margin-right: .15rem; }
html[data-theme="dark"] .yv-week { --fill: rgba(236, 232, 246, .08); color: #8f8a9f; }
html[data-theme="dark"] .yv-week.is-lived { --fill: rgba(236, 232, 246, .5); color: #16141d; }
html[data-theme="dark"] .yv-week.has-own { color: #fff; }
html[data-theme="dark"] .yv-week.is-now { --fill: #f4b447; color: #1e1b2e; }
html[data-theme="dark"] .yv-week.is-before { border-color: rgba(236, 232, 246, .2); color: #6c6780; }
html[data-theme="dark"] :is(.yv-head span, .yv-key, .yv-month h4, .yv-when) { color: #a8a3b8; }
html[data-theme="dark"] .yv-panel { background: #1f1c29; }
html[data-theme="dark"] .yv-key .k-lived { background: rgba(236, 232, 246, .5); }
html[data-theme="dark"] .wc-badge.is-future { color: #a8a3b8; border-color: #4a4558; }
@media (max-width: 600px) {
  .yv-months { grid-template-columns: repeat(2, 1fr); gap: 1rem 1.1rem; }
  .yv-weeks { gap: 6px; }
  .yv-week { font-size: .72rem; border-radius: 6px; }
}

/* The Lab: a card per project */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; margin: 1.5rem 0 2rem; }
.lab-card {
  display: flex; flex-direction: column; overflow: hidden;
  color: inherit; text-decoration: none; background: #fffdf8;
  border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink);
  transition: transform .25s ease, box-shadow .25s ease;
}
@media (hover: hover) { .lab-card:hover { transform: translate(-2px, -3px) rotate(-.5deg); box-shadow: 8px 9px 0 var(--ink); } }
.lab-art { display: block; padding: .9rem; background: #f2eee8; border-bottom: 1.5px solid var(--ink); color: #1e1b2e; }
.lab-art svg { display: block; width: 100%; height: auto; }
.lab-body { display: flex; flex-direction: column; gap: .4rem; padding: 1rem 1.15rem 1.15rem; }
.lab-title { font-size: 1.2rem; font-weight: 700; }
.lab-pitch { color: #555; font-size: .95rem; }
.lab-go { margin-top: .3rem; font: 700 .85rem var(--sans); color: #337ab7; }
.lab-credit { margin-top: 2.5rem; font: .85rem var(--sans); color: #777; }
html[data-theme="dark"] .lab-card { background: #1f1c29; }
html[data-theme="dark"] .lab-art { background: #2a2637; color: #ece8f6; }
html[data-theme="dark"] .lab-pitch { color: #c2bdd0; }
html[data-theme="dark"] .lab-go { color: #8db4ff; }

/* Dani’s mix: the controls beside the record */
.music-side { display: none; flex-direction: column; gap: 6px; align-self: center; }
.music-dock.is-started .music-side { display: flex; }
.mc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  color: var(--ink); background: #fffdf8;
  border: 1.5px solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer; transition: transform .2s cubic-bezier(.34, 1.6, .64, 1);
}
.mc-btn svg { width: 14px; height: 14px; }
.mc-btn:active { transform: translate(1px, 1px) scale(.94); box-shadow: 1px 1px 0 var(--ink); }
.mc-btn.is-off { opacity: .55; }
@media (hover: hover) { .mc-btn:hover { transform: translateY(-2px) rotate(-6deg); } }
html[data-theme="dark"] .mc-btn { background: #1f1c29; }
@media (max-width: 600px) {
  .mc-btn { width: 32px; height: 32px; }
  .music-side { gap: 5px; }
}

/* A section with nothing in it yet */
.empty-note { margin: .6rem 0 1.5rem; padding: .8rem 1rem; color: #666; background: rgba(244, 180, 71, .1); border: 1.5px dashed rgba(244, 180, 71, .7); border-radius: 12px; }
html[data-theme="dark"] .empty-note { color: #a8a3b8; }
