/* Ted Ingberman · portfolio
   The page opens on the paper of the first drawing and then becomes the desk at
   night. Colors come from the drawings: the paper and the pink of the faces
   sheet, the ochre line, and the blue of the spiral in the color drawing. */

:root {
  --desk: #1c1613;
  --desk-up: #272019;
  --rule: rgba(239, 230, 216, 0.15);
  --paper: #efe6d8;
  --paper-2: #b9ab9a;
  --paper-3: #807366;
  --wash: #f06b8f;
  --ochre: #e3aa45;
  --blue: #63aeea;
  --frog: #86db6e;

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --rail: clamp(7rem, 12vw, 11rem);
  --gap: clamp(1.25rem, 2.6vw, 2.75rem);
  --wide: 92rem;

  --sans: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --hero-h: min(100vh, 62.5rem);
}

@supports (height: 100svh) {
  :root { --hero-h: min(100svh, 62.5rem); }
}

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

html {
  color-scheme: dark;
  background: var(--desk);
  scrollbar-gutter: stable;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.is-viewing { overflow: hidden; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 0.99rem + 0.28vw, 1.1875rem);
  font-weight: 380;
  font-optical-sizing: auto;
  line-height: 1.55;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--wash); color: var(--desk); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 3px;
}

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

.skip {
  position: absolute;
  left: var(--pad);
  top: 0.75rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--paper);
  color: var(--desk);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Small type ---------- */

.label,
.margin-note,
.status,
.num,
.fine,
.plate-caption,
.sheet-caption,
.screen-caption,
.colophon {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--paper-2);
}

.label {
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Links ---------- */

.intro p a,
.prose a,
.project-main p a:not(.out),
.footer-mail a {
  text-decoration: underline;
  text-decoration-color: var(--wash);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
  transition: color 0.2s;
}

.intro p a:hover,
.prose a:hover,
.project-main p a:not(.out):hover,
.footer-mail a:hover { color: var(--wash); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
}

.out {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  padding: 0.62rem 0 0.45rem;
  font-weight: 540;
  text-decoration: none;
  border-bottom: 2px solid var(--wash);
  transition: color 0.2s, border-color 0.2s;
}
.out:hover { color: var(--wash); border-color: var(--paper); }
.out .arrow { font-family: var(--mono); font-size: 0.82em; transition: transform 0.3s var(--ease); }
.out:hover .arrow { transform: translate(0.12em, -0.12em); }

/* ---------- Opening: the screen is the sheet ---------- */

/* The top of the page is the paper of the first drawing, so everything on it is
   ink. The same names the desk uses are pointed at paper values here, and the
   links, rules and focus rings follow. */
.opening {
  --paper: #1d1a1c;
  --paper-2: #55515a;
  --paper-3: #a7a3a8;
  --desk: #f6fafc;
  --rule: rgba(29, 26, 28, 0.16);
  --wash: #e8336f;
  --blue: #1766b3;
  --slant: 2vw;
  --inset: max(var(--pad), calc((100% - var(--wide)) / 2));
  position: relative;
  z-index: 1;
  overflow: hidden; /* the row of faces behind "little characters" must never widen the page */
  padding-bottom: calc(var(--slant) + 5.5rem);
  background: #f6fafc;
  color: var(--paper);
  /* the bottom of the sheet: a paper edge that is not quite square to the desk */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slant)), 0 100%);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.15rem;
  padding: 0.5rem var(--inset) 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.nav a {
  padding: 0.75rem 0;
  color: var(--paper-2);
  text-decoration: none;
  transition: color 0.2s;
}
.nav a:hover { color: var(--paper); }
.nav .brand {
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--paper);
}
.dy { color: var(--paper-3); }
.nav-gap { flex: 1 1 0; }

@media (max-width: 560px) {
  .nav { justify-content: space-between; gap: 0 0.6rem; }
  .nav .brand { flex: 1 0 100%; padding-bottom: 0; }
  .nav-gap { display: none; }
}
/* Beside the sheet there is only room for one of them on a line until the window is wide. */
@media (min-width: 940px) and (max-width: 1200px) {
  .nav .brand { flex: 1 0 100%; padding-bottom: 0; }
  .nav-gap { display: none; }
}

