/* ==========================================================================
   tylerattaway.com / site.css

   Layout: a photobook on a white page. Photographs sit off-centre on a
   12-column grid, and each one's roll, frame and film stock run down its
   edge like the printing along a strip of film. Type stays small so the
   pictures can stay big.

   You shouldn't need to edit this file to add photos, rolls or notes.
   Colors live in the first two blocks below if you ever want to tweak them.
   ========================================================================== */

/* Fonts (self-hosted, SIL Open Font License; see fonts/ folder) ----------- */
@font-face {
  font-family: "Literata";
  src: url("fonts/literata.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-ext.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0100-0130, U+0132-0151, U+0154-017F;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic-ext.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0100-0130, U+0132-0151, U+0154-017F;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-ext.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
  unicode-range: U+0100-0130, U+0132-0151, U+0154-017F;
}

/* Tokens ------------------------------------------------------------------ */
:root {
  /* Light: a white page, ink, and one cyanotype blue. */
  --page: #fafaf8;
  --ink: #17191b;
  --ink-soft: #585d63;
  --line: #dcdedf;
  --well: #ebecea;
  --accent: #2a52a3;
  --visited: #6a4d95;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  --gap: clamp(14px, 1.9vw, 28px);
  --max: 1480px;

  --t-edge: 12.5px;
  --t-small: 14px;
  --t-ui: 15.5px;
  --t-body: 18px;
  --t-cap: 15.5px;
  --t-lead: clamp(20px, 0.9vw + 15px, 27px);
  --t-h2: clamp(24px, 0.9vw + 18px, 31px);
  --t-title: clamp(32px, 1.5vw + 21px, 46px);

  --edge-w: 30px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #131517;
    --ink: #e8e9ea;
    --ink-soft: #a0a6ac;
    --line: #2b2f33;
    --well: #1e2124;
    --accent: #94b3ee;
    --visited: #c4abeb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #131517;
  --ink: #e8e9ea;
  --ink-soft: #a0a6ac;
  --line: #2b2f33;
  --well: #1e2124;
  --accent: #94b3ee;
  --visited: #c4abeb;
  color-scheme: dark;
}

/* Base -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  padding-inline: var(--gutter);
  background: var(--page);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--serif);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
.vlink:visited { color: var(--visited); }
.vlink:visited:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.sans { font-family: var(--sans); }
.soft { color: var(--ink-soft); }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--page); padding: 10px 14px;
  font: 500 var(--t-small)/1 var(--sans); text-decoration: none; border-radius: 4px;
}
.skip:focus { top: 12px; color: var(--page); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
.grid > * { min-width: 0; }

/* Flowing text (notes, about, roll notes) */
.flow > * + * { margin-top: 0.9em; }
.flow h2 { font-size: var(--t-h2); line-height: 1.2; margin-top: 1.6em; }
.flow h3 { font: 500 var(--t-ui)/1.4 var(--sans); margin-top: 1.8em; }
.flow ul { padding-left: 1.1em; }
.flow li + li { margin-top: 0.3em; }
.flow blockquote { padding-left: 1em; border-left: 2px solid var(--line); font-style: italic; }
.flow strong { font-weight: 600; }

/* Header ------------------------------------------------------------------ */
.site-head {
  max-width: var(--max);
  margin-inline: auto;
  padding-block: 22px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 28px;
  font: 400 var(--t-ui)/1.3 var(--sans);
}
.site-name { font: 400 19px/1.2 var(--serif); text-decoration: none; letter-spacing: -0.005em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.site-nav a { text-decoration: none; }
.site-nav a[aria-current] {
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}
@media (max-width: 560px) {
  .site-head { flex-direction: column; gap: 6px; padding-top: 18px; }
  .site-nav { gap: 6px 20px; }
}

main { max-width: var(--max); margin-inline: auto; display: block; }

/* Page heads (Selected, Rolls, Notes, About) ------------------------------ */
.page-head { padding-block: clamp(40px, 7vw, 104px) clamp(36px, 5.5vw, 80px); row-gap: 12px; align-items: baseline; }
.page-head h1 {
  grid-column: 1 / span 4;
  grid-row: 1 / span 2;
  font-size: var(--t-title);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.page-head .lead {
  grid-column: 5 / span 6;
  font-size: var(--t-lead);
  line-height: 1.38;
}
.page-head .stats {
  grid-column: 5 / span 6;
  font: 400 var(--t-small)/1.5 var(--sans);
  color: var(--ink-soft);
}
@media (max-width: 860px) {
  .page-head h1, .page-head .lead, .page-head .stats { grid-column: 1 / -1; grid-row: auto; }
}

/* Photographs ------------------------------------------------------------- */
.photo {
  display: block;
  position: relative;
  aspect-ratio: var(--r, 1.5);
  max-width: 100%;
  background: var(--well);
  overflow: hidden;
}
.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
a.photo-link { display: block; text-decoration: none; color: inherit; }
a.photo-link:hover { color: inherit; }
a.photo-link:focus-visible { outline-offset: 4px; }

/* A plate: one photograph with its edge print running down the right side. */
.plate {
  display: flex;
  align-items: flex-start;
  max-width: 100%;
}
.plate .photo-link { flex: none; width: min(calc(100% - var(--edge-w)), calc(var(--maxh, 80vh) * var(--r, 1.5))); }
.plate .photo-link .photo { width: 100%; }
.edge {
  writing-mode: vertical-rl;
  flex: none;
  display: flex;
  gap: 1.7em;
  margin-left: 11px;
  font: 400 var(--t-edge)/1 var(--sans);
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.edge b { font-weight: 500; color: var(--ink); }
@media (max-width: 720px) {
  :root { --edge-w: 0px; }
  .plate { flex-direction: column; }
  .edge {
    writing-mode: horizontal-tb;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 10px 0 0;
    white-space: normal;
  }
}

.caption { font: italic var(--t-cap)/1.45 var(--serif); }
.meta { font: 400 var(--t-small)/1.55 var(--sans); color: var(--ink-soft); }
.meta a { color: var(--ink); }
.meta a:hover { color: var(--accent); }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 var(--t-small)/1.1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.textbtn {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 var(--t-small)/1.3 var(--sans);
  text-decoration: underline; text-underline-offset: 0.25em;
  text-decoration-color: color-mix(in srgb, currentColor 38%, transparent);
}
.textbtn:hover { color: var(--accent); text-decoration-color: currentColor; }

/* Home -------------------------------------------------------------------- */
.hero { padding-block: clamp(28px, 5vw, 64px) clamp(64px, 9vw, 136px); row-gap: 28px; }
.hero__plate { grid-column: 5 / -1; grid-row: 1; }
.hero__figure {
  --maxh: 76vh; --maxh: 76svh;
  width: min(100%, calc(var(--maxh) * var(--r, 1.5) + var(--edge-w)));
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.hero__text {
  grid-column: 1 / span 4;
  grid-row: 1;
  align-self: end;
  display: grid;
  gap: 22px;
  padding-right: clamp(0px, 2vw, 32px);
}
.hero__intro { font-size: var(--t-lead); line-height: 1.38; }
.hero__about { display: grid; gap: 10px; }
.hero__under {
  width: calc(100% - var(--edge-w));
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}
.hero__under > div { display: grid; gap: 4px; min-width: 0; flex: 1 1 16em; }
@media (max-width: 900px) {
  .hero__plate, .hero__text { grid-column: 1 / -1; }
  .hero__plate { grid-row: 1; }
  .hero__text { grid-row: 2; padding: 12px 0 0; }
  .hero__figure { margin: 0; }
}
@media (max-width: 720px) {
  .hero__figure { --maxh: 70vh; --maxh: 70svh; }
}

.section { padding-block: 0 clamp(56px, 8vw, 120px); }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(20px, 3vw, 36px);
}
.section__head h2 { font-size: var(--t-h2); line-height: 1.15; letter-spacing: -0.01em; }
.section__head a { font: 500 var(--t-small)/1.3 var(--sans); }

/* Roll rows (home + Rolls page) ------------------------------------------- */
.rolls { list-style: none; padding: 0; display: grid; }
.rollrow {
  position: relative;
  padding-block: 24px;
  row-gap: 16px;
  border-top: 1px solid var(--line);
}
.rollrow:last-child { border-bottom: 1px solid var(--line); }
.rollrow__num {
  grid-column: 1 / span 1;
  font: 500 clamp(20px, 1.4vw + 10px, 30px)/1 var(--sans);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.rollrow__info { grid-column: 2 / span 4; display: grid; align-content: start; gap: 8px; }
.rollrow__title { font-size: clamp(21px, 0.6vw + 17px, 26px); line-height: 1.15; letter-spacing: -0.01em; }
.rollrow__title a { text-decoration: none; }
.rollrow__title a::after { content: ""; position: absolute; inset: 0; }
.rollrow:hover .rollrow__title a { color: var(--accent); }
.rollrow__strip { grid-column: 6 / -1; }
.rollrow .tag {
  font: 500 12px/1 var(--sans); color: var(--ink-soft);
  border: 1px dashed var(--ink-soft); border-radius: 999px; padding: 4px 8px;
  justify-self: start;
}
@media (max-width: 860px) {
  .rollrow { grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; }
  .rollrow__num { grid-column: 1; padding-top: 2px; }
  .rollrow__info { grid-column: 2; }
  .rollrow__strip { grid-column: 1 / -1; }
}

/* A strip of frames that runs off the right edge, like a strip of negatives. */
.strip {
  --sh: 96px;
  display: flex;
  gap: 6px;
  height: var(--sh);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
}
.strip .photo { height: var(--sh); width: auto; flex: none; }
@media (max-width: 860px) { .strip { --sh: 72px; gap: 5px; } }

/* Filter (Rolls page) */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(24px, 3.5vw, 44px);
}
.filter__label { font: 400 var(--t-small)/1 var(--sans); color: var(--ink-soft); margin-right: 6px; }

/* Roll page --------------------------------------------------------------- */
.back { padding-top: clamp(24px, 4vw, 44px); font: 400 var(--t-small)/1.3 var(--sans); }
.back a { color: var(--ink-soft); }
.back a:hover { color: var(--accent); }
.roll-head { padding-block: clamp(20px, 3vw, 36px) clamp(56px, 8vw, 112px); row-gap: 24px; grid-template-rows: auto 1fr; }
.roll-head__title { grid-column: 1 / span 4; grid-row: 1; display: grid; gap: 14px; }
.roll-head__body { grid-column: 1 / span 4; grid-row: 2; display: grid; align-content: start; gap: 22px; }
.roll-head__plate { grid-column: 5 / -1; grid-row: 1 / span 2; --maxh: 74vh; --maxh: 74svh; }
.roll-head__kicker { font: 500 var(--t-ui)/1 var(--sans); font-variant-numeric: tabular-nums; }
.roll-head h1 { font-size: clamp(32px, 1.8vw + 20px, 50px); line-height: 1.06; letter-spacing: -0.015em; }
.roll-head .flow { font-size: var(--t-body); max-width: 36em; }
.specs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 20px; font: 400 var(--t-small)/1.45 var(--sans); }
.specs dt { color: var(--ink-soft); }
.specs dd { font-variant-numeric: tabular-nums; }
.roll-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 900px) {
  .roll-head { grid-template-rows: none; }
  .roll-head__title, .roll-head__plate, .roll-head__body { grid-column: 1 / -1; grid-row: auto; }
}

.sheet-head { margin-bottom: clamp(20px, 3vw, 32px); }
.sheet {
  --cols: 3;
  list-style: none; padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(22px, 3vw, 44px) clamp(12px, 1.6vw, 24px);
}
@media (min-width: 780px) { .sheet { --cols: 4; } }
@media (min-width: 1120px) { .sheet { --cols: 6; } }
.cell { min-width: 0; }
.cell a { display: block; text-decoration: none; color: inherit; }
.cell__box { aspect-ratio: 1; display: flex; align-items: flex-end; justify-content: center; }
.cell__box .photo { width: calc(100% * min(1, var(--r, 1.5))); flex: none; }
.cell__label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-top: 9px;
  font: 400 13.5px/1.35 var(--sans);
  color: var(--ink-soft);
}
.cell__label b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell__cap {
  margin-top: 3px;
  font: italic 14.5px/1.4 var(--serif);
  color: var(--ink-soft);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cell a:hover .cell__label b { color: var(--accent); }
@media (max-width: 479px) {
  .sheet { gap: 18px 10px; }
  .cell__cap { display: none; }
  .cell__label { font-size: 12.5px; margin-top: 6px; }
}

.pager {
  margin-top: clamp(64px, 9vw, 128px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px;
}
.pager a { display: grid; gap: 4px; text-decoration: none; max-width: 30em; }
.pager a span:first-child { font: 400 var(--t-small)/1.3 var(--sans); color: var(--ink-soft); }
.pager a span:last-child { font-size: 21px; line-height: 1.25; }
.pager a:hover span:last-child { color: var(--accent); }
.pager .next { margin-left: auto; text-align: right; }

/* Selected ---------------------------------------------------------------- */
.plates { list-style: none; padding: 0; display: grid; gap: clamp(80px, 13vw, 200px); }
.plates > li { row-gap: 18px; align-items: end; }
.plates > li { --maxh: 84vh; --maxh: 84svh; }
.plates .pl-photo, .plates .pl-text { grid-row: 1; }
.plates .pl-text { display: grid; gap: 6px; align-content: end; padding-bottom: 2px; }
.plates .pl-num { font: 500 var(--t-small)/1 var(--sans); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
/* Four placements, chosen per photo so the sequence keeps moving. */
.plates [data-pos="a"] .pl-photo { grid-column: 1 / span 9; }
.plates [data-pos="a"] .pl-text  { grid-column: 10 / -1; }
.plates [data-pos="b"] .pl-photo { grid-column: 4 / -1; }
.plates [data-pos="b"] .pl-text  { grid-column: 1 / span 3; }
.plates [data-pos="c"] .pl-photo { grid-column: 7 / span 5; }
.plates [data-pos="c"] .pl-text  { grid-column: 3 / span 4; }
.plates [data-pos="d"] .pl-photo { grid-column: 2 / span 5; }
.plates [data-pos="d"] .pl-text  { grid-column: 7 / span 4; }
.plates [data-pos="e"] .pl-photo { grid-column: 2 / span 10; }
.plates [data-pos="e"] .pl-text  { grid-column: 2 / span 6; grid-row: 2; }
.plates [data-pos="f"] .pl-photo { grid-column: 5 / span 5; }
.plates [data-pos="f"] .pl-text  { grid-column: 10 / -1; }
.plates [data-pos="b"] .pl-text, .plates [data-pos="c"] .pl-text { text-align: right; justify-items: end; }
@media (max-width: 860px) {
  .plates { gap: clamp(56px, 12vw, 96px); }
  .plates .pl-photo, .plates .pl-text { grid-column: 1 / -1 !important; text-align: left !important; justify-items: start !important; }
  .plates .pl-text { grid-row: 2; }
}

/* Notes ------------------------------------------------------------------- */
.notelist { list-style: none; padding: 0; display: grid; }
.noterow { position: relative; padding-block: 22px 26px; row-gap: 6px; border-top: 1px solid var(--line); }
.noterow:last-child { border-bottom: 1px solid var(--line); }
.noterow__date { grid-column: 1 / span 3; font: 400 var(--t-small)/1.9 var(--sans); color: var(--ink-soft); }
.noterow__body { grid-column: 4 / span 7; display: grid; gap: 6px; }
.noterow__title { font-size: clamp(21px, 0.6vw + 17px, 26px); line-height: 1.2; letter-spacing: -0.01em; }
.noterow__title a { text-decoration: none; }
.noterow__title a::after { content: ""; position: absolute; inset: 0; }
.noterow:hover .noterow__title a { color: var(--accent); }
.noterow__sum { color: var(--ink-soft); font-size: 17px; line-height: 1.5; }
@media (max-width: 860px) {
  .noterow__date, .noterow__body { grid-column: 1 / -1; }
}

.article { padding-bottom: 8px; }
.article-head { padding-block: clamp(20px, 3vw, 36px) clamp(36px, 5vw, 64px); row-gap: 18px; }
.article-head > * { grid-column: 3 / span 8; }
.article-head .date { font: 400 var(--t-small)/1.3 var(--sans); color: var(--ink-soft); }
.article-head h1 { font-size: clamp(34px, 2.2vw + 20px, 58px); line-height: 1.06; letter-spacing: -0.015em; }
.article-head .lead { font-size: var(--t-lead); line-height: 1.4; color: var(--ink-soft); }
.article-body { row-gap: 0; }
.article-body > * { grid-column: 4 / span 6; }
.article-body > * + * { margin-top: 0.95em; }
.article-body > h2 { font-size: var(--t-h2); line-height: 1.2; margin-top: 1.7em; }
.article-body > h3 { font: 500 var(--t-ui)/1.4 var(--sans); margin-top: 1.9em; }
.article-body > ul { padding-left: 1.1em; }
.article-body > blockquote { padding-left: 1em; border-left: 2px solid var(--line); font-style: italic; }
.article-body > .fig { grid-column: 2 / span 10; margin-block: 1.8em; }
.article-body > .fig--pair { grid-column: 1 / -1; }
.article-body strong { font-weight: 600; }
.fig { display: grid; gap: 10px; }
.fig--pair .fig__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: end; }
.fig .photo-link { width: min(100%, calc(80vh * var(--r, 1.5))); }
.fig--pair .photo-link { width: 100%; }
.fig figcaption { display: grid; gap: 2px; }
@media (max-width: 860px) {
  .article-head > *, .article-body > *, .article-body > .fig { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .fig--pair .fig__row { grid-template-columns: 1fr; }
}

/* About ------------------------------------------------------------------- */
.about-body { row-gap: clamp(48px, 7vw, 96px); padding-bottom: 8px; }
.about-body .about-text { grid-column: 1 / span 8; font-size: var(--t-lead); line-height: 1.42; }
.about-body .about-text > * + * { margin-top: 0.75em; }
.about-col { display: grid; align-content: start; gap: 14px; }
.about-col h2 { font: 500 var(--t-ui)/1.3 var(--sans); }
.about-col--into { grid-column: 1 / span 5; }
.about-col--else { grid-column: 7 / span 5; }
.about-col--colophon { grid-column: 1 / span 7; }
.index { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.index li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-block: 11px 12px; border-bottom: 1px solid var(--line);
}
.index li > span:last-child { font: 400 var(--t-small)/1.4 var(--sans); color: var(--ink-soft); text-align: right; }
.index li > span:last-child a { color: var(--ink); }
.index li > span:last-child a:hover { color: var(--accent); }
.index .draft span:first-child { color: var(--ink-soft); }
.index .draft span:last-child { font-style: normal; border: 1px dashed var(--ink-soft); border-radius: 999px; padding: 3px 9px; font-size: 12.5px; }
.colophon { font-size: 16px; line-height: 1.6; color: var(--ink-soft); max-width: 36em; }
@media (max-width: 860px) {
  .about-body .about-text, .about-col--into, .about-col--else, .about-col--colophon { grid-column: 1 / -1; }
}

/* Empty and error states -------------------------------------------------- */
.notice {
  margin-block: 24px;
  padding: 18px 20px;
  border: 1px dashed var(--ink-soft);
  border-radius: 6px;
  font: 400 var(--t-small)/1.55 var(--sans);
  max-width: 44em;
}
.notice b { font-weight: 600; }
.notice code { font-size: 13px; }
.empty { padding-block: 24px 8px; color: var(--ink-soft); max-width: 34em; }

/* 404 */
.lost { padding-block: clamp(56px, 10vw, 160px) clamp(48px, 8vw, 120px); row-gap: 24px; }
.lost > * { grid-column: 1 / span 8; }
.lost h1 { font-size: clamp(36px, 2.6vw + 20px, 60px); line-height: 1.05; letter-spacing: -0.015em; }
.lost p { font-size: var(--t-lead); line-height: 1.4; }
.lost .actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 860px) { .lost > * { grid-column: 1 / -1; } }

/* Footer ------------------------------------------------------------------ */
.site-foot {
  max-width: var(--max);
  margin: clamp(40px, 5vw, 72px) auto 0;
  padding-block: 26px 40px;
  border-top: 1px solid var(--line);
  row-gap: 24px;
  font: 400 var(--t-small)/1.6 var(--sans);
  color: var(--ink-soft);
}
.site-foot a { color: var(--ink); text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; }
.site-foot ul { list-style: none; padding: 0; }
.foot-id { grid-column: 1 / span 4; }
.foot-id p:first-child { color: var(--ink); font-weight: 500; }
.foot-pages { grid-column: 5 / span 2; }
.foot-else { grid-column: 7 / span 3; }
.foot-tools { grid-column: 10 / -1; display: grid; justify-items: end; align-content: start; gap: 6px; }
.foot-tools .textbtn { color: var(--ink); font-weight: 400; }
.foot-preview { grid-column: 1 / -1; font-size: 13px; }
@media (max-width: 860px) {
  .foot-id { grid-column: 1 / -1; }
  .foot-pages { grid-column: 1 / span 6; }
  .foot-else { grid-column: 7 / -1; }
  .foot-tools { grid-column: 1 / -1; justify-items: start; grid-auto-flow: column; justify-content: start; gap: 22px; }
}

/* Viewer ------------------------------------------------------------------ */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--page);
  color: var(--ink);
}
.viewer[hidden] { display: none; }
.viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 14px var(--gutter);
  font: 400 var(--t-small)/1.4 var(--sans);
}
.viewer__bar--top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.viewer__bar--bottom {
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  align-items: flex-end;
}
.viewer__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.viewer__title a { color: var(--ink); }
.viewer__stage {
  position: relative;
  min-height: 0;
  margin: 0;
  padding: 4px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y pinch-zoom;
}
.viewer__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 160ms ease;
}
.viewer__img.is-swapping { opacity: 0; }
.viewer__info { display: grid; gap: 3px; min-width: 0; }
.viewer__count { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.viewer__cap { font: italic var(--t-cap)/1.4 var(--serif); color: var(--ink); }
.viewer__meta { color: var(--ink-soft); }
.viewer__nav { display: flex; gap: 8px; flex: none; }
.viewer__keys { color: var(--ink-soft); font-size: 12.5px; }
@media (max-width: 720px) {
  .viewer__bar--bottom { flex-direction: column; align-items: stretch; gap: 12px; }
  .viewer__nav { justify-content: space-between; }
  .viewer__nav .btn { flex: 1; justify-content: center; }
  .viewer__keys { display: none; }
  .viewer__cap, .viewer__meta {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}
@media (hover: none) { .viewer__keys { display: none; } }

/* Motion ------------------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
  .fade-in { animation: fade-in 220ms ease both; }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
