/* ============================================================
   Made with Ji
   White ground, black type, no accent colour.
   Two type roles only: a heavy display face for names, and a
   small text face for everything else. Pictures are never cropped.
   One exception to both rules: the Hyunbo Calligraphy mark on the Ink
   pages keeps its own red seal and its own lettering.
   ============================================================ */

:root {
  --black: #000;
  --white: #fff;
  /* --grey-display is 3.5:1 on white: ONLY for heavy type of 24px and up (the grey half of a Pair). */
  --grey-display: #8a8a8a;
  /* --grey is 6.5:1 on white: all small secondary text. */
  --grey: #5e5e5e;
  --hair: #d6d6d6;
  --band: #f4f4f4;

  --display: 'Inter Tight', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

  /* type scale: rem + vw so browser zoom still works. px values are at 390 and 1440 wide. */
  --d1: clamp(4rem, 2.887rem + 4.571vw, 7rem); /* 64 to 112: the four material words only */
  --d2: clamp(2.25rem, 1.556rem + 2.857vw, 4.125rem); /* 36 to 66: titles */
  --d3: clamp(1.75rem, 1.472rem + 1.143vw, 2.5rem); /* 28 to 40: section and row names */
  --t1: clamp(1.1875rem, 1.118rem + 0.286vw, 1.375rem); /* 19 to 22: lead */
  --t2: 1.0625rem; /* 17: reading text */
  --t3: 0.875rem; /* 14: captions, navigation, data. Nothing on the site is smaller. */

  --m: clamp(1rem, 2.78vw, 2.5rem); /* page margin */
  --g: 1.5rem; /* gutter */
  --maxw: 110rem;
  --gap-xl: clamp(4.5rem, 9vw, 8rem);
  --bar-h: 3rem;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font: 400 var(--t2) / 1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
table {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  /* the transparent outline is repainted in a system colour in forced-colors mode */
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black);
}

[hidden] {
  display: none !important;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  left: var(--m);
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: var(--black);
  color: var(--white);
  font-size: var(--t3);
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--m);
}

