/* IBM Plex, self-hosted from IBM's official split files (OFL, see fonts/IBM-Plex-OFL.txt). */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  src: url("fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02;
  font-display: swap;
}

/* arrows (↗ ← →) and other symbols */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  src: url("fonts/IBMPlexSans-Regular-Pi.woff2") format("woff2");
  unicode-range: U+0E3F, U+2032-2033, U+2070, U+2075-2079, U+2080-2081, U+2083, U+2085-2089, U+2113, U+2116, U+2126, U+212E, U+2150-2151, U+2153-215E, U+2190-2199, U+21A9-21AA, U+21B0-21B3, U+21B6-21B7, U+21BA-21BB, U+21C4, U+21C6, U+2202, U+2206, U+220F, U+2211, U+221A, U+221E, U+222B, U+2248, U+2260, U+2264-2265, U+25CA, U+2713, U+274C, U+2B0E-2B11;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  src: url("fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2");
  unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00A3, U+00A4-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* The page follows the system theme: white in light mode, black in dark mode. */
  --paper: #fff;
  --paper-line: #e3e5e8;
  --line-strong: #c9ced6;
  --card: #fff;
  --bar-bg: rgba(255, 255, 255, 0.85);
  --text: #16191f;
  --text-soft: #535864;
  --text-faint: #6d727d;
  --slate: #3a4763;
  --select: rgba(58, 71, 99, 0.2);
  --print-shadow: 0 3px 8px #28251d14, 0 16px 30px #28251d17;
  --print-shadow-hover: 0 4px 10px #28251d14, 0 24px 40px #28251d26;
  --cell-0: rgba(58, 71, 99, 0.08);
  --cell-1: #b3bccc;
  --cell-2: #7e8ca6;
  --cell-3: #56647f;
  --cell-4: #3a4763;

  /* the gallery viewer is always dark */
  --ink: #f7f7f5;

  --strip: 52px;
  --bar: 56px;
  --gutter: clamp(24px, 5vw, 80px);
  --measure: 880px;
  --section-pad: clamp(40px, 7vh, 72px);
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: var(--sans);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #000;
    --paper-line: #26282d;
    --line-strong: #3a3d44;
    --card: #131417;
    --bar-bg: rgba(0, 0, 0, 0.8);
    --text: #f2f3f5;
    --text-soft: #aeb2ba;
    --text-faint: #8c919a;
    --slate: #a9b8d6;
    --select: rgba(169, 184, 214, 0.3);
    --print-shadow: 0 3px 8px #0006, 0 16px 30px #0008;
    --print-shadow-hover: 0 4px 10px #0006, 0 24px 40px #000a;
    --cell-0: rgba(169, 184, 214, 0.1);
    --cell-1: #2c3546;
    --cell-2: #435273;
    --cell-3: #6577a0;
    --cell-4: #a9b8d6;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--select);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 24px;
  z-index: 20;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--text);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

/* ── top bar ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  height: var(--bar);
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  letter-spacing: 0.005em;
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  transition:
    color 0.35s var(--ease-out),
    background-color 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out);
}

.topbar.is-light {
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--paper-line);
}

.topbar-name {
  margin-right: auto;
  font-family: var(--display);
  font-size: 14px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.topbar.is-light .topbar-name {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  color: var(--text);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.topbar a {
  color: inherit;
  text-decoration: underline 1px transparent;
  text-underline-offset: 0.25em;
  transition: text-decoration-color 0.25s var(--ease-out);
}

.topbar a:hover,
.topbar a:focus-visible {
  text-decoration-color: currentColor;
  outline: none;
}

/* ── hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: calc(var(--bar) + 80px) var(--gutter) calc(var(--strip) + 80px);
  color: var(--text);
  background: var(--paper);
  overflow: hidden;
}

.hero-shader {
  /* hero-shader.js sizes and places the plate */
  position: absolute;
  z-index: 0;
  width: 0;
  height: 0;
  display: block;
  border: 1px solid var(--paper-line);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s var(--ease-out);
}

.hero-shader.is-on {
  opacity: 1;
}

