/* Black on white by default, with one gray and one hairline. Visitors may choose other colors. */

/* Handwriting: Shadows Into Light Two by Kimberly Geswein, SIL Open Font License. See fonts/OFL.txt. */
@font-face {
  font-family: "Hand";
  src: url("fonts/shadows-into-light-two-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Local stand-ins, sized to match its width so the swap barely moves anything. */
@font-face {
  font-family: "Hand Fallback Bradley";
  src: local("Bradley Hand"), local("Bradley Hand Bold"), local("BradleyHandITCTT-Bold");
  size-adjust: 89.9%;
  ascent-override: 124.6%;
  descent-override: 36.7%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Hand Fallback Comic";
  src: local("Comic Sans MS"), local("ComicSansMS");
  size-adjust: 85.1%;
  ascent-override: 131.6%;
  descent-override: 34.1%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;
  --bg: #fff;
  --fg: #000;
  --muted: #595959;
  --line: #d9d9d9;
  --hand: "Hand", "Hand Fallback Bradley", "Bradley Hand", "Segoe Print", "Hand Fallback Comic", "Comic Sans MS", cursive;
}

/* Moon. The radio works without script. The attribute restores a saved choice before the page draws. */
:root[data-theme="moon"],
:root:has(#theme-moon:checked) {
  color-scheme: dark;
  --bg: #000;
  --fg: #fff;
  --muted: #d9d9d9;
  --line: #595959;
}

/* Your own. Secondary text uses the full text color so it stays readable. */
:root[data-theme="own"] {
  color-scheme: var(--own-scheme, light);
  --bg: var(--own-bg, #fff);
  --fg: var(--own-fg, #000);
  --muted: var(--fg);
  --line: var(--fg);
}

@supports (color: color-mix(in srgb, #000 50%, #fff)) {
  :root[data-theme="own"] { --line: color-mix(in srgb, var(--fg) 22%, var(--bg)); }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
p, li { text-wrap: pretty; }
ul, ol { list-style: none; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

/* The main landmark takes focus from the skip link and needs no ring. */
main:focus { outline: none; }

.wrap {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 3rem);
}

.nowrap { white-space: nowrap; }

.skip {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 1;
  padding: 8px 16px;
  background: var(--bg);
}

.skip:focus { top: 8px; }

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--hand);
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.3;
  text-decoration: none;
}

/* The paint palette: sun, moon, or make your own. */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.palette {
  position: relative;
  flex: none;
}

.palette summary {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--fg);
  list-style: none;
  cursor: pointer;
}

.palette summary::-webkit-details-marker { display: none; }

.palette summary:hover,
.palette[open] summary {
  background: var(--fg);
  color: var(--bg);
}

.panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  width: 232px;
  padding: 12px;
  border: 2px solid var(--fg);
  background: var(--bg);
}

.panel fieldset {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tile {
  position: relative;
  flex: 1;
  height: 48px;
}

.tile[hidden] { display: none; }

.tile input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.face {
  display: grid;
  place-items: center;
  height: 100%;
  border: 2px solid var(--fg);
  pointer-events: none;
}

.tile input:checked + .face {
  background: var(--fg);
  color: var(--bg);
}

.palette summary:focus-visible,
.tile input:focus-visible + .face,
.own input:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

.own { display: none; }

:root[data-theme="own"] .own { display: block; }

.own label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 8px;
  font-size: 1rem;
  cursor: pointer;
}

.own input {
  width: 64px;
  height: 44px;
  padding: 2px;
  border: 2px solid var(--fg);
  border-radius: 0;
  background: var(--bg);
  cursor: pointer;
}

.own p {
  font-size: 1rem;
  line-height: 1.4;
}

.own p:not(:empty) { margin-top: 8px; }

/* Without :has() or script the choices cannot work, so the palette is not shown. */
@supports not selector(:has(*)) {
  :root:not([data-theme]) .palette { display: none; }
}

/* Hero. The headline sits in a square frame. The last word gets out. */

.hero { padding-block: 32px 48px; }

/* The frame hugs the words, which leaves "box." room to break past its edge. */
.hero { container-type: inline-size; }

.hero h1 { width: fit-content; }

h1 {
  font-size: clamp(2.5rem, 8vw, 5.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.inside {
  display: block;
  border: 3px solid var(--fg);
  padding: 0.5em 0.4em 0.55em;
}

.inside span { display: block; }

/* Size the headline to its frame. The spare room covers wider fallback fonts. */
@supports (width: 1cqi) {
  .inside, .out { font-size: calc((100cqi - 6px) / 9); }
  .out { font-size: calc((100cqi - 6px) / 5); }
}

.out {
  display: block;
  width: fit-content;
  margin: 0 -0.3em 0 auto;
  font-family: var(--hand);
  font-size: 1.65em;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.2;
  transform: rotate(-8deg);
}

/* Once, on arrival: the word starts on the frame and pops out. */
@media screen and (prefers-reduced-motion: no-preference) {
  .out { animation: escape 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s backwards; }
}

@keyframes escape {
  from { transform: translate(-0.5em, -0.55em) rotate(0deg); }
}

.subhead {
  max-width: 32em;
  margin-top: 32px;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  max-width: 100%;
  margin-top: 40px;
  padding: 12px 32px;
  border: 2px solid var(--fg);
  border-radius: 0;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: var(--bg);
  color: var(--fg);
}

/* Sections: 72px each side of a hairline makes 144px. 48px each side makes 96px on mobile. */

.section,
.site-footer { position: relative; }

.section { padding-block: 72px; }

.section::before,
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: clamp(1.25rem, 5vw, 3rem);
  left: clamp(1.25rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
}

h2 {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 32px;
  font-family: var(--hand);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  transform: rotate(-0.6deg);
}

/* The underline: one pen stroke with a small hook at the end. */
.stroke {
  display: block;
  width: 0;
  min-width: 100%;
  height: 16px;
  margin-top: 2px;
  overflow: visible;
}

.stroke path { stroke-width: 2.25; }

#who-title .stroke { min-width: 104%; }
#contact-title .stroke { min-width: 98%; height: 20px; }
.visit .stroke path { stroke-dasharray: none; animation: none; }

/* Draw each line as it comes into view. Without support, or with motion off, it is simply there.
   The dash is longer than any line on screen, measured in screen pixels. */
@supports (animation-timeline: view()) {
  @media screen and (prefers-reduced-motion: no-preference) {
    /* The heading keeps time: a path inside a drawing cannot watch its own position. */
    h2 { view-timeline: --pen block; }

    .stroke path {
      stroke-dasharray: var(--ink, 320px);
      animation: draw linear both;
      animation-timeline: --pen;
      animation-range: cover 24px cover 200px;
    }

    #contact-title .stroke path { --ink: 520px; }
  }
}

@keyframes draw {
  from { stroke-dashoffset: var(--ink, 320px); }
  to { stroke-dashoffset: 0px; }
}

/* Small open circles, as drawn by hand. */
.record li {
  position: relative;
  padding-left: 28px;
}

.record li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 2px;
  width: 9px;
  height: 10px;
  border: 1.5px solid var(--fg);
  border-radius: 52% 46% 50% 48% / 48% 52% 46% 54%;
  transform: rotate(-14deg);
}

.record li:nth-child(even)::before {
  width: 10px;
  height: 9px;
  border-radius: 46% 54% 47% 53% / 55% 48% 52% 45%;
  transform: rotate(9deg);
}

h2 span { display: block; white-space: nowrap; }

/* The way to Marble: plain words over one pen stroke. */

.visit {
  display: inline-block;
  max-width: 100%;
  min-height: 44px;
  margin-top: 24px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}

.visit:hover { text-decoration: none; }
.visit:hover .stroke path { stroke-width: 3.5; }
.visit > span { display: block; width: fit-content; max-width: 100%; }

/* About: three short lines. */

.about span { display: block; }
.about span + span { margin-top: 8px; }

/* Expertise: five, numbered. */

.expertise { counter-reset: item; }

.expertise li {
  counter-increment: item;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 12px;
}

.expertise li + li { margin-top: 40px; }

.expertise li::before {
  content: counter(item, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-size: 1rem;
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

h3 {
  font-size: 1.25rem;
  line-height: 1.44;
  letter-spacing: -0.01em;
}

.expertise p {
  max-width: 32em;
  margin-top: 8px;
  font-size: 1rem;
  color: var(--muted);
}

/* Who I work with */

.statement {
  font-size: clamp(1.5rem, 7.4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.plain { margin-top: 32px; }
.plain li + li { margin-top: 8px; }

/* Track record */

.record li { max-width: 40em; }
.record li + li { margin-top: 16px; }

/* Marble leads. */
.record .lead {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.5;
}

/* Inline links get a taller hit area without moving the lines around them. */
.record a { padding-block: 12px; }

/* Kind words. The quote marks are decoration: the empty alt text keeps screen readers
   from announcing them. The first content line serves older browsers. */

.testimonial { margin: 0; }

.testimonial blockquote {
  max-width: 38em;
  margin: 0;
  font-size: clamp(1.25rem, 3.2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
}

.testimonial blockquote p::before {
  content: "\22";
  content: "\22" / "";
}

.testimonial blockquote p::after {
  content: "\22";
  content: "\22" / "";
}

.testimonial figcaption {
  margin-top: 24px;
  font-family: var(--hand);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.3;
}

/* The name keeps a 44px touch target without adding space. */
.testimonial figcaption a { display: inline-block; padding-block: 10px; margin-block: -10px; }

/* About */

.about { max-width: 32em; }

/* Contact closes the page at full voice. */

.contact h2 {
  margin-bottom: 24px;
  font-size: clamp(3.75rem, 11vw, 7rem);
  line-height: 1.2;
}

.invite {
  max-width: 30em;
  margin-bottom: 40px;
  font-size: 1.25rem;
  line-height: 1.5;
}

.button-large {
  min-height: 64px;
  margin-top: 0;
  font-size: clamp(1rem, 4.5vw, 1.5rem);
  overflow-wrap: anywhere;
}

.social {
  display: flex;
  column-gap: 32px;
  margin-top: 24px;
}

.social a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

/* Footer */

.site-footer {
  padding-block: 32px 48px;
  font-size: 1rem;
  color: var(--muted);
}

/* Footer link */

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: inherit;
}

/* Whiteboard page. A modern take on the old paint program layout. The chrome follows the
   site theme. The board itself is always white. */

[hidden] { display: none !important; }

/* theme.js marks the page before it draws, so the board holds its place from the first frame.
   Without script there is no mark, and no board. */
:root:not([data-theme]) .paint { display: none; }

.board-intro { padding-block: 0 16px; }

.back a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.board-title {
  font-family: var(--hand);
  font-size: clamp(2.75rem, 7vw, 4rem);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.2;
}

.board-intro .subhead { margin-top: 4px; }
.board-message { margin-top: 24px; }

.paint {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding: 0 clamp(0.75rem, 2.5vw, 2rem) 48px;
  font-size: 1rem;
}

.paint button,
.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 10px;
  border: 2px solid transparent;
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.paint button:hover,
.actions a:hover { border-color: var(--line); }

.paint button[aria-pressed="true"],
.paint button[data-armed],
.paint [role="tab"][aria-selected="true"] {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.paint button[aria-disabled="true"] {
  color: var(--muted);
  text-decoration: line-through;
  cursor: default;
}

.paint button:focus-visible,
.actions a:focus-visible,
.paint input:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 2px;
}

/* Top bar */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding-block: 4px;
  border-block: 1px solid var(--line);
}

.spacer { flex: 1; }

.actions #save,
.actions a { border-color: var(--fg); font-weight: 700; }

.actions #save { background: var(--fg); color: var(--bg); }

.steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  column-gap: 12px;
  padding-block: 8px;
  color: var(--muted);
}

.steps .next {
  color: var(--fg);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

/* Layout: phones first. */

.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "toolbox" "stage" "paintbox";
  gap: 12px;
}

.toolbox { grid-area: toolbox; min-width: 0; }
.stage { grid-area: stage; min-width: 0; width: 100%; }
.paintbox { grid-area: paintbox; min-width: 0; }

.tools {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  overscroll-behavior-x: contain;
}

.paint .tools button {
  flex: none;
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
  min-height: 56px;
  padding: 4px;
  font-size: 1rem;
}

.options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 52px;
  padding: 4px;
}

.sizes,
.option {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.dot {
  display: block;
  border-radius: 50%;
  background: currentColor;
}

.dot-0 { width: 5px; height: 5px; }
.dot-1 { width: 9px; height: 9px; }
.dot-2 { width: 15px; height: 15px; }
.dot-3 { width: 22px; height: 22px; }

.option input[type="text"] {
  min-height: 44px;
  width: 100%;
  max-width: 260px;
  padding: 4px 8px;
  border: 2px solid var(--fg);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}

.option input[type="range"] {
  width: 130px;
  min-height: 44px;
  accent-color: var(--fg);
}

.turned { color: var(--muted); }

/* The board */

.frame {
  border: 2px solid #000;
  outline: 1px solid var(--line);
  outline-offset: 3px;
  background: #fff;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.16);
  margin: 4px;
}

.frame canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.frame canvas[data-tool="text"] { cursor: text; }
.frame canvas[data-tool="sticker"] { cursor: copy; }

.statusbar {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  padding: 8px 4px 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Colors */

.paintbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 8px 4px;
  border-block: 1px solid var(--line);
}

.current {
  position: relative;
  width: 132px;
  height: 92px;
}

.paint .current button {
  position: absolute;
  width: 44px;
  height: 44px;
  border: 2px solid var(--fg);
  outline: 1px solid var(--bg);
}

#fg-slot { top: 4px; left: 4px; z-index: 1; }
#bg-slot { top: 24px; left: 40px; }

.paint .current button[aria-pressed="true"] { outline: 3px solid var(--fg); outline-offset: 2px; }

.current p {
  position: absolute;
  bottom: 0;
  left: 0;
  font-size: 1rem;
  white-space: nowrap;
  line-height: 1.2;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(14, 44px);
  grid-auto-rows: 44px;
  gap: 2px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px;
  overscroll-behavior-x: contain;
}

.paint .swatches button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--muted);
}

.custom {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}

.custom input {
  width: 56px;
  height: 44px;
  padding: 2px;
  border: 2px solid var(--fg);
  border-radius: 0;
  background: var(--bg);
}

/* Sticker tray: a bottom sheet on phones. */

.tray {
  display: none;
  min-width: 0;
  border: 2px solid var(--fg);
  background: var(--bg);
}

.tray.open { display: block; }

.tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 12px;
}

h2.tray-title {
  width: auto;
  margin: 0;
  font-family: var(--hand);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.3;
  transform: none;
  view-timeline: none;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 0 4px;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  align-content: start;
  gap: 6px;
  padding: 8px;
}

.sticker-grid p { grid-column: 1 / -1; color: var(--muted); }

.paint .sticker-grid button {
  height: 64px;
  padding: 4px;
  border: 2px solid var(--line);
  background: #fff;
}

.paint .sticker-grid button[aria-pressed="true"] {
  border-color: var(--fg);
  outline: 3px solid var(--fg);
  background: #fff;
}

.sticker-grid img { display: block; width: 44px; height: 44px; pointer-events: none; }

.board-help {
  max-width: 52em;
  margin-top: 16px;
  color: var(--muted);
}

@media (max-width: 899px) {
  .tray.open {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    max-height: 58vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 0 -10px 28px rgb(0 0 0 / 0.2);
  }

  .swatches { width: 100%; }
}

/* Desktop: tools on the left, colors along the bottom. */
@media (min-width: 900px) {
  .narrow-only { display: none !important; }

  .work {
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-areas: "toolbox stage" "paintbox paintbox" "tray tray";
    align-items: start;
  }

  .tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: visible;
    padding: 0;
  }

  .paint .tools button { min-width: 0; }
  .paint .tools button span { font-size: 0.875rem; }

  .options,
  .option { flex-direction: column; align-items: stretch; }
  .options { padding: 8px 0 0; }
  .sizes { display: grid; grid-template-columns: 1fr 1fr; }
  .option input[type="range"] { width: 100%; }

  /* Sticker controls sit in pairs so they stay in view. */
  .option[data-for="sticker"] { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
  .option[data-for="sticker"] label,
  .option[data-for="sticker"] input,
  .option[data-for="sticker"] .turned { grid-column: 1 / -1; }
  .option[data-for="sticker"] button { min-width: 0; padding-inline: 4px; }

  /* Keep the whole board in view on short screens. */
  .stage { max-width: max(520px, calc((100vh - 250px) * 1.6)); justify-self: center; }

  .tray { grid-area: tray; }
  #tray-close { display: inline-flex; }
}

/* Wide screens: the stickers are always in view. */
@media (min-width: 1200px) {
  .work {
    grid-template-columns: 148px minmax(0, 1fr) 252px;
    grid-template-areas: "toolbox stage tray" "paintbox paintbox paintbox";
  }

  .tray {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: 0;
    min-height: 100%;
  }

  .sticker-grid {
    grid-template-columns: repeat(3, 1fr);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  #tray-close { display: none; }
}

/* 404 */

.not-found { padding-block: 64px 96px; }

/* Narrow screens */

@media (max-width: 599px) {
  .hero { padding-block: 16px 32px; }
  .section { padding-block: 48px; }
  h2 { margin-bottom: 24px; }

  .button { width: 100%; }
  .button-large { padding-inline: 12px; }
}

@media (min-width: 600px) {
  .hero { padding-block: 48px; }
}

/* Wider screens: a quiet label on the left, the substance on the right. */
@media (min-width: 760px) {
  .section:not(.contact) {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    column-gap: 48px;
    align-items: start;
  }

  /* Headings keep the left column. Everything else stays on the right. */
  .section:not(.contact) > * { grid-column: 2; }

  .section:not(.contact) h2 {
    grid-column: 1;
    grid-row: 1 / span 3;
    margin-bottom: 0;
    font-size: 2.375rem;
  }

  .stroke path { stroke-width: 2.5; }

  .statement { font-size: min(3.8vw, 2.75rem); }
}

/* Print: black on white, even when the screen is dark. */

@media print {
  :root,
  :root[data-theme],
  :root:has(#theme-moon:checked) {
    color-scheme: light;
    --bg: #fff;
    --fg: #000;
    --muted: #595959;
    --line: #d9d9d9;
  }

  body { font-size: 10.5pt; line-height: 1.5; }
  .skip, .palette, .footer-nav, .back, .actions, .steps, .toolbox, .tray, .paintbox, .statusbar, .board-help { display: none; }
  .wrap { max-width: none; padding-inline: 0; }
  .section::before, .site-footer::before { right: 0; left: 0; }
  .hero, .section, .site-footer, .not-found { padding-block: 12pt; }
  h2, .section:not(.contact) h2 { margin-bottom: 8pt; font-size: 20pt; transform: none; }
  .stroke, #contact-title .stroke { height: 9pt; }
  .stroke path { stroke-width: 1.5; stroke-dasharray: none; animation: none; }
  h2, .section:not(.contact) h2 { view-timeline: none; }
  .wordmark { font-size: 20pt; }
  .record li { padding-left: 16pt; }
  h3 { font-size: 12pt; }
  .expertise li + li { margin-top: 8pt; }
  .statement { font-size: 18pt; }
  .visit { margin-top: 8pt; font-size: 12pt; }
  .visit > span::after { content: " (https://marbletech.us/)"; font-size: 9pt; font-weight: 400; }
  .record .lead { font-size: 12pt; }
  .plain { margin-top: 8pt; }
  .record li + li { margin-top: 6pt; }
  .expertise p { margin-top: 2pt; font-size: 10pt; }
  .record a { padding-block: 0; }
  .testimonial blockquote { font-size: 13pt; }
  .testimonial figcaption { margin-top: 10pt; font-size: 16pt; }
  h1 { font-size: 36pt; }
  .inside { border-width: 2pt; font-size: 28pt; }
  .hero h1 { width: auto; }
  .out { margin-right: 10pt; font-size: 46pt; }
  .subhead { margin-top: 12pt; font-size: 12pt; }
  .about { max-width: none; }
  .contact h2 { font-size: 34pt; }
  .invite { margin-bottom: 10pt; font-size: 12pt; }
  h2, h3 { break-after: avoid; break-inside: avoid; }
  li, .about, .testimonial { break-inside: avoid; }

  .button {
    width: auto;
    min-height: 0;
    margin-top: 12pt;
    padding: 6pt 10pt;
    background: var(--bg);
    color: var(--fg);
    font-size: 11pt;
  }

  .button-large { margin-top: 0; }

  /* Paper cannot be clicked, so show where links go. */
  .record a[href^="https://"]::after,
  .testimonial figcaption a::after,
  .social a::after {
    content: " (" attr(href) ")";
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 9pt;
    font-weight: 400;
    overflow-wrap: anywhere;
  }

  .social { flex-direction: column; margin-top: 8pt; }
  .social a { min-height: 0; }
}