/* ---------- type ---------- */
.d1,
.d2,
.d3 {
  font-family: var(--display);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.d1 {
  font-size: var(--d1);
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.d1 .name {
  text-transform: uppercase;
}

.d2 {
  font-size: var(--d2);
  line-height: 1;
  letter-spacing: -0.025em;
}

.d3 {
  font-size: var(--d3);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.pair .fact {
  color: var(--grey-display);
}

/* beside a material word the grey half is one step smaller, so only the four words are the largest type */
.d1 .fact {
  font-size: var(--d2);
  line-height: 1;
  letter-spacing: -0.025em;
}

@media (max-width: 699px) {
  .d1 .fact {
    display: block;
    margin-top: 0.15em;
  }
}

.stmt {
  max-width: 17em;
}

.pair a:hover {
  text-decoration: none;
}

.pair a:hover .name {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.1em;
}

.label {
  font: 400 var(--t3) / 1.43 var(--text);
  color: var(--grey);
  letter-spacing: 0;
}

.label a {
  text-decoration: underline;
}

.lead {
  font-size: var(--t1);
  line-height: 1.45;
}

.measure {
  max-width: 46rem;
}

.ext {
  color: var(--grey);
}

.more,
.more a {
  font-size: var(--t3);
  font-weight: 500;
}

a.more,
.more a {
  text-decoration: underline;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-top: 1.25rem;
}

.links .more {
  padding: 0.5rem 0;
}

.links span.more {
  padding: 0;
}

.links .more a {
  display: inline-block;
  padding: 0.5rem 0;
}

.caplines {
  margin-top: 1.5rem;
  font-size: var(--t3);
  line-height: 1.43;
}

/* ---------- header: the four materials are always on screen ---------- */
.hdr {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: center;
  min-height: 4rem;
  font-size: var(--t3);
}

.wordmark,
.wordmark a {
  font: 800 1.125rem/1.1 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.hdr .wordmark {
  grid-column: 1 / span 4;
  justify-self: start;
  padding: 0.5rem 0;
}

.wordmark:hover,
.wordmark a:hover {
  text-decoration: none;
}

/* the material links start on the same line as every picture column */
.hdr-mat {
  grid-column: 5 / span 5;
  display: flex;
  gap: clamp(1.25rem, 2.4vw, 2.5rem);
}

.hdr-util {
  grid-column: 10 / -1;
  justify-self: end;
  display: flex;
  gap: 1.5rem;
}

.hdr nav a {
  padding: 0.75rem 0;
}

.hdr-mat a {
  font-weight: 600;
}

.hdr nav a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}

@media (max-width: 699px) {
  .hdr {
    grid-template-columns: 1fr auto;
    min-height: 0;
  }

  .hdr .wordmark {
    grid-column: 1;
    grid-row: 1;
    min-height: 3rem;
    display: flex;
    align-items: center;
    font-size: 1rem;
  }

  .hdr-util {
    grid-column: 2;
    grid-row: 1;
  }

  .hdr-mat {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-inline: calc(-1 * var(--m));
    border-top: 1px solid var(--hair);
    border-bottom: 1px solid var(--hair);
  }

  .hdr .hdr-mat a {
    display: grid;
    place-items: center;
    min-height: 2.75rem;
    padding: 0;
  }

  .hdr .hdr-mat a[aria-current] {
    text-decoration: none;
    box-shadow: inset 0 -2px 0 var(--black);
  }

  .hdr .hdr-mat a[aria-current]:focus-visible {
    box-shadow: inset 0 -2px 0 var(--black), inset 0 0 0 2px var(--white), inset 0 0 0 4px var(--black);
  }
}

/* ---------- the axis: words in columns 1 to 4, pictures in 5 to 12 ---------- */
.axis,
.entry {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--g);
  align-items: start;
}

.words,
.entry-words {
  grid-column: 1 / span 4;
  min-width: 0;
}

.pics,
.entry-pics {
  grid-column: 5 / -1;
  min-width: 0;
}

.bleed {
  margin-right: calc(-1 * var(--m));
}

@media (min-width: 700px) and (max-width: 1023px) {
  .words,
  .entry-words {
    grid-column: 1 / span 5;
  }

  .pics,
  .entry-pics {
    grid-column: 6 / -1;
  }

  .hdr-mat {
    grid-column: 6 / span 5;
    gap: 1.25rem;
  }

  .hdr-util {
    grid-column: 11 / -1;
    gap: 1rem;
  }
}

@media (max-width: 699px) {
  .axis {
    display: block;
  }

  .axis > .words {
    margin-bottom: 1.25rem;
  }

  /* on small screens the title comes first, then the picture, then the data */
  .entry {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .entry-words,
  .entry-pics {
    display: contents;
  }

  .entry .tb {
    order: 1;
  }

  .entry .lead.plate {
    order: 2;
  }

  .entry-info {
    order: 3;
  }

  .plate-rest {
    order: 4;
  }
}

/* ---------- title block ---------- */
.tb {
  container-type: inline-size;
}

.tb .label {
  margin-bottom: 0.75rem;
}

.tb .pair.d2 .fact {
  display: block;
}

/* titles are sized by the column they sit in, not by the window */
@supports (width: 1cqi) {
  .entry .tb .pair.d2 {
    font-size: min(var(--d2), max(2.25rem, 13.5cqi));
  }
}

.tb .pair.d2.is-long,
.entry .tb .pair.d2.is-long {
  font-size: var(--d3);
  line-height: 1.05;
}

.tb .lead,
.byline {
  margin-top: 0.75rem;
}

.byline {
  font-size: var(--t3);
}

.byline a {
  text-decoration: underline;
}

/* ---------- Hyunbo's seal and the Hyunbo Calligraphy mark (Ink pages) ----------
   The seal's red is Hyunbo's own, the one colour the site allows itself.
   Its size comes from the --seal set beside it in the markup. */
.seal {
  display: block;
  width: var(--seal);
  height: auto;
  flex: none;
}

.tb > .seal {
  margin-bottom: 1.25rem;
}

.byline .seal {
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.maker {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  color: var(--black);
  text-decoration: none;
}

/* proportions from the logo: the name is twice the size of CALLIGRAPHY, and the seal
   stands about 1.6 times as tall as the two lines together */
.maker-words {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.maker-name {
  font: 600 1.75rem / 0.8 var(--text);
  letter-spacing: -0.03em;
}

.maker-kind {
  font: 500 var(--t3) / 0.8 var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey);
}

a.maker:hover {
  text-decoration: none;
}

a.maker:hover .maker-name {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.1em;
}

.page-tb {
  margin-top: clamp(2rem, 5vw, 4rem);
  margin-bottom: 1.5rem;
}

.entry {
  margin-top: clamp(1.5rem, 4vw, 3rem);
}

.entry-info {
  margin-top: 1.5rem;
}

.entry-info > * + * {
  margin-top: 1.25rem;
}

.entry-info > .caplines:first-child {
  margin-top: 0;
}

.text .label {
  margin-bottom: 0.5rem;
}

.poem {
  max-width: 34em;
}

/* each line of verse is its own block; a line that wraps hangs under itself */
.pl {
  display: block;
  padding-left: 1.25em;
  text-indent: -1.25em;
}

.pl-gap {
  display: block;
  height: 1em;
}

/* ---------- data ---------- */
.meta {
  font-size: var(--t3);
  line-height: 1.43;
  border-bottom: 1px solid var(--hair);
  max-width: 46rem;
}

.meta > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--hair);
}

.meta dt {
  color: var(--grey);
}

.meta dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.meta a {
  text-decoration: underline;
}

.acc {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  max-width: 46rem;
}

.acc + .acc {
  border-top: 0;
}

.acc summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3rem;
  font-size: var(--t3);
  cursor: pointer;
  list-style: none;
}

.acc summary::-webkit-details-marker {
  display: none;
}

.acc summary::after {
  content: '+';
  font-size: 1.25rem;
  line-height: 1;
}

.acc[open] summary::after {
  content: '\2212';
}

.acc > :not(summary) {
  padding-bottom: 1rem;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 1.5rem;
  border-top: 1px solid var(--hair);
  font-size: var(--t3);
}

.lead + .jump,
.lead + .reg-tools,
.jump[hidden] + .reg-tools {
  margin-top: 1.75rem;
}

.jump .label {
  min-width: 4.5rem;
}

.jump a {
  padding: 0.75rem 0;
}

.jump .n {
  color: var(--grey);
}

.jump a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

/* ---------- pictures ---------- */
.cap {
  display: block;
  margin-top: 0.625rem;
  font-size: var(--t3);
  line-height: 1.43;
}

.cap-top {
  display: block;
}

.cap-ref,
.cap-facts {
  color: var(--grey);
}

.cap-title {
  font-weight: 600;
}

.cap-facts {
  display: block;
}

.cell {
  display: block;
}

.cell:hover {
  text-decoration: none;
}

.cell:hover .cap-title {
  text-decoration: underline;
}

/* a caption never makes its cell wider than the picture above it */
.cell .cap {
  width: 0;
  min-width: 100%;
}

/* pale paper must not dissolve into the white page */
.cell-ink img,
.lead-ink img {
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

/* contact strip: one fixed height, natural widths, scrolls sideways */
.strip {
  --h: 280px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #b5b5b5 transparent;
}

.strip-m {
  --h: 240px;
}

.strip {
  margin-top: -4px;
}

.strip ul {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: 4px var(--m) 0.75rem 0;
}

.strip li {
  flex: none;
  min-width: 9.5rem;
}

.strip-m li {
  min-width: 0;
}

.strip img {
  height: var(--h);
  width: auto;
  max-width: none;
}

.strip-tools {
  display: flex;
  justify-content: flex-end;
  gap: 1.25rem;
  padding-right: var(--m);
  margin-bottom: 0.5rem;
  font-size: var(--t3);
}

.strip-tools button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.5rem 0;
  cursor: pointer;
  text-decoration: underline;
}

.strip-tools button[aria-disabled='true'] {
  color: var(--grey);
  text-decoration: none;
  cursor: default;
}

/* fingers scroll the strip directly */
@media (pointer: coarse) {
  .strip-tools {
    display: none;
  }
}

@media (max-width: 1023px) {
  .strip {
    --h: 220px;
  }

  .strip-m {
    --h: 200px;
  }
}

@media (max-width: 699px) {
  .bleed {
    margin-inline: calc(-1 * var(--m));
  }

  .bleed .strip ul {
    padding-left: var(--m);
  }
}

@media (max-width: 599px) {
  .strip {
    --h: 180px;
  }

  .strip-m {
    --h: 150px;
  }
}

/* hanging row: works share a height and a top edge, and take their natural widths */
.hang {
  --h: 280px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2.5rem 1.5rem;
}

.hang li {
  flex: none;
  min-width: 9.5rem;
}

.hang img {
  height: var(--h);
  width: auto;
  max-width: none;
}

@media (min-width: 600px) {
  .hang li {
    max-width: 100%;
  }

  .hang img {
    height: auto;
    max-height: var(--h);
    max-width: 100%;
  }
}

@media (max-width: 1023px) {
  .hang {
    --h: 220px;
  }
}

@media (max-width: 599px) {
  .hang {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1rem;
  }

  .hang li {
    min-width: 0;
  }

  /* each picture stands on the same baseline inside a 4:5 box */
  .hang picture {
    display: block;
    aspect-ratio: 4 / 5;
  }

  .hang img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left bottom;
    outline: 0;
  }
}

