/* ==========================================================================
   Namtech Fine Art — design system
   The frame follows the family of blackcube.in / thotavaikuntam.in (Montserrat 300,
   uppercase labels tracked .16em, hairlines, works shown whole). Each publication page
   sets its own theme tokens inline (--paper, --ink, --accent, --accent-text) from the
   book's own paper and design; everything below reads them.
   Sections: 1 tokens · 2 fonts/reset · 3 type · 4 layout · 5 header · 6 footer
   7 components · 8 index + home · 9 book page · 10 lightbox · 11 motion · 12 a11y
   ========================================================================== */

/* ------------------------------------------------------------ 1 tokens */
:root {
  --ff: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fw: 300;
  --track: .16em;
  --fs-meta: max(11px, 1.15rem);
  --fs-nav: max(11px, 1.25rem);

  --paper: #fff;
  --ink: #010101;
  --ink-2: #151515;
  --grey-1: #585858;
  --grey-2: #6b6b6b;
  --rule: #EBEBEB;
  --accent: #e98930;          /* the orange dot of the NFA logo: rules only, never text */
  --accent-text: #46291e;     /* the logo's brown */
  --brand: #46291e;

  --container: 1660px;
  --gutter: 80px;
  --gap-x: 40px;
  --gap-y: 50px;
  --cap-gap: 20px;
  --section-y: 60px;          /* 60 + 60 = 120 between two sections' content (Thota rhythm) */
  --para: 2.32rem;
  --row-h: 330px;             /* cover band on the index */
  --header-h: 104px;

  --ease-reveal: cubic-bezier(.18, 1, .21, 1);
  --t-reveal: 900ms;
  --ease-header: cubic-bezier(.65, .06, .19, .96);
  --t-header: 600ms;
  --t-hover: 500ms;
  color-scheme: light;
}
@media (max-width: 1280px) { :root { --gutter: 40px; } }
@media (max-width: 1024px) { :root { --gutter: 30px; --header-h: 84px; --row-h: 280px; } }
@media (max-width: 768px)  { :root { --row-h: 220px; --gap-y: 40px; } }
@media (max-width: 460px)  { :root { --gutter: 18px; --row-h: 190px; --gap-x: 18px; } }

/* dark books (printed on black): the page takes the book's own black */
.theme-dark {
  --ink: #ECE9E3;
  --ink-2: #F3F0EA;
  --grey-1: #A3A09A;
  --grey-2: #9a978f;
  --rule: #262626;
  color-scheme: dark;
}

/* ------------------------------------------------------------ 2 fonts / reset */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url("/assets/fonts/montserrat-300-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: italic; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/montserrat-300-italic-latin.woff2") format("woff2");
}
/* metric-matched fallback so the late font does not move text */
@font-face {
  font-family: "Montserrat Fallback"; src: local("Arial"); size-adjust: 112%; ascent-override: 86%; descent-override: 22%;
}
*, *::before, *::after { box-sizing: border-box; }
a, button, summary, input { -webkit-tap-highlight-color: transparent; }   /* iOS grey tap flash; focus and hover states remain */
html {
  font-size: 60.9375%;        /* 9.75px, and it follows the visitor's own default size */
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--ff), "Montserrat Fallback";
  font-weight: var(--fw);
  font-size: 1.45rem;
  line-height: 3.1rem;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img, picture, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:where(p, dd) a:where(:not(.btn)) { text-decoration: underline; text-underline-offset: .22em; text-decoration-thickness: 1px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
::selection { background: var(--ink-2); color: var(--paper); }

/* ------------------------------------------------------------ 3 type */
h1, h2, h3, .eyebrow, .btn, .nav, .meta-label, .caption__title, .card__title, .shelf__dir, .site-footer {
  text-transform: uppercase;
  letter-spacing: var(--track);
}
h1, h2, h3 { font-weight: var(--fw); margin: 0 0 .8em; color: var(--ink); text-wrap: balance; }
h1 { font-size: 2.1rem; line-height: 1.5; margin-bottom: 1.2em; }
h2 { font-size: 2.1rem; line-height: 1.5; }
h3 { font-size: 1.65rem; line-height: 1.6; }
p { margin: 0 0 var(--para); }
.prose p, .prose { max-width: 62ch; }
.lede { font-size: 1.65rem; line-height: 3.2rem; }
.eyebrow { font-size: var(--fs-meta); line-height: 2.1rem; color: var(--grey-1); margin: 0 0 1.2em; }
.meta { font-size: var(--fs-meta); line-height: 2.1rem; color: var(--grey-1); }
strong { font-weight: 500; }
em, i { font-style: italic; }

/* ------------------------------------------------------------ 4 layout */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));   /* iPhone in landscape: clear the notch */
}
.section { padding-block: var(--section-y); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px 20px; flex-wrap: wrap;
  border-bottom: 1px solid var(--rule); padding-bottom: 14px; margin-bottom: var(--gap-y);
}
.section-head h2 { margin: 0; }
.section-head a { font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); white-space: nowrap; display: inline-flex; min-height: 44px; align-items: center; }
.section-head a:hover { color: var(--ink); }