.opening-head { padding: clamp(1.5rem, 7vw, 2.75rem) var(--inset) 0; }

.hello {
  font-size: clamp(2.6rem, 13.2vw, 4rem);
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.hello .line { display: block; }

/* A line that gets typed once the name has landed. */
.voice {
  min-height: 1.6em;
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--paper-2);
}
.voice-rest { opacity: 0; }
.voice-caret {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin: 0 -0.5em 0 0;
  vertical-align: -0.16em;
  background: var(--wash);
  animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.intro { max-width: 34rem; padding: 1.75rem var(--inset) 0; box-sizing: content-box; }
.intro p + p { margin-top: 0.85em; }
.intro .links { margin-top: 1.25rem; }

/* The sheet. Its paper is the page's paper, so where the photo stops the page carries on. */
.sheet { position: relative; margin: 0; }
.sheet-link {
  display: block;
  position: relative;
  cursor: zoom-in;
}
.sheet-art {
  display: block;
  position: relative;
  overflow: hidden;
}
.sheet-art img { width: 100%; height: auto; dynamic-range-limit: standard; }

.sheet--pink { margin-top: 1.25rem; }
.sheet-art--pink {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 8%), linear-gradient(to top, transparent 1.2%, #000 4.5%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, #000 8%), linear-gradient(to top, transparent 1.2%, #000 4.5%);
  mask-composite: intersect;
}
/* The view starts close on a few marks and backs away from them. The point it
   backs away from is the tip of the long nose. */
.sheet-zoom {
  display: block;
  position: relative;
  transform-origin: 34.7% 63.4%;
}
/* The same marks at the photo's own resolution, laid exactly over themselves,
   so the close view is sharp. Only fetched when the opening plays. */
.sheet-close {
  display: none;
  position: absolute;
  left: 12.9926%;
  top: 41.28%;
  width: 36.3794% !important;
  height: 32.64% !important;
}
.intro-run .sheet-close { display: block; }

.sheet-caption {
  font-family: var(--mono);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1rem;
}
.sheet--pink .sheet-caption { padding: 0.2rem var(--pad) 0; }

/* A phrase in the introduction that has a few of the characters behind it. */
.peek { position: relative; display: inline-block; }
.peek-word {
  margin: -0.3em 0;
  padding: 0.3em 0;
  border: 0;
  background: none;
  font-weight: 560;
  white-space: nowrap;
  text-decoration: underline dotted var(--wash);
  text-decoration-thickness: 0.11em;
  text-underline-offset: 0.24em;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.peek:hover .peek-word,
.peek.is-open .peek-word { color: var(--wash); }
.peek-faces {
  position: absolute;
  left: 50%;
  bottom: 100%;
  z-index: 3;
  display: flex;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem 0.45rem;
  translate: calc(-50% + var(--shift, 0px)) 0;
  visibility: hidden;
  transition: visibility 0s 0.3s;
}
.peek-faces .found {
  --size: clamp(3.4rem, 17vw, 4.1rem);
  flex: none;
  scale: 0.4;
  opacity: 0;
  box-shadow: 0 0 0 2px #f6fafc, 0 0.45rem 1rem rgba(29, 26, 28, 0.34);
  transition: scale 0.3s var(--ease), opacity 0.2s, transform 0.45s var(--ease), rotate 0.45s var(--ease);
}
.peek-faces .found img,
.peek-faces .found:hover img,
.peek-faces .found:focus-visible img {
  -webkit-mask-image: none;
  mask-image: none;
  filter: none;
}
.peek:hover .peek-faces,
.peek:focus-within .peek-faces,
.peek.is-open .peek-faces { visibility: visible; transition-delay: 0s; }
.peek:hover .found,
.peek:focus-within .found,
.peek.is-open .found {
  scale: 1;
  opacity: 1;
  transition: scale 0.5s var(--ease) calc(var(--i, 0) * 70ms), opacity 0.25s calc(var(--i, 0) * 70ms), transform 0.45s var(--ease), rotate 0.45s var(--ease);
}
.peek.is-shut .peek-faces { visibility: hidden !important; }
.peek.is-shut .found { scale: 0.4 !important; opacity: 0 !important; }

/* A detail lifted from a drawing: lit like the sheet, soft at the edge. */
.margin-note { max-width: 24ch; }
.found {
  --size: 4.6rem;
  display: block;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  rotate: var(--tilt, 0deg);
  transition: transform 0.45s var(--ease), rotate 0.45s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.found img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 60%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 60%, transparent 100%);
  filter: brightness(0.97);
  transition: filter 0.35s;
}
/* Sheets photographed in brighter light: their details are eased down to sit on the dark desk. */
.found--bright img { filter: brightness(0.84); }
.found:hover,
.found:focus-visible { transform: scale(1.14); rotate: 0deg; }
.found:hover img,
.found:focus-visible img { filter: brightness(1.3) contrast(1.03); }
.found--bright:hover img,
.found--bright:focus-visible img { filter: brightness(1.06) contrast(1.03); }
.found:focus-visible { outline-offset: 2px; border-radius: 50%; }

@keyframes face-in {
  from { opacity: 0; transform: scale(0.55); }
}

/* Where a loose face lives on its sheet. */
.spot {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--paper);
  box-shadow: 0 0 0 200vmax rgba(20, 14, 11, 0.5);
  opacity: 0;
  transform: scale(1.5);
  transition: opacity 0.35s, transform 0.55s var(--ease);
  pointer-events: none;
}
.spot.is-on { opacity: 1; transform: none; }
.sheet-art--pink .spot { box-shadow: 0 0 0 200vmax rgba(246, 250, 252, 0.6); }

