@font-face {
  font-family: Caveat;
  src: url('/portfolio/fonts/caveat-semibold.eebf3dcbbbe8.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
:root {
  --gutter: clamp(22px, 4.5vw, 72px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* One handwriting scale for every page. */
  --text-small: 22px;
  --text-body: 24px;
  --text-lead: 26px;
  --text-item: 30px;
  --text-heading: 36px;
  --text-section: clamp(42px, 4.3vw, 58px);
  --text-title: clamp(54px, 7vw, 92px);
  --text-title-compact: clamp(46px, 5.6vw, 76px);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-padding-top: 28px; background: var(--paper); color: var(--ink); scrollbar-color: var(--muted) var(--paper); }
body { margin: 0; display: flex; flex-direction: column; font-family: Caveat, 'Segoe Print', 'Bradley Hand', cursive; font-weight: 600; font-size: var(--text-body); line-height: 1.5; -webkit-font-smoothing: antialiased; }
body > main { flex: 1 0 auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; border-radius: 0; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
picture { display: block; }
figure, p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
button svg, a svg, summary svg { flex-shrink: 0; vertical-align: middle; }
input { caret-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: 1; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 30; padding: 12px 18px; background: var(--ink); color: var(--paper); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

/* Crayon marks. One plum crayon (illustrated.css) draws every divider, the
   current page and each selection: a stroke under words, a loop around
   swatches and icons. Nothing else marks state. */
.site-header nav a[aria-current]::after,
.filter-button[aria-pressed="true"]::after,
.stamp-size[aria-pressed="true"]::after,
.text-button[aria-pressed="true"]::after {
  content: ''; position: absolute; left: -5px; right: -5px; bottom: 2px; height: 9px;
  background: currentColor; pointer-events: none;
  -webkit-mask: var(--crayon-underline) center / 100% 100% no-repeat;
  mask: var(--crayon-underline) center / 100% 100% no-repeat;
}
.view-controls [aria-pressed="true"]::after,
.crayon[aria-pressed="true"]::after,
.brush-size[aria-pressed="true"]::after,
.zoom-mark::after {
  content: ''; position: absolute; inset: 0; background: var(--ink); pointer-events: none;
  -webkit-mask: var(--crayon-ring) center / 100% 100% no-repeat;
  mask: var(--crayon-ring) center / 100% 100% no-repeat;
}
.stamp-option[aria-pressed="true"]::after {
  content: ''; position: absolute; inset: -2px -6px auto; aspect-ratio: 300 / 190; background: var(--ink); pointer-events: none;
  -webkit-mask: var(--crayon-ring-wide) center / 100% 100% no-repeat;
  mask: var(--crayon-ring-wide) center / 100% 100% no-repeat;
}
.search-field::after,
.work-grid[data-view="index"] .work-card::after,
.detail-composition .work-description dl::before,
.work-pagination::before {
  content: ''; position: absolute; left: 0; right: 0; height: 8px; background: var(--line); pointer-events: none;
  -webkit-mask: var(--crayon-rule) left center / auto 100% repeat-x;
  mask: var(--crayon-rule) left center / auto 100% repeat-x;
}

.site-header { min-height: 80px; display: flex; align-items: center; gap: 28px; }
.brand { font-size: var(--text-item); line-height: 44px; white-space: nowrap; }
.site-header nav { display: flex; gap: 32px; margin-left: auto; }
.site-header nav a { display: flex; align-items: center; min-height: 44px; position: relative; font-size: var(--text-body); }
.icon-button { position: relative; width: 44px; min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.theme-button { margin-right: -10px; }
.dark-icon { display: none; }
[data-theme="dark"] .light-icon { display: none; }
[data-theme="dark"] .dark-icon { display: inline-flex; }
.text-link, .back-link { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; line-height: 1.4; }
.text-link { font-size: var(--text-lead); }
.text-link svg { transition: transform 180ms var(--ease); }
.text-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border: 0; padding: 6px 0; background: none; }
.text-button[aria-pressed="false"] { color: var(--muted); }

/* Home: the three companions stand on the meadow at the foot of the first screen. */
.painted-entry { display: flex; flex-direction: column; min-height: min(calc(100svh - 80px), 1400px); }
.hero-scene { flex: 1 0 auto; display: flex; flex-direction: column; padding-top: 12px; padding-bottom: calc(var(--meadow-height) * .32 - 48px); }
.hero-greeting { margin-block: auto; padding-bottom: 18px; }
.painted-wordmark { width: min(100%, 760px); margin: 0 auto; line-height: 1; }
.painted-wordmark img { width: 100%; }
.entry-invitation { text-align: center; color: var(--muted); margin-top: 0; font-size: var(--text-lead); }
.entry-invitation-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.entry-companion { width: 88px; flex: 0 0 88px; }
.night-companion, [data-theme="dark"] .day-companion { display: none; }
[data-theme="dark"] .night-companion { display: block; }
.painted-navigation { display: grid; grid-template-columns: 1.2fr 1fr .9fr; align-items: end; column-gap: 7%; width: 100%; max-width: 900px; margin: 0 auto; }
.painted-link { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.painted-link picture { width: 100%; }
.painted-link img { width: 100%; height: 240px; object-fit: contain; transition: transform 220ms var(--ease); }
.flower-link img { height: 195px; }
.butterfly-link img { height: 140px; }
/* The companions stand on the outline at .37 of the meadow; their names sit lower,
   below the outline's lowest dip (.33), so the line never runs through a word. */
.painted-link > span { display: flex; align-items: center; gap: 14px; min-height: 48px; margin-top: calc(var(--meadow-height) * .05); font-size: var(--text-item); line-height: 1.2; }
.painted-link > span svg { transition: transform 180ms var(--ease); }
.studio-invitation { display: flex; align-items: center; justify-content: center; gap: 48px; padding-top: 20px; padding-bottom: 72px; }
.studio-invitation > picture { width: 200px; flex-shrink: 0; transform: rotate(-6deg); }
.studio-invitation h2 { font-size: var(--text-section); line-height: 1.2; }
.studio-invitation p { color: var(--muted); font-size: var(--text-lead); margin: 10px 0 12px; max-width: 32ch; }
.collection-outro { display: flex; align-items: center; justify-content: flex-end; gap: 28px; margin-top: 84px; }
.collection-outro > picture { width: 176px; flex-shrink: 0; }
.collection-outro p { font-size: var(--text-item); margin-bottom: 2px; }
.lost-snail { width: 160px; margin-bottom: 28px; }
.work-section { padding-top: 64px; padding-bottom: 84px; scroll-margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.section-heading h2 { font-size: var(--text-section); line-height: 1.25; }
.collection-pending { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: 24px; }
.pending-caption { max-width: 440px; }
.pending-caption p { font-size: var(--text-item); }
.pending-caption span { display: block; margin-top: 6px; color: var(--muted); font-size: var(--text-small); line-height: 1.45; }
.collection-pending > a { max-width: 330px; }

/* Collection tools */
.gallery-search { margin-top: 28px; max-width: 480px; }
.gallery-search label { display: block; margin-bottom: 5px; }
.search-field { position: relative; display: flex; align-items: center; gap: 12px; }
.search-field::after { bottom: -5px; background: var(--muted); }
.search-field input { width: 100%; min-width: 0; padding: 9px 0; border: 0; border-radius: 4px; background: none; outline-offset: 2px; }
.search-field input::-webkit-search-cancel-button, .search-field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 0 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.filter-button { position: relative; min-width: 44px; min-height: 44px; background: none; border: 0; padding: 8px 2px; color: var(--muted); font-size: var(--text-small); }
.filter-button[aria-pressed="true"] { color: var(--ink); }
.view-controls { display: flex; gap: 4px; }
.view-controls [aria-pressed="false"] { color: var(--muted); }
.gallery-status { color: var(--muted); min-height: 1.5em; margin: 16px 0 28px; font-size: var(--text-small); }
.gallery-status:empty { display: none; }

/* Work cards */
.work-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 80px 8%; align-items: start; margin-top: 28px; }
.artwork { position: relative; display: block; background: var(--plate); overflow: hidden; }
.artwork img { width: 100%; height: 100%; object-fit: contain; }
.work-card { min-width: 0; }
.work-card .artwork { aspect-ratio: 4/5; }
.work-card:nth-child(2n) { margin-top: 110px; }
.work-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-top: 18px; }
.work-caption h3 { font-size: var(--text-item); line-height: 1.3; overflow-wrap: anywhere; }
.work-caption p { font-size: var(--text-small); color: var(--muted); margin-top: 2px; }
.work-caption svg { margin-top: 6px; }
.work-grid.is-filtered .work-card { margin: 0; }
.work-grid[data-view="index"] { display: block; }
.work-grid[data-view="index"] .work-card { position: relative; margin: 0; padding: 22px 0; }
.work-grid[data-view="index"] .work-card::after { bottom: -4px; }
.work-grid[data-view="index"] .work-link { display: grid; grid-template-columns: 112px 1fr; gap: 28px; align-items: center; }
.work-grid[data-view="index"] .artwork { width: 112px; height: 100px; aspect-ratio: auto; }
.work-grid[data-view="index"] .work-caption { padding: 0; }
.work-gallery { padding-top: 48px; padding-bottom: 72px; }
.collection-header { display: grid; grid-template-columns: 1fr 1fr; gap: 10%; align-items: end; margin-bottom: 36px; }
.collection-header .page-title { font-size: var(--text-title-compact); }
.collection-header p { max-width: 39ch; color: var(--muted); font-size: var(--text-body); }
.collection-header .collection-note { margin-top: 0; }
.collection-note { color: var(--muted); max-width: 65ch; margin-top: 18px; font-size: var(--text-small); }
.collection-link { margin-top: 36px; }
.sample-label { display: block; color: var(--muted); font-size: var(--text-small); line-height: 1.4; margin-top: 4px; }
.sample-notice { max-width: 55ch; color: var(--muted); font-size: var(--text-small); line-height: 1.5; }
.collection-gallery .gallery-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 5%; margin-bottom: 14px; }
.collection-gallery .gallery-search { flex: 1 1 300px; margin-top: 0; max-width: 390px; }
.collection-gallery .gallery-toolbar { flex: 1 1 500px; min-height: 55px; padding: 0 0 4px; }
.collection-gallery .gallery-status { margin-block: 12px 24px; }
.filter-button[aria-pressed="true"]::after { left: 2px; right: 2px; }
.collection-gallery .work-grid { grid-template-columns: repeat(12,minmax(0,1fr)); gap: 56px 4%; }
.collection-gallery .work-card { grid-column: span 6; margin-top: 0; }
.collection-gallery .work-card:first-child { grid-column: 1 / 8; grid-row: span 2; }
.collection-gallery .work-card:nth-child(2), .collection-gallery .work-card:nth-child(3) { grid-column: 9 / -1; }
.collection-gallery .work-card:nth-child(2) { margin-top: 76px; }
.collection-gallery .work-card .artwork, .home-work-grid .work-card .artwork { aspect-ratio: auto; background: transparent; }
.collection-gallery .work-card .artwork img, .home-work-grid .work-card .artwork img { height: auto; }
.collection-gallery .work-grid.is-filtered .work-card { grid-column: span 6; grid-row: auto; margin-top: 0; }
.collection-gallery .work-grid[data-view="index"] .work-card { margin: 0; }
.collection-gallery .work-grid[data-view="index"] .artwork { height: 100px; background: var(--plate); }
.collection-gallery .work-grid[data-view="index"] .artwork img { height: 100%; }
.home-work-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4%; margin-top: 34px; }
.home-work-grid .work-card:nth-child(2) { margin-top: 76px; }
.home-work-grid .work-card:nth-child(3) { margin-top: 32px; }
.home-work-grid .work-caption { gap: 12px; }
.empty-message { padding: 44px 0; color: var(--muted); }

/* The footer stands in the meadow at the foot of every page. */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 40px; padding-top: calc(var(--meadow-height) * .44); padding-bottom: max(30px, env(safe-area-inset-bottom)); }
.footer-name { font-size: var(--text-item); }
.copyright, .footer-top { font-size: var(--text-small); }
.footer-top { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }

.page-title { font-size: var(--text-title); line-height: 1.15; overflow-wrap: anywhere; }
.about-page { padding-top: 56px; padding-bottom: 72px; }
.about-composition { display: grid; grid-template-columns: 1fr 1fr; gap: 12%; align-items: center; margin-top: 56px; }
.about-identity { display: flex; justify-content: center; }
.about-sun { width: 230px; }
.about-block { margin-bottom: 36px; max-width: 42ch; }
.about-block h2 { font-size: var(--text-heading); margin-bottom: 12px; }
.about-block p { font-size: var(--text-lead); line-height: 1.5; color: var(--muted); white-space: pre-line; }

/* Work details */
.detail-page { padding-top: 28px; }
.back-link { font-size: var(--text-small); color: var(--muted); }
.detail-heading { padding: 24px 0 36px; }
.detail-heading .page-title { font-size: var(--text-title-compact); }
.detail-heading > .sample-label { display: inline-block; margin: 12px 18px 0 0; }
.detail-heading > p { display: inline-block; margin-top: 12px; color: var(--muted); }
.detail-image .artwork { width: 100%; height: min(78svh,840px); min-height: 380px; padding: 36px; }
figcaption { max-width: 48ch; margin-top: 14px; color: var(--muted); font-size: var(--text-small); }
.image-note { display: block; }
.work-reserved { min-height: 100%; width: 100%; display: grid; place-items: center; color: var(--plate-ink); }
.zoom-mark { position: absolute; bottom: 14px; right: 14px; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); }
.work-description { padding: 64px 0 80px; display: grid; grid-template-columns: 1fr .65fr; gap: 12%; }
.work-description h2 { font-size: var(--text-heading); line-height: 1.25; }
.work-description p { max-width: 65ch; margin-top: 20px; color: var(--muted); white-space: pre-line; }
.work-description dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 24px; }
.work-description dl:empty { display: none; }
.work-description dl div:last-child { grid-column: 1/-1; }
.work-description dt { font-size: var(--text-small); color: var(--muted); margin-bottom: 2px; }
.work-description dd { font-size: var(--text-body); margin: 0; }
.detail-composition { display: grid; grid-template-columns: 1.5fr 1fr; gap: 7%; align-items: start; margin-bottom: 72px; }
.detail-composition .detail-image { min-width: 0; }
/* The link shrinks to the drawn image so the zoom mark and caption sit on its edges. */
.detail-composition .detail-image .artwork { width: fit-content; max-width: 100%; height: auto; min-height: 0; padding: 0; background: transparent; }
.detail-composition .detail-image .artwork img { width: auto; max-width: 100%; height: auto; max-height: 80svh; object-fit: contain; }
.detail-composition .work-description { display: block; padding: 12px 0 0; }
.detail-composition .work-description p { margin-top: 14px; font-size: var(--text-body); max-width: 36ch; }
.detail-composition .work-description dl { position: relative; margin-top: 32px; padding-top: 28px; grid-template-columns: 1fr; gap: 20px; }
.detail-composition .work-description dl::before { top: 0; }
.detail-composition .work-description .sample-notice { margin-top: 28px; font-size: var(--text-small); }
.work-pagination { position: relative; display: flex; justify-content: space-between; gap: 28px; padding: 36px 0 24px; }
.work-pagination::before { top: 0; }
.work-pagination > a { display: flex; gap: 20px; align-items: center; font-size: var(--text-item); }
.work-pagination > a:last-child { text-align: right; }
.work-pagination small { display: block; font-size: var(--text-small); color: var(--muted); margin-bottom: 4px; }
.additional-image { max-width: 1000px; margin: 0 auto 72px; }
.additional-image .artwork img { height: auto; }

