/* nozim.here, in heatunit's barebones style: black, white and greys, square corners, no shadows,
   nothing fades; DM Sans for text, OpenMono for names, figures and labels; everything lowercase;
   a 4pt grid; small and compact. The only colour on the site is in the intro's glitch. */

@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: block; }
@font-face { font-family: "DM Sans"; src: url("/fonts/DMSans-Medium.ttf") format("truetype"); font-weight: 500; font-display: block; }
/* OpenMono, heatunit's copy with the plain hollow zero, cut down to the letters the site uses
   (scripts/subset-font.py); unicode-range matches what it keeps, so anything else falls back. */
@font-face { font-family: "OpenMono"; src: url("/fonts/OpenMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: block; unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026, U+2190-2193; }
@font-face { font-family: "OpenMono"; src: url("/fonts/OpenMono-Medium.ttf") format("truetype"); font-weight: 500; font-display: block; unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2022, U+2026, U+2190-2193; }

:root {
  --canvas: #ffffff;
  --ink: #000000;
  --ink-2: #666666;
  --ink-faint: rgba(0, 0, 0, 0.25);
  --fill-held: rgba(0, 0, 0, 0.04);
  --fill-tapped: rgba(0, 0, 0, 0.10);
  --media-ground: #f0f0f0;
  --page: 16px;
  --gap: 8px;
  --head: 48px;
  --row: 44px;
  --top: var(--page); /* above the info: the same as the sides */
  --info: 400px;       /* the info's width at most: phones up to 432 wide get the full width */
  --part-top: 16px;    /* between the switch and what's under it */
  --part-bottom: 8px;  /* under the rail's contents, above the hint */
  --tile-max: 184px;   /* tiles in two rows grow up to this */
  --tile-max-one: 328px; /* and in one row up to this: on phones the row fills the rail, up to where two rows take over */
  --lead: max(var(--page), calc((100vw - var(--info)) / 2)); /* the info's left edge: the rail starts here */
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "OpenMono", ui-monospace, monospace;
}

@media (min-width: 768px) {
  :root { --page: 32px; --gap: 16px; --head: 56px; --part-top: 32px; --tile-max: 216px; --tile-max-one: 240px; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3 { font-size: inherit; font-weight: inherit; }

/* Nothing scrolls up and down: the rail scrolls sideways. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { background: var(--canvas); color: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 20px;
  text-transform: lowercase;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button {
  font: inherit;
  color: inherit;
  text-transform: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
img, video { display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.mono { font-family: var(--mono); font-size: 16px; line-height: 20px; letter-spacing: 0; }
.small { font-family: var(--mono); font-size: 13px; line-height: 16px; letter-spacing: 0; }
.faint { color: var(--ink-2); }
.bar-row { height: var(--head); display: flex; align-items: center; justify-content: space-between; }

/* ---- the page: the info on top, the rail under it ---- */

/* Too short for the info and a rail of 240px (a small phone): the page scrolls up and down to make
   room, the one case it does. */
.page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }

.top {
  flex: none;
  display: flex;
  justify-content: center;
  padding: calc(var(--top) + env(safe-area-inset-top)) var(--page) 0;
}
/* One column on every screen: the name and lines, the links, the switch; the rail under it. */
.top-inner { width: 100%; max-width: var(--info); }
/* heatunit's wordmark treatment (medium, tight tracking), at a medium size, in OpenMono. */
.name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 33px;
  line-height: 40px;
  letter-spacing: -0.08em;
}
.text { margin-top: 8px; color: var(--ink-2); }
.text p + p { margin-top: 8px; }

.links { margin-top: 16px; }
.handles { list-style: none; border: 1px solid var(--ink); }
.handles li + li { border-top: 1px solid var(--ink); }
/* A row: what the link is and the link, its years at the end, its note under it, smaller. */
.handles a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
  min-height: var(--row);
  padding: 6px 12px;
  font-family: var(--mono);
}
.handles .kind, .handles .note, .handles .years { font-size: 13px; line-height: 16px; color: var(--ink-2); }
.handles .kind { margin-right: 8px; }
.handles .note { grid-column: 1 / -1; }
.handles .years { font-variant-numeric: tabular-nums; }
@media (hover: hover) { .handles a:hover { background: var(--fill-held); } }
.handles a:active { background: var(--fill-tapped); }

/* The switch: the chosen half filled, like heatunit's rows; it changes at once. */
.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: var(--row);
  margin-top: 8px;
  border: 1px solid var(--ink);
  font-family: var(--mono);
}
.switch button + button { border-left: 1px solid var(--ink); }
.switch button[aria-selected="true"] { background: var(--ink); color: var(--canvas); }
/* A note beside a label, smaller and dimmer, on either fill. */
.switch button { white-space: nowrap; }
.switch .aside { margin-left: 6px; font-size: 13px; opacity: 0.6; }
@media (max-width: 359px) { .switch .aside { font-size: 11px; } }
@media (hover: hover) { .switch button[aria-selected="false"]:hover { background: var(--fill-held); } }