.script {
  margin-top: clamp(3rem, 6vw, 5rem);
  scroll-margin-top: 1.5rem;
}

.script .pair {
  margin-bottom: 1.25rem;
}

/* plates on a roll page */
.plate {
  margin-bottom: var(--g);
}

.plate figcaption {
  margin-top: 0.5rem;
  font-size: var(--t3);
  color: var(--grey);
}

.plate figcaption a {
  text-decoration: underline;
}

.plate a {
  display: block;
}

.plate-wide img {
  width: 100%;
}

.plate-tall img,
.lead-ink img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 7rem);
}

.lead-ink img {
  max-width: min(100%, 45rem);
}

.featured .plate img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
}

.plate-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--g);
}

.plate-pair img {
  width: 100%;
}

@media (max-width: 699px) {
  .plate-tall img,
  .lead-ink img,
  .featured .plate img {
    max-height: 80svh;
  }

  .entry .lead.plate {
    margin-top: 1.25rem;
  }

  .plate-pair {
    gap: 0.75rem;
  }
}

@media (min-width: 110rem) {
  .bleed,
  .more-in .strip {
    margin-right: 0;
  }

  .strip ul {
    padding-right: 0;
  }
}

/* ---------- rows (Light index) ---------- */
.rows {
  border-bottom: 1px solid var(--hair);
}

