/* Object Project
   Vanilla CSS. Encode Sans Semi Expanded, two-column grid,
   header 15vh, footer 5vh, 5% side padding. */

:root {
  --ink: #000;
  --paper: #fff;
  --tint: #f4f4f3;
  --rule: rgba(0, 0, 0, 0.16);
  --pad: 5%;
  --header-h: 15vh;
  --footer-h: 5vh;
  --sans: "Encode Sans Semi Expanded", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; }

.shell {
  width: 100%;
  padding-inline: var(--pad);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
}
.skip-link:focus { left: 0; }

/* ---------- header: 15vh, two columns, text left ---------- */

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  column-gap: var(--pad);
  height: var(--header-h);
  min-height: var(--header-h);
  padding-inline: var(--pad);
  border-bottom: 1px solid var(--ink);
  text-align: left;
}

.masthead-intro {
  min-width: 0;
  align-self: center;
}

.eyebrow {
  margin: 0 0 clamp(0.3rem, 0.9vh, 0.8rem);
  font-size: clamp(0.52rem, 1.1vh, 0.7rem);
  line-height: 1.3;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.title {
  margin: 0;
  font-size: clamp(1.2rem, 4.4vh, 3.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.masthead-meta {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: clamp(0.4rem, 1.1vh, 1rem);
}

.lede {
  margin: 0;
  max-width: 64ch;
  font-size: clamp(0.6rem, 1.25vh, 0.78rem);
  line-height: 1.35;
  color: rgba(0, 0, 0, 0.66);
}

/* ---------- nav ---------- */

.nav {
  min-width: 0;
}

.nav-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(0.75rem, 2vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.nav-list a {
  display: flex;
  align-items: baseline;
  gap: 0.7em;
  padding: clamp(0.1rem, 0.7vh, 0.45rem) 0;
  font-size: clamp(0.52rem, 1.2vh, 0.75rem);
  line-height: 1.3;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--rule);
  transition: padding-left 0.18s ease, border-color 0.18s ease;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  padding-left: 0.5rem;
  border-bottom-color: var(--ink);
}

.nav-num { color: rgba(0, 0, 0, 0.4); }

.nav-list a[aria-current="true"] {
  border-bottom-color: var(--ink);
  box-shadow: inset 0.18em 0 0 var(--ink);
}

/* ---------- sections: two columns ---------- */

.section {
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.section > .shell {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: start;
  column-gap: var(--pad);
  padding-block: clamp(2.5rem, 7vh, 6rem);
}

.section-tint { background: var(--tint); }

.col { min-width: 0; }

.head {
  position: sticky;
  top: 1rem;
  min-width: 0;
  padding-right: 0.5rem;
}

.head-num {
  margin: 0 0 clamp(0.4rem, 1.2vh, 0.9rem);
  font-size: clamp(0.62rem, 1.35vh, 0.8rem);
  letter-spacing: 0.24em;
  color: rgba(0, 0, 0, 0.42);
}

.head-title {
  margin: 0;
  font-size: clamp(1.4rem, 3.6vh, 2.9rem);
  line-height: 1;
  letter-spacing: 0.002em;
}

.head-text {
  margin: clamp(0.7rem, 2vh, 1.4rem) 0 0;
  max-width: 38ch;
  font-size: clamp(0.78rem, 1.7vh, 1rem);
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.62);
}

/* ---------- introduction: project title + reflection ---------- */

.prose {
  max-width: 58ch;
}

.prose p {
  margin: 0;
  font-size: clamp(0.82rem, 1.8vh, 1.05rem);
  line-height: 1.45;
  letter-spacing: 0.004em;
  color: rgba(0, 0, 0, 0.72);
}

.prose p + p {
  margin-top: clamp(0.8rem, 2.2vh, 1.5rem);
  padding-top: clamp(0.8rem, 2.2vh, 1.5rem);
  border-top: 1px solid var(--rule);
  font-size: clamp(0.86rem, 1.95vh, 1.18rem);
  color: var(--ink);
}

#introduction .head-title {
  max-width: 14ch;
  font-size: clamp(1.2rem, 2.9vh, 2.35rem);
  line-height: 1.05;
}

/* ---------- figures ---------- */

.figure { margin: 0; }

.frame {
  border: 1px solid var(--rule);
  background: var(--paper);
  overflow: hidden;
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.frame-object { aspect-ratio: 3360 / 1214; }

.frame-pdf { aspect-ratio: 36 / 48; }

.frame-pdf iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.figure-poster { max-width: 560px; }

.cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  margin-top: 0.8rem;
  font-size: clamp(0.58rem, 1.25vh, 0.7rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}

.cap-name { color: var(--ink); }

.cap-link {
  margin-left: auto;
  padding-bottom: 1px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
}

.cap-link:hover { background: var(--ink); color: var(--paper); }

/* ---------- symbol groups ---------- */

.group + .group {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  padding-top: clamp(2rem, 5vh, 3.5rem);
  border-top: 1px solid var(--rule);
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.1rem;
  margin-bottom: clamp(0.9rem, 2.4vh, 1.5rem);
}

.group-name {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vh, 1.7rem);
  line-height: 1;
}

.group-meta {
  margin: 0;
  font-size: clamp(0.56rem, 1.2vh, 0.68rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.48);
}

/* ---------- grids ---------- */

.grid {
  display: grid;
  gap: clamp(0.5rem, 1.2vh, 1rem);
  align-items: start;
}

.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.cell {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  text-align: left;
  transition: border-color 0.15s ease;
}

.cell:hover,
.cell:focus-visible { border-color: var(--ink); }

.cell-figure {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--paper);
}

.cell-figure img,
.cell-figure canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.cell-figure img { object-fit: contain; }

.grid-landscape .cell-figure { aspect-ratio: 1224 / 792; }

/* p5.svgkit plates fade in once the vector file has loaded */

.cell-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cell-plate.is-ready::after { opacity: 0; }

.cell-plate.is-error::after { opacity: 0; }

.cell-plate.is-error::before {
  content: "svg unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
}

.cell-label {
  display: block;
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--rule);
  font-size: clamp(0.55rem, 1.15vh, 0.64rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  color: rgba(0, 0, 0, 0.55);
}

/* ---------- footer: 5vh ---------- */

.footer {
  display: flex;
  align-items: center;
  height: var(--footer-h);
  min-height: var(--footer-h);
}

.footer > .shell {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.25rem;
}

.footer-title {
  margin: 0;
  font-size: clamp(0.75rem, 1.6vh, 1rem);
  letter-spacing: 0.04em;
}

.footer-note {
  margin: 0;
  font-size: clamp(0.56rem, 1.15vh, 0.7rem);
  letter-spacing: 0.06em;
  color: rgba(0, 0, 0, 0.55);
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 2vw, 1.5rem);
  padding: clamp(1rem, 4vw, 2.5rem);
  background: #000;
}