.plate-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.6rem var(--pad) 0;
}
.open-large {
  display: inline-block;
  padding: 0.85rem 0;
  color: var(--paper);
  text-decoration: underline;
  text-decoration-color: var(--wash);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3em;
  cursor: zoom-in;
}
.open-large:hover { color: var(--wash); }

@media (min-width: 940px) {
  .opening {
    --slant: 0.9vw;
    --sheet-w: min(calc(var(--hero-h) * 0.7389), 52vw);
    --copy-w: calc(100% - var(--sheet-w) + 0.5rem);
    min-height: var(--hero-h);
    padding-bottom: calc(var(--slant) + 8.5rem);
  }
  .nav,
  .opening-head,
  .intro { box-sizing: border-box; max-width: var(--copy-w); padding-right: 0; }
  .nav { padding-top: 0.75rem; }
  .opening-head { padding-top: clamp(2rem, 10vh, 6.5rem); }
  .hello { font-size: clamp(2.9rem, 5.4vw, 5.2rem); }
  .intro { padding-top: 2rem; }
  .intro > * { max-width: 31rem; }

  .sheet--pink {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--sheet-w);
    margin: 0;
  }
  .sheet-art--pink {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%), linear-gradient(to top, transparent 1.2%, #000 5%);
    mask-image: linear-gradient(to right, transparent 0, #000 7%), linear-gradient(to top, transparent 1.2%, #000 5%);
  }
  .sheet--pink .sheet-caption {
    position: absolute;
    right: var(--pad);
    top: 1.1rem;
    display: grid;
    justify-items: end;
    padding: 0;
    text-align: right;
  }
  .sheet--pink .open-large { padding: 0.3rem 0; }
}

/* ---------- The opening, a beat at a time ----------
   Only while <html> carries .intro-run: set before first paint when motion is
   welcome and the visit starts at the top, taken away the moment the visitor
   scrolls, taps or presses a key. Without it every part is simply in place. */

.intro-run .hello .line { animation: rise 0.8s var(--ease) both; }
.intro-run .hello .line:nth-child(1) { animation-delay: 0.1s; }
.intro-run .hello .line:nth-child(2) { animation-delay: 0.55s; }
.intro-run .hello .line:nth-child(3) { animation-delay: 1s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(0.45em); }
}

.intro-run .sheet-art--pink { animation: surface 0.9s ease both; }
.intro-run .sheet-zoom { animation: pull-back 4.6s linear both; will-change: transform; }
@keyframes pull-back {
  0% { transform: scale(4); }
  32.6% { transform: scale(4); animation-timing-function: cubic-bezier(0.6, 0, 0.2, 1); }   /* a few marks */
  58.7% { transform: scale(1.9); }
  69.6% { transform: scale(1.9); animation-timing-function: cubic-bezier(0.6, 0, 0.2, 1); } /* a face */
  100% { transform: scale(1); }                                                             /* its neighbors */
}

