/* Stephen Biernacki — site.css
   The hand writes; the machine records.
   Stephen Hand carries everything he would say. Fragment Mono carries what a machine would log:
   years, specs, links, navigation. Amber appears on links, the count's dot, and the footer's mark for
   now. The light follows the visitor's own clock (light.js); without the script, the device's light
   or dark setting. The artworks are never changed. */

@font-face {
  font-family: "Stephen Hand";
  src: url("fonts/StephenHand-Regular.woff2") format("woff2");
  font-display: block;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("fonts/FragmentMono-Regular.woff2") format("woff2");
  font-display: swap;
}

/* These are the noon values. light.js replaces them through the day, before anything is drawn. */
:root {
  --paper: #FAFAF8;
  --ink: #1C1B18;
  --pencil: rgba(28, 27, 24, 0.66);
  --rule: rgba(28, 27, 24, 0.16);
  --well: #E9E9E7;   /* behind a work while it loads */
  --amber: #D4A934;

  --hand: "Stephen Hand", ui-rounded, system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --pad: clamp(16px, 3.4vw, 48px);

  color-scheme: light;
}
/* without the script there is no clock to read, so the device's own dark setting decides */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --ink: #ECE8E0;
    --pencil: rgba(236, 232, 224, 0.66);
    --rule: rgba(236, 232, 224, 0.18);
    --well: #080807;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  transition: background-color 3s linear, color 3s linear;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  transition: background-color 3s linear, color 3s linear;
}
@media (min-width: 60rem) { body { font-size: 14px; } }
h1, h2, h3, p, ul, ol, figure, blockquote { margin: 0; padding: 0; font-weight: 400; font-size: inherit; }
ul, ol { list-style: none; }
img, iframe, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.hand { font-family: var(--hand); }
.mono { font-family: var(--mono); }