/* ------------------------------------------------------------ 5 header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  transition: transform var(--t-header) var(--ease-header), box-shadow .5s linear;
}
.site-header.is-scrolled { box-shadow: 0 0 8px rgba(0, 0, 0, .12); }
.theme-dark .site-header.is-scrolled { box-shadow: none; }
.site-header.is-hidden { transform: translate3d(0, -110%, 0); }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-logo img { width: auto; height: 52px; }
@media (max-width: 1024px) { .site-logo img { height: 42px; } }
.theme-dark .site-logo img { filter: brightness(0) invert(.93); }
.nav { font-size: var(--fs-nav); }
.nav a { color: var(--grey-1); padding: 12px 0; display: inline-block; }
.nav a[aria-current="page"], .nav a.is-active { color: var(--ink); }
.nav a:hover { color: var(--ink); }

/* ------------------------------------------------------------ 6 footer */
.site-footer { border-top: 1px solid var(--rule); font-size: max(11px, 1rem); color: var(--grey-1); }
.site-footer__inner { padding-block: 30px; }
.site-footer p { margin: 0; }

/* ------------------------------------------------------------ 7 components */
.btn {
  display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap;
  min-height: 44px; padding: 12px 22px;
  border: 1px solid var(--ink-2);
  font-size: var(--fs-meta); line-height: 1.6;
  transition: background-color var(--t-hover), color var(--t-hover);
}
.btn:hover, .btn:focus-visible { background: var(--ink-2); color: var(--paper); }
.btn__note { color: var(--grey-1); letter-spacing: .08em; transition: color var(--t-hover); }
.btn:hover .btn__note, .btn:focus-visible .btn__note { color: inherit; }

blockquote.voice {
  margin: 0; padding-left: 30px; border-left: 1px solid var(--accent);
  font-size: 2.4rem; line-height: 3.5rem; color: var(--ink-2); max-width: 34ch;
}
blockquote.voice p { margin: 0; }
blockquote.voice footer {
  margin-top: 18px; font-size: var(--fs-meta); line-height: 2.1rem; letter-spacing: var(--track);
  text-transform: uppercase; color: var(--grey-1);
}
@media (max-width: 768px) { blockquote.voice { font-size: 1.95rem; line-height: 3rem; padding-left: 20px; } }


/* covers read as books: a soft object shadow, lifted on hover where there is a pointer */
.book-cover { box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 16px 32px -14px rgba(0,0,0,.42); transition: transform var(--t-hover) var(--ease-reveal), box-shadow var(--t-hover); background: var(--paper); }
.theme-dark .book-cover { box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a:hover > .book-cover, a:focus-visible > .book-cover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 22px 36px -14px rgba(0,0,0,.45); }
}