.intro-run .intro,
.intro-run .sheet--pink .sheet-caption { animation: surface 0.9s ease 3.9s both; }
@keyframes surface {
  from { opacity: 0; }
}

/* ---------- Landing: the sketchbook lies across the paper's edge ---------- */

main { position: relative; }
/* the shadow the sheet casts on the desk, along its slanted edge */
main::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -2vw;
  height: 1.6rem;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
  transform: skewY(-1.1458deg);
  transform-origin: 100% 0;
  pointer-events: none;
}

.landing {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 1.75rem var(--gap);
  width: min(100% - 2 * var(--pad), var(--wide));
  margin: 0 auto;
}
.sheet--crowd {
  width: min(74vw, 22rem);
  margin-top: -4rem;
}
.sheet--crowd .sheet-link {
  rotate: -2.2deg;
  filter: drop-shadow(0 1.25rem 2rem rgba(0, 0, 0, 0.5));
}
/* cut along the page's own edges, so the table in the photo falls away */
.sheet-art--crowd {
  clip-path: polygon(1.71% 0, 96.26% 0, 99.73% 99.12%, 6.46% 98.75%);
}
.sheet--crowd .sheet-caption { padding: 0.9rem 0 0 6%; }

.landing-copy { max-width: 34rem; }
.landing-copy > * + * { margin-top: 1.1rem; }
.landing-copy p a {
  text-decoration: underline;
  text-decoration-color: var(--wash);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
  transition: color 0.2s;
}
.landing-copy p a:hover { color: var(--wash); }

.loose { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.25rem; padding: 0.4rem 0; }
.loose .margin-note { max-width: 19ch; }
.loose-faces { display: flex; gap: 0.35rem; }
.loose-faces .found { --size: min(4.6rem, (100vw - 2 * var(--pad) - 1.2rem) / 4); }
.loose-faces li:nth-child(even) { translate: 0 0.5rem; }

/* The faces turn up one after another as the sketchbook comes into view. */
.js .landing:not(.is-seen) .loose-faces li { opacity: 0; }
.landing.is-seen .loose-faces li { animation: face-in 0.7s var(--ease) both; }
.landing.is-seen .loose-faces li:nth-child(1) { animation-delay: 0.15s; }
.landing.is-seen .loose-faces li:nth-child(2) { animation-delay: 0.3s; }
.landing.is-seen .loose-faces li:nth-child(3) { animation-delay: 0.45s; }
.landing.is-seen .loose-faces li:nth-child(4) { animation-delay: 0.6s; }

@media (min-width: 940px) {
  main::before { top: -0.9vw; transform: skewY(-0.5157deg); }
  .landing {
    grid-template-columns: min(26rem, 32vw) minmax(0, 1fr);
    align-items: start;
    gap: 0 clamp(2rem, 6vw, 6rem);
  }
  .sheet--crowd { width: 100%; margin-top: -7rem; }
  .landing-copy { padding-top: clamp(3rem, 9vh, 6rem); }
}

/* ---------- Sections ---------- */

/* Nothing in the page body may widen it, even for a moment (the Pocket ring, the frogs). */
main { overflow-x: clip; }

.section {
  display: grid;
  gap: 1.5rem var(--gap);
  width: min(100% - 2 * var(--pad), var(--wide));
  margin: clamp(4.5rem, 11vw, 9rem) auto 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

@media (min-width: 940px) {
  .section { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .section > .rail .label { position: sticky; top: 1.25rem; }
}

/* ---------- Work ---------- */

.projects {
  display: grid;
  gap: clamp(4.5rem, 10vw, 8rem);
  margin-top: clamp(0.5rem, 3vw, 2.5rem);
}

.project {
  display: grid;
  gap: 1.1rem var(--gap);
  scroll-margin-top: 2rem;
}

.project-rail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1rem;
}
.num { color: var(--paper-3); letter-spacing: 0.1em; }

.status {
  display: flex;
  align-items: flex-start;
  gap: 0.65em;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.status--building { color: var(--ochre); }
.status--release { color: var(--blue); }
.dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.36em;
  border-radius: 50%;
  background: currentColor;
}
.status--building .dot { animation: pulse 2.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 170, 69, 0.5); }
  50% { box-shadow: 0 0 0 0.45rem rgba(227, 170, 69, 0); }
}