.row {
  padding: 1.5rem 0 1.25rem;
  border-top: 1px solid var(--hair);
}

.row .label {
  margin-bottom: 0.4rem;
}

.row .caplines {
  margin-top: 0.75rem;
  color: var(--grey);
}

/* ---------- home: one square, four materials ---------- */
.home main {
  min-height: 100svh;
}

.home-stage {
  /* the square: as large as the window allows, with room for the labels above and below */
  --s: min(calc(100vw - 2 * var(--m) - 7rem), calc(100svh - 14rem), 44rem);
  --gap: clamp(6px, 1.1vmin, 12px);
  min-height: 100svh;
  overflow-x: clip;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: clamp(1rem, 3vh, 2rem) var(--m);
}

.home-mark {
  align-self: start;
  font: 800 1rem/1 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.home-mark a {
  display: inline-block;
  padding: 0.5rem 0;
}

.home-mark a:hover {
  text-decoration: none;
}

.quad {
  align-self: center;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--gap);
  width: var(--s);
  height: var(--s);
  margin: 2.75rem 0;
  perspective: 1400px;
}

.tile {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  display: block;
  transform-style: preserve-3d;
  transition:
    transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 650ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 450ms ease,
    opacity 450ms ease;
}

/* each tile lifts from the centre of the square, so its outer corner comes toward you */
.tile-light {
  transform-origin: 100% 100%;
  --lx: -1;
  --ly: -1;
}