/* ------------------------------------------------------------ 8 index + home */
.page-intro { padding-top: 70px; padding-bottom: 10px; }
.page-intro h1 { margin-bottom: .6em; }
.page-intro .lede { max-width: 62ch; }

/* search: one field for artists and titles (shown only when search.js runs) */
.search { margin: 10px 0 0; }
.search input {
  -webkit-appearance: none; appearance: none; width: 100%; max-width: 640px; margin: 0; padding: 12px 0;
  font: inherit; font-size: max(16px, 1.8rem); font-weight: 300; letter-spacing: .02em; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--grey-2, #737373); border-radius: 0;
}
.search input::placeholder { color: #737373; opacity: 1; }
.search input:focus, .search input:focus-visible { outline: none; border-bottom: 2px solid var(--ink); padding-bottom: 11px; }
.search input::-webkit-search-decoration { -webkit-appearance: none; }
.search__status { min-height: 2.4rem; margin: 10px 0 0; color: #585858; font-size: 1.3rem; letter-spacing: .04em; }
.search__empty { padding: 20px 0 60px; color: #585858; }
.card[hidden] { display: none; }
.artist-filter { margin: 30px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.artist-filter summary {
  list-style: none; cursor: pointer; padding: 14px 0; font-size: var(--fs-meta); letter-spacing: var(--track);
  text-transform: uppercase; color: var(--grey-1); display: flex; justify-content: space-between; align-items: center; min-height: 44px;
}
.artist-filter summary::-webkit-details-marker { display: none; }
.artist-filter summary::after { content: "+"; font-size: 1.8rem; line-height: 1; }
.artist-filter[open] summary::after { content: "–"; }
.artist-filter summary:hover { color: var(--ink); }
.artist-list { columns: 4 220px; column-gap: var(--gap-x); padding: 6px 0 26px; }
.artist-list li { break-inside: avoid; line-height: 2.8rem; }
.artist-list a { text-decoration: none; color: var(--grey-1); }
@media (pointer: coarse) { .artist-list a { display: inline-block; padding-block: 8px; } }
.artist-list a:hover, .artist-list a[aria-current="page"] { color: var(--ink); }
.artist-list .count { color: var(--grey-2); font-size: var(--fs-meta); margin-left: .5em; }

.shelf-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gap-x); row-gap: 70px; padding-top: var(--gap-y);
  grid-auto-rows: auto;
}
@media (max-width: 1280px) { .shelf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .shelf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 50px; } }
/* each row's cover band is as tall as its tallest cover (capped at --row-h); covers stand on one shelf line */
.card, .card__link { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.card__media { display: flex; align-items: flex-end; justify-content: flex-start; border-bottom: 1px solid var(--rule); }
.card__media .book-cover { width: min(100%, calc(var(--row-h) * var(--ar))); aspect-ratio: var(--ar); }
.card__media img { width: 100%; height: 100%; object-fit: contain; }
.card__body { padding-top: var(--cap-gap); }
.card__artist { font-size: var(--fs-meta); line-height: 2.1rem; color: var(--grey-1); margin: 0 0 4px; transition: color var(--t-hover); }
.card__title { font-size: 1.4rem; line-height: 2.3rem; margin: 0 0 4px; }
@media (hover: hover) { .card__link:hover .card__artist { color: var(--card-accent, var(--ink)); } }

/* home slideshow: whole works, one at a time; native swipe (scroll-snap), auto-advance in show.js */
.home-show { padding-top: 50px; --show-h: min(66svh, 720px); }
.home-show__track {
  display: flex; list-style: none; margin: 0; padding: 0; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.home-show__track::-webkit-scrollbar { display: none; }
.home-show__track:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.home-show__slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.home-show figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
/* every slide has the same stage, so the caption and dots never jump; the work sits centred in it */
.home-show__stage { height: var(--show-h); width: 100%; display: flex; align-items: center; justify-content: center; }
/* the work at the stage height, never wider than the column, never blown up much past its own pixels */
.home-show__img { display: block; width: min(100%, calc(min(var(--show-h), calc(var(--native-h) / 1.25)) * var(--ar))); }
.home-show img { display: block; width: 100%; height: auto; }
.home-show figcaption { margin-top: var(--cap-gap); text-align: center; min-height: 6.4rem; max-width: 64ch; margin-inline: auto; }
/* the printed details in one typographic voice whatever the book's own casing: small capitals, tracked */
.home-show__details { text-transform: uppercase; letter-spacing: .08em; font-size: calc(var(--fs-meta) * .92); color: var(--grey-1); }
.caption .home-show__nw { display: inline; white-space: nowrap; margin: 0; }   /* a size or year never splits across lines */
.home-show__src { margin-top: 2px; }
.home-show__bar { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; }
.home-show__dots { display: flex; gap: 4px; }
.home-show__dot { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; position: relative; }
.home-show__dot::after { content: ""; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--rule); transition: background var(--t-hover), transform var(--t-hover); }
.home-show__dot[aria-current="true"]::after { background: var(--ink); transform: scale(1.15); }
@media (hover: none) { .home-show__bar .strip__btn { display: none; } }
@media (max-width: 768px) { .home-show { padding-top: 24px; --show-h: min(50svh, 420px); } }
.home-intro { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap-x); align-items: start; }
.home-intro p { font-size: 1.65rem; line-height: 3.2rem; max-width: 60ch; }
@media (max-width: 1024px) { .home-intro { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ 9 book page */
.book { background: var(--paper); }
.frontis { padding-top: 70px; padding-bottom: var(--section-y); }
.frontis__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
/* the cover stays in view while the description is read beside it */
.frontis__cover { grid-column: 1 / span 6; display: flex; justify-content: center; position: sticky; top: calc(var(--header-h) + 36px); }
.frontis__cover .book-cover { width: min(100%, calc(min(calc(100svh - var(--header-h) - 150px), 720px) * var(--ar))); aspect-ratio: var(--ar); }
.frontis__cover img { width: 100%; height: 100%; object-fit: contain; }
.frontis__text { grid-column: 8 / span 5; padding-bottom: 4px; }
.frontis__text h1 { font-size: 2.5rem; line-height: 1.45; margin-bottom: .35em; }
.frontis__sub { font-size: 1.65rem; line-height: 2.8rem; color: var(--grey-1); margin: 0 0 1.4em; }
.frontis .eyebrow { color: var(--accent-text); }
.frontis__desc p:last-child { margin-bottom: 0; }
.frontis h1 + .frontis__desc, .frontis h1 + .frontis__read { margin-top: 30px; }
.frontis__desc details { margin-top: var(--para); }
.frontis__desc summary {
  cursor: pointer; list-style: none; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase;
  color: var(--grey-1); display: inline-flex; min-height: 44px; align-items: center;
}
.frontis__desc summary::-webkit-details-marker { display: none; }
.frontis__desc summary::after { content: " +"; white-space: pre; }
.frontis__desc details[open] summary::after { content: " –"; }
.frontis__desc summary .less, .frontis__desc details[open] summary .more { display: none; }
.frontis__desc details[open] summary .less { display: inline; }
.frontis__desc details[open] summary { order: 2; margin-top: 6px; }
.frontis__desc details[open] { display: flex; flex-direction: column; }
.frontis__desc details > p:first-of-type { margin-top: 0; }
.frontis__read { margin-top: 34px; }
.frontis__links { margin-top: 18px; font-size: var(--fs-meta); color: var(--grey-1); }
@media (max-width: 1024px) {
  .frontis__cover { grid-column: 1 / -1; position: static; margin-bottom: 40px; }
  .frontis__cover .book-cover { width: min(72vw, calc(62svh * var(--ar)), 520px); }
  .frontis__text { grid-column: 1 / -1; }
}

/* M2 — the plate: one work, whole */
.plate-hero { padding-block: var(--section-y); }
.plate-hero .plate { width: min(100%, calc(min(84svh, 1000px) * var(--ar))); margin-inline: auto; }
.plate-hero .plate__img { width: 100%; height: auto; }
.plate-hero figcaption { margin-top: var(--cap-gap); text-align: center; max-width: 62ch; }

.plate__link { display: block; cursor: zoom-in; }
.plate__img { background: transparent; }
.caption { font-size: var(--fs-meta); line-height: 2.1rem; color: var(--grey-1); }
.caption__title, .caption__who { color: var(--ink); }
.caption__who { text-transform: uppercase; letter-spacing: var(--track); }
.caption span { display: block; }
.caption .pp { color: var(--grey-2); }

/* M3 — voice */
.voice-wrap { padding-block: var(--section-y); }
.voice-wrap .container { display: flex; justify-content: center; }

/* M4 — contents (chapters) */
.contents { padding-block: var(--section-y); }
.contents__list { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: var(--gap-x); counter-reset: none; }
.contents__item a { display: block; text-decoration: none; padding-top: 16px; border-top: 2px solid var(--swatch, var(--accent)); height: 100%; }
.contents__num { display: block; font-size: var(--fs-meta); letter-spacing: var(--track); color: var(--accent-text); }
.contents__title { display: block; text-transform: uppercase; letter-spacing: var(--track); font-size: 1.3rem; line-height: 2.2rem; margin-top: 6px; }
.contents__item picture { margin-top: 18px; }
.contents__item img { height: 150px; width: auto; }
@media (max-width: 1024px) { .contents__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .contents__list { grid-template-columns: 1fr; } .contents__item img { display: none; } }

/* M5 — sequence */
.sequence { padding-block: var(--section-y); }
.chapter-mark { margin: 140px 0 70px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.chapter-mark:first-child { margin-top: 0; }
.chapter-mark__rule { display: block; width: 48px; height: 1px; background: var(--swatch, var(--accent)); transform-origin: left; }
.chapter-mark__num { font-size: var(--fs-meta); letter-spacing: var(--track); color: var(--accent-text); text-transform: uppercase; }
.chapter-mark h2 { margin: 0; }
@media (max-width: 768px) { .chapter-mark { margin: 90px 0 44px; } }

/* rows: singles centred, portrait pairs justified to one height on one baseline */
.rows > .row { display: flex; justify-content: center; align-items: flex-end; gap: 80px; margin-bottom: 140px; }
.rows > .row:last-child { margin-bottom: 0; }
.row .plate { flex: 0 1 auto; display: flex; flex-direction: column; min-width: 0; }
.row--single .plate { max-width: 100%; align-items: center; }
.row--single .plate { width: min(100%, calc(min(80svh, 900px) * var(--ar))); }
.row--single .plate__link, .row--single picture { width: 100%; }
.row--single .plate__img { width: 100%; height: auto; }
.row--single figcaption { text-align: center; }
.row--pair .plate { flex: var(--ar) 1 0; max-width: calc(min(78svh, 820px) * var(--ar)); }
.row--pair .plate__img { width: 100%; height: auto; }
.row figcaption { margin-top: var(--cap-gap); }
@media (max-width: 768px) {
  .rows > .row { flex-direction: column; align-items: center; gap: 70px; margin-bottom: 90px; }
  .row--pair .plate, .row--single .plate { flex: none; width: min(100%, calc(70svh * var(--ar))); align-items: center; }
  .row--pair .plate__link, .row--pair picture { width: 100%; }
  .row figcaption { text-align: center; }
}

/* grid: Thota art grid, works whole on a shared baseline */
/* M5 strip: works slide sideways (native scroll-snap: momentum swipe on iOS, two-finger swipe on a Mac trackpad) */
.strip { --strip-h: min(60svh, 620px); margin-bottom: 30px; }
.strip__bar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; color: var(--grey-1); }
.strip__count { font-variant-numeric: tabular-nums; min-width: 5.5em; }
.strip__hint { flex: 1; }
.strip__btn {
  -webkit-appearance: none; appearance: none; width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--ink); font: inherit; font-size: 1.8rem; line-height: 1; cursor: pointer;
  transition: border-color var(--t-hover), opacity var(--t-hover);
}
.strip__btn:hover { border-color: var(--ink); }
.strip__btn:disabled { opacity: .3; cursor: default; border-color: var(--rule); }
.strip__track {
  display: flex; align-items: flex-start; gap: 48px; list-style: none; margin: 0;
  /* bleed to the window edges; the first work lines up with the page text */
  margin-inline: calc(50% - 50vw);
  padding: 0 max(var(--gutter), calc((100vw - var(--container)) / 2), env(safe-area-inset-left)) 6px;
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2), env(safe-area-inset-left));
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.strip__track::-webkit-scrollbar { display: none; }
.strip__track:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.strip__item { flex: none; scroll-snap-align: start; }
.strip__item:last-child { padding-right: max(var(--gutter), calc((100vw - var(--container)) / 2)); }
.plate--strip { width: min(calc(var(--strip-h) * var(--ar)), 86vw); margin: 0; }
.plate--strip .plate__link, .plate--strip picture { display: block; width: 100%; }
.plate--strip .plate__img { display: block; width: 100%; height: auto; }
.plate--strip figcaption { margin-top: var(--cap-gap); max-width: max(100%, 30ch); }
.strip.is-static .strip__bar { display: none; }
.strip__item--words { width: min(420px, 78vw); min-height: var(--strip-h); display: flex; align-items: center; }
.strip__item--words blockquote.voice { font-size: 1.85rem; line-height: 3rem; margin: 0; }
@media (hover: none) { .strip__btn { display: none; } }
@media (hover: hover) and (pointer: fine) { .strip__hint { visibility: hidden; } }
@media (max-width: 768px) { .strip { --strip-h: min(52svh, 460px); } .strip__track { gap: 28px; } }

.art-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap-x); row-gap: 70px; }
.art-grid .plate { display: flex; flex-direction: column; }
.art-grid .plate__link { height: 360px; display: flex; align-items: flex-end; justify-content: center; }
.art-grid .plate__link picture { width: min(100%, calc(360px * var(--ar))); }
.art-grid .plate__img { width: 100%; height: auto; }
.art-grid figcaption { margin-top: var(--cap-gap); }
@media (max-width: 1280px) { .art-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 768px)  { .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 50px; } .art-grid .plate__link { height: 230px; } .art-grid .plate__link picture { width: min(100%, calc(230px * var(--ar))); } }

