/* =====================================================================
   Qiao Li — personal website
   One stylesheet for every page. Colours, fonts and spacing are set in
   :root below; change them there and the whole site follows.
   ===================================================================== */

/* Fonts are stored on this site (assets/fonts), so nothing is loaded from
   Google or any other third party. That keeps the site fast in mainland China. */
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-latin-wght-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --bg: #ffffff;
  --ink: #111111;        /* headings, links */
  --text: #2a2a2a;       /* body text */
  --muted: #6b6b6b;      /* labels, meta */
  --faint: #a3a3a3;
  --line: #e3e3e1;       /* hairlines */
  --soft: #f4f4f2;       /* quiet panels */

  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --space: clamp(72px, 10vw, 136px);   /* vertical space between sections */
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 17px; line-height: 1.62;
  font-feature-settings: "kern", "liga"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--muted); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { background: #111; color: #fff; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 400; }
p { margin: 0 0 1em; }
em, cite { font-style: italic; }
cite { font-style: italic; }
[lang|="zh"] { font-style: normal; letter-spacing: .02em; }
.zh { font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--space) 0 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Type ---------- */
.label {
  font-family: var(--sans); font-size: 12px; line-height: 1.4; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.display { font-family: var(--serif); font-size: clamp(64px, 11vw, 148px); line-height: .9; letter-spacing: -.015em; }
.title { font-family: var(--serif); font-size: clamp(46px, 7vw, 92px); line-height: .98; letter-spacing: -.01em; }
.h2 { font-family: var(--serif); font-size: clamp(32px, 3.6vw, 46px); line-height: 1.05; }
.h3 { font-family: var(--serif); font-size: clamp(24px, 2.2vw, 30px); line-height: 1.15; }
.lede { font-family: var(--serif); font-size: clamp(22px, 2.2vw, 29px); line-height: 1.32; color: var(--ink); max-width: 34em; }
.prose { max-width: 40em; }
.prose p { margin-bottom: 1.1em; }
.prose h3 { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 2.4em 0 1em; }
.meta { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.small { font-size: 14.5px; line-height: 1.55; }
.more { display: inline-flex; gap: .5em; align-items: baseline; font-size: 14px; font-weight: 500; letter-spacing: .02em; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.more::after { content: "→"; transition: transform .2s ease; }
.more:hover::after { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(255,255,255,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }
.brand { font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: .3em; text-decoration: none; color: var(--ink); white-space: nowrap; padding-right: .3em; }
.nav { display: flex; gap: clamp(16px, 1.9vw, 28px); align-items: center; }
.nav a { font-size: 14px; color: var(--muted); text-decoration: none; white-space: nowrap; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.menu-btn { display: none; font: inherit; font-size: 14px; letter-spacing: .04em; color: var(--ink); background: none; border: 0; padding: 10px 0 10px 12px; cursor: pointer; }

@media (max-width: 940px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 12px var(--gutter) 40px;
    overflow-y: auto; visibility: hidden; opacity: 0; transition: opacity .2s, visibility 0s .2s;
  }
  .menu-open .nav { visibility: visible; opacity: 1; transition: opacity .2s; }
  .menu-open { overflow: hidden; }
  .nav a { font-family: var(--serif); font-size: clamp(30px, 7vw, 40px); color: var(--ink); padding: 10px 0; border: 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav a[aria-current] { font-style: italic; border-bottom-color: var(--line); }
  .menu-open .site-header { border-bottom-color: var(--line); background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Page head (inner pages) ---------- */
.page-head { padding: clamp(56px, 9vw, 120px) 0 0; }
.page-head .label { margin-bottom: 22px; }
.page-head .lede { margin-top: clamp(24px, 3vw, 36px); }

/* ---------- Section head ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head .h2 { flex: 1; }
.sec-head .more { flex: none; }
.sec-intro { max-width: 40em; margin: -12px 0 clamp(28px, 4vw, 44px); color: var(--muted); }

/* ---------- Home hero ---------- */
.hero { padding: clamp(48px, 8vw, 112px) 0 0; }
.hero .grid { align-items: end; row-gap: 40px; }
.hero-text { grid-column: 1 / span 7; }
.hero-text .label { margin-bottom: clamp(20px, 3vw, 32px); }
.hero-text .lede { margin-top: clamp(28px, 3.4vw, 44px); }
.hero-roles { margin: clamp(28px, 3vw, 36px) 0 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15.5px; color: var(--text); max-width: 36em; }
.hero-roles li { padding-left: 18px; position: relative; }
.hero-roles li::before { content: ""; position: absolute; left: 0; top: .78em; width: 8px; border-top: 1px solid var(--ink); }
.hero-portrait { grid-column: 9 / span 4; }
.hero-portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--soft); }
.hero-portrait figcaption { margin-top: 10px; }

/* ---------- Wide still with caption ---------- */
.still { margin: var(--space) auto 0; }
.still img { width: 100%; aspect-ratio: 2.55 / 1; object-fit: cover; background: #ddd; }
.still figcaption { margin-top: 12px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.still figcaption a { color: inherit; }

/* ---------- Highlights ---------- */
.highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); margin: 0; padding: 0; list-style: none; }
.highlights li { border-top: 1px solid var(--ink); padding-top: 18px; }
.highlights .label { display: block; margin-bottom: 14px; }
.highlights strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.18; color: var(--ink); margin-bottom: 10px; }
.highlights p { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin: 0; }

/* ---------- Film cards (4:5) ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.card { text-decoration: none; color: inherit; display: block; }
.card figure { margin: 0; overflow: hidden; background: var(--soft); }
.card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity .25s ease; }
a.card:hover img { opacity: .86; }
.card .label { display: block; margin: 16px 0 8px; }
.card h3 { font-family: var(--serif); font-size: 24px; line-height: 1.12; }
.card p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* ---------- Book covers ---------- */
.books { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px); }
.book { color: inherit; text-decoration: none; display: block; }
.book .cover { display: block; background: var(--soft); border: 1px solid var(--line); }
.book .cover img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.book .label { display: block; margin: 16px 0 8px; }
.book h3 { font-family: var(--serif); font-size: 21px; line-height: 1.16; }
.book p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
a.book:hover .cover { opacity: .9; }

/* ---------- Text blocks with top rule (projects teaser, themes) ---------- */
.blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); margin: 0; padding: 0; list-style: none; }
.blocks.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blocks.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.blocks > * { border-top: 1px solid var(--line); padding-top: 20px; }
.blocks .label { display: block; margin-bottom: 12px; }
.blocks h3 { font-family: var(--serif); font-size: 25px; line-height: 1.15; margin-bottom: 10px; }
.blocks p { font-size: 15.5px; line-height: 1.58; margin: 0 0 .6em; }
.blocks p.meta { font-size: 14px; }

/* ---------- Contact strip ---------- */
.contact-strip { border-top: 1px solid var(--ink); padding-top: clamp(28px, 4vw, 44px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 20px; align-items: end; }
.contact-strip .h2 { grid-column: 1 / span 7; }
.contact-strip .contact-links { grid-column: 9 / span 4; }
.email { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.2; text-decoration: none; border-bottom: 1px solid var(--ink); word-break: break-word; }

/* ---------- Two-column body (aside + main) ---------- */
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 32px; }
.split > .aside { grid-column: 1 / span 4; }
.split > .main { grid-column: 6 / span 7; }
.sticky { position: sticky; top: calc(var(--header-h) + 28px); }
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--soft); }
.portrait figcaption { margin-top: 10px; }
.box { background: var(--soft); padding: clamp(22px, 3vw, 32px); }
.box .label { display: block; margin-bottom: 12px; }
.box p:last-child { margin-bottom: 0; }