/* Image viewer */
.has-lightbox { overflow: hidden; }
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 68px 60px 24px; background: var(--overlay); border: 0; color: var(--ink); overflow: auto; }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 12px; }
.lightbox::backdrop { background: var(--paper); }
.lightbox > img { min-height: 0; max-height: calc(100dvh - 240px); object-fit: contain; flex-shrink: 1; }
.lightbox-caption { text-align: center; max-width: 65ch; overflow-wrap: anywhere; }
.lightbox-close { position: absolute; right: 24px; top: 16px; }
.lightbox-controls { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: var(--text-small); }
.lightbox-controls p { text-align: center; overflow-wrap: anywhere; min-width: 0; }
.image-unavailable { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--plate); color: var(--plate-ink); text-align: center; }
.not-found { padding-top: 64px; padding-bottom: 64px; }
.not-found > p:first-of-type { color: var(--muted); font-size: var(--text-small); }
.not-found h1 { margin: 12px 0 20px; }
.not-found > .text-link { margin-top: 24px; }

/* Sketchbook */
.sketchbook-page { padding-top: 42px; padding-bottom: 64px; max-width: 1280px; }
.sketchbook-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 44px; }
.sketchbook-heading p { text-wrap: balance; color: var(--muted); font-size: var(--text-lead); margin-top: 14px; }
.sketchbook-artist { width: 180px; flex-shrink: 0; }
.drawing-workspace { max-width: 960px; margin-inline: auto; }
.drawing-tools { display: flex; align-items: flex-end; gap: 36px; margin-bottom: 18px; }
.drawing-tools fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.drawing-tools legend, .stamp-size-controls legend { color: var(--muted); font-size: var(--text-small); margin-bottom: 4px; }
.drawing-tools fieldset > div { display: flex; gap: 2px; }
.crayon, .brush-size { position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; padding: 6px; }
.crayon span { display: block; width: 22px; height: 30px; border-radius: 30% 40% 20% 25%; background: var(--crayon); transform: rotate(-9deg); border: 1px solid #653861; }
.crayon-plum { --crayon: #653861; }
.crayon-pink { --crayon: #dc6595; }
.crayon-blue { --crayon: #628ed5; }
.crayon-green { --crayon: #73ae79; }
.crayon-yellow { --crayon: #e9bf39; }
.crayon-lilac { --crayon: #ab7fc8; }
.crayon:focus-visible, .brush-size:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.brush-size span { display: block; border-radius: 50%; background: var(--ink); }
.brush-fine span { width: 5px; height: 5px; }
.brush-medium span { width: 12px; height: 12px; }
.brush-wide span { width: 22px; height: 22px; }
.drawing-history { display: flex; gap: 4px; margin-left: auto; }
.drawing-paper { position: relative; background: #fff8e7; }
/* A crayon outline around the sheet, drawn for its 4:3 shape. */
.drawing-paper::after { content: ''; position: absolute; inset: -7px; background: var(--crayon-frame) center / 100% 100% no-repeat; pointer-events: none; }
.drawing-paper canvas { display: block; width: 100%; height: auto; aspect-ratio: 4/3; touch-action: none; cursor: crosshair; }
.drawing-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 22px; }
.drawing-actions .text-button { flex-shrink: 0; }
.drawing-status { font-size: var(--text-small); color: var(--muted); text-align: center; }
.download-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border: 0; background: var(--ink); color: var(--paper); padding: 8px 20px; flex-shrink: 0; border-radius: 22px 26px 24px 20px / 24px 20px 26px 22px; }
.stamp-picker > summary, .drawing-help summary { display: flex; align-items: center; gap: 12px; width: fit-content; min-height: 48px; padding: 6px 0; cursor: pointer; list-style: none; }
.stamp-picker > summary::-webkit-details-marker, .drawing-help summary::-webkit-details-marker { display: none; }
.stamp-picker > summary svg, .drawing-help summary svg { transition: transform 180ms var(--ease); }
.stamp-picker[open] > summary svg, .drawing-help[open] summary svg { transform: rotate(45deg); }
.drawing-help { max-width: 72ch; margin-top: 28px; color: var(--muted); font-size: var(--text-small); }
.drawing-help summary { color: var(--ink); font-size: var(--text-body); }
.drawing-help p { margin-top: 10px; }
.sketchbook-notice { margin-block: 50px; }
.sketchbook-notice a { text-decoration: underline; text-underline-offset: 5px; }
.stamp-picker { margin: 0 0 10px; }
.stamp-options { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; padding: 4px 0 16px; }
.stamp-option { position: relative; border: 0; background: none; padding: 10px 6px 8px; min-width: 0; display: flex; align-items: center; flex-direction: column; font-size: var(--text-small); line-height: 1.2; gap: 6px; border-radius: 50%; }
.stamp-option img, .stamp-option picture { width: 100%; }
.stamp-option img { aspect-ratio: 3/2; object-fit: contain; }
.stamp-option[aria-pressed="false"] span { color: var(--muted); }
.stamp-size-controls { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.stamp-controls { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 12px; }
.stamp-controls .stamp-size-controls { margin: 0; }
.stamp-size-controls > div { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.stamp-size { position: relative; min-height: 44px; min-width: 44px; border: 0; background: transparent; padding: 4px 2px; color: var(--muted); }
.stamp-size[aria-pressed="true"] { color: var(--ink); }
.tool-status { color: var(--muted); font-size: var(--text-small); min-height: 1.5em; margin: 0 0 14px; }
.drawing-error { color: var(--ink); font-size: var(--text-small); border-left: 3px solid var(--accent); padding: 6px 14px; margin: 0 0 16px; }

@media (hover:hover) and (pointer:fine) {
  .painted-link:hover img { transform: translateY(-5px); }
  .painted-link:hover > span, .text-link:hover, .back-link:hover, .site-header a:hover, .work-link:hover .work-caption, .footer-name:hover, .footer-top:hover, .work-pagination > a:hover { color: var(--accent); }
  .filter-button:hover, .stamp-size:hover, .view-controls button:hover, .text-button:hover:not(:disabled), .stamp-option:hover span { color: var(--accent); }
  .painted-link:hover > span svg, .text-link:hover svg { transform: translateX(3px); }
  .icon-button:hover:not(:disabled), .brush-size:hover, .crayon:hover { background: var(--surface); }
  .download-button:hover { background: var(--accent); }
}
@media(prefers-reduced-motion:no-preference) {
  .lightbox[open] { animation: appear 160ms var(--ease); }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
}
@media(prefers-reduced-motion:reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media(max-width:1023px) {
  .collection-gallery .work-grid { column-gap: 5%; }
  .collection-gallery .work-card:first-child { grid-column: 1 / 8; }
  .collection-gallery .work-card:nth-child(2), .collection-gallery .work-card:nth-child(3) { grid-column: 8 / -1; }
  .collection-gallery .work-card:nth-child(2) { margin-top: 38px; }
  .detail-composition { gap: 6%; grid-template-columns: 1.2fr 1fr; }
  .painted-navigation { max-width: 760px; gap: 5%; }
  .painted-link img { height: 210px; }
  .flower-link img { height: 170px; }
  .butterfly-link img { height: 120px; }
  .collection-pending { align-items: flex-start; }
  .collection-pending > a { max-width: 250px; }
}
/* Short laptop screens keep the whole scene, names included, on the first screen. */
@media(min-width:768px) and (max-height:760px) {
  .painted-link img { height: 210px; }
  .flower-link img { height: 170px; }
  .butterfly-link img { height: 120px; }
}
@media(min-width:768px) and (max-height:680px) {
  .painted-wordmark { width: min(100%, 600px); }
  .painted-link img { height: 180px; }
  .flower-link img { height: 145px; }
  .butterfly-link img { height: 100px; }
}
@media(max-width:767px) {
  :root { --gutter: 22px; --text-lead: 24px; --text-item: 28px; --text-heading: 32px; --text-section: 40px; --text-title: clamp(44px,11.5vw,68px); --text-title-compact: clamp(42px,10.8vw,64px); }
  .site-header { display: grid; grid-template-columns: 1fr 44px; gap: 0; padding-top: 10px; padding-bottom: 8px; }
  .brand { width: fit-content; }
  .theme-button { grid-column: 2; grid-row: 1; margin: 0; }
  .site-header nav { grid-row: 2; grid-column: 1/-1; margin: 0; justify-content: center; gap: 34px; }
  .painted-entry { min-height: min(calc(100svh - 106px), 900px); }
  .hero-scene { padding-top: 16px; padding-bottom: calc(var(--meadow-height) * .37 - 134px); }
  .hero-greeting { padding-bottom: 24px; }
  .entry-invitation { margin-top: 5px; }
  .entry-invitation-row { gap: 8px; }
  .entry-invitation-row .entry-invitation { margin: 0; text-align: left; max-width: 19ch; }
  .entry-companion { width: 62px; flex-basis: 62px; }
  .studio-invitation { gap: 14px; padding-top: 16px; padding-bottom: 48px; align-items: flex-start; }
  .studio-invitation > picture { width: 124px; margin-top: 8px; }
  .studio-invitation h2 { font-size: var(--text-heading); }
  .studio-invitation .text-link { gap: 10px; }
  .collection-outro { margin-top: 56px; gap: 18px; justify-content: center; }
  .collection-outro > picture { width: 120px; }
  .collection-outro .text-link { gap: 8px; }
  .painted-navigation { grid-template-columns: 1.2fr 1fr; gap: 14px 4%; }
  .painted-link img { height: 210px; }
  .flower-link img { height: 165px; }
  .butterfly-link { grid-column: 1/-1; flex-direction: row; justify-content: center; gap: 20px; }
  .butterfly-link picture { width: 72px; }
  .butterfly-link img { height: 60px; }
  /* A phone shows only the meadow's middle, where the outline stays above the names. */
  .painted-link > span { margin-top: 4px; }
  .butterfly-link > span { margin: 0; }
  .work-section { padding-top: 44px; padding-bottom: 48px; }
  .work-section .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 6px 24px; }
  .work-gallery { padding-top: 30px; padding-bottom: 52px; }
  .collection-header { grid-template-columns: 1fr; gap: 20px; margin-bottom: 28px; }
  .collection-header p { max-width: 42ch; }
  .collection-note { margin-top: 16px; }
  /* Search and layout share the first row so the filters keep a full line. */
  .collection-gallery .gallery-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px 12px; }
  .collection-gallery .gallery-toolbar { display: contents; }
  .collection-gallery .gallery-search { grid-column: 1; grid-row: 1; max-width: none; }
  .collection-gallery .view-controls { grid-column: 2; grid-row: 1; }
  .collection-gallery .filters { grid-column: 1 / -1; gap: 4px 18px; }
  .collection-gallery .gallery-status { margin-bottom: 22px; }
  .collection-gallery .work-grid, .home-work-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 44px; }
  .collection-gallery .work-grid[data-view="index"] { display: block; }
  .collection-gallery .work-card, .collection-gallery .work-card:first-child, .collection-gallery .work-card:nth-child(2), .collection-gallery .work-card:nth-child(3), .collection-gallery .work-grid.is-filtered .work-card { grid-column: auto; grid-row: auto; margin: 0; }
  .home-work-grid .work-card:nth-child(2), .home-work-grid .work-card:nth-child(3) { margin: 0; }
  .collection-pending { display: block; margin-top: 22px; }
  .pending-caption span { max-width: 34ch; }
  .collection-pending > a { max-width: 100%; margin-top: 22px; }
  .gallery-toolbar { align-items: flex-start; gap: 12px; }
  .filters { gap: 4px 18px; }
  .work-grid { grid-template-columns: 1fr; gap: 44px; }
  .work-card:nth-child(2n) { margin-top: 0; }
  .work-grid[data-view="index"] .work-link { grid-template-columns: 80px 1fr; gap: 16px; }
  .work-grid[data-view="index"] .artwork { width: 80px; height: 100px; }
  .work-grid[data-view="index"] .work-caption { gap: 10px; }
  .site-footer { gap: 0 28px; }
  .footer-name { flex-basis: 100%; text-align: center; }
  .about-page { padding-top: 38px; padding-bottom: 56px; }
  .about-composition { grid-template-columns: 1fr; margin-top: 28px; gap: 28px; }
  .about-sun { width: 150px; }
  .detail-page { padding-top: 16px; }
  .detail-heading { padding: 30px 0; }
  .detail-composition { grid-template-columns: minmax(0,1fr); gap: 34px; margin-bottom: 44px; }
  .detail-composition .work-description { padding: 0; }
  .detail-composition .work-description p { max-width: 65ch; }
  .detail-composition .detail-image .artwork img { max-height: none; }
  .detail-image .artwork { height: 62svh; min-height: 320px; max-height: 640px; padding: 18px; }
  .zoom-mark { bottom: 10px; right: 10px; }
  .work-description { grid-template-columns: 1fr; gap: 36px; padding: 48px 0 60px; }
  .work-pagination { display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; padding: 30px 0 16px; }
  .work-pagination > a { gap: 12px; min-width: 0; font-size: var(--text-lead); overflow-wrap: anywhere; }
  .work-pagination > a:last-child { justify-content: flex-end; }
  .lightbox { padding: 72px 20px 24px; }
  .lightbox > img { max-height: calc(100dvh - 260px); }
  .lightbox-controls { gap: 10px; }
  .additional-image { margin-bottom: 44px; }
  .sketchbook-page { padding-top: 28px; padding-bottom: 48px; }
  .sketchbook-heading { gap: 12px; margin-bottom: 28px; align-items: flex-start; }
  .sketchbook-heading .page-title { font-size: clamp(40px,9.8vw,62px); }
  .sketchbook-heading p { margin-top: 10px; }
  .sketchbook-artist { width: 84px; margin-top: 12px; }
  .stamp-options { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .drawing-tools { flex-wrap: wrap; gap: 10px 16px; }
  .crayon-palette { flex-basis: 100%; }
  .drawing-history { align-self: flex-end; }
  .drawing-actions { flex-wrap: wrap; gap: 12px 16px; }
  .drawing-status { flex-basis: 100%; order: 3; text-align: left; }
  .download-button { padding-inline: 16px; }
  .drawing-help { margin-top: 18px; }
}
@media(max-width:374px) {
  :root { --gutter: 18px; }
  .site-header nav { gap: 28px; }
  .painted-link img { height: 180px; }
  .flower-link img { height: 140px; }
  .butterfly-link img { height: 56px; }
  .section-heading h2 { font-size: 38px; }
  .studio-invitation { flex-direction: column; gap: 8px; }
  .studio-invitation > picture { width: 112px; }
  .collection-outro { gap: 10px; }
  .collection-outro > picture { width: 96px; }
  .crayon-palette > div { gap: 0 !important; }
  .download-button { padding-inline: 12px; }
}
/* Forced colours repaint backgrounds as Canvas, which would erase the marks and
   swatches; they take system colours instead. */
@media(forced-colors:active) {
  .site-header nav a[aria-current]::after, .filter-button[aria-pressed="true"]::after, .stamp-size[aria-pressed="true"]::after, .text-button[aria-pressed="true"]::after,
  .view-controls [aria-pressed="true"]::after, .crayon[aria-pressed="true"]::after, .brush-size[aria-pressed="true"]::after, .zoom-mark::after,
  .stamp-option[aria-pressed="true"]::after, .brush-size span { forced-color-adjust: none; background: CanvasText; }
  .search-field::after, .work-grid[data-view="index"] .work-card::after, .detail-composition .work-description dl::before, .work-pagination::before { forced-color-adjust: none; background: GrayText; }
  .crayon span { forced-color-adjust: none; }
}