.lightbox[hidden] { display: none; }

.lb-figure {
  margin: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  max-height: 100%;
}

.lb-plate {
  position: relative;
  height: 76vh;
  width: auto;
  max-width: 92vw;
  aspect-ratio: 3 / 4;
  background: #fff;
  flex: none;
}

.lb-plate[hidden] { display: none; }

.lb-plate canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#lb-image {
  max-height: 76vh;
  max-width: 92vw;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
}

#lb-image[hidden] { display: none; }

.lb-caption {
  font-size: clamp(0.55rem, 1.2vh, 0.68rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
}

.lb-caption b { font-weight: 400; color: rgba(255, 255, 255, 0.55); }

.lb-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
}

.lb-tools[hidden] { display: none; }

.lb-tool {
  appearance: none;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: clamp(0.55rem, 1.2vh, 0.66rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lb-tool[hidden] { display: none; }

.lb-tool:hover:not(:disabled) {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.lb-tool:disabled { opacity: 0.4; cursor: progress; }

.lb-close,
.lb-step {
  flex: none;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lb-close:hover,
.lb-step:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.lb-close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.3rem;
}

.lb-step { width: 2.75rem; height: 2.75rem; font-size: 1.5rem; }

/* ---------- misc ---------- */

.noscript {
  margin: 0;
  padding: var(--pad);
  border-top: 1px solid var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- responsive ---------- */

@media (max-width: 1600px) {
  .grid-6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1280px) {
  .grid-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .masthead {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    height: auto;
    min-height: var(--header-h);
    padding-block: 2rem;
    row-gap: 1.75rem;
  }
  .title { font-size: clamp(1.5rem, 5vh, 2.6rem); }
  .lede { max-width: 60ch; }
  .section > .shell { grid-template-columns: minmax(0, 1fr); row-gap: 1.75rem; }
  .head { position: static; }
  .head-title { font-size: clamp(1.4rem, 4vh, 2.2rem); }
  .head-text { max-width: 60ch; }
  .prose { max-width: 60ch; }
  #introduction .head-title { font-size: clamp(1.2rem, 3.4vh, 1.9rem); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .cap-link { margin-left: 0; }
  .lb-step { display: none; }
  .footer { height: auto; min-height: var(--footer-h); padding-block: 1rem; }
}

@media (max-height: 620px) {
  .masthead {
    height: auto;
    min-height: var(--header-h);
    padding-block: 1.5rem;
  }
  .head { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