.project-main { max-width: 38rem; }
.project--komaphone .project-main { max-width: 66rem; }
.project-main > * + *,
.project-cols > * + *,
.project-side > * + * { margin-top: 1em; }

.project-title {
  font-size: clamp(2.7rem, 7.2vw, 5.4rem);
  font-weight: 690;
  font-variation-settings: "wdth" 90;
  line-height: 0.94;
  letter-spacing: -0.04em;
}
.project-lede {
  margin-top: 1.1rem;
  font-size: 1.36em;
  font-weight: 450;
  line-height: 1.28;
  letter-spacing: -0.012em;
}
.project-lede { max-width: 24em; }
.fine { max-width: 48ch; }
.project-main .project-link { margin-top: 1.4em; }

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.facts li {
  padding: 0.34rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--paper);
}

/* IronJot screens: the real captures, uncropped. */
.screens {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1rem;
  align-items: start;
  margin-top: 1rem;
}
.screen-link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 8% / 3.7%;
  background: #20272d;
  box-shadow: 0 0 0 1px rgba(239, 230, 216, 0.17), 0 1.75rem 3rem -1.25rem rgba(0, 0, 0, 0.7);
  cursor: zoom-in;
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.screen-link img { width: 100%; height: auto; }
.screen-link:hover,
.screen-link:focus-visible {
  transform: translateY(-5px);
  box-shadow: 0 0 0 1px rgba(239, 230, 216, 0.45), 0 2.25rem 3.25rem -1.25rem rgba(0, 0, 0, 0.8);
}
.screen-link:focus-visible { outline-offset: 5px; }
.screen-caption { margin-top: 0.85rem; }
.screen-caption strong { color: var(--paper); font-weight: 500; }

@media (min-width: 600px) {
  .screens {
    grid-template-columns: 1.35fr 1fr 1fr 1fr;
    align-items: end;
    gap: 1rem;
    max-width: 50rem;
  }
  .screen-caption { min-height: 6.4em; }
}

@media (min-width: 940px) {
  .projects { grid-column: 1 / -1; }
  .project { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .project--ironjot { grid-template-columns: var(--rail) minmax(0, 1fr) minmax(0, 1.45fr); }
  .project-lede { font-size: clamp(1.45rem, 2vw, 1.8rem); line-height: 1.2; letter-spacing: -0.018em; }
  .project-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: var(--gap);
    margin-top: 1.5rem;
  }
  .project-cols > * + * { margin-top: 0; }
  .project-rail {
    position: sticky;
    top: 1.25rem;
    align-self: start;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.55rem;
  }
  .screens { max-width: none; margin-top: 0.75rem; }
}

/* ---------- Made together in Komaphone (only exists once the collection has a piece) ---------- */

.together {
  margin-top: clamp(1.5rem, 4vw, 3rem);
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}
.together-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wash);
}
.together-note { max-width: 34rem; margin-top: 0.5rem; color: var(--paper-2); }

.together-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1rem;
  margin-top: 1.5rem;
}
@media (min-width: 700px) {
  .together-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem 1.25rem; }
}
@media (min-width: 1180px) {
  .together-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.together-list[data-count="1"] { grid-template-columns: minmax(0, 1fr); max-width: 56rem; }

.piece-link {
  display: block;
  position: relative;
  border-radius: 4px;
  text-decoration: none;
  cursor: zoom-in;
}
.piece-window {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  background: var(--desk-up);
}
.together-list[data-count="1"] .piece-window { aspect-ratio: 4 / 3; }

.piece-media {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  opacity: 0;
  transition: transform 0.75s var(--ease), opacity 0.4s;
}
.piece-media.is-ready { opacity: 1; }
.piece-media--cover { width: 100%; height: 100%; object-fit: cover; }
.piece-link:hover .piece-media,
.piece-link:focus-visible .piece-media { transform: scale(var(--peek, 1)); }

.piece-cta,
.piece-kind {
  position: absolute;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: rgba(28, 22, 19, 0.84);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
}
.piece-cta { left: 0.7rem; bottom: 0.7rem; transition: background 0.25s, color 0.25s; }
.piece-kind { left: 0.7rem; top: 0.7rem; color: var(--ochre); }
.piece-link:hover .piece-cta,
.piece-link:focus-visible .piece-cta { background: var(--wash); color: var(--desk); }

.piece-meta { margin-top: 0.85rem; }
.piece-title { font-size: 1.12em; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.piece-by {
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper-2);
}
.piece-credits { display: flex; flex-wrap: wrap; gap: 0 0.55em; line-height: 1.4; }
.piece-credits li + li::before { content: "+"; margin-right: 0.55em; color: var(--wash); }

.together-list[data-count="1"] .piece-title { font-size: 1.5em; }
.together-list[data-count="1"] .piece-credits { font-size: 1.15em; }

.preview-note {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--ochre);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ochre);
}
.preview-note ul { margin-top: 0.4rem; padding-left: 1.1rem; list-style: disc; }