/* The rail: the only thing that moves, sideways, edge to edge. Its height is what's left under
   the info, and the tiles are sized from it (container units). */
.rail {
  flex: 1 0 0;
  min-height: 192px; /* tiles of 144px at the least; below that the page scrolls */
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: none;
  scrollbar-width: none;
  container: rail / size;
}
@media (min-width: 768px) { .rail { min-height: 232px; } } /* laptops keep tiles of 168px or more */
.rail::-webkit-scrollbar { display: none; }
html.is-loading .rail { overflow: hidden; }

.part {
  flex: none;
  padding: var(--part-top) var(--page) var(--part-bottom);
  display: flex;
  align-items: flex-start;
}
.part[hidden] { display: none; }

/* Work: equal squares in columns. The first column lines up with the info above. Two rows while
   the rail is tall enough for squares of 136px or more, one row below that. */
.part-work { padding-left: var(--lead); }
/* On wider screens the work sits in the middle; when it's wider than the screen, it starts at the
   page's edge and scrolls (auto margins never push it off the left). */
@media (min-width: 768px) {
  .part-work { padding-left: var(--page); margin-inline: auto; }
}
.grid {
  --cap: 24px; /* the caption under a tile: 8 + one 16px line (40px with the software line) */
  --room: calc(100cqh - var(--part-top) - var(--part-bottom));
  --tile: round(down, min(var(--tile-max), (var(--room) - 2 * var(--cap) - 16px) / 2), 1px);
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, auto);
  grid-auto-columns: var(--tile);
  column-gap: var(--gap);
  row-gap: 16px;
}
@container rail (height < 376px) {
  .grid {
    --tile: round(down, min(var(--tile-max-one), var(--room) - var(--cap)), 1px);
    grid-template-rows: auto;
  }
}
.tile { min-width: 0; }
.tile-media {
  position: relative;
  display: block;
  width: var(--tile);
  height: var(--tile);
  background: var(--media-ground) center / cover no-repeat;
  overflow: hidden;
}
.tile-media img, .tile-media video { width: 100%; height: 100%; object-fit: cover; }
.tile-tag {
  position: absolute;
  left: 4px;
  top: 4px;
  padding: 0 4px;
  background: var(--canvas);
  color: var(--ink);
}
.tile-cap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  margin-top: 8px;
}
.tile-cap .t, .tile-cap .sw { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-cap .sw { grid-column: 2; color: var(--ink-2); }
@media (hover: hover) {
  .tile:hover .t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
}

/* Experience: a timeline across the years. The playhead stands on the info's left edge while the
   timeline passes under it, and the place it's on fills in. It starts on the first month, and the
   room after the timeline lets it reach "now". */
.part-experience { padding-left: var(--lead); padding-right: calc(100vw - var(--lead)); }
.timeline { position: relative; }
.playhead {
  position: sticky;
  left: var(--lead);
  width: 1px;
  height: 100%;
  background: var(--ink);
  z-index: 1;
}
/* The playhead's reading: a black tag at its foot, over the years as they pass. */
.readout {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0 6px;
  background: var(--ink);
  color: var(--canvas);
  white-space: nowrap;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
}
.track { position: absolute; inset: 0; }
.axis { position: absolute; left: 0; height: 1px; background: var(--ink); }
.tick { position: absolute; width: 1px; height: 12px; background: var(--ink); }
.tick.minor { height: 6px; background: var(--ink-faint); }
.tick-label { position: absolute; white-space: nowrap; font-family: var(--mono); font-size: 16px; line-height: 20px; }
.tick-label.covered { visibility: hidden; }
/* Places the playhead isn't on are faded; the one it's on is full and filled, switched at once. */
.entry { position: absolute; color: var(--ink); opacity: 0.3; }
.entry .meta { color: var(--ink-2); }
.entry .bar { height: 12px; border: 1px solid var(--ink); }
/* The name sticks just past the playhead while its bar runs under it, and stops at the bar's end:
   sticky, so it moves with the scroll itself and doesn't lag behind it. */
.entry .label { position: sticky; left: calc(var(--lead) + 8px); width: max-content; margin-top: 8px; }
.entry .name-line { white-space: nowrap; font-weight: 500; font-size: 21px; line-height: 24px; letter-spacing: -0.01em; }
.entry .meta { white-space: nowrap; font-family: var(--mono); font-size: 16px; line-height: 20px; }
.entry.on { opacity: 1; }
.entry.on .bar { background: var(--ink); }
/* When the rail is too short for that (many places at once on a small phone), the smaller set. */
.timeline.tight .readout, .timeline.tight .tick-label { font-size: 13px; line-height: 16px; }
.timeline.tight .entry .bar { height: 8px; }
.timeline.tight .entry .name-line { font-size: 16px; line-height: 20px; letter-spacing: 0; }
.timeline.tight .entry .meta { font-size: 13px; line-height: 16px; }

/* Under the rail, on the right: a nudge that there's more that way. Phones say swipe, a mouse
   says scroll. The arrow ticks twice now and then until the rail is first moved; the hint goes
   (keeping its room, so nothing jumps) when there's nothing further right. */
.hint {
  flex: none;
  padding: 0 var(--page);
  text-align: right;
  font-size: 13px;
  line-height: 16px;
  color: var(--ink-2);
}
.hint.off { visibility: hidden; }
.hint .mouse { display: none; }
@media (hover: hover) and (pointer: fine) {
  .hint .touch { display: none; }
  .hint .mouse { display: inline; }
}
.hint .arrow { display: inline-block; animation: nudge 2.4s steps(1, end) infinite; }
.hint.seen .arrow { animation: none; }
@keyframes nudge {
  0%, 20% { transform: none; }
  10%, 30% { transform: translateX(4px); }
  40%, 100% { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .hint .arrow { animation: none; } }

/* The line at the bottom, in the middle. */
.foot {
  flex: none;
  padding: 8px var(--page) calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--ink-2);
}
.foot:empty { display: none; }

/* ---- now and then a glitch (alive.js) ---- */

/* Two layers, shown only for a burst's few frames: one drawn as it is (black dot blocks), one
   blended by difference, where white flips what's under it to negative. */
.alive {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.alive.flip { mix-blend-mode: difference; }
.alive[hidden] { display: none; }
.alive i { position: absolute; left: 0; top: 0; background: #ffffff; }
.alive i.red { background: #ff0000; }
.alive i.static { background: var(--static); }
.alive i.dots { background-size: 16px 16px; image-rendering: pixelated; }
.alive i.d0 { background-image: var(--d0); }
.alive i.d1 { background-image: var(--d1); }
.alive i.d2 { background-image: var(--d2); }
.alive i.d3 { background-image: var(--d3); }
.alive i.d4 { background-image: var(--d4); }
.alive i.d5 { background-image: var(--d5); }

/* ---- intro ---- */

.cover { position: fixed; inset: 0; z-index: 100; background: #000000; } /* black until the intro: a dead screen */
.intro-gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  pointer-events: none;
}

/* ---- lightbox: drawn dark, like heatunit's black screens ---- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000000;
  color: #ffffff;
  display: grid;
  grid-template-rows: var(--head) minmax(0, 1fr) auto auto;
  padding: env(safe-area-inset-top) var(--page) calc(var(--page) + env(safe-area-inset-bottom));
}
.lightbox[hidden] { display: none; }
.lightbox :focus-visible { outline-color: #ffffff; }
.lightbox .bar-row { margin: 0 0 0 -12px; } /* close on the left, its hit area out to the edge */
.lb-stage { position: relative; min-height: 0; }
.lb-stage img, .lb-stage video { width: 100%; height: 100%; object-fit: contain; }
.lb-stage video { cursor: pointer; }
.lb-btn { display: inline-flex; align-items: center; height: 44px; padding: 0 12px; }
@media (hover: hover) { .lb-btn:hover { background: rgba(255, 255, 255, 0.08); } }
.lb-btn:active { background: rgba(255, 255, 255, 0.16); }
.lb-controls {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 8px -12px 0;
}
.lb-controls[hidden] { display: none; }
.lb-time { font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.6); }
.lb-scrub { position: relative; height: 44px; cursor: pointer; touch-action: none; }
.lb-scrub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 21px;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
}
.lb-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 21px;
  height: 2px;
  background: #ffffff;
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.lb-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #ffffff;
}
.lb-title { font-family: var(--mono); font-weight: 500; }
.lb-dim { color: rgba(255, 255, 255, 0.6); }
.lb-note { margin-top: 8px; max-width: 40em; }
.lb-nav { display: flex; margin: -12px -12px 0 0; }
