/* OFF THE CANVAS: the about section. The story on a blue thread beside his portrait, the camera roll (a drifting row of his photos as paper prints, each with his note written under it,
   opening big on a click), and the resume. Same voices as the rest of the page: Archivo 800 for titles and names,
   Geist Mono for every sentence and label, his scribbled handwriting (Reenie Beanie) for the notes in the story, and a plainer hand (Caveat) for the notes on the prints, which have to be read at a glance. */

.otc {
  --col: min(1000px, 72vw);
  --grey: #6a6b70;
  --rule: #dcd8cf;
  position: relative;
  z-index: 2;
  width: var(--col);
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) 0 clamp(120px, 22vh, 220px);
  color: var(--ink);
} /* the same column as the work above it, on the same paper */
@media (max-width: 760px) {
  .otc {
    --col: calc(100vw - 32px);
    --tk: 0.0806;
  }
}
.otc :where(h2, h3, h4, h5, p, figure, ol, ul) {
  margin: 0;
  padding: 0;
}
.otc .lbl {
  font:
    500 11.5px/1.5 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--grey);
} /* the small grey labels, as under the work */
.otc-title {
  white-space: nowrap;
  font:
    800 calc(var(--col) * var(--tk, 0.062)) / 1 Archivo,
    'Arial Narrow',
    Arial,
    sans-serif;
  font-stretch: 112%;
  letter-spacing: -0.035em;
} /* the same size as "Featured work" */
.otc-line {
  margin-top: 18px;
  font:
    500 17px/1.4 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: -0.012em;
  color: var(--grey);
}

/* ---------- his portrait, and the story on a thread ---------- */
.otc-me {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 64px;
  margin-top: 76px;
  align-items: start;
}
.otc-portrait {
  position: sticky;
  top: 112px;
} /* it stays in view while the story beside it is read */
.otc-portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 16px;
  background: #e4e0d8;
  transform: rotate(-2deg);
  box-shadow:
    0 0 1px rgba(20, 20, 30, 0.14),
    0 3px 3px rgba(20, 20, 30, 0.24),
    0 6px 14px rgba(20, 20, 30, 0.08);
}
.beats {
  position: relative;
  padding-left: 46px;
  container: beats / inline-size;
}
.beats ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.beat .lbl {
  display: block;
  margin-bottom: 9px;
}
.beat p {
  max-width: 25em;
  font:
    400 17px/1.6 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: -0.012em;
}
.beat {
  position: relative;
}
.note {
  display: block;
  width: fit-content;
  margin: 16px 0 0 34px;
  white-space: nowrap; /* it breaks where the page says (one <br>), not where the margin runs out */
  rotate: -3deg;
  font:
    400 29px/0.92 'Reenie Beanie',
    'Bradley Hand',
    cursive;
  color: var(--blue);
  -webkit-text-stroke: 0.3px currentColor; /* the pen pressed a little harder: the face alone is a hairline */
} /* his note on the story: under the paragraph where the column is narrow... */
@container beats (min-width: 600px) {
  .note {
    position: absolute;
    left: 492px;
    top: var(--note-y, 40px);
    margin: 0;
  }
} /* ...and in the margin beside the line it is about, where there is room (the lines are 25em, 425px, wide; the gap leaves the arrow room). about.js sets --note-y */
.scrawl {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.scrawl path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.55s cubic-bezier(0.45, 0, 0.2, 1) var(--d, 0s);
} /* the arrow from the note to its line, drawn once the thread has passed */
.beats.in .scrawl path {
  stroke-dashoffset: 0;
}
.won {
  position: relative;
  white-space: nowrap;
}
.won svg {
  position: absolute;
  left: -15px;
  top: -4px;
  width: calc(100% + 26px);
  height: calc(100% + 9px);
  overflow: visible;
  pointer-events: none;
}
.won path {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.45, 0, 0.2, 1) 1.5s;
} /* circled by hand, after the thread has reached it */
.thread {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  overflow: visible;
  pointer-events: none;
}
.thread .line {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.9s cubic-bezier(0.45, 0, 0.25, 1);
} /* the thread draws itself down the story the first time it comes into view */
.thread .knot {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  scale: 0.3;
  transition:
    opacity 0.3s ease var(--d),
    scale 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) var(--d);
} /* a knot is tied at each step as the thread passes it */
.beats.in .thread .line,
.beats.in .won path {
  stroke-dashoffset: 0;
}
.beats.in .thread .knot {
  opacity: 1;
  scale: 1;
}

/* ---------- the camera roll ---------- */
.roll {
  margin-top: 160px;
}
.roll .lbl b {
  font-weight: 500;
  color: var(--ink);
}
.roll-line {
  margin-top: 10px;
  max-width: 33em;
  font:
    400 17px/1.6 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: -0.012em;
}
/* THE ROLL: one row of paper prints running the full width of the screen, each tilted a little as if dropped on a desk, the note written under the photo.
   The row drifts slowly and goes round forever (the script moves it and makes the copies that close the loop); it stops while the pointer is on it,
   can be dragged or swiped, and a print under the pointer straightens and lifts. A click opens the photo big */