/* ---------- Definition-style lists (profile, facts) ---------- */
.list { margin: 0; padding: 0; list-style: none; }
.list > li, .list > div { display: grid; grid-template-columns: minmax(96px, 2fr) 10fr; column-gap: clamp(16px, 2.4vw, 32px); padding: 16px 0; border-top: 1px solid var(--line); }
.list > :last-child { border-bottom: 1px solid var(--line); }
.list .yr { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.list .what { font-size: 16px; line-height: 1.5; }
.list .what strong { font-weight: 500; color: var(--ink); }
.list .what .meta { display: block; margin-top: 3px; }
.facts { margin: 0; }
.facts div { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; font-size: 15.5px; color: var(--ink); }

.profile-block + .profile-block { margin-top: clamp(56px, 7vw, 88px); }
.profile-block .h3 { margin-bottom: 20px; }

/* ---------- Role tags ---------- */
.tag { display: inline-block; font-size: 11px; line-height: 1; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); border: 1px solid var(--ink); padding: 6px 8px 5px; margin: 0 6px 6px 0; vertical-align: middle; white-space: nowrap; }
.tag.light { color: var(--muted); border-color: var(--faint); }

/* ---------- Film rows (Filmmaking page) ---------- */
.film { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 24px; padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--line); }
.film:first-of-type { border-top: 0; padding-top: 0; }
.film figure { grid-column: 1 / span 4; margin: 0; background: var(--soft); }
.film figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.film .body { grid-column: 6 / span 7; }
.film .label { display: block; margin-bottom: 14px; }
.film h3 { font-family: var(--serif); font-size: clamp(30px, 3.2vw, 42px); line-height: 1.04; margin-bottom: 8px; }
.film .alt { font-size: 18px; color: var(--muted); margin-bottom: 18px; display: block; }
.film .roles { margin: 16px 0 18px; }
.film p { max-width: 36em; }
.film .recog { margin: 18px 0 0; padding: 0; list-style: none; font-size: 15px; }
.film .recog li { padding: 9px 0; border-top: 1px solid var(--line); }
.film .recog li:last-child { border-bottom: 1px solid var(--line); }