.hero-shader[hidden] {
  display: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}

.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 7.8vw, 112px);
  line-height: 1;
  letter-spacing: -0.035em;
}

/* ── hero index ── */
.index {
  list-style: none;
  width: min(100%, 600px);
  display: flex;
  gap: 32px;
  margin: 40px 0 0;
  padding: 0;
  font-family: var(--display);
  font-size: 16px;
  line-height: 2;
}

.index-row {
  flex: 1;
}

.index-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line-strong);
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.index-link:focus-visible {
  outline: none;
}

.index-number {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}

.index-label {
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease-out);
}

.index-link:hover .index-label,
.index-link:focus-visible .index-label {
  border-bottom-color: var(--text-soft);
}

.index-arrow {
  margin-left: auto;
  font-family: var(--sans);
  color: var(--text-soft);
  transition: transform 0.3s var(--ease-out);
}

.index-link:hover .index-arrow,
.index-link:focus-visible .index-arrow {
  transform: translate(2px, -2px);
}

@media (hover: hover) {
  .index:hover .index-row:not(:hover) {
    opacity: 0.7;
    transition: opacity 0.3s var(--ease-out);
  }
}

/* ── bottom strip ── */
.strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: var(--strip);
  padding: 0 var(--gutter);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--paper-line);
  font-size: 12.5px;
  color: var(--text-soft);
}

.strip a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.strip a svg {
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(2px); }
}

/* ── content ── */
.content {
  position: relative;
  z-index: 1;
  background: var(--paper);
  padding: clamp(56px, 10vh, 120px) 24px 64px;
}

.intro,
.block,
.colophon {
  width: min(100%, var(--measure));
  margin: 0 auto;
}

.intro,
.block {
  scroll-margin-top: calc(var(--bar) + 16px);
}

.intro {
  padding-bottom: var(--section-pad);
}

.intro-text {
  max-width: 760px;
  margin: 0;
  font-size: clamp(20px, 2.3vw, 27px);
  line-height: 1.55;
}

.intro-text + .intro-text {
  margin-top: 1em;
}

.intro-text a {
  color: var(--slate);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: text-decoration-color 0.25s var(--ease-out);
}

.intro-text a:hover {
  text-decoration-color: currentColor;
}

.intro .block-title {
  margin-bottom: clamp(20px, 3vh, 28px);
}

.block {
  padding: var(--section-pad) 0;
  border-top: 1px solid var(--paper-line);
}

.block-title {
  margin: 0 0 clamp(24px, 4vh, 36px);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.block-number {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  vertical-align: 0.9em;
  margin-right: 6px;
}

.block-lede {
  margin: -8px 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-soft);
}

/* lede introducing the second half of a section */
.block-lede.is-mid {
  margin: clamp(28px, 4vh, 40px) 0 16px;
  padding-top: clamp(28px, 4vh, 40px);
  border-top: 1px solid var(--paper-line);
}

.block-lede a,
.rows a {
  color: inherit;
  text-decoration: underline 1px var(--paper-line);
  text-underline-offset: 0.25em;
  transition: text-decoration-color 0.25s var(--ease-out);
}

.rows a {
  color: var(--text);
}

.block-lede a:hover,
.rows a:hover {
  text-decoration-color: currentColor;
}