.tile-clay {
  transform-origin: 0% 100%;
  --lx: 1;
  --ly: -1;
}

.tile-ink {
  transform-origin: 100% 0%;
  --lx: -1;
  --ly: 1;
}

.tile-road {
  transform-origin: 0% 0%;
  --lx: 1;
  --ly: 1;
}

.tile-img {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #efece6;
  transition:
    filter 450ms ease,
    opacity 450ms ease;
}

.tile-img::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.tile-img img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--focus);
  transform: scale(var(--z));
  transform-origin: var(--focus);
  filter: var(--img-filter, none);
  transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* labels sit outside the square, at its four corners */
.tile-label {
  position: absolute;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  white-space: nowrap;
  font-size: var(--t3);
  line-height: 1;
  transition: opacity 300ms ease;
}

.tile-light .tile-label,
.tile-clay .tile-label {
  bottom: calc(100% + 0.9rem);
}

.tile-ink .tile-label,
.tile-road .tile-label {
  top: calc(100% + 0.9rem);
}

.tile-light .tile-label,
.tile-ink .tile-label {
  left: 0;
}

.tile-clay .tile-label,
.tile-road .tile-label {
  right: 0;
  flex-direction: row-reverse;
}

.tile-name {
  font: 800 1.125rem/1 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.tile-meaning {
  color: var(--grey);
  opacity: 0;
  transform: translateY(0.25rem);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.tile:hover,
.tile:focus-visible {
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .tile:hover,
  .tile:focus-visible {
    z-index: 2;
    transform: translateZ(90px) scale(1.07) rotateX(calc(var(--ly) * 7deg + var(--rx))) rotateY(calc(var(--lx) * -7deg + var(--ry)));
    box-shadow: 0 45px 80px -30px rgba(0, 0, 0, 0.5);
  }

  .tile:hover .tile-img img,
  .tile:focus-visible .tile-img img {
    transform: scale(calc(var(--z) * 1.12));
  }

  /* the other three settle back */
  .quad:has(.tile:hover, .tile:focus-visible) .tile:not(:hover, :focus-visible) {
    transform: scale(0.97);
  }

  .quad:has(.tile:hover, .tile:focus-visible) .tile:not(:hover, :focus-visible) .tile-img {
    filter: saturate(0.4);
    opacity: 0.85;
  }
}

.tile:hover .tile-meaning,
.tile:focus-visible .tile-meaning {
  opacity: 1;
  transform: none;
}

.quad:has(.tile:hover, .tile:focus-visible) .tile:not(:hover, :focus-visible) .tile-label {
  color: var(--grey);
}

/* the focus ring follows the tile instead of the page */
.tile:focus-visible {
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--black), 0 45px 80px -30px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .tile:hover .tile-img,
  .tile:focus-visible .tile-img {
    outline: 2px solid var(--black);
    outline-offset: 3px;
  }
}

.home-links {
  align-self: end;
  display: flex;
  gap: 1.5rem;
  font-size: var(--t3);
}

.home-links a {
  padding: 0.6rem 0;
  color: var(--grey);
}

.home-links a:hover {
  color: var(--black);
}

/* opening a section: the chosen tile grows to fill the window (added by site.js) */
.tile-open {
  position: fixed;
  z-index: 50;
  overflow: hidden;
  background: #efece6;
  transition:
    inset 520ms cubic-bezier(0.7, 0, 0.2, 1),
    top 520ms cubic-bezier(0.7, 0, 0.2, 1),
    left 520ms cubic-bezier(0.7, 0, 0.2, 1),
    width 520ms cubic-bezier(0.7, 0, 0.2, 1),
    height 520ms cubic-bezier(0.7, 0, 0.2, 1);
}

.tile-open img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--focus);
  transform: scale(calc(var(--z) * 1.12));
  transform-origin: var(--focus);
  filter: var(--img-filter, none);
}