/* ---------- Table (further credits, funding) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.table th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 0 16px 12px 0; border-bottom: 1px solid var(--ink); }
.table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table td:first-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; width: 6em; }
.table td .meta { display: block; margin-top: 2px; }
.table .t { color: var(--ink); }

/* ---------- Bibliography ---------- */
.biblio { margin: 0; padding: 0; list-style: none; }
.biblio li { display: grid; grid-template-columns: minmax(96px, 2fr) 10fr; column-gap: clamp(16px, 2.4vw, 32px); padding: 20px 0; border-top: 1px solid var(--line); }
.biblio li:last-child { border-bottom: 1px solid var(--line); }
.biblio .yr { font-size: 14px; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.biblio .ttl { font-family: var(--serif); font-size: 22px; line-height: 1.22; color: var(--ink); display: block; margin-bottom: 6px; }
.biblio .ref { font-size: 15px; color: var(--text); }
.biblio .ref a { word-break: break-word; }

/* Book entries with cover */
.book-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 20px; padding: clamp(32px, 4vw, 48px) 0; border-top: 1px solid var(--line); }
.book-row:first-child { border-top: 0; padding-top: 0; }
.book-row .cover { grid-column: 1 / span 3; border: 1px solid var(--line); background: var(--soft); align-self: start; }
.book-row .cover img { width: 100%; height: auto; }
.book-row .body { grid-column: 5 / span 8; }
.book-row .label { display: block; margin-bottom: 12px; }
.book-row h3 { font-family: var(--serif); font-size: clamp(28px, 2.8vw, 38px); line-height: 1.06; margin-bottom: 6px; }
.book-row .sub { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.25; color: var(--text); display: block; margin-bottom: 18px; }
.book-row p { max-width: 36em; }
.book-row .links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 18px; }

/* ---------- Projects (International page) ---------- */
.project { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 20px; padding: clamp(40px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.project:first-of-type { border-top: 0; padding-top: 0; }
.project .side { grid-column: 1 / span 4; }
.project .side .label { display: block; margin-bottom: 14px; }
.project .side h3 { font-family: var(--serif); font-size: clamp(28px, 2.8vw, 38px); line-height: 1.06; }
.project .body { grid-column: 6 / span 7; }
.project .facts { margin-top: 22px; }
.project figure { margin: 0 0 24px; }
.project figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }

.countries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px clamp(20px, 2.4vw, 32px); margin: 0; padding: 0; list-style: none; }
.countries li { border-top: 1px solid var(--line); padding-top: 14px; font-size: 15px; line-height: 1.55; }
.countries .label { display: block; margin-bottom: 8px; color: var(--ink); }