@media (min-width: 940px) {
  .together { grid-column: 2 / -1; }
  .together-list[data-count="1"] .piece-window { aspect-ratio: 16 / 9; }
}

/* ---------- Drawing ---------- */

.drawing-body { display: grid; gap: 1.75rem var(--gap); }
.drawing-intro { display: grid; gap: 1.5rem; align-content: start; }
.statement {
  max-width: 13em;
  font-size: clamp(1.75rem, 3.7vw, 3.1rem);
  font-weight: 560;
  line-height: 1.1;
  letter-spacing: -0.028em;
}
.starts { display: grid; gap: 1rem; }
.start-here { display: flex; align-items: center; gap: 1rem; }
.start-here .margin-note { max-width: 18ch; }
.found--spiral { --size: 5.4rem; flex: none; }

.plates { display: grid; gap: 2.5rem var(--gap); align-items: start; }
.plate { margin: 0; }
.plate-link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  cursor: zoom-in;
}
.plate-link img { width: 100%; height: auto; }
.plate .plate-caption { padding-inline: 0; }
/* The second sheet was photographed lying on a print on a table. The frame stops
   at the sheet's bottom edge and the image is cut along its sides. */
.plate--crescent .plate-link { aspect-ratio: 3000 / 3731; }
.plate-full { display: block; position: relative; }
.plate-full img {
  dynamic-range-limit: standard;
  clip-path: polygon(
    1.5% 0, 96.81% 0, 99.43% 92.89%, 0.84% 93.66%, 0.87% 92%, 0.7% 85.15%, 0.9% 78.3%,
    1.1% 71.45%, 1.07% 64.6%, 1.13% 57.75%, 1.27% 50.9%, 1.7% 44.07%, 1.83% 37.23%,
    1.97% 30.38%, 1.6% 23.52%, 1.3% 16.68%, 1.2% 9.83%, 1.13% 3%
  );
}

@media (min-width: 940px) {
  .drawing-body { grid-template-columns: minmax(0, 1fr) minmax(0, 2.7fr); align-items: start; }
  .drawing-intro { position: sticky; top: 2rem; padding-top: 0.4rem; }
  .drawing .statement { font-size: clamp(1.5rem, 2.3vw, 2.3rem); }
  .plates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- About ---------- */

.prose { position: relative; max-width: 44rem; font-size: clamp(1.06em, 0.9em + 0.55vw, 1.24em); }
.prose p + p { margin-top: 1.05em; }
.prose .ps { margin-top: 2.4em; font-size: 1.18em; font-weight: 450; }

.pocket {
  margin: -0.45em -0.2em;
  padding: 0.45em 0.2em;
  border: 0;
  border-radius: 4px;
  background: none;
  font-weight: 620;
  text-decoration: underline dotted var(--frog);
  text-decoration-thickness: 0.11em;
  text-underline-offset: 0.24em;
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.pocket:hover,
.pocket.is-casting { color: var(--frog); }

.shout {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  translate: -50% -108%;
  rotate: -5deg;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
  font-variation-settings: "wdth" 78;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--frog);
  text-shadow: 0 0 1.3rem rgba(134, 219, 110, 0.6);
  pointer-events: none;
  transition: opacity 0.6s, translate 0.6s var(--ease);
}
.shout span {
  display: inline-block;
  animation: shout-in 0.5s var(--ease) both;
  animation-delay: calc(var(--i) * 30ms);
}
.shout.is-leaving { opacity: 0; translate: -50% -150%; }

@keyframes shout-in {
  from { opacity: 0; transform: translateY(0.5em) scale(0.5) skewX(-10deg); }
  60% { opacity: 1; transform: translateY(-0.14em) scale(1.14) skewX(-10deg); }
  to { opacity: 1; transform: skewX(-10deg); }
}

.aoe {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--r) * 2);
  height: calc(var(--r) * 2);
  translate: -50% -50%;
  border: 1.5px solid var(--frog);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: aoe 1.15s cubic-bezier(0.2, 0.6, 0.2, 1) both;
}
@keyframes aoe {
  from { transform: scale(0.04); opacity: 0.95; }
  to { transform: scale(1); opacity: 0; }
}