/* ---------- links: ink text, amber underline ---------- */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 0.125em;
  text-underline-offset: 0.24em;
  text-decoration-skip-ink: none;
}
a:hover { text-decoration-thickness: 0.3em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.hand a, a.hand { text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
.hand a:hover, a.hand:hover { text-decoration-thickness: 0.16em; }

/* quiet links: underline appears on hover, focus, or when current */
.quiet { text-decoration-color: transparent; }
.quiet:hover, .quiet:focus-visible, .quiet[aria-current="page"] { text-decoration-color: var(--amber); }

/* buttons that read as links: Show another */
.act {
  font: inherit; color: inherit; background: none; border: 0; border-radius: 0;
  padding: 12px 0; margin: -12px 0;   /* a thumb-sized target, the same look */
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  text-decoration-line: underline; text-decoration-color: var(--amber); text-decoration-thickness: 0.125em;
  text-underline-offset: 0.24em; text-decoration-skip-ink: none;
}
.act:hover { text-decoration-thickness: 0.3em; }

.skip {
  position: absolute; left: var(--pad); top: -4rem;
  background: var(--paper); padding: 0.5rem 0.75rem; z-index: 20;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); }

.vh, .hw-sr {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.vh, .hw-sr { -webkit-user-select: none; user-select: none; }

/* ---------- the page ---------- */
.root {
  max-width: 1680px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 var(--pad) clamp(24px, 2.8vw, 40px);
  display: flex;
  flex-direction: column;
}
.root > main { display: block; }

/* ---------- header: the name and the pages ---------- */
.hd {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 6px 36px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 0 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: background-color 3s linear;
}
.nm { grid-column: 1; font-family: var(--hand); font-size: 26px; line-height: 1; }
.nm a { text-decoration-color: transparent; }
.nm a:hover, .nm a:focus-visible { text-decoration-color: var(--amber); }
.hd nav { grid-column: 2; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
@media (max-width: 700px) {
  .hd { grid-template-columns: minmax(0, 1fr); }
  .hd nav { grid-column: 1; grid-row: 2; }
}

/* the footer: the time where the visitor is, and the day's light from midnight to midnight with a mark
   at now. Only with the script, which fills it in and draws the bar from its own colors (light.js);
   without it the light follows the device instead of the clock, so there is no footer. */
.foot { display: none; margin-top: auto; padding-top: clamp(40px, 5vw, 72px); color: var(--pencil); }
.js .foot { display: block; }
.day { visibility: hidden; }
.day.is-on { visibility: visible; }
.day-now > span { display: inline-block; }   /* on a narrow screen, each sentence starts its own line */
.day-bar { position: relative; max-width: 560px; height: 12px; margin-top: 16px; border: 1px solid var(--rule); forced-color-adjust: none; }
.day-mark { position: absolute; top: -6px; bottom: -6px; left: 50%; width: 3px; margin-left: -1.5px; background: var(--amber); }
.day-hours { display: flex; justify-content: space-between; max-width: 560px; margin-top: 10px; font-size: 12px; line-height: 15px; }
/* ---------- home: the bio, then the wall, laid out by chance (wall.js) ---------- */
.top { display: flex; align-items: flex-start; gap: 0 56px; margin-top: clamp(36px, 4.4vw, 64px); }
.bio { flex: 0 1 auto; max-width: 640px; font-size: clamp(21px, 1.85vw, 27px); line-height: 1.44; text-wrap: pretty; }
.side { position: relative; flex: 1 1 0; min-width: 0; }
.wall { position: relative; }
.home .wall { margin-top: clamp(40px, 5vw, 80px); }
/* the list is the wall's stand-in: it shows only if the wall can't be drawn */
.walled .home .index { display: none; }

.cell { position: absolute; }
.it, .pick { display: block; width: 100%; color: inherit; text-decoration: none; }
.pick { padding: 0; margin: 0; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.it img, .it video, .pick img, .pick video { display: block; width: 100%; height: auto; border: 1px solid var(--rule); transition: transform 0.25s ease; }
.it video, .pick video { object-fit: fill; background: var(--well); }
.it:hover img, .it:hover video, .it:focus-visible img, .it:focus-visible video,
.pick:hover img, .pick:hover video, .pick:focus-visible img, .pick:focus-visible video { transform: translateY(-3px); }
.cap {
  display: block; margin-top: 10px; font-family: var(--hand); transform-origin: 0 60%;
  text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 0.06em;
  text-underline-offset: 0.16em; text-decoration-skip-ink: none;
}
.it:hover .cap, .it:focus-visible .cap, .pick:hover .cap, .pick:focus-visible .cap, .pick[aria-current="true"] .cap {
  text-decoration-color: var(--amber); text-decoration-thickness: 0.11em;
}
.it .meta { display: block; margin-top: 6px; font-size: 12px; line-height: 1.4; color: var(--pencil); }
.pixelated { image-rendering: pixelated; }

/* ---------- lists: the works without the wall, Also, Elsewhere ---------- */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 0.4rem; }
@media (min-width: 60rem) {
  .pair { grid-template-columns: 14.5rem minmax(0, 1fr); column-gap: clamp(2rem, 4.5vw, 5rem); align-items: baseline; }
  .pair > .m { grid-column: 1; grid-row: 1; }
  .pair > .f { grid-column: 2; grid-row: 1; }
}
.m { color: var(--pencil); }
.m a { color: var(--ink); }
.index { margin-top: clamp(40px, 5vw, 80px); }
.entry + .entry { margin-top: clamp(1.4rem, 3.2vw, 2.25rem); }
.entry .f { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.2; }
/* the Statement's three questions, in order, after the works: one column on a phone, one row on a wider screen */
.asks { margin-top: clamp(24px, 3vw, 48px); }  /* the wall already ends with a row's worth of space */
.asks-h { color: var(--pencil); font-size: 13px; }
.asks-list { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; }
@media (min-width: 48rem) { .asks-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px clamp(32px, 4vw, 64px); } }
.ask { font-size: clamp(23px, 2vw, 30px); line-height: 1.3; text-wrap: pretty; }
.asks-list a { display: inline-block; margin-top: 12px; font-size: 13px; }

/* ---------- a work: the frame, then everything said about it ---------- */
.work { display: flex; flex-direction: column; align-items: flex-start; gap: 32px; margin-top: clamp(24px, 3vw, 44px); }
/* the frame keeps the work's own shape, never cropped, and stays within 74% of the screen's height */
.stage { flex: 0 1 auto; width: min(100%, 860px, calc(74vh * var(--arn, 1))); min-width: 0; }
/* side by side on a wide screen, where the work stays in view while its words are read */
@media (min-width: 64rem) {
  .work { flex-direction: row; gap: clamp(32px, 4vw, 64px); }
  .stage { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)); }
}
/* in a series, a line above the frame names the work showing; the only line drawn is the frame's own edge */
.strip { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 0 10px; font-size: 12px; line-height: 15px; }
.v-title { min-width: 0; overflow-wrap: anywhere; }
.v-ctl { display: flex; gap: 18px; align-items: baseline; white-space: nowrap; }
.v-pos { color: var(--pencil); }
.series-next { display: none; }
.js .series-next { display: inline; }
.js .series:not(.is-ready) .v-title { visibility: hidden; }
/* the edge is drawn just outside the frame, so the frame keeps the work's exact proportions */
.frame { position: relative; aspect-ratio: var(--ar, 1); background: var(--well); box-shadow: 0 0 0 1px var(--rule); }
.frame > img, .frame > video, .frame > iframe, .frame > .ph {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain;
  background: var(--media-bg, transparent);
}
.frame > video { object-fit: fill; }
.frame > iframe { background: var(--live-bg, var(--well)); }
.series .frame > .series-img, .series .frame > .series-video { cursor: pointer; }
.ph { display: grid; place-items: center; color: var(--pencil); padding: 1.25rem; text-align: center; }
.media-note { margin-top: 10px; color: var(--pencil); }