/* ---------- Working into Old Age project page ---------- */
.film-hero { background: #0f0f0e; color: #eeebe5; }
.film-hero img { width: 100%; aspect-ratio: 2.55 / 1; object-fit: cover; }
.film-hero .wrap { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(36px, 5vw, 64px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.film-hero .label { color: #a8a49b; }
.film-hero h1 { color: #f3f1ec; }
.film-hero .alt { font-size: clamp(22px, 2.6vw, 34px); color: #cfcac0; margin-top: 10px; display: block; }
.film-hero .status { display: flex; gap: 18px; align-items: center; }
.wip { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; border: 1px solid #a8a49b; color: #e3dfd7; padding: 7px 10px 6px; }
.year { font-family: var(--serif); font-size: 34px; color: #f3f1ec; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 16px); }
.gallery a { display: block; background: var(--soft); }
.gallery a:nth-child(5n+1) { grid-column: 1 / -1; }
.gallery img { width: 100%; aspect-ratio: 2.39 / 1; object-fit: cover; transition: opacity .2s; }
.gallery a:hover img { opacity: .88; }
.epigraph { text-align: center; padding: var(--space) var(--gutter); }
.epigraph p { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 46px); line-height: 1.2; color: var(--ink); margin: 0; }
.epigraph .zh { font-size: clamp(20px, 2.2vw, 28px); color: var(--muted); margin-top: 14px; letter-spacing: .12em; }

/* Lightbox */
.lightbox { padding: 0; border: 0; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; background: rgba(12,12,11,.97); color: #eee; }
.lightbox::backdrop { background: rgba(12,12,11,.97); }
.lightbox[open] { display: flex; flex-direction: column; }
.lb-bar, .lb-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px var(--gutter); }
.lb-bar .label { color: #aaa; }
.lightbox button { font: inherit; font-size: 14px; color: #eee; background: none; border: 0; cursor: pointer; padding: 8px 0; }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 var(--gutter); min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Footer ---------- */
.site-footer { margin-top: var(--space); border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 32px); row-gap: 24px; }
.site-footer .f-name { grid-column: 1 / span 4; }
.site-footer .f-name strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--ink); margin-bottom: 6px; }
.site-footer .f-nav { grid-column: 6 / span 5; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.site-footer .f-nav a { color: var(--text); text-decoration: none; }
.site-footer .f-nav a:hover { text-decoration: underline; }
.site-footer .f-copy { grid-column: 11 / span 2; text-align: right; align-self: end; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .books { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .countries { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-footer .f-nav { grid-column: 6 / span 7; }
  .site-footer .f-copy { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 900px) {
  .hero-text { grid-column: 1 / -1; }
  .hero-portrait { grid-column: 1 / span 7; }
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .blocks, .blocks.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split > .aside, .split > .main { grid-column: 1 / -1; }
  .sticky { position: static; }
  .split > .aside .portrait { max-width: 420px; }
  .film figure { grid-column: 1 / span 5; }
  .film .body { grid-column: 6 / span 7; }
  .project .side, .project .body { grid-column: 1 / -1; }
  .book-row .cover { grid-column: 1 / span 4; }
  .book-row .body { grid-column: 5 / span 8; }
  .contact-strip .h2, .contact-strip .contact-links { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .hero-portrait { grid-column: 1 / span 9; }
  .highlights { grid-template-columns: 1fr; row-gap: 28px; }
  .cards { column-gap: 14px; row-gap: 32px; }
  .card h3 { font-size: 20px; }
  .card p { font-size: 13.5px; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; row-gap: 32px; }
  .book h3 { font-size: 19px; }
  .blocks, .blocks.two, .blocks.four { grid-template-columns: 1fr; }
  .film figure, .film .body { grid-column: 1 / -1; }
  .film figure { max-width: 420px; }
  .book-row .cover { grid-column: 1 / span 6; }
  .book-row .body { grid-column: 1 / -1; }
  .list > li, .list > div, .biblio li { grid-template-columns: 1fr; row-gap: 4px; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .countries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: 1fr; }
  .sec-head { flex-wrap: wrap; }
  .still img { aspect-ratio: 16 / 9; }
  .film-hero img { aspect-ratio: 4 / 3; }
  .site-footer .f-name, .site-footer .f-nav { grid-column: 1 / -1; }
  /* tables become stacked entries on phones */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: auto; }
  .table tr { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .table tr:first-child { border-top: 1px solid var(--ink); }
  .table td { border: 0; padding: 2px 0; }
  .table td:first-child { width: auto; font-size: 13.5px; }
  .table td:nth-child(3), .table td:nth-child(4) { font-size: 14.5px; color: var(--muted); }
  .table td .tag { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .menu-btn { display: none; }
  body { font-size: 11pt; }
  a { text-decoration: none; }
}