.snaps {
  position: relative;
  width: 100vw;
  margin: clamp(72px, 10vh, 104px) 0 0 calc(50% - 50vw);
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
} /* it steps out of the column to run edge to edge */
.snaps.held {
  cursor: grabbing;
}
.roll-track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  padding: 34px 0 76px;
  will-change: transform;
}
.snaps .snap {
  flex: none;
  width: clamp(200px, 20vw, 300px);
  margin: 0 clamp(8px, 1.3vw, 18px);
  padding: 14px 14px 0;
  background: #fffdf8;
  border-radius: 3px;
  box-shadow:
    0 0 1px rgba(20, 20, 30, 0.14),
    0 3px 3px rgba(20, 20, 30, 0.24),
    0 6px 14px rgba(20, 20, 30, 0.08); /* a firm shadow tight to the print, as if it lies on the paper: defined at the edge, gone within a few pixels */
  transition:
    rotate 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    scale 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    translate 0.45s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.45s;
}
.snap:nth-child(9n + 1) {
  rotate: -3deg;
  translate: 0 6px;
}
.snap:nth-child(9n + 2) {
  rotate: 2.2deg;
}
.snap:nth-child(9n + 3) {
  rotate: -1.4deg;
  translate: 0 10px;
}
.snap:nth-child(9n + 4) {
  rotate: 3deg;
}
.snap:nth-child(9n + 5) {
  rotate: -2.4deg;
  translate: 0 4px;
}
.snap:nth-child(9n + 6) {
  rotate: 1.2deg;
  translate: 0 12px;
}
.snap:nth-child(9n + 7) {
  rotate: -3.4deg;
}
.snap:nth-child(9n + 8) {
  rotate: 2.6deg;
  translate: 0 8px;
}
.snap:nth-child(9n) {
  rotate: -1deg;
} /* no two neighbours lean the same way */
.snaps .snap.on {
  rotate: 0deg;
  scale: 1.06;
  translate: 0 -6px;
  z-index: 2;
  box-shadow:
    0 0 1px rgba(20, 20, 30, 0.14),
    0 5px 5px rgba(20, 20, 30, 0.22),
    0 12px 24px rgba(20, 20, 30, 0.14);
} /* the one under the pointer straightens, lifts and comes forward; nothing else changes */
.snap-pic {
  all: unset;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 1px;
  background: #e4e0d8;
  cursor: inherit;
  -webkit-tap-highlight-color: transparent;
}
.snap-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.snap-pic:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.snap figcaption {
  display: grid;
  place-items: center;
  min-height: calc(3.3em + 32px); /* room for three lines on every print, so they all stand the same height */
  padding: 14px 6px 18px;
  font:
    500 clamp(19px, 1.55vw, 23px) / 1.1 Caveat,
    'Bradley Hand',
    cursive;
  color: #26262b;
  text-align: center;
  text-wrap: balance;
} /* his note, written under the photo like on a print */


/* a photo opened big, with its note under it. A tap or click anywhere closes it; the arrow keys go through the roll */
.viewer {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 16px calc(40px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  opacity: 0;
  visibility: hidden;
  overscroll-behavior: contain;
  transition:
    opacity 0.25s ease,
    visibility 0s 0.25s;
}
.viewer.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}
.viewer figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-width: min(640px, 100%);
  padding: 16px 16px 0;
  border-radius: 4px;
  background: #fffdf8;
  rotate: -1deg;
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.16),
    0 4px 4px rgba(0, 0, 0, 0.26),
    0 12px 28px rgba(0, 0, 0, 0.16);
} /* opened big, it is still a print: the photo on paper, the note written under it */
.viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 300px);
  max-height: calc(100dvh - 300px);
  width: auto;
  height: auto;
  border-radius: 2px;
}
.viewer figcaption {
  contain: inline-size; /* the note takes the photo's width and never widens the print */
  padding: 18px 10px 22px;
  font:
    500 26px/1.12 Caveat,
    'Bradley Hand',
    cursive;
  text-align: center;
  text-wrap: balance;
  color: #26262b;
}
.viewer-bar {
  position: absolute;
  left: max(16px, 2.6vw);
  right: max(16px, 2.6vw);
  top: calc(24px + env(safe-area-inset-top, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.viewer .lbl {
  font:
    500 11.5px/1.5 'Geist Mono',
    ui-monospace,
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6a6b70;
}
#vClose {
  all: unset;
  cursor: pointer;
  padding: 8px 0 8px 16px;
  color: var(--ink);
}
#vClose:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
html.viewing {
  overflow: hidden;
}

/* ---------- phones: one column, the wall in two, and no hover (a tap opens a photo instead) ---------- */
@media (max-width: 760px) {
  .otc-line {
    font-size: 15px;
  }
  .otc-me {
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 44px;
  }
  .otc-portrait {
    position: static;
    width: 72%;
    max-width: 320px;
  }
  .beats {
    padding-left: 34px;
  }
  .beats ol {
    gap: 32px;
  }
  .beat p,
  .roll-line {
    font-size: 15.5px;
  }
  .roll {
    margin-top: 112px;
  }
  .snaps {
    margin-top: 64px;
  }
  .snaps .snap {
    width: 62vw;
    padding: 11px 11px 0;
  }
  .snap figcaption {
    font-size: 19px;
  }
  .viewer figure {
    padding: 12px 12px 0;
  }
  .viewer figcaption {
    padding: 14px 6px 18px;
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .thread .line,
  .won path,
  .scrawl path {
    stroke-dashoffset: 0;
  }
  .thread .knot {
    opacity: 1;
    scale: 1;
  } /* with motion off, the thread is simply there */
  .thread .line,
  .thread .knot,
  .won path,
  .scrawl path,
  .snaps .snap,
  .viewer {
    transition: none;
  }
}