/* under the work: Full screen, and for a live work a tab of its own (view.js). On a computer they show
   while the pointer is over the work or the keyboard reaches them; on a phone they are always there. */
.acts { display: flex; justify-content: flex-end; align-items: baseline; gap: 18px; padding-top: 10px; font-size: 12px; line-height: 15px; }
.acts .full { display: none; }
.js .acts .full { display: inline-block; }
@media (hover: hover) and (pointer: fine) {
  .acts { opacity: 0; transition: opacity 0.2s ease; }
  .stage:hover .acts, .acts:focus-within, .is-focus .acts { opacity: 1; }
}

/* full screen: the work alone on the page's own light, as large as the screen allows, never cropped */
.focusing { overflow: hidden; overscroll-behavior: none; }
.focusing .stage { z-index: 100; }
.viewer.is-focus {
  position: fixed; inset: 0; z-index: 100; margin: 0;
  display: flex; flex-direction: column;
  background: var(--paper);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 calc(14px + env(safe-area-inset-bottom, 0px));
}
/* the work may reach the screen's edges; the lines of text above and below keep the page's margins */
.viewer.is-focus > .strip, .viewer.is-focus > .acts {
  padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px));
}
.viewer.is-focus .frame {
  flex: 1 1 auto; min-height: 0; aspect-ratio: auto; background: none; box-shadow: none; container-type: size;
  margin: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}
.viewer.is-focus .frame > img, .viewer.is-focus .frame > video, .viewer.is-focus .frame > iframe, .viewer.is-focus .frame > .ph {
  inset: 0; margin: auto;
  width: min(100cqw, 100cqh * var(--fs-ar, 1)); height: min(100cqh, 100cqw / var(--fs-ar, 1));
  object-fit: contain; box-shadow: 0 0 0 1px var(--rule);
}

.about { flex: 1 0 400px; max-width: 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 63.99rem) { .about { flex: none; width: 100%; } }
.work-title { font-size: clamp(40px, 5vw, 76px); line-height: 1.05; text-wrap: balance; }
/* the count keeps its place but stays unseen until the visitor has been with the work a full minute (light.js) */
.count { display: none; color: var(--pencil); }
.js .count { display: block; visibility: hidden; opacity: 0; transition: opacity 1.6s ease, visibility 0s linear 1.6s; }
.js .count.is-on { visibility: visible; opacity: 1; transition: opacity 1.6s ease; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-right: 9px; vertical-align: 1px; }
.spec { color: var(--pencil); }
.ext li + li { margin-top: 6px; }
.record { color: var(--pencil); }
.record p + p { margin-top: 0.15rem; }

/* the whole series, laid out by chance under the frame; a tap opens one above */
.set { margin-top: clamp(56px, 6vw, 96px); padding-top: 16px; border-top: 1px solid var(--rule); }
.set-h { color: var(--pencil); font-size: 13px; }
.set .wall { margin-top: 28px; }