/* ── gallery ── */
.photo-gallery {
  width: min(100%, var(--measure));
  margin: 8px auto 0;
  padding: 24px 20px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px 20px;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.photo-print {
  display: block;
  flex: 0 0 calc((100% - 40px) / 3);
  min-width: 0;
  padding: 7px 7px 0;
  background: var(--card);
  color: var(--text-soft);
  text-decoration: none;
  box-shadow: var(--print-shadow);
  transform: rotate(var(--tilt));
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
  cursor: zoom-in;
}

.photo-print img {
  display: block;
  width: 100%;
  height: auto;
}

.print-caption {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 2px 10px;
  font-family: var(--display);
  font-size: 13px;
  line-height: 1.25;
}

.print-year {
  flex-shrink: 0;
  font-family: var(--mono);
  margin-left: auto;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.js .photo-gallery:not(.is-visible) .photo-print {
  transform: translateY(28px) rotate(0);
}

/* The staggered entrance is an animation, not a transition delay, so it
   doesn't linger and slow down later hovers. */
.js .photo-gallery.is-visible .photo-print {
  animation: print-in 0.45s var(--ease-out) backwards;
  animation-delay: calc(var(--order) * 80ms);
}

@keyframes print-in {
  from { transform: translateY(28px) rotate(0); }
}

.photo-print:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 4px;
  z-index: 2;
  transform: translateY(-12px) rotate(0);
}

@media (hover: hover) {
  .photo-print:hover {
    z-index: 2;
    transform: translateY(-12px) rotate(0) scale(1.035);
    box-shadow: var(--print-shadow-hover);
  }
}

.video-print {
  position: relative;
}

.video-play {
  position: absolute;
  top: calc(50% - 16px);
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding-left: 3px;
  border-radius: 50%;
  background: #111b;
  color: #fff;
  font-size: 20px;
}

/* ── gallery viewer ── */
.photo-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 64px 24px 80px;
  border: 0;
  background: rgba(17, 18, 19, 0.96);
  color: var(--ink);
}

.photo-viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fx-fade-in 0.25s ease-out;
}

/* Keep scroll gestures from reaching the page behind the open viewer. */
.photo-viewer:modal {
  overscroll-behavior: contain;
}

.photo-viewer::backdrop {
  background: #111;
  overflow: hidden;
  overscroll-behavior: contain;
}

.viewer-image,
.viewer-video {
  max-width: 100%;
  max-height: 100%;
}

.viewer-image {
  display: block;
  object-fit: contain;
}

.viewer-image[hidden],
.viewer-video[hidden] {
  display: none;
}

.photo-viewer button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: 24px var(--sans);
  cursor: pointer;
}

.photo-viewer button:hover {
  background: #ffffff18;
}

.photo-viewer button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.viewer-close {
  position: absolute;
  right: 20px;
  top: 14px;
}

.viewer-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.viewer-count {
  min-width: 48px;
  font: 13px var(--display);
  text-align: center;
}

/* ── activity ── */
/* Cells grow to fill the column, down to 9px before the graph scrolls. */
#activity {
  container-type: inline-size;
}

.graph-wrap,
.graph-legend {
  --gap: 3px;
  --cell: max(9px, min(14px, calc((100cqw - 52 * var(--gap)) / 53)));
}

.graph-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.graph-months {
  display: grid;
  grid-template-columns: repeat(53, var(--cell));
  gap: var(--gap);
  width: max-content;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-faint);
}

.graph {
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  grid-auto-flow: column;
  grid-auto-columns: var(--cell);
  gap: var(--gap);
  width: max-content;
  min-height: calc(7 * var(--cell) + 6 * var(--gap));
}

.cell {
  display: block;
  width: var(--cell, 9px);
  height: var(--cell, 9px);
  border-radius: 2px;
  background: var(--cell-0);
}

.cell.pad { visibility: hidden; }
.cell.l1 { background: var(--cell-1); }
.cell.l2 { background: var(--cell-2); }
.cell.l3 { background: var(--cell-3); }
.cell.l4 { background: var(--cell-4); }

.graph-legend {
  max-width: calc(53 * var(--cell) + 52 * var(--gap)); /* lines up with the graph */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-faint);
}

.graph-legend span + .cell,
.graph-legend .cell + span {
  margin-left: 4px;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
}

.rows li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--paper-line);
}

.rows li:first-child {
  border-top: none;
  padding-top: 0;
}

.row-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* artifact rows carry a full-width description under the name line */
.rows .has-blurb {
  flex-wrap: wrap;
  row-gap: 2px;
}

.row-blurb {
  flex-basis: 100%;
  font-size: 13.5px;
  color: var(--text-soft);
}

.row-leader {
  flex: 1 1 0;
  min-width: 16px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--paper-line);
  letter-spacing: 2px;
}

.row-leader::before {
  content: "..........................................................................................";
}