/* folio: a work beside the words the book prints with it, sides alternating */
.folio > .folio__item { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; margin-bottom: 150px; }
.folio > .folio__item:last-child { margin-bottom: 0; }
.folio__media { grid-column: 2 / span 6; display: flex; justify-content: center; }
.folio__media .plate { width: min(100%, calc(min(78svh, 820px) * var(--ar))); }
.folio__media .plate__img { width: 100%; height: auto; }
.folio__words { grid-column: 9 / span 3; }
.folio__item:nth-child(even) .folio__media { grid-column: 6 / span 6; grid-row: 1; }
.folio__item:nth-child(even) .folio__words { grid-column: 2 / span 3; grid-row: 1; }
.folio__words blockquote.voice { font-size: 1.85rem; line-height: 3rem; margin-bottom: 30px; }
@media (max-width: 768px) {
  .folio > .folio__item { grid-template-columns: 1fr; row-gap: 26px; margin-bottom: 100px; }
  .folio__media, .folio__words, .folio__item:nth-child(even) .folio__media, .folio__item:nth-child(even) .folio__words { grid-column: 1; grid-row: auto; }
  .folio__media .plate { width: min(100%, calc(66svh * var(--ar))); }
}


/* M8 — shelf (previous / next) */
.shelf { padding-top: var(--section-y); padding-bottom: calc(var(--section-y) + 20px); }
.shelf__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-x); border-top: 1px solid var(--rule); padding-top: 30px; }
.shelf__item { display: flex; gap: 22px; align-items: flex-end; text-decoration: none; }
.shelf__item--next { justify-content: flex-start; justify-self: end; text-align: right; flex-direction: row-reverse; }
.shelf__item .book-cover { width: calc(120px * var(--ar)); max-width: 150px; aspect-ratio: var(--ar); flex: none; }
.shelf__item img { width: 100%; height: 100%; object-fit: contain; }
.shelf__dir { display: block; font-size: var(--fs-meta); color: var(--grey-1); }
.shelf__title { display: block; text-transform: uppercase; letter-spacing: var(--track); font-size: 1.3rem; line-height: 2.2rem; margin-top: 6px; }
.shelf__all { text-align: center; margin-top: 40px; font-size: var(--fs-meta); letter-spacing: var(--track); text-transform: uppercase; }
.shelf__all a { color: var(--grey-1); text-decoration: none; }
.shelf__all a:hover { color: var(--ink); }
@media (max-width: 600px) {
  .shelf__grid { grid-template-columns: 1fr; }
  .shelf__item--next { flex-direction: row; justify-content: flex-start; text-align: left; }
}