/* ---------- prose in the hand ---------- */
.prose { font-family: var(--hand); font-size: clamp(1.3125rem, 1.25rem + 0.25vw, 1.4375rem); line-height: 1.6; max-width: 34em; text-wrap: pretty; }
.prose p + p, .prose p + ul, .prose ul + p, .prose blockquote + p, .prose p + blockquote { margin-top: 0.95em; }
.prose h2 { font-size: 1.55em; line-height: 1.25; margin-top: 1.7em; margin-bottom: 0.35em; }
.prose .sep { margin-top: 1.4em; }
.prose .sep + h2 { margin-top: 0.4em; }
.prose blockquote { margin-left: 1.4em; }
.prose li { line-height: 1.6; padding-left: 0.8em; text-indent: -0.8em; }
.prose .url { font-size: 0.62em; overflow-wrap: anywhere; }
.prose h2 + p { margin-top: 0; }

/* ---------- previous and next ---------- */
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 48px; margin-top: clamp(48px, 5vw, 80px); padding-top: 18px; border-top: 1px solid var(--rule); }
.pager a { display: flex; flex-direction: column; text-decoration: none; }
.pager a.next { align-items: flex-end; margin-left: auto; text-align: right; }
/* only the destination is underlined, never the label, and only on hover or focus */
.pager .hand { font-size: 32px; line-height: 1.2; text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 0.06em; text-underline-offset: 0.16em; text-decoration-skip-ink: none; }
.pager a:hover .hand, .pager a:focus-visible .hand { text-decoration-color: var(--amber); text-decoration-thickness: 0.11em; }
.pager .lbl { color: var(--pencil); }

/* ---------- statement ---------- */
.statement { margin-top: clamp(3rem, 8vw, 6rem); }
.st-lead { font-size: clamp(1.5rem, 7.6vw, 3.2rem); line-height: 1.28; }
.st-lead > span { display: block; }
.st-intro { margin-top: clamp(2.5rem, 6vw, 4rem); }
.movement { margin-top: clamp(2.75rem, 6vw, 4.25rem); }
.numeral { color: var(--pencil); }
.mv-title { font-family: var(--hand); font-size: clamp(1.75rem, 3.6vw, 2.75rem); line-height: 1.2; }
.movement .prose { margin-top: 0.6rem; }

/* ---------- elsewhere: social first, then the art platforms ---------- */
.elsewhere { margin-top: clamp(3rem, 9vw, 6.5rem); }
.group + .group { margin-top: clamp(3.5rem, 9vw, 6rem); }
.group .index { margin-top: 0.9rem; }
.elsewhere .entry { row-gap: 0; }
.elsewhere .entry + .entry { margin-top: clamp(1.5rem, 3vw, 2.1rem); }
.elsewhere .entry .f { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.15; }
.elsewhere .entry .m { overflow-wrap: anywhere; }

/* ---------- not found ---------- */
.lost { margin-top: clamp(4.5rem, 16vh, 11rem); }
.lost h1 { font-family: var(--hand); font-size: clamp(2.75rem, 7.5vw, 5.5rem); line-height: 1.15; }
.lost p { margin-top: 1.5rem; }

/* ---------- the hand, written fresh on every visit (see hand.js and wall.js) ---------- */
.hw-ink span { font-feature-settings: "calt" 0; }
.hw-ink .hw-keep { white-space: nowrap; }
.hw-ink .v1 { font-feature-settings: "calt" 0, "ss01" 1; }
.hw-ink .v2 { font-feature-settings: "calt" 0, "ss02" 1; }
.hw-ink .v3 { font-feature-settings: "calt" 0, "ss03" 1; }
.hw-ink .v4 { font-feature-settings: "calt" 0, "ss04" 1; }
.hw-ink .v5 { font-feature-settings: "calt" 0, "ss05" 1; }
.hw-ink .v6 { font-feature-settings: "calt" 0, "ss06" 1; }
.hw-ink .v7 { font-feature-settings: "calt" 0, "ss07" 1; }
.hw-ink .v8 { font-feature-settings: "calt" 0, "ss08" 1; }
.hw-ink .v9 { font-feature-settings: "calt" 0, "ss09" 1; }

/* Hold the hand until it has been written, so nothing visibly changes. Failsafe if the script never runs. */
.js .hand:not(.is-written) { visibility: hidden; animation: hw-failsafe 0s linear 2.5s forwards; }
@keyframes hw-failsafe { to { visibility: visible; } }

@media (prefers-reduced-motion: reduce) {
  html, body, .hd { transition: none; }
  .it img, .it video, .pick img, .pick video { transition: none; }
  .js .count, .js .count.is-on { transition: none; }
  .acts { transition: none; }
}
