/* blueprint.css — lobee.ca design system (2026 blueprint rebuild)
   Hand-written plain CSS. No frameworks, no imports, no external fonts.
   Pages link this file only: no <style> blocks, no style="" attributes. */

/* Reading column width: 70ch of the body font (--p-size), inherited as a
   length so headings and other sizes share the same left edge. */
@property --col {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

/* ---------- 1. Tokens ---------- */
:root {
  /* Blueprint */
  --bp-950: #081a36;
  --bp-900: #0b2347;
  --bp-800: #0f2e5c;
  --bp-grid: rgba(160, 196, 255, 0.075);
  --bp-grid-major: rgba(160, 196, 255, 0.17);
  --bp-edge: #7fa9e0;
  --bp-ink: #f4f8ff;
  --bp-ink-muted: rgba(244, 248, 255, 0.78);

  /* Page ground (gray around the sheet) + paper (sheets) */
  --ground: #3f434a;
  --paper: #ffffff;
  --paper-2: #f3f6fb;
  --code-bg: rgba(20, 33, 51, 0.07);
  --rule: #dde4ee;
  --ink: #142133;
  --ink-muted: #4b5a6c;
  --link: #1d5bb8;
  --link-hover: #0f3f8a;
  --ok: #12804a;

  /* Sketch colours (match the default drawing) */
  --sk-white: #f4f8ff;
  --sk-blue: #5aa2ff;
  --sk-red: #ff7a8a;
  --sk-yellow: #ffd45a;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang HK", "Microsoft JhengHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.1875rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.625rem, 1.2rem + 1.8vw, 2.25rem);
  --fs-hero: clamp(1.75rem, 1.15rem + 2.2vw, 2.75rem);
  --fs-hero-sub: clamp(1.0625rem, 0.92rem + 0.5vw, 1.25rem);
  --lh-tight: 1.25;
  --lh-body: 1.65;
  --lh-prose: var(--p-leading);

  /* Space (4px base) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --gutter: clamp(20px, 5vw, 56px);
  --max: 1200px;
  --sheet-pad-x: clamp(22px, 6vw, 72px);
  --sheet-pad-top: clamp(24px, 3.5vw, 40px);
  --bar-x: var(--sheet-pad-x);                 /* nav lines up with sheet content padding */
  --head-h: 60px;                              /* slightly larger compact blueprint bar */
  --peek: 48px;                                /* sheet strip visible under the desktop hero */
  --show: 1;                                   /* share of the bust above the sheet */
  --fs-title: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  --measure: 70ch;              /* reading column; centered in the sheet */
  --p-size: 1.0625rem;          /* 17px body; slightly larger on wide screens */
  --p-leading: 1.65;
  --p-gap: 1.25em;            /* between paragraphs and other blocks */
  --gap-tight: 0.5em;          /* between things that belong together: list items, a label and its code */

  /* Shape + motion */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 14px;
  --tuck: var(--radius-lg);                    /* sheet tucks under the hero; navy in the rounded corners */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 180ms;
  --dur-sheet: 460ms;
  --shadow-photo: 0 1px 2px rgba(10, 30, 60, 0.14), 0 8px 22px rgba(10, 30, 60, 0.16);
  --shadow-sheet: 0 -1px 0 rgba(255, 255, 255, 0.28), 0 30px 80px rgba(3, 12, 30, 0.45);
  --focus: 0 0 0 3px rgba(90, 162, 255, 0.55);
  --shadow-photo-hover: 0 2px 4px rgba(10, 30, 60, 0.14), 0 14px 30px rgba(10, 30, 60, 0.2);
  --shadow-chip: 0 1px 2px rgba(10, 30, 60, 0.08), 0 6px 16px rgba(10, 30, 60, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-chip-hover: 0 2px 4px rgba(10, 30, 60, 0.10), 0 12px 24px rgba(10, 30, 60, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --chip-bg: #ffffff;
  --btn: #0f2e5c;
  --btn-hover: #0b2347;

  color-scheme: light;
}

/* Dark theme: deeper blueprint, dark slate sheets. Sizes and layout stay the same.
   Applied when the OS asks for dark (unless the user forced light) or when the
   user forced dark. Keep these two blocks identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bp-950: #030910;
    --bp-900: #071221;
    --bp-800: #0a1a30;
    --bp-grid: rgba(160, 196, 255, 0.045);
    --bp-grid-major: rgba(160, 196, 255, 0.10);
    --bp-edge: #5a82b5;
    --bp-ink: #f4f8ff;
    --bp-ink-muted: rgba(244, 248, 255, 0.72);

    --ground: #0b0f15;
    --paper: #161c26;
    --paper-2: #1e2633;
    --code-bg: rgba(232, 238, 246, 0.10);
    --rule: #2c3646;
    --ink: #e8eef6;
    --ink-muted: #9aa7b8;
    --link: #7eb6ff;
    --link-hover: #a8ceff;
    --ok: #3dce86;

    --shadow-photo: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.35);
    --shadow-sheet: 0 -1px 0 rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.55);
    --focus: 0 0 0 3px rgba(126, 182, 255, 0.55);
    --shadow-photo-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 30px rgba(0, 0, 0, 0.45);
    --shadow-chip: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --shadow-chip-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    --chip-bg: #222b3a;
    --btn: #2c5690;
    --btn-hover: #3a67a8;

    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bp-950: #030910;
    --bp-900: #071221;
    --bp-800: #0a1a30;
    --bp-grid: rgba(160, 196, 255, 0.045);
    --bp-grid-major: rgba(160, 196, 255, 0.10);
    --bp-edge: #5a82b5;
    --bp-ink: #f4f8ff;
    --bp-ink-muted: rgba(244, 248, 255, 0.72);

    --ground: #0b0f15;
    --paper: #161c26;
    --paper-2: #1e2633;
    --code-bg: rgba(232, 238, 246, 0.10);
    --rule: #2c3646;
    --ink: #e8eef6;
    --ink-muted: #9aa7b8;
    --link: #7eb6ff;
    --link-hover: #a8ceff;
    --ok: #3dce86;

    --shadow-photo: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.35);
    --shadow-sheet: 0 -1px 0 rgba(255, 255, 255, 0.06), 0 30px 80px rgba(0, 0, 0, 0.55);
    --focus: 0 0 0 3px rgba(126, 182, 255, 0.55);
    --shadow-photo-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 30px rgba(0, 0, 0, 0.45);
    --shadow-chip: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 18px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --shadow-chip-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 14px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.10);
    --chip-bg: #222b3a;
    --btn: #2c5690;
    --btn-hover: #3a67a8;

    color-scheme: dark;
}

/* Paragraph size may grow slightly on large screens; phones stay 17px. */
@media (min-width: 760px) {
  :root { --p-size: clamp(1.0625rem, 0.95rem + 0.16vw, 1.125rem); }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #3f434a; /* gray fallback so the first paint is never white */
  background: var(--ground);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--p-size);
  line-height: var(--p-leading);
  color: var(--bp-ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 50;
  padding: var(--s-2) var(--s-4); background: var(--paper); color: var(--ink);
  border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: 600;
}
.skip-link:focus { top: var(--s-4); }

/* ---------- 3. Blueprint surface ---------- */
.blueprint {
  background-color: var(--bp-800);
  background-image:
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

/* One continuous, viewport-anchored grid behind the header and the main
   view, so the squares stay aligned. The header is 60px and the cell is
   24px, so a second box-local grid on the bar started mid-cell and did
   not meet the main grid. The bar also has horizontal padding, and the
   default padding-box origin shifted its vertical lines on some widths.
   Local .blueprint surfaces (library demos, card thumbs) keep their own
   grid. */
body.home-page,
body.page {
  isolation: isolate;
  background-color: var(--bp-800);
}
body.home-page::before,
body.page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bp-800);
  background-image:
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
/* The sticky bar stays opaque navy so a scrolling sheet cannot show
   through it. It sits at the viewport origin, so a border-box grid at
   -1px -1px is the same field as the shared viewport grid. The home
   hero is transparent over that shared grid. */
.home-page > .masthead.blueprint,
.page > .masthead.blueprint {
  background-origin: border-box;
  background-clip: border-box;
}
.home.blueprint {
  background-color: transparent;
  background-image: none;
}

/* ---------- 4. Masthead: compact navy blueprint bar, every page ---------- */
/* Full-width bar; the nav and logo line up with the sheet's edges. */
.masthead {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  width: 100%;
  min-height: var(--head-h);
  margin: 0;
  padding: 0 var(--bar-x);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav { display: flex; gap: var(--s-4); margin: 0; padding: 0; list-style: none; min-width: 0; }
.nav li { min-width: 0; }
.nav a {
  display: block;
  padding: var(--s-1) 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--bp-ink-muted);
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color var(--dur) var(--ease-out);
}
.nav a:hover { color: var(--bp-ink); text-decoration: underline; text-decoration-color: rgba(244, 248, 255, 0.5); }
.nav a[aria-current="page"] { color: var(--bp-ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--bp-ink); }
.masthead__end { display: flex; align-items: center; gap: var(--s-3); flex-shrink: 0; }
.brand { display: block; line-height: 0; flex-shrink: 0; }
.brand img {
  width: auto; height: 36px;
  /* White letters sit high in the asset (black outline hangs below). Nudge so they line up with the nav text. */
  transform: translateY(4px);
}
.tool.tool--header { display: none; }

/* ---------- 5. Home: blueprint hero, then a white sheet comes up ---------- */
/* The document scrolls. The masthead sticks to the top. The hero (hello +
   drawing) is ordinary flow, and the sheet follows it, so the drawing's
   visible bottom edge always sits on the sheet's top edge and the two move
   up together. The sheet is at least one screen tall. With JS (sheet.js),
   once the sheet reaches the bar it docks like an inner menu page: rounded
   corners stay visible under the bar, and only the list below the Home
   title scrolls. Without JS, the document keeps scrolling (the title still
   sticks, but cards can pass under it). */
.home-page > .masthead { position: sticky; top: 0; }
.home-main { display: block; }
.home {
  position: relative;
  isolation: isolate;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "intro" "art";
  align-content: start;
  /* Full-width hero; bottom padding lets the rounded sheet tuck over navy, not gray. */
  padding: 0 0 var(--tuck);
  overflow: hidden;
}
.home__intro {
  grid-area: intro;
  position: relative; z-index: 3;
  min-width: 0;
  padding: var(--s-6) var(--sheet-pad-x) 0;
}
.home__hello {
  max-width: 18ch;
  margin: 0;
  font-size: var(--fs-hero);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
  color: var(--bp-ink);
}
.home__sub {
  display: block;
  max-width: 28ch;
  margin: var(--s-3) 0 0;
  font-size: var(--fs-hero-sub);
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
  color: var(--bp-ink);
}
.home__intro strong { font-weight: 800; letter-spacing: -0.03em; }

/* Cached copies of the old homepage may still include the three hero links. Hide them. */
.home__links { display: none !important; }

/* The art box is a window onto the top --show share of the 558x639 bust.
   Its bottom edge is the bottom of the hero, i.e. the top of the sheet. */
.home__art {
  grid-area: art;
  position: relative; z-index: 1;
  justify-self: center;
  align-self: end;
  width: min(100%, 520px, calc(48svh * 558 / 639 / var(--show)));
  aspect-ratio: 558 / 639;
  margin-top: var(--s-5);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.home__art img {
  position: absolute;
  left: 0; top: 0;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 558 / 639;
  max-width: none;
}
.has-canvas .home__art img { visibility: hidden; }

/* Small screens (phones, coarse pointers, narrow windows): only the top part
   of the bust (ears, glasses, cheeks) shows above the sheet. 0.68 of 639px puts
   the sheet edge just under the blush and mouth, like the mockup. */
@media (max-width: 759px), (pointer: coarse) {
  :root { --show: 0.68; }
  .home__art { aspect-ratio: 558 / 434.52; }   /* 639 x 0.68 */
  .home__hello, .home__sub { max-width: none; }
}

/* Landscape phones and tablets: hello on the left, the cropped bust on the right. */
@media (orientation: landscape) and (min-width: 560px) {
  .home {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "intro art";
    column-gap: var(--s-5);
  }
  .home__intro { padding-top: var(--s-5); align-self: start; }
  .home__art {
    justify-self: end;
    margin-right: var(--sheet-pad-x);
    width: min(46vw, 560px, calc((100svh - var(--head-h) - 40px) * 558 / 639 / var(--show)));
  }
}

/* Desktop (wide, landscape, mouse): the hero fills the first screen (less a
   strip of sheet peeking at the bottom). Hello across the top left, the whole
   figure at the lower right standing on the sheet. Short windows (e.g.
   1269x634) use the same layout; the figure just scales to the room left. */
@media (min-width: 760px) and (orientation: landscape) and (hover: hover),
       (min-width: 760px) and (orientation: landscape) and (pointer: fine) {
  .home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "intro art" ". art";
    height: calc(100vh - var(--head-h) - var(--peek));
    height: calc(100svh - var(--head-h) - var(--peek));
    min-height: 360px;
  }
  .home__intro { padding-top: var(--s-7); }
  .home__hello { max-width: 22ch; }
  .home__art {
    justify-self: stretch;
    align-self: stretch;
    width: auto;
    aspect-ratio: auto;
    margin: var(--s-6) var(--sheet-pad-x) 0 0;
    container-type: size;
  }
  .home__art img {
    left: auto; right: 0; top: auto; bottom: 0;
    /* contain the full 558/639 figure in the cell, standing on its bottom edge */
    width: min(100cqw, calc(100cqh * 558 / 639));
  }
}

/* Drawing canvas: off by default, never blocks scrolling or links until turned on */
.sketch-canvas {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  pointer-events: none;
}
.is-drawing .sketch-canvas {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
.is-drawing.tool-eraser .sketch-canvas { cursor: cell; }

/* Toolbar */
.sketch-tools {
  position: absolute; z-index: 4;
  left: var(--bar-x);
  bottom: calc(var(--tuck) + var(--s-5));
  display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-start;
  gap: var(--s-2);
  max-width: calc(100% - 2 * var(--gutter));
  padding: var(--s-1);
  /* Translucent blueprint tint + crisp edge, so the closed Draw chip
     (and the open tool tray, which shares this class) sit on the navy
     grid instead of punching a near-black hole in it. */
  background: rgba(160, 196, 255, 0.16);
  border: 1px solid rgba(160, 196, 255, 0.45);
  border-radius: 999px;
  box-shadow: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* Open toolbar: same quiet chrome, a slightly tighter radius that still fits the tool row. */
.sketch-tools:has(.sketch-tools__group:not([hidden])) {
  border-radius: var(--radius-lg);
}
.sketch-tools[hidden] { display: none; }
.sketch-tools__group { display: flex; align-items: center; gap: var(--s-1); }
.sketch-tools__group[hidden] { display: none; }
.sketch-tools__sep { width: 1px; align-self: stretch; margin: var(--s-1) var(--s-1); background: rgba(160, 196, 255, 0.3); }
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-width: 40px; height: 40px;
  padding: 0 var(--s-3);
  font: inherit; font-size: var(--fs-sm); font-weight: 600;
  color: var(--bp-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.tool--icon { padding: 0; width: 40px; }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: rgba(160, 196, 255, 0.14); }
.tool[aria-pressed="true"] { background: var(--bp-ink); color: var(--bp-900); }
.tool--toggle { border-radius: 999px; }
.tool--toggle svg { width: 18px; height: 18px; stroke-width: 2.2; }
.tool--toggle:focus-visible { border-radius: 999px; box-shadow: var(--focus); }
.tool--toggle[aria-pressed="true"] { background: var(--sk-blue); color: var(--bp-950); }
.swatch {
  width: 32px; height: 32px; padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { border-color: var(--bp-ink); box-shadow: 0 0 0 2px var(--bp-950), 0 0 0 4px var(--bp-ink); }
.swatch--white { background: var(--sk-white); }
.swatch--blue { background: var(--sk-blue); }
.swatch--red { background: var(--sk-red); }
.swatch--yellow { background: var(--sk-yellow); }
/* Draw is desktop-only. Narrow screens and coarse, no-hover devices (phones, landscape phones, tablets) never get the toggle or toolbar. */
@media (max-width: 759px), (pointer: coarse) and (hover: none) {
  .tool.tool--header,
  .sketch-tools { display: none !important; }
}

/* ---------- 6. Sheets: home sheet + inner pages ---------- */
/* Shared sheet look: full-width white paper. No side gutters.
   Top corners are rounded (--radius-lg). On inner pages the navy
   blueprint behind the sheet (not gray --ground) shows in the notches. */
.sheet {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  --col: var(--measure); /* 70ch of the sheet's body size, shared by all children */
  padding: var(--sheet-pad-top) var(--sheet-pad-x) var(--s-7);
  padding-bottom: calc(var(--s-7) + env(safe-area-inset-bottom, 0px));
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sheet);
}

/* Home sheet: comes up under the hero. At least one screen (minus the bar)
   tall, so scrolling to the end leaves only bar + sheet on screen. */
.sheet--home {
  z-index: 2;
  min-height: calc(100vh - var(--head-h));
  min-height: calc(100svh - var(--head-h));
  /* Tucks under the hero's bottom padding so navy, not gray, shows at the
     rounded corners. Radius is unchanged (--radius-lg). */
  margin-top: calc(-1 * var(--tuck));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.sheet__title {
  margin: 0 0 var(--s-4);
  font-size: var(--fs-title);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
/* Home: one scroller, the document. The "Home" title is sticky under the
   bar, so once the sheet reaches the bar the title stays put and the
   shelves scroll past it (they are hidden behind the title's opaque paper,
   exactly where the old docked list was clipped). There is no dock or
   undock, no scroll handler and no layout switch, so native wheel, touch
   and trackpad scrolling (and momentum) run straight through the point
   where the sheet meets the bar.

   At rest the title box starts at the sheet's top edge: the negative top
   margin cancels the sheet's top padding, and the same padding moves into
   the title, so the word "Home" sits where it always did. Negative side
   margins plus matching padding make the paper span the full sheet width.
   Its top corners are left unpainted so the sheet's own corners show. */
.sheet--home > .sheet__title {
  position: sticky;
  top: var(--head-h);
  z-index: 10;
  /* Opaque paper everywhere except the two top corner squares, so the
     sheet's own rounded corners show at rest (no second, doubled edge) and
     the bar's corner pieces take over once the title is stuck. Nothing
     scrolls under those squares: cards start at --sheet-pad-x. */
  background:
    linear-gradient(var(--paper), var(--paper)) var(--radius-lg) 0 / calc(100% - 2 * var(--radius-lg)) var(--radius-lg) no-repeat,
    linear-gradient(var(--paper), var(--paper)) 0 var(--radius-lg) / 100% calc(100% - var(--radius-lg)) no-repeat;
  margin: calc(-1 * var(--sheet-pad-top)) calc(-1 * var(--sheet-pad-x)) 0;
  padding: var(--sheet-pad-top) var(--sheet-pad-x) var(--s-4);
}
.sheet--home > .sheet__body { min-width: 0; }

/* Rounded corners under the bar. Once the sheet has scrolled up behind the
   bar, its own rounded top is out of sight, so the bar draws the two
   corner notches itself: 14px navy pieces hanging off the bar's bottom
   edge (same navy and the same viewport-aligned grid as the page), shaped
   like the notches of a rounded sheet. Over the hero they are invisible,
   because the hero shows the same grid. Home only; inner pages have
   their own rounded sheet under the bar. */
.home-page > .masthead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: var(--radius-lg);
  pointer-events: none;
  background-color: var(--bp-800);
  background-image:
    linear-gradient(var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid-major) 1px, transparent 1px),
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px calc(-1px - var(--head-h));
  -webkit-mask-image:
    radial-gradient(circle at 100% 100%, transparent calc(var(--radius-lg) - 0.5px), #000 var(--radius-lg)),
    radial-gradient(circle at 0 100%, transparent calc(var(--radius-lg) - 0.5px), #000 var(--radius-lg));
  mask-image:
    radial-gradient(circle at 100% 100%, transparent calc(var(--radius-lg) - 0.5px), #000 var(--radius-lg)),
    radial-gradient(circle at 0 100%, transparent calc(var(--radius-lg) - 0.5px), #000 var(--radius-lg));
  -webkit-mask-size: var(--radius-lg) var(--radius-lg);
  mask-size: var(--radius-lg) var(--radius-lg);
  -webkit-mask-position: left top, right top;
  mask-position: left top, right top;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.shelf { margin: 0 0 var(--s-6); }
.shelf:last-child { margin-bottom: 0; }
.shelf__head { margin: 0 0 var(--s-3); font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; min-width: 0; }
.shelf__head a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--ink);
  text-decoration: none;
  vertical-align: top;
}
.shelf__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
}
.shelf__head a:hover { color: var(--link); }

/* Inner pages: bar + sheet. The document is scroll-locked; only the sheet
   scrolls, so the bar never leaves the top. Pure CSS (works with JS off). */
html.is-page {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  /* Navy from the first paint so the rounded sheet corners never flash gray or white. */
  background: var(--bp-800);
}
.page {
  min-height: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
  /* Navy first paint; the shared body::before grid shows in the 14px
     corner notches and through the transparent masthead. */
  background-color: var(--bp-800);
}
.page > .masthead { flex-shrink: 0; }
/* The sheet itself no longer scrolls. It is a flex column: the head (back
   arrow, title, day/night switch) stays locked at the top, and only
   .sheet__body, everything below the head, scrolls. This is the same split
   the docked Home uses ("Home" title locked, shelves scroll below it), so
   nothing slides under the title. The scroller runs to the sheet's edges
   so its scrollbar sits at the right edge; the sheet's side padding is
   restored inside the head and the body. Pure CSS. */
.page > .sheet {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;

  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  animation: sheet-in var(--dur-sheet) var(--ease-out) both;
}
.page > .sheet > .sheet__head {
  flex: none;
  margin: 0 0 calc(var(--s-6) - var(--s-2));
  padding: var(--sheet-pad-top) var(--sheet-pad-x) 0;
}
/* The small top padding keeps focus rings on the first item from being
   clipped; the head's bottom margin is reduced by the same amount so the
   gap between the title row and the content is unchanged. */
.page > .sheet > .sheet__body {
  position: relative;  /* absolutely placed bits (e.g. visually-hidden text) belong to the scroller */
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: var(--s-2) var(--sheet-pad-x) calc(var(--s-7) + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sheet__body:focus, .sheet__body:focus-visible { outline: none; box-shadow: none; }
@keyframes sheet-in {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sheet__head { margin: 0 0 var(--s-6); min-width: 0; }
.sheet__bar { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
/* Round back arrow, as in the mockup */
.back {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 34px; height: 34px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 50%;
  transition: background-color var(--dur) var(--ease-out);
}
.back:hover { background: var(--link); }
.back:focus-visible { border-radius: 50%; }
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  margin-left: auto;
  width: 34px; height: 34px;
  padding: 0;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out);
}
.theme-toggle:hover { background: var(--link); }
.theme-toggle:focus-visible { border-radius: 50%; box-shadow: var(--focus); }
.theme-toggle svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }
.sheet h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: var(--fs-title);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.sheet__lede {
  margin: var(--s-3) auto 0;
  max-width: var(--col);
  color: var(--ink-muted);
  font-size: var(--p-size);
  line-height: var(--p-leading);
  text-align: left;
  text-indent: 0;
}

/* Lead photo: framed, centred and larger on desktop, full sheet width on phones. */
.figure.lead { width: min(100%, 480px); margin: 0 auto var(--s-6); }
.figure.lead figcaption { text-align: center; }
@media (max-width: 639px) {
  .figure.lead { width: 100%; }
}

/* ---------- 7. Prose ---------- */
.prose {
  max-width: none;
  width: 100%;
  font-size: var(--p-size);
  line-height: var(--p-leading);
  text-align: left;
  text-wrap: pretty;
}
.prose > :first-child { margin-top: 0; }
/* One centered reading column: headings, paragraphs, lists, notes, tables
   and buttons share the same max width and the same left edge. Figures are
   excepted so memorial story photos can stay at their natural size (ao).
   On phones --measure is wider than the sheet, so width is unchanged. */
.prose > :not(.figure) {
  max-width: var(--col);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
  text-indent: 0;
}
.prose h2 {
  margin: 2.4em auto 0.9em;
  font-size: var(--fs-lg);
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 700;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.prose h3 {
  margin: 2.15em auto 0.75em;
  font-size: var(--fs-md);
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 600;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose figure, .prose table { margin: 0 auto var(--p-gap); }
.prose p {
  font-size: inherit;
  line-height: inherit;
  color: var(--ink);
  text-align: left;
  text-indent: 0;
}
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: 0 0 var(--gap-tight); }
.prose li:last-child { margin-bottom: 0; }
.prose li::marker { color: var(--ink-muted); }
.prose li > ul, .prose li > ol { margin: var(--gap-tight) 0 0; padding-left: 1.2em; }
.prose a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.prose strong { font-weight: 700; }
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--code-bg);
  border: 0;
  border-radius: 2px;
}
.prose pre {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  padding: var(--s-3) var(--s-4); /* 12px 16px */
  font-size: 0.85em;
  line-height: 1.45;
  white-space: pre;
  text-wrap: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  color: #e8f0ff;
  background: var(--bp-900);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}
.prose pre code { padding: 0; font-size: inherit; color: inherit; background: none; border: 0; }
.prose blockquote {
  padding: var(--s-4) var(--s-5);
  background: var(--paper-2);
  border-left: 3px solid var(--sk-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.prose blockquote > :last-child { margin-bottom: 0; }
.prose em.kicker, .prose p.kicker, .prose .kicker {
  display: block;
  margin: 0.15em auto var(--gap-tight);
  font-style: italic;
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-muted);
}
.prose .meta { font-size: var(--fs-sm); color: var(--ink-muted); }
.prose .sources-line { font-size: var(--fs-xs); line-height: 1.45; color: var(--ink-muted); margin-bottom: var(--gap-tight); }
/* A short label, kicker or small heading sits tight on the code, list or
   figure it introduces. The usual --p-gap still sits above it. */
.prose p:has(> strong:only-child):is(:has(+ pre), :has(+ ul), :has(+ ol), :has(+ figure)),
.prose h3:is(:has(+ pre), :has(+ ul), :has(+ ol), :has(+ figure)) {
  margin-bottom: var(--gap-tight);
}
.prose .sources-line a { color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-6) 0; }
.prose table {
  width: 100%;
  max-width: var(--col);
  border-collapse: collapse;
  font-size: var(--fs-sm);
  line-height: var(--p-leading);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose th, .prose td {
  padding: 0.45em 0.75em 0.45em 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
.prose th {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.prose tbody tr:last-child th,
.prose tbody tr:last-child td { border-bottom: 0; }

/* Content blocks: same paper as prose, not a kit of loud widgets.
   Markdown fences: :::note, :::pull, :::stats, :::timeline, :::details, :::link. */
.note,
.pull,
.stats,
.timeline,
.disclosure,
.link-btn-wrap {
  margin: 0 auto var(--p-gap);
  max-width: var(--col);
  overflow-wrap: break-word;
}
.note {
  padding: 0.7em 1em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
}
.note__label {
  display: block;
  margin: 0 0 0.3em;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.note > :last-child { margin-bottom: 0; }
.pull {
  padding: 0.15em 0;
  background: none;
  border: 0;
}
.pull::before {
  content: "\201C";
  display: block;
  margin: 0 0 0.1em;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--ink-muted);
  opacity: 0.7;
}
.pull > p {
  margin: 0;
  font-size: var(--p-size);
  font-weight: 500;
  line-height: var(--p-leading);
  letter-spacing: 0;
  text-align: left;
  text-indent: 0;
  text-wrap: pretty;
}
.pull > p + p { margin-top: 0.5em; }
.pull__attrib {
  display: block;
  margin: 0.45em 0 0;
  font-size: var(--fs-sm);
  font-weight: 400;
  font-style: normal;
  color: var(--ink-muted);
}
.prose ul.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: var(--s-3) var(--s-4);
  margin: 0 auto var(--p-gap);
  padding: 0.85em 0 !important;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.prose ul.stats > li { margin: 0; }
.stats__value {
  display: block;
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stats__label {
  display: block;
  margin-top: 0.2em;
  font-size: var(--fs-xs);
  line-height: 1.35;
  color: var(--ink-muted);
}
.prose ol.timeline {
  list-style: none;
  margin: 0 auto var(--p-gap);
  padding: 0 0 0 1.25em !important;
  border-left: 1px solid var(--rule);
}
.prose ol.timeline > li {
  position: relative;
  margin: 0 0 0.9em;
  padding: 0;
}
.prose ol.timeline > li:last-child { margin-bottom: 0; }
.prose ol.timeline > li::before {
  content: "";
  position: absolute;
  left: -1.25em;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink-muted);
  transform: translateX(-50%);
  box-sizing: border-box;
}
.timeline__when {
  display: block;
  margin: 0 0 0.15em;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.timeline__body > :first-child { margin-top: 0; }
.timeline__body > :last-child { margin-bottom: 0; }
.disclosure {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: none;
}
.disclosure + .disclosure {
  margin-top: -1.25em;
  border-top: 0;
}
.disclosure > summary {
  display: block;
  padding: 0.65em 0;
  font-weight: 600;
  line-height: var(--lh-prose);
  cursor: pointer;
  list-style: none;
  overflow-wrap: break-word;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin-right: 0.55em;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: rotate(-45deg);
  vertical-align: 0.15em;
  transition: transform var(--dur) var(--ease-out);
}
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:focus-visible { border-radius: var(--radius-sm); }
.disclosure__body { padding: 0 0 0.8em; }
.disclosure__body > :first-child { margin-top: 0; }
.disclosure__body > :last-child { margin-bottom: 0; }
.link-btn-wrap { margin: 0 auto var(--p-gap); }
.prose a.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  max-width: 100%;
  padding: 0.45em 0.85em;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.3;
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow-wrap: break-word;
}
.prose a.link-btn:hover {
  color: var(--link-hover);
  border-color: var(--link);
  text-decoration: none;
}
@media (max-width: 359px) {
  .prose ul.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
}

/* Photos: white mat + soft shadow */
.photo {
  margin: 0 0 0.9em;
  padding: 6px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-photo);
}
a.photo {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}
a.photo:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.photo img { width: 100%; height: auto; border-radius: 2px; vertical-align: middle; }
.photo--hero { max-width: var(--col); }
.figure { margin: 0.9em 0 1.1em; }
.figure .photo { margin-bottom: var(--s-2); }
.figure figcaption,
.gallery figcaption,
.lightbox__cap {
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
.figure figcaption a,
.gallery figcaption a { color: inherit; }

/* Memorial only: on large screens, story photos stay at their natural size
   and do not upscale with the full-width prose. Phones keep sheet-width photos. */
@media (min-width: 760px) {
  .calm .prose .figure {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .calm .prose .figure .photo,
  .calm .prose .figure a.photo {
    width: fit-content;
    max-width: 100%;
  }
  .calm .prose .figure .photo img {
    width: auto;
    max-width: 100%;
    height: auto;
  }
  /* Keep captions wrapped to the image width so they do not stretch the figure. */
  .calm .prose .figure figcaption {
    width: 0;
    min-width: 100%;
  }
}

/* Photo gallery: one image uses .figure; a row of 2; 2–3 columns for more. */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin: 0.9em 0 1.1em;
  align-items: start;
}
.gallery__item { margin: 0; min-width: 0; }
.gallery__item .photo { margin: 0 0 var(--s-2); }
.gallery--2 { grid-template-columns: 1fr 1fr; }
.gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 759px) {
  .gallery--3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 479px) {
  .gallery--2,
  .gallery--3 { grid-template-columns: 1fr; }
}

/* Lightbox: navy stage in both themes so opening never flashes white. */
.lightbox[open] {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: calc(100vw - 2 * var(--s-5));
  max-height: calc(100dvh - 2 * var(--s-5));
  margin: auto;
  padding: 0;
  border: 0;
  background: #081a36;
  color: #f4f8ff;
  color-scheme: dark;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.lightbox::backdrop {
  background: rgba(8, 26, 54, 0.92);
}
.lightbox__toolbar {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
  padding: var(--s-2);
}
.lightbox__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  min-width: 12rem;
  background: #081a36;
  overflow: hidden;
}
.lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(78dvh, 48rem);
  margin: 0 auto;
  opacity: 0;
  background: transparent;
}
.lightbox__img.is-ready { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox__img.is-ready { transition: opacity 160ms ease; }
}
.calm .lightbox__img.is-ready { transition: none; }
.lightbox__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  flex-shrink: 0;
  padding: var(--s-2) var(--s-3) var(--s-3);
}
.lightbox__cap {
  flex: 1;
  margin: 0;
  padding: 0;
  color: rgba(244, 248, 255, 0.82);
  text-align: center;
}
.lightbox__cap[hidden] { display: none; }
.lightbox__close,
.lightbox__nav {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(244, 248, 255, 0.1);
  color: #f4f8ff;
  cursor: pointer;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(244, 248, 255, 0.18); }
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible {
  outline: 2px solid #f4f8ff;
  outline-offset: 2px;
}
.lightbox__nav[hidden] { display: none; }
/* If prev/next are hidden, keep the caption centred in the remaining space. */
.lightbox__meta:not(:has(.lightbox__nav:not([hidden]))) { justify-content: center; }

/* Task list */
.tasks { list-style: none; padding-left: 0 !important; }
.tasks li { display: flex; gap: var(--s-3); align-items: baseline; }
.tasks .box {
  flex-shrink: 0; position: relative; top: 2px;
  width: 16px; height: 16px;
  border: 1.5px solid var(--ink-muted); border-radius: 3px;
}
.tasks .is-done .box { background: var(--link); border-color: var(--link); }
.tasks .is-done .box::after {
  content: ""; position: absolute; left: 4px; top: 0px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

/* About: two columns with photo */
.about { display: grid; gap: var(--s-6); }
.about__photo { margin: 0; justify-self: center; width: min(100%, 480px); }
@media (max-width: 639px) { .about__photo { width: 100%; } }
.about__photo .photo { margin: 0; }
/* About click-to-copy chips. Values stay visible without JavaScript. */
.contact-chip {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--s-3);
  width: 100%;
  max-width: 28rem;
  margin: 0 0 var(--s-5);
  padding: 14px 16px 14px 14px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, var(--rule));
  border-radius: var(--radius-lg);
  background: var(--chip-bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-chip);
  transition: background-color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out),
              transform var(--dur) var(--ease-out);
}
.contact-chip:hover {
  transform: translateY(-1px);
  border-color: var(--link);
  box-shadow: var(--shadow-chip-hover);
}
.contact-chip:active { transform: translateY(0); }
.contact-chip:focus-visible {
  outline: none;
  box-shadow: var(--focus), var(--shadow-chip);
}
.contact-chip:hover:focus-visible {
  box-shadow: var(--focus), var(--shadow-chip-hover);
}
.contact-chip__icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--link) 16%, transparent);
  color: var(--link);
}
.contact-chip__icon svg { display: block; }
.contact-chip__text { flex: 1; min-width: 0; }
.contact-chip__title {
  display: block;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-chip__value {
  display: block;
  font-family: var(--font);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-chip__hint {
  flex-shrink: 1;
  max-width: 42%;
  font-size: var(--fs-xs);
  line-height: 1.3;
  color: var(--ink-muted);
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-chip.is-copied .contact-chip__hint {
  font-size: 0;
  padding: 4px 10px;
  border-color: color-mix(in srgb, var(--ok) 40%, var(--rule));
  background: color-mix(in srgb, var(--ok) 14%, transparent);
}
.contact-chip.is-copied .contact-chip__hint::before {
  content: "Copied";
  font-size: var(--fs-xs);
  color: var(--ok);
}


/* Memorial: calm page */
.calm .sheet { animation-duration: 700ms; }
.names {
  columns: 3 14rem; column-gap: var(--s-6);
  list-style: none; padding-left: 0 !important;
  font-size: var(--fs-sm);
}
.names li { break-inside: avoid; margin: 0 0 var(--s-1); }
.sources li { font-size: var(--fs-sm); scroll-margin-top: var(--s-6); }
.sources li:target { background: var(--paper-2); border-radius: var(--radius-sm); }

/* ---------- 8. Cards (blogs, projects, documents, fishing) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-7) var(--s-6);
  margin: 0; padding: 0; list-style: none;
}
.card { position: relative; }
.card__link { display: flex; flex-direction: column; gap: var(--s-3); color: inherit; text-decoration: none; }
.card__thumb {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 6px;
  background: var(--paper);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-photo);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.card__thumb--blank {
  display: flex; align-items: center; justify-content: center;
}
.card__thumb--blank span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--bp-ink); font-weight: 700; font-size: 2rem; letter-spacing: 0.04em;
  border-radius: 2px;
}
.card__thumb--blank .blueprint { background-size: 60px 60px, 60px 60px, 12px 12px, 12px 12px; }
.card__title { margin: 0; font-size: var(--fs-md); line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.card__text {
  margin: calc(-1 * var(--s-2)) 0 0;
  font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; min-width: 0;
}
.card__link:hover .card__thumb { transform: translateY(-3px); box-shadow: var(--shadow-photo-hover); }
.card__link:hover .card__title { color: var(--link); }
.card__link:focus-visible { box-shadow: none; }
.card__link:focus-visible .card__thumb { box-shadow: var(--focus), var(--shadow-photo); }
@media (max-width: 899px) and (min-width: 640px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .cards { grid-template-columns: 1fr; gap: var(--s-5); }
  .card__link { display: grid; grid-template-columns: 80px minmax(0, 1fr); column-gap: var(--s-4); row-gap: var(--s-1); align-items: center; }
  .card__thumb { grid-row: 1 / span 2; width: 80px; padding: 4px; }
  .card__thumb--blank span { font-size: 1rem; }
  .card__title { align-self: end; font-size: var(--fs-base); }
  .card__text { margin: 0; align-self: start; }
  .card__link:hover .card__thumb { transform: none; }
}


/* ---------- 9. Error pages ---------- */
.oops { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--s-6) 0; }
.oops__img { width: 168px; height: auto; margin-bottom: var(--s-4); }
/* Light mode: the white die-cut edge disappears into the sheet. A soft
   ink outline traces the sticker so the border reads against white.
   Dark mode leaves the filter off — the white edge already shows. */
.oops__img {
  filter:
    drop-shadow(0 0 0.5px rgba(20, 33, 51, 0.55))
    drop-shadow(0 0 1px rgba(20, 33, 51, 0.35))
    drop-shadow(0 1px 1.5px rgba(20, 33, 51, 0.12));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .oops__img { filter: none; }
}
:root[data-theme="dark"] .oops__img { filter: none; }
/* Error pages: the switch sits alone at the top right, above the sticker.
   The .oops padding already separates them, so the head needs no extra gap. */
.sheet--oops .sheet__head { margin-bottom: 0; }
.page > .sheet--oops > .sheet__head { margin-bottom: 0; }
.page > .sheet--oops > .sheet__body { padding-top: 0; }
.oops__code { margin: 0; color: var(--ink); font-size: clamp(3.5rem, 2.5rem + 4vw, 5rem); line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.oops__title { margin: var(--s-3) 0 var(--s-3); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.015em; }
.oops__title .ok { color: var(--ok); }
/* Message paragraphs only. .oops p is more specific than .oops__code /
   .oops__title, so a font-size here (added with the unified paragraph
   rule) had shrunk the display number to body size. */
.oops p:not(.oops__code):not(.oops__title):not(.oops__name) {
  margin: 0; max-width: 48ch; color: var(--ink-muted); font-size: var(--p-size); line-height: var(--p-leading);
}
.oops__name { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: var(--s-2) !important; }
.button {
  display: inline-flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-6);
  padding: var(--s-3) var(--s-5);
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--bp-ink); background: var(--btn);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease-out);
}
.button:hover { background: var(--btn-hover); }

/* ---------- 10. Library (example.html) ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-4); margin: 0 0 var(--s-5); padding: 0 !important; list-style: none; }
.swatches li { margin: 0; font-size: var(--fs-xs); }
.swatches .chip { display: block; height: 56px; margin-bottom: var(--s-2); border-radius: var(--radius-md); border: 1px solid var(--rule); }
.chip--bp-950 { background: var(--bp-950); } .chip--bp-800 { background: var(--bp-800); }
.chip--paper { background: var(--paper); } .chip--paper-2 { background: var(--paper-2); }
.chip--ink { background: var(--ink); } .chip--link { background: var(--link); }
.chip--sk-blue { background: var(--sk-blue); } .chip--sk-red { background: var(--sk-red); }
.chip--sk-yellow { background: var(--sk-yellow); } .chip--ok { background: var(--ok); }
.demo { margin: 0 0 var(--s-5); padding: var(--s-5); border: 1px dashed var(--rule); border-radius: var(--radius-md); }
.demo--bp { color: var(--bp-ink); border: 0; }

/* ---------- 11. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .page > .sheet { animation: none; }
}