@media (max-width: 599px) {
  .home-stage {
    --s: min(calc(100vw - 2 * var(--m)), calc(100svh - 10rem));
  }

  .tile-name {
    font-size: 1rem;
  }

  /* no hover on touch screens: show the meaning all the time, under the name */
  .tile-label {
    flex-direction: column;
    gap: 0.3rem;
  }

  .tile-clay .tile-label,
  .tile-road .tile-label {
    flex-direction: column;
    align-items: flex-end;
  }

  .tile-light .tile-label,
  .tile-clay .tile-label {
    bottom: calc(100% + 0.6rem);
  }

  .tile-ink .tile-label,
  .tile-road .tile-label {
    top: calc(100% + 0.6rem);
  }
}

@media (hover: none) {
  .tile-meaning {
    opacity: 1;
    transform: none;
  }
}

/* ---------- index of work ---------- */
.reg-group {
  margin-top: clamp(3rem, 6vw, 5rem);
  scroll-margin-top: 1.5rem;
}

.reg-group .pair {
  margin-bottom: 1rem;
}

.reg-empty {
  color: var(--grey);
  border-top: 1px solid var(--hair);
  padding-top: 1rem;
  max-width: 46rem;
}

.reg {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t3);
  line-height: 1.43;
}

.reg th,
.reg td {
  padding: 0.6rem 1.25rem 0.6rem 0;
  border-top: 1px solid var(--hair);
  text-align: left;
  vertical-align: middle;
  font-weight: 400;
}

.reg thead th {
  border-top: 0;
  color: var(--grey);
}

.reg .reg-title {
  font-weight: 600;
}

.reg-pic {
  width: 6.5rem;
}

.reg-ref {
  white-space: nowrap;
  color: var(--grey);
}

.reg-thumb img {
  width: auto;
  height: auto;
  max-height: 56px;
  max-width: 5.25rem;
}

.reg-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  align-items: center;
  border-top: 1px solid var(--hair);
  font-size: var(--t3);
}

.reg-tools button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.75rem 0;
  cursor: pointer;
}

.reg-tools button[aria-pressed='true'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.reg-tools .gap {
  flex: 1;
}

.key {
  margin-top: var(--gap-xl);
}

.key .d3 {
  margin-bottom: 1rem;
}

.acc-body {
  max-width: 40rem;
}

@media (max-width: 759px) {
  .reg thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .reg,
  .reg tbody {
    display: block;
  }

  .reg tr {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    column-gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--hair);
  }

  .reg th,
  .reg td {
    display: block;
    grid-column: 2;
    padding: 0;
    border: 0;
  }

  .reg .reg-pic {
    grid-column: 1;
    grid-row: 1 / span 5;
    width: auto;
  }

  .reg-thumb img {
    height: auto;
    max-height: 56px;
    max-width: 100%;
  }

  .reg-class,
  .reg-when,
  .reg-medium {
    color: var(--grey);
  }
}

/* ---------- sticky position bar (entry pages only) ---------- */
.pos {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-size: var(--t3);
}

.pos-in {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: var(--bar-h);
}

.crumbs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 0.5rem;
  white-space: nowrap;
}

.crumbs li + li::before {
  content: '/';
  margin-right: 0.5rem;
  color: var(--grey);
}