/* Frogs hop out from behind the word and settle a little way off.
   Each one is the frog emoji, so there is no drawing here that isn't Ted's. */
.frog {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
  translate: -50% -100%;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: var(--s, 1.4rem);
  line-height: 1;
  pointer-events: none;
  transition: opacity 0.45s;
}
.frog.is-leaving { opacity: 0; }
.frog-x,
.frog-y { display: block; }
.frog-x { animation: frog-run var(--t, 1.2s) linear var(--wait, 0ms) both; }
.frog-y {
  transform-origin: 50% 100%;
  animation: frog-hop var(--t, 1.2s) linear var(--wait, 0ms) both;
}
@keyframes frog-run {
  0% { transform: translateX(0); opacity: 0; }
  8% { opacity: 1; }
  44%, 56% { transform: translateX(calc(var(--dx) * 0.58)); }
  100% { transform: translateX(var(--dx)); opacity: 1; }
}
@keyframes frog-hop {
  0% { transform: translateY(0.2em) scale(0.4); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  22% { transform: translateY(calc(var(--h) * -1)) scale(1); animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  44% { transform: translateY(0) scale(1.18, 0.78); animation-timing-function: ease-out; }
  56% { transform: translateY(0) scale(1); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
  78% { transform: translateY(calc(var(--h) * -0.55)) scale(1); animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5); }
  94% { transform: translateY(0) scale(1.14, 0.82); animation-timing-function: ease-out; }
  100% { transform: translateY(0) scale(1); }
}

/* Damage over time, non-lethal: the words dip and come back. */
.w.afflicted {
  animation: tick 2.5s linear both;
  animation-delay: var(--d, 0ms);
}
@keyframes tick {
  0% { color: inherit; opacity: 1; text-shadow: none; }
  4% { color: var(--frog); opacity: 1; text-shadow: 0 0 0.7em rgba(134, 219, 110, 0.55); }
  16% { opacity: 0.42; }
  24% { opacity: 0.95; }
  38% { opacity: 0.4; }
  46% { opacity: 0.9; }
  60% { opacity: 0.45; }
  68% { opacity: 0.9; }
  80% { color: var(--frog); opacity: 0.55; text-shadow: 0 0 0.7em rgba(134, 219, 110, 0.4); }
  100% { color: inherit; opacity: 1; text-shadow: none; }
}

/* ---------- Footer ---------- */

.footer {
  display: grid;
  gap: 2.5rem var(--gap);
  width: min(100% - 2 * var(--pad), var(--wide));
  margin: clamp(5rem, 12vw, 10rem) auto 0;
  padding: 1.1rem 0 2.5rem;
  border-top: 1px solid var(--rule);
}
.footer-mail { margin-top: 0.9rem; }
.footer-mail a {
  font-size: clamp(1.8rem, 7.4vw, 5rem);
  font-weight: 660;
  font-variation-settings: "wdth" 90;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
.footer .links { margin-top: 1.5rem; }
.footer-last { display: flex; align-items: center; gap: 1rem; }
.found--last { --size: 5.6rem; flex: none; }
.footer-last .margin-note { max-width: 15ch; }
.colophon { color: var(--paper-2); }

@media (min-width: 940px) {
  .footer { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .colophon { grid-column: 1 / -1; }
}

/* ---------- Viewer ---------- */

.viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  color: var(--paper);
  --side: clamp(0.75rem, 3vw, 2.5rem);
}
.viewer::backdrop { background: transparent; }
.viewer.is-closing { opacity: 0; transition: opacity 0.16s; }

.viewer-bg { position: absolute; inset: 0; background: #15100d; }
.viewer[open] .viewer-bg,
.viewer[open] .viewer-top,
.viewer[open] .viewer-bottom { animation: v-fade 0.45s ease both; }
@keyframes v-fade { from { opacity: 0; } }

.viewer-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: zoom-out;
}
.viewer-world {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  cursor: zoom-in;
}
.viewer-stage.is-zoomed .viewer-world { cursor: grab; }
.viewer-stage.is-dragging .viewer-world { cursor: grabbing; }
.viewer-world.is-easing { transition: transform 0.3s var(--ease); }
.viewer-world.is-arriving { animation: v-fade 0.3s ease both; }

.viewer-img,
.viewer-still {
  dynamic-range-limit: standard;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.viewer-spot {
  position: absolute;
  border: calc(2px * var(--inv, 1)) solid var(--paper);
  border-radius: 50%;
  box-shadow: 0 0 0 calc(5px * var(--inv, 1)) rgba(240, 107, 143, 0.6);
  opacity: 0;
  pointer-events: none;
}
.viewer-spot.is-on { animation: spot 3.6s ease both; }
@keyframes spot {
  0% { opacity: 0; transform: scale(1.8); }
  13% { opacity: 1; transform: scale(1); }
  28% { transform: scale(1.1); }
  42% { transform: scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: scale(1); }
}

.viewer-clip {
  position: absolute;
  inset: 4.5rem var(--side) 7rem;
  display: grid;
  place-items: center;
}
.viewer-clip[hidden] { display: none; }
.viewer-video { max-width: 100%; max-height: 100%; border-radius: 2px; }

.viewer-top,
.viewer-bottom {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}
.viewer-top {
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem var(--side) 1.25rem;
  background: linear-gradient(rgba(21, 16, 13, 0.9), rgba(21, 16, 13, 0));
}
.viewer-bottom {
  bottom: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 1.75rem var(--side) max(0.9rem, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(21, 16, 13, 0), rgba(21, 16, 13, 0.92) 60%);
}
.viewer-top > *,
.viewer-bottom > * { pointer-events: auto; }

.viewer-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-2);
}
.viewer-count { margin-left: 0.9em; letter-spacing: 0.06em; }
.viewer-tools { display: flex; gap: 0.45rem; }

.v-btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(239, 230, 216, 0.3);
  border-radius: 50%;
  background: rgba(28, 22, 19, 0.78);
  color: var(--paper);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}
.v-btn:hover { border-color: var(--paper); background: rgba(52, 42, 36, 0.9); }
.v-btn[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.v-btn[hidden] { display: none; }
.v-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.viewer[data-kind="clip"] .v-zoom { display: none; }

.viewer-caption { min-width: 0; text-align: left; }
.viewer-bottom .v-btn[hidden] + .viewer-caption { grid-column: 1 / -1; }
.viewer-title { font-size: 1.12rem; font-weight: 580; line-height: 1.25; letter-spacing: -0.01em; }
.viewer-credits { display: flex; flex-wrap: wrap; gap: 0 0.55em; margin-top: 0.2rem; line-height: 1.4; }
.viewer-credits li + li::before { content: "+"; margin-right: 0.55em; color: var(--wash); }
.viewer-status {
  min-height: 1.6em;
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--paper-2);
}
[hidden] { display: none !important; }

/* ---------- Reduced motion: everything has a still view ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .found:hover,
  .found:focus-visible,
  .screen-link:hover,
  .screen-link:focus-visible { transform: none; }
  .piece-link:hover .piece-media,
  .piece-link:focus-visible .piece-media { transform: none; }
  .spot { transform: none; }
  .peek-faces .found { scale: 1; }
  .voice-caret { display: none; }
  .viewer-spot.is-on { animation: none; opacity: 1; }
  .shout span { animation: none; transform: skewX(-10deg); }
  .aoe { display: none; }
  .frog-x { animation: none; transform: translateX(var(--dx)); opacity: 1; }
  .frog-y { animation: none; }
  .w.afflicted { animation: none; color: var(--frog); }
  .status--building .dot { animation: none; }
}