.row-count {
  margin-left: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.row-when {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* artifacts read as cards: each one is a whole page you can open */
#artifact-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

#artifact-list li,
#artifact-list li:first-child {
  position: relative;
  padding: 18px 20px 20px;
  border: 1px solid var(--paper-line);
  border-radius: 10px;
  background: var(--card);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

#artifact-list .row-leader {
  display: none;
}

#artifact-list .row-name {
  flex: 1 1 auto;
  font-family: var(--display);
  font-size: 17px;
}

#artifact-list .row-when {
  margin-left: auto;
}

#artifact-list .row-blurb {
  margin-top: 6px;
}

/* The whole card is the link's hit area. */
#artifact-list a {
  border-bottom: 0;
}

#artifact-list a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

#artifact-list a:focus-visible {
  outline: none;
}

#artifact-list li:focus-within {
  outline: 2px solid var(--slate);
  outline-offset: 3px;
}

@media (hover: hover) {
  #artifact-list li:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--print-shadow);
  }
}

/* ── footer ── */
.colophon {
  margin-top: var(--section-pad);
  padding-top: 24px;
  border-top: 1px solid var(--paper-line);
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-faint);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.colophon a {
  color: inherit;
  text-decoration: underline 1px transparent;
  text-underline-offset: 0.25em;
}

.colophon a:hover {
  text-decoration-color: currentColor;
}

/* ── entrance effects ── */
/* Only hide when JS is running; without it the page stays visible. */
.js .fx {
  opacity: 0;
}

.is-ready .fx {
  animation: fx-el-in 0.9s var(--ease-out) forwards;
  animation-delay: calc(0.25s + var(--i, 0) * 0.09s);
}

.is-ready .title.fx {
  animation-name: fx-title-in;
  animation-duration: 1.1s;
}

/* The top bar is position:fixed and later gains backdrop-filter. A filter left
   behind by animation-fill-mode:forwards nests the backdrop group in WebKit,
   so fade it with opacity only and leave its filter at none. */
.is-ready .topbar.fx {
  animation-name: fx-fade-in;
}

.js .reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(10px);
  transition:
    opacity 0.9s var(--ease-out),
    filter 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
}

@keyframes fx-title-in {
  0% { opacity: 0; filter: blur(26px); }
  45% { opacity: 1; }
  100% { opacity: 1; filter: blur(0); }
}

@keyframes fx-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fx-el-in {
  0% { opacity: 0; filter: blur(12px); }
  100% { opacity: 1; filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fx,
  .reveal,
  .strip a svg {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }
  .photo-print,
  .js .photo-gallery.is-visible .photo-print,
  .photo-viewer[open] {
    animation: none;
    transition: none;
  }
  .js .photo-gallery:not(.is-visible) .photo-print {
    transform: rotate(var(--tilt));
  }
}

/* ── small screens ── */
@media (max-width: 720px) {
  .topbar-name {
    display: none;
  }
  .topbar-links {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: 88svh;
    padding-bottom: calc(var(--strip) + 48px);
  }
  .title {
    font-size: clamp(38px, 10vw, 60px);
  }
  .index {
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-top: 32px;
  }
  .index-row {
    flex: 1 1 120px;
  }
  .content {
    padding-top: 56px;
    padding-bottom: 32px;
  }
  .photo-gallery {
    margin-top: 0;
    padding: 16px 4px 24px;
    gap: 24px 16px;
  }
  .photo-print {
    flex-basis: calc((100% - 16px) / 2);
    padding: 4px;
  }
  .row-leader {
    display: none;
  }
  .row-when {
    margin-left: auto;
    padding-left: 8px;
  }
  .colophon {
    gap: 20px;
  }
  .colophon-links {
    gap: 12px 20px;
  }
}

@media (max-width: 480px) {
  .row-name {
    flex: 1 1 auto;
  }
  .colophon {
    flex-direction: column;
  }
}

/* The two contact links stop fitting the bar below ~337px */
@media (max-width: 380px) {
  .topbar {
    padding: 0 16px;
    font-size: 11.5px;
  }
}