.crumbs li {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  /* room for the focus ring and the tap area inside the clipped box */
  padding: 0.75rem 0.3rem;
  margin: -0.75rem -0.3rem;
}

.crumbs a {
  padding: 0.75rem 0;
}

.crumbs li:last-child {
  color: var(--grey);
}

.pos-nav a {
  padding: 0.75rem 0;
}

.pos-count {
  color: var(--grey);
  white-space: nowrap;
}

.pos-nav {
  display: flex;
  gap: 1.25rem;
  white-space: nowrap;
}

.pos-nav a {
  font-weight: 500;
}

.pos-nav span {
  color: #a8a8a8;
}

html:has(body.has-pos) {
  scroll-padding-top: calc(var(--bar-h) + 1rem);
}

.has-pos [id] {
  scroll-margin-top: calc(var(--bar-h) + 1rem);
}

@media (max-width: 699px) {
  /* only the way back up is shown: "< Light" */
  .crumbs li {
    display: none;
  }

  .crumbs li:nth-last-child(2) {
    display: block;
  }

  .crumbs li:nth-last-child(2)::before {
    content: '\2039';
    margin-right: 0.4rem;
    color: inherit;
  }

  .pos-in {
    gap: 1rem;
  }

  /* the way back up already closes the photograph */
  .pos-close {
    display: none;
  }
}

/* ---------- pager: one sequence through all four materials ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--g);
  margin-top: var(--gap-xl);
}

.pager > * {
  border-top: 1px solid var(--black);
  padding-top: 1rem;
}

.pager > span {
  border-color: transparent;
}

.pager a:hover {
  text-decoration: none;
}

.pager a:hover .name {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
}

.pager .label,
.pager .d3 {
  display: block;
}

.pager .label {
  margin-bottom: 0.4rem;
}

.pager .fact {
  color: var(--grey-display);
}

.pager-next {
  text-align: right;
}

@media (max-width: 599px) {
  .pager {
    grid-template-columns: 1fr;
  }

  .pager > span {
    display: none;
  }

  .pager-next {
    text-align: left;
  }
}

.more-in {
  margin-top: var(--gap-xl);
}

.more-in .d3 {
  margin-bottom: 1.25rem;
}

.more-in .strip {
  margin-right: calc(-1 * var(--m));
}

/* ---------- plain pages ---------- */
.empty .meta,
.empty .links {
  margin-top: 2rem;
}

.empty .measure + .measure {
  margin-top: 1rem;
  color: var(--grey);
}

.about {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--hair);
}

.about .words .label {
  margin-top: 0.4rem;
}

.prose p + p,
.pics > p + p {
  margin-top: 1rem;
}

.prose {
  max-width: 44rem;
}

.pics > .meta {
  margin-top: 1.25rem;
}

.contents li a {
  display: grid;
  grid-template-columns: minmax(5.5rem, 9rem) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.9rem 0;
  border-top: 1px solid var(--hair);
}

.contents li:last-child a {
  border-bottom: 1px solid var(--hair);
}

.c-name {
  font: 800 var(--d3) / 1 var(--display);
  letter-spacing: -0.02em;
}

.c-def {
  font-size: var(--t3);
}

.c-fact {
  font-size: var(--t3);
  color: var(--grey);
  white-space: nowrap;
}