/* ------------------------------------------------------------ 10 lightbox */
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(8, 8, 8, .96); color: #eee; }
.lightbox::backdrop { background: rgba(8, 8, 8, .96); }
.lightbox__stage { position: absolute; inset: 56px 64px 96px; display: flex; align-items: center; justify-content: center; touch-action: pinch-zoom; }
.lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox__bar { position: absolute; left: 64px; right: 64px; bottom: 26px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.lightbox__cap { font-size: var(--fs-meta); line-height: 2.1rem; letter-spacing: .06em; color: #cfcfcf; }
.lightbox__cap span { display: block; }
.lightbox :focus-visible { outline-color: #fff; }
.lightbox:focus { outline: none; }
.lightbox__cap .caption__title { color: #fff; }
.lightbox__count { font-size: var(--fs-meta); letter-spacing: var(--track); color: #9a9a9a; white-space: nowrap; }
.lightbox__btn { position: absolute; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; color: #ddd; }
.lightbox__btn:hover { color: #fff; }
.lightbox__close { top: 6px; right: 6px; }
.lightbox__prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 4px; top: 50%; transform: translateY(-50%); }
@media (max-width: 768px) {
  .lightbox__stage { inset: 56px 10px 120px; }
  .lightbox__bar { left: 18px; right: 18px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .lightbox__prev, .lightbox__next { top: 6px; transform: none; }
  .lightbox__prev { left: 6px; }
  .lightbox__next { right: 62px; }
}

/* ------------------------------------------------------------ 11 motion */
.reveal-on [data-reveal] { opacity: 0; transform: translate3d(0, -28px, 0); transition: opacity var(--t-reveal) var(--ease-reveal), transform var(--t-reveal) var(--ease-reveal); transition-delay: var(--stagger, 0ms); }
.reveal-on [data-reveal].is-visible { opacity: 1; transform: none; }
.reveal-on .chapter-mark[data-reveal] .chapter-mark__rule { transform: scaleX(0); transition: transform 600ms var(--ease-reveal) 200ms; }
.reveal-on .chapter-mark[data-reveal].is-visible .chapter-mark__rule { transform: scaleX(1); }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 250ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal-on [data-reveal] { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
.no-anim [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ------------------------------------------------------------ 12 a11y + print */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink-2); color: var(--paper); padding: 10px 16px; font-size: var(--fs-meta); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media print {
  .site-header, .site-footer, .shelf, .lightbox, .frontis__read { display: none !important; }
  .reveal-on [data-reveal] { opacity: 1; transform: none; }
}
.page-intro + .section { padding-top: 0; }