@media (max-width: 599px) {
  .contents li a {
    grid-template-columns: 1fr auto;
  }

  .c-def {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.offer {
  margin-top: clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--hair);
}

.offer-row {
  padding: 1.5rem 0;
  border-top: 1px solid var(--hair);
}

.book {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.book .lead a {
  text-decoration: underline;
}

.textlist {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.textlist .pair {
  margin-bottom: 1rem;
}

.textlist li a {
  display: grid;
  grid-template-columns: 5rem minmax(8rem, 16rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-top: 1px solid var(--hair);
  font-size: var(--t3);
  line-height: 1.43;
}

.textlist li:last-child a {
  border-bottom: 1px solid var(--hair);
}

.textlist a:hover {
  text-decoration: none;
}

.textlist a:hover .tl-title {
  text-decoration: underline;
}

.tl-title {
  font-weight: 600;
}

.tl-line {
  color: var(--grey);
}

@media (max-width: 699px) {
  .textlist li a {
    grid-template-columns: 5rem minmax(0, 1fr);
  }

  .tl-line {
    grid-column: 2;
  }
}

/* ---------- footer ---------- */
.ftr {
  margin-top: var(--gap-xl);
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-size: var(--t3);
  line-height: 1.43;
}

.ftr::before {
  content: '';
  display: block;
  border-top: 1px solid var(--black);
  margin-bottom: 2rem;
}

.ftr-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem var(--g);
  margin-bottom: 2.5rem;
}

.ftr .label {
  margin-bottom: 0.5rem;
}

.ftr li a {
  display: inline-block;
  padding: 0.3rem 0;
}

.ftr-base {
  color: var(--grey);
}

.ftr-base a {
  color: var(--black);
  text-decoration: underline;
}

@media (max-width: 699px) {
  .ftr-cols {
    grid-template-columns: 1fr 1fr;
  }

  .ftr li a {
    padding: 0.6rem 0;
  }
}

/* ---------- single photograph ---------- */
.plate-page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.plate-page main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 1.5rem var(--m);
}

.view img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100svh - var(--bar-h) - 12.5rem);
}

.view-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}

.view-prev {
  left: 0;
  cursor: w-resize;
}

.view-next {
  right: 0;
  cursor: e-resize;
}

.view-cap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
  padding-block: 0.75rem;
  font-size: var(--t3);
  line-height: 1.43;
}

.view-cap a {
  font-weight: 600;
  text-decoration: underline;
}

.view-cap p:nth-child(2) {
  text-align: center;
  color: var(--grey);
}

.view-cap p:last-child {
  text-align: right;
  color: var(--grey);
}

.view-thumbs {
  background: var(--band);
  overflow-x: auto;
  scrollbar-width: thin;
}

.view-thumbs ul {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  margin-inline: auto;
  padding: 0.75rem var(--m);
}

.view-thumbs a {
  display: block;
}

.view-thumbs img {
  height: 56px;
  width: auto;
  max-width: none;
}

.view-thumbs a[aria-current] {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.view-thumbs a[aria-current]:focus-visible {
  outline-width: 4px;
}

.pos-close {
  margin-left: 0.5rem;
}

@media (max-width: 699px) {
  .view {
    padding-inline: 0;
  }

  .view-cap {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .view-cap p:nth-child(2),
  .view-cap p:last-child {
    text-align: left;
  }

  .view img {
    max-height: calc(100svh - var(--bar-h) - 14rem);
  }
}

/* short windows (a phone on its side, heavy zoom): the photograph takes the first screen and the rest scrolls */
@media (max-height: 560px) {
  .view img {
    max-height: calc(100svh - var(--bar-h) - 3rem);
  }
}

/* ---------- /links ---------- */
.links-page main {
  display: grid;
  justify-items: center;
  padding: clamp(2rem, 8vw, 5rem) var(--m);
}

.links-card {
  width: 100%;
  max-width: 28rem;
}

.links-card .lead {
  margin: 0.75rem 0 2rem;
}

.links-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--hair);
}

.links-list li:last-child a {
  border-bottom: 1px solid var(--hair);
}

.links-list a:hover {
  text-decoration: none;
}

.links-list a:hover .l-name {
  text-decoration: underline;
}

.l-name {
  font: 800 1.375rem/1.1 var(--display);
  letter-spacing: -0.015em;
}

.l-sub {
  font-size: var(--t3);
  color: var(--grey);
  text-align: right;
}

.links-card .ftr-base {
  margin-top: 2rem;
  font-size: var(--t3);
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 160ms;
  }
}
