/* Xiaoyi Li portfolio
   Layout: one long page in rooms. Film sits in a dark screening room where every film plays in place; art hangs on
   a light wall (a sideways strip for Landscapes of the Mind); design sits in a paler room with a working phone and a
   page-turning magazine. The sticky header shows how far down you are and which room you're in. The loud elements are
   the dotted name and the Verse phone; everything else stays quiet. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {  /* Archivo fixed at 62% width, weight 800, letters only: used to draw the dotted name */
  font-family: "Archivo Name";
  src: url("fonts/archivo-name.woff2") format("woff2");
  font-weight: 800;
  font-display: block;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --wall: #e9ecea;      /* light rooms: a cool classroom wall */
  --ink: #142028;       /* text and the dotted name */
  --graphite: #56626a;  /* secondary text on the wall */
  --rule: #c3cbc9;      /* hairlines */
  --moon: #2a6669;      /* links and focus: the moonlight teal from The Pen */
  --night: #0f1c1e;     /* the screening room */
  --on-night: #dfe7e5;  /* text in the screening room */
  --dim-night: #93a5a2; /* secondary text in the screening room */

  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Newsreader", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(20px, 4vw, 56px);
  --max: 1360px;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 2rem;
  --step-3: clamp(2.6rem, 6vw, 5rem);

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
}
img, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--moon); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; }
.night :focus-visible, dialog :focus-visible { outline-color: var(--on-night); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header: sticky, shows where you are ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(233, 236, 234, 0.86); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  transition: background 0.4s, color 0.4s;
}
.head-row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px; padding-top: 16px; padding-bottom: 14px;
  font-family: var(--display); font-size: 0.95rem;
}
.site-head .home { color: var(--ink); text-decoration: none; font-weight: 650; font-stretch: 75%; font-size: 1.15rem; transition: color 0.4s; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-head nav a { position: relative; color: var(--graphite); text-decoration: none; padding: 2px 0; transition: color 0.3s; }
.site-head nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.45s var(--ease); }
.site-head nav a:hover { color: var(--ink); }
.site-head nav a[aria-current="true"] { color: var(--ink); }
.site-head nav a[aria-current="true"]::after { transform: scaleX(1); }
.head-progress { height: 2px; background: rgba(20, 32, 40, 0.08); }
.head-progress i { display: block; height: 100%; background: var(--moon); transform-origin: 0 50%; transform: scaleX(var(--read, 0)); }
.site-head.on-dark { background: rgba(15, 28, 30, 0.82); }
.site-head nav .nav-gh { display: inline-flex; align-items: center; gap: 6px; padding-left: 18px; border-left: 1px solid var(--rule); }
.site-head nav .nav-gh svg { width: 1.05em; height: 1.05em; flex: none; }
.site-head.on-dark nav .nav-gh { border-left-color: rgb(255 255 255 / 0.18); }
.site-head.on-dark .home, .site-head.on-dark nav a[aria-current="true"], .site-head.on-dark nav a:hover { color: var(--on-night); }
.site-head.on-dark nav a { color: var(--dim-night); }
.site-head.on-dark .head-progress { background: rgba(223, 231, 229, 0.12); }
.site-head.on-dark .head-progress i { background: #8fd0c4; }
html { scroll-padding-top: 58px; }

.site-foot { padding-top: clamp(56px, 8vw, 110px); padding-bottom: 40px; }
.site-foot .row {
  padding-top: 20px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-family: var(--display); font-size: 0.95rem; color: var(--graphite);
}

/* ---------- hero: the name drawn in dots by dots.js ---------- */
.hero { padding-top: clamp(24px, 5vw, 72px); padding-bottom: clamp(48px, 7vw, 104px); overflow-x: hidden; overflow-x: clip; }
.hero-name {
  position: relative;
  font-family: "Archivo Name", var(--display);
  font-weight: 800;
  font-size: clamp(5.5rem, 27vw, 27rem);
  line-height: 0.86;
  white-space: nowrap;
  margin-left: -0.04em;
  touch-action: pan-y;
}
.hero-name canvas { position: absolute; left: 0; top: 0; }
.hero-name.dotted .name-text { color: transparent; }
.hero-sub {
  margin-top: clamp(22px, 3vw, 40px); font-family: var(--display); font-size: clamp(0.98rem, 1.2vw, 1.12rem); line-height: 1.6; color: var(--graphite);
}

/* ---------- page not found ---------- */
.nf { min-height: 60vh; padding-top: clamp(48px, 10vw, 140px); padding-bottom: clamp(48px, 8vw, 120px); }
.nf h1 { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-size: clamp(3rem, 9vw, 7rem); line-height: 0.9; margin: 0 0 24px; }
.nf p { font-size: 1.15rem; margin: 0 0 10px; }

/* ---------- rooms ---------- */
.room { padding-top: clamp(64px, 9vw, 128px); padding-bottom: clamp(64px, 9vw, 128px); }
.night { background: var(--night); color: var(--on-night); }
.night a { color: var(--on-night); }
.room-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-bottom: clamp(36px, 5vw, 64px); }
.room-head h2 { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-size: var(--step-3); line-height: 0.9; }
.room-head p { color: var(--graphite); font-size: 1.05rem; max-width: 30rem; }
.night .room-head p { color: var(--dim-night); }

/* shared project pattern: words left, pictures right */
.project { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px clamp(16px, 2.4vw, 36px); }
.project + .project { margin-top: clamp(64px, 8vw, 112px); }
.project-text { grid-column: 1 / span 4; display: grid; gap: 10px; align-content: start; }
.project-media { grid-column: 5 / -1; }
.project-text h3 { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 0.92; }
.kind { font-family: var(--display); font-size: 0.95rem; color: var(--graphite); }
.night .kind { color: var(--dim-night); }
.project-text p.line { font-size: 1.05rem; line-height: 1.55; max-width: 30rem; }
.project-text .more { font-family: var(--display); font-size: 0.98rem; }

/* ---------- films ---------- */
.film .project-media { grid-row: span 1; }
.screen {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer;
  background: #000; overflow: hidden; aspect-ratio: var(--ar, 16 / 9);
}
.screen video, .screen img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity 0.6s; }
.screen video { position: absolute; inset: 0; opacity: 0; }
.screen video.live { opacity: 1; }
.screen:hover video, .screen:hover img { transform: scale(1.025); }
.screen .badge {
  position: absolute; left: clamp(12px, 2vw, 22px); bottom: clamp(12px, 2vw, 22px);
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 1rem; color: #fff;
  background: rgba(10, 18, 20, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 9px 16px 9px 10px; border-radius: 999px;
  transition: background 0.3s, transform 0.4s var(--ease);
}
.screen:hover .badge { background: rgba(10, 18, 20, 0.9); transform: translateY(-2px); }
.badge svg { width: 26px; height: 26px; flex: none; }
.loop-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.16); }
.loop-bar i { display: block; height: 100%; background: rgba(255, 255, 255, 0.75); transform-origin: 0 50%; transform: scaleX(0); }
.badge .len { color: #b9c7c4; font-weight: 500; }
.play-text {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-top: 6px;
  background: var(--on-night); color: var(--night); border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--display); font-weight: 650; font-size: 1rem; padding: 10px 18px 10px 12px;
  transition: transform 0.3s var(--ease);
}
.play-text:hover { transform: translateY(-2px); }
.play-text svg { width: 22px; height: 22px; }
.film .stills { grid-column: 1 / -1; --row-h: clamp(80px, 8.4vw, 126px); margin-top: 4px; }

/* ---------- justified galleries ---------- */
.jg { --row-h: clamp(150px, 17vw, 240px); display: flex; flex-wrap: wrap; gap: clamp(8px, 1vw, 12px); }
.jg::after { content: ""; flex-grow: 1000000; }
.jg a, .jg figure { position: relative; display: block; margin: 0; flex-grow: var(--ar); flex-basis: calc(var(--ar) * var(--row-h)); overflow: hidden; background: rgba(127, 140, 140, 0.15); }
.jg img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; transition: transform 0.9s var(--ease), filter 0.4s; }
.jg a:hover img { transform: scale(1.04); }
.jg.tall { --row-h: clamp(150px, 15vw, 220px); }
.jg.jg-js::after { display: none; }
.jg.jg-js > * { flex: none; }
.jg.jg-js img { height: 100%; }
.jg.small { --row-h: clamp(90px, 9vw, 130px); }

/* ---------- series heads, sub-heads ---------- */
.series-head { display: grid; gap: 10px; max-width: 46rem; margin-bottom: clamp(20px, 3vw, 32px); }
.series-head h3 { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-size: clamp(2.2rem, 4.4vw, 3.6rem); line-height: 0.92; }
.series-head .line { font-size: 1.05rem; line-height: 1.55; max-width: 36rem; }
.sub-head { font-family: var(--display); font-weight: 650; font-size: 1rem; color: var(--ink); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.sub-head span { font-weight: 400; color: var(--graphite); font-size: 0.92rem; }
.process { margin-top: clamp(28px, 4vw, 44px); }
.process-row { margin-top: clamp(20px, 3vw, 32px); }

/* ---------- sideways strip: swipe, drag, arrows, progress ---------- */
.strip { position: relative; }
.strip-track {
  display: flex; gap: clamp(14px, 2vw, 28px); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  padding: 4px max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  scrollbar-width: none; cursor: grab; outline-offset: -4px;
}
.strip-track::-webkit-scrollbar { display: none; }
.strip-track.dragging { cursor: grabbing; scroll-snap-type: none; }
.strip-track.dragging a { pointer-events: none; }
.strip-track figure { margin: 0; flex: 0 0 auto; scroll-snap-align: start; display: grid; gap: 10px; }
.strip-track a { display: block; height: clamp(300px, 58vh, 640px); overflow: hidden; background: rgba(127, 140, 140, 0.15); -webkit-user-drag: none; }
.strip-track img { height: 100%; width: auto; transition: transform 0.9s var(--ease); -webkit-user-drag: none; user-select: none; }
.strip-track a:hover img { transform: scale(1.03); }
.strip-track figcaption { font-family: var(--display); font-size: 0.92rem; color: var(--graphite); }
.strip-track figcaption b { color: var(--ink); font-weight: 650; }
.strip-ui { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-family: var(--display); }
.strip-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--rule); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background 0.25s, border-color 0.25s, opacity 0.25s, transform 0.25s var(--ease);
}
.strip-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.strip-btn:hover:not(:disabled) { background: var(--ink); color: var(--wall); border-color: var(--ink); }
.strip-btn:active:not(:disabled) { transform: scale(0.94); }
.strip-btn:disabled { opacity: 0.3; cursor: default; }
.strip-progress { position: relative; flex: 1; height: 22px; cursor: pointer; touch-action: none; }
.strip-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 2px; background: var(--rule); border-radius: 1px; }
.strip-progress i { position: absolute; top: 8px; height: 6px; border-radius: 3px; background: var(--ink); left: calc(var(--pos, 0) * (100% - var(--size, 0.2) * 100%)); width: calc(var(--size, 0.2) * 100%); transition: height 0.2s, top 0.2s; }
.strip-progress:hover i, .strip-progress.active i { top: 6px; height: 10px; border-radius: 5px; }
.strip-count { flex: none; min-width: 5.5em; text-align: right; font-size: 0.95rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.strip-count b { color: var(--ink); font-weight: 700; }

/* ---------- design room ---------- */
.room.design { background: #f1f3f1; }
.project-extra { grid-column: 1 / -1; display: grid; gap: clamp(28px, 4vw, 44px); margin-top: clamp(12px, 2vw, 24px); }
.project-extra > .sub-head, .project-extra > .jg { grid-column: 1 / -1; }
.project-extra .sub-head { margin-bottom: 12px; }

/* Verse: words, the working phone, things to try */
.verse { align-items: center; }
.verse .project-text { grid-column: 1 / span 4; }
.verse-stage { grid-column: 5 / span 4; }
.verse-live { position: relative; min-height: 200px; }
.verse-live .verse-fallback { width: min(100%, 392px); margin: 0 auto; }
.verse-live.ready .verse-fallback { display: none; }
.vp-try { grid-column: 9 / -1; font-family: var(--display); align-self: center; }
.vp-try-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 650; }
.vp-try-count { font-weight: 400; color: var(--graphite); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.vp-try-bar { height: 4px; border-radius: 2px; background: var(--rule); margin: 10px 0 6px; overflow: hidden; }
.vp-try-bar i { display: block; height: 100%; background: var(--moon); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform 0.6s var(--ease); }
.vp-try ul { list-style: none; margin: 0; padding: 0; }
.vp-try li button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 2px; border: 0; border-bottom: 1px solid var(--rule);
  background: none; cursor: pointer; text-align: left; font-family: var(--display); font-size: 0.98rem; color: var(--ink); transition: color 0.2s, padding 0.3s var(--ease);
}
.vp-try li button:hover { padding-left: 8px; color: var(--moon); }
.vp-try .tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; transition: background 0.3s, border-color 0.3s; }
.vp-try .tick::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px) scale(0); transition: transform 0.35s var(--ease); }
.vp-try li.done .tick { background: var(--moon); border-color: var(--moon); }
.vp-try li.done .tick::after { transform: rotate(45deg) translate(-1px, -1px) scale(1); }
.vp-try li.done button { color: var(--graphite); }
.vp-try-note { margin-top: 12px; font-size: 0.88rem; color: var(--graphite); }
.vp-try-reset { margin-top: 10px; border: 0; background: none; padding: 0; font-family: var(--display); font-size: 0.9rem; color: var(--moon); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; visibility: hidden; }
.vp-try.started .vp-try-reset { visibility: visible; }

/* Living Blueprint: the page-turning reader */
.lb .project-media { min-width: 0; }
.book { position: relative; outline: none; }
.book:focus-visible { outline: 2px solid var(--moon); outline-offset: 8px; }
.book-stage { position: relative; perspective: 2400px; }
.book-fallback { width: 45%; margin-left: 50%; }
.book-spread { position: relative; width: 100%; aspect-ratio: 1.4142; transition: transform 0.7s var(--ease); perspective: 2600px; }
.book-spread.only-right { transform: translateX(-25%); }
.book-spread.only-left { transform: translateX(25%); }
.book-spread.single { aspect-ratio: 0.7071; width: min(100%, 420px); margin: 0 auto; transform: none; }
.book-page { position: absolute; top: 0; bottom: 0; width: 50%; background: #fff; box-shadow: 0 22px 40px -24px rgba(20, 32, 40, 0.45); }
.book-page.l { left: 0; }
.book-page.r { right: 0; }
.book-page img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.book-page.empty { visibility: hidden; }
.book-page.l::after, .book-page.r::after { content: ""; position: absolute; top: 0; bottom: 0; width: 12%; pointer-events: none; }
.book-page.l::after { right: 0; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12)); }
.book-page.r::after { left: 0; background: linear-gradient(270deg, transparent, rgba(0, 0, 0, 0.16)); }
.single .book-page { width: 100%; left: 0; }
.single .book-page::after { display: none; }
.book-leaf { display: none; position: absolute; top: 0; bottom: 0; width: 50%; pointer-events: none; z-index: 3; background: #fff; overflow: hidden; will-change: transform; box-shadow: 0 0 24px rgba(0, 0, 0, 0.12); }
.book-leaf img { width: 100%; height: 100%; object-fit: cover; }
.book-leaf.fwd { left: 50%; transform-origin: 0 50%; }
.book-leaf.back { left: 0; transform-origin: 100% 50%; }
.book-leaf .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.04) 75%); opacity: 0; pointer-events: none; }
.book-page { cursor: zoom-in; }
.book-spread { touch-action: pan-y; }
.book-hit { position: absolute; z-index: 4; top: 0; bottom: 0; width: 14%; border: 0; padding: 0; background: transparent; cursor: pointer; transition: background 0.3s; }
.book-hit.hit-prev { left: 0; }
.book-hit.hit-next { right: 0; }
.book-hit.hit-prev:hover { background: linear-gradient(90deg, rgba(20, 32, 40, 0.12), transparent); }
.book-hit.hit-next:hover { background: linear-gradient(270deg, rgba(20, 32, 40, 0.12), transparent); }
.at-start .book-hit.hit-prev, .at-end .book-hit.hit-next { display: none; }
.only-right .book-hit.hit-prev { left: 50%; }
.only-left .book-hit.hit-next { right: 50%; }
.book-ui { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-family: var(--display); }
.book-track { flex: 1; display: flex; gap: 3px; height: 22px; align-items: center; }
.book-track button { flex: 1; height: 6px; padding: 0; border: 0; border-radius: 2px; background: var(--rule); cursor: pointer; transition: background 0.3s, height 0.2s; }
.book-track button:hover { height: 12px; }
.book-track button.seen { background: #9fb3b0; }
.book-track button.on { background: var(--ink); height: 12px; }
.book-num { flex: none; min-width: 7.5em; text-align: right; font-size: 0.95rem; color: var(--graphite); font-variant-numeric: tabular-nums; }
.credit { margin-top: 14px; font-size: 0.88rem; color: var(--graphite); max-width: 40rem; }

/* ---------- other projects ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 48px) clamp(16px, 2.4vw, 36px); }
.card { display: grid; gap: 16px; align-content: start; }
.card.wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 16px clamp(16px, 2.4vw, 36px); align-items: end; }
.card.plain { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 22px; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.card.plain .card-text { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 4px 32px; }
.card.plain .card-text p:not(.kind) { grid-column: 2; grid-row: 1 / span 2; }
.card-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: rgba(127, 140, 140, 0.15); }
.card-media a { display: block; height: 100%; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card-media a:hover img { transform: scale(1.03); }
.card-media a { position: relative; }
.card-media a[hidden] { display: none; }
.card-count { position: absolute; left: 12px; bottom: 12px; padding: 5px 11px 6px; border-radius: 999px; background: rgba(12, 18, 18, 0.62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-family: var(--display); font-size: 0.84rem; line-height: 1; pointer-events: none; }
/* a document (a certificate): shown whole, like a sheet of paper lying on the table */
.card-media.doc { padding: clamp(14px, 5.5%, 34px) clamp(18px, 8%, 52px); }
.card-media.doc a { overflow: visible; }
.card-media.doc img { object-fit: contain; filter: drop-shadow(0 10px 22px rgb(20 32 40 / 0.16)) drop-shadow(0 1px 2px rgb(20 32 40 / 0.12)); }
.card-media.doc a:hover img { transform: scale(1.02); }
.card-media.duo { aspect-ratio: auto; display: flex; gap: clamp(8px, 1vw, 12px); background: none; }
.card-media.duo a { flex: var(--ar) 1 0; aspect-ratio: var(--ar); min-width: 0; height: auto; }
.card-text { display: grid; gap: 8px; align-content: start; }
.card h3 { font-family: var(--display); font-weight: 700; font-stretch: 75%; font-size: var(--step-1); line-height: 1.2; }
.card .kind { margin-top: -2px; }
.card-text p:not(.kind) { font-size: 1.02rem; line-height: 1.55; max-width: 34rem; }
.card .links { font-family: var(--display); font-size: 0.95rem; display: flex; gap: 16px; }

/* video channels: one tile per channel, each opening its page on shawntv.co */
.card.channels { grid-column: 1 / -1; }
.ch-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 20px); }
.ch { display: grid; gap: 6px; align-content: start; color: inherit; text-decoration: none; }
.ch-face { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 6px; overflow: hidden; }
.ch-face img { height: auto; transition: transform 0.9s var(--ease); }
.ch:hover .ch-face img { transform: scale(1.05); }
.ch-go { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; color: #fff; opacity: 0.6; transition: opacity 0.3s, transform 0.4s var(--ease); }
.ch:hover .ch-go { opacity: 1; transform: translate(2px, -2px); }
.ch--shawntv .ch-face { background: radial-gradient(80% 90% at 15% 10%, rgb(40 130 240 / 0.35), transparent 60%), linear-gradient(135deg, #004ca7, #002a4e); }
.ch--sft .ch-face, .ch--sfa .ch-face { background: #f7f7f6; box-shadow: inset 0 0 0 1px var(--rule); }
.ch--sft .ch-go, .ch--sfa .ch-go { color: var(--ink); }
.ch-name { font-family: var(--display); font-weight: 700; font-stretch: 75%; font-size: 1.2rem; line-height: 1.2; }
.ch:hover .ch-name { color: var(--moon); }
.ch-line { font-size: 0.95rem; line-height: 1.45; color: var(--graphite); }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px clamp(16px, 2.4vw, 36px); }
.about-text { grid-column: 1 / span 7; display: grid; gap: 16px; font-size: var(--step-1); line-height: 1.5; }
.contact { grid-column: 9 / -1; display: grid; gap: 18px; align-content: start; font-family: var(--display); }
.contact dt { font-size: 0.88rem; color: var(--graphite); }
.contact dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 600; }
.contact a { color: var(--ink); }

/* ---------- film page ---------- */
.back { font-family: var(--display); font-size: 0.95rem; }
.title-block { padding-top: clamp(16px, 4vw, 40px); padding-bottom: clamp(28px, 4vw, 48px); }
.page-title { font-family: var(--display); font-weight: 800; font-stretch: 62%; font-size: clamp(4.5rem, 15vw, 12rem); line-height: 0.84; margin-top: 18px; }
.title-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 48px; margin-top: clamp(24px, 4vw, 44px); }
.meta { margin: 0; display: grid; gap: 12px; font-family: var(--display); font-size: 0.98rem; align-content: start; }
.meta div { display: grid; gap: 1px; }
.meta dt { color: var(--graphite); font-size: 0.85rem; }
.meta dd { margin: 0; }
.logline { font-size: var(--step-1); line-height: 1.5; max-width: 40rem; }
.screening { padding: clamp(28px, 5vw, 64px) 0; }
.screening video { width: 100%; aspect-ratio: 2.35; background: #000; }
.screening .note { margin-top: 12px; font-family: var(--display); font-size: 0.92rem; color: var(--dim-night); }
.screening .stills { margin-top: clamp(20px, 3vw, 32px); --row-h: clamp(110px, 13vw, 190px); }
.laurels { list-style: none; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 18px; align-items: center; }
.laurels img { width: 100%; max-width: 150px; margin: 0 auto; opacity: 0.9; }
.prose-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 16px 48px; padding-top: clamp(44px, 6vw, 80px); }
.prose-grid h2 { font-family: var(--display); font-weight: 700; font-stretch: 75%; font-size: var(--step-2); line-height: 1.1; }
.prose { max-width: 38rem; display: grid; gap: 16px; }
.prose h3 { font-family: var(--display); font-weight: 650; font-stretch: 85%; font-size: 1.05rem; margin-top: 10px; }
.prose h3 + p { margin-top: -10px; }
.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.awards h3 { font-family: var(--display); font-weight: 650; font-stretch: 85%; font-size: 1.05rem; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.awards ul { list-style: none; margin: 0; padding: 0; }
.wins li { padding: 12px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; }
.wins .cat { font-family: var(--display); font-weight: 600; font-size: 1.02rem; }
.wins .fest { font-size: 0.98rem; color: var(--graphite); }
.also-head { font-family: var(--display); font-size: 0.85rem; color: var(--graphite); margin-top: 18px; }
.also { margin-top: 6px !important; }
.also li { font-size: 0.95rem; line-height: 1.45; color: var(--graphite); padding: 5px 0; }
.awards-note { grid-column: 1 / -1; font-size: 0.95rem; color: var(--graphite); }
.credits-block { padding-top: clamp(44px, 6vw, 80px); }
.credits-block h2 { font-family: var(--display); font-weight: 700; font-stretch: 75%; font-size: var(--step-2); text-align: center; margin-bottom: 24px; }
.credits { display: grid; gap: 10px; max-width: 34rem; margin: 0 auto; padding: 8px 0; }
.credits div { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.credits dt { text-align: right; color: var(--graphite); font-family: var(--display); font-size: 0.92rem; padding-top: 3px; }
.credits dd { margin: 0; }
.next { margin-top: clamp(56px, 8vw, 100px); border-top: 1px solid var(--ink); padding-top: 16px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; font-family: var(--display); }
.next .big { font-weight: 800; font-stretch: 62%; font-size: clamp(2.5rem, 7vw, 5rem); line-height: 0.9; color: var(--ink); text-decoration: none; }
.next .big:hover { text-decoration: underline; }

/* ---------- theater (films play here) ---------- */
dialog { padding: 0; border: 0; max-width: none; max-height: none; }
.theater, .lightbox { width: 100vw; height: 100vh; height: 100dvh; margin: 0; background: transparent; color: var(--on-night); }
.theater::backdrop, .lightbox::backdrop { background: rgba(6, 12, 13, 0.94); }
.theater[open], .lightbox[open] { display: grid; place-items: center; }
.theater-frame { width: min(94vw, calc(84vh * var(--ar, 1.78))); display: grid; gap: 12px; }
.theater video { width: 100%; aspect-ratio: var(--ar, 16 / 9); background: #000; }
.theater-bar, .lightbox-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-family: var(--display); }
.theater-bar .t { font-weight: 700; font-stretch: 75%; font-size: 1.4rem; }
.close {
  position: fixed; top: 16px; right: 16px; z-index: 2;
  background: rgba(255, 255, 255, 0.1); border: 0; color: var(--on-night); border-radius: 999px;
  font-family: var(--display); font-size: 0.95rem; padding: 8px 16px; cursor: pointer;
}
.close:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-frame { display: grid; gap: 12px; justify-items: center; }
.lightbox-frame > img { max-width: 92vw; max-height: 72vh; width: auto; height: auto; object-fit: contain; }
.lightbox-bar { width: 100%; max-width: 92vw; color: var(--dim-night); }
.lightbox-bar .cap { color: var(--on-night); }
.lb-progress { width: 100%; max-width: 92vw; height: 2px; background: rgba(223, 231, 229, 0.15); }
.lb-progress i { display: block; height: 100%; background: var(--on-night); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform 0.4s var(--ease); }
.lb-thumbs { display: flex; gap: 6px; max-width: 92vw; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumbs button { flex: none; height: 48px; padding: 0; border: 0; background: #222; opacity: 0.45; cursor: pointer; transition: opacity 0.25s, transform 0.25s var(--ease); outline-offset: 2px; }
.lb-thumbs button:hover { opacity: 0.8; }
.lb-thumbs button.on { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 2px var(--on-night); }
.lb-thumbs img { height: 100%; width: auto; max-width: none; }
.lightbox img.main { max-height: 72vh; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.08); border: 0; color: var(--on-night); width: 52px; height: 52px; border-radius: 999px; cursor: pointer; font-size: 1.4rem; }
.lb-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lb-prev { left: 16px; } .lb-next { right: 16px; }

/* ---------- motion ---------- */
.anim .rv { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.anim .rv.in { opacity: 1; transform: none; }
.anim .rv-wipe > * { clip-path: inset(0 0 100% 0); transition: clip-path 1.3s var(--ease); transition-delay: var(--d, 0s); }
.anim .rv-wipe.in > * { clip-path: inset(0 0 0 0); }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .verse .project-text { grid-column: 1 / -1; }
  .verse-stage { grid-column: 1 / span 7; }
  .vp-try { grid-column: 8 / -1; }
}
@media (max-width: 860px) {
  html { scroll-padding-top: 48px; }  /* a little less than the header, so a section lands tucked under it */
  .project-text, .project-media, .about-text, .contact { grid-column: 1 / -1; }
  .verse-stage, .vp-try { grid-column: 1 / -1; }
  .vp-try { max-width: 30rem; width: 100%; justify-self: center; }
  .cards { grid-template-columns: 1fr; }
  .ch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card.wide, .card.plain, .card.plain .card-text { grid-template-columns: 1fr; }
  .card.plain .card-text p:not(.kind) { grid-column: auto; grid-row: auto; }
  .head-row { padding-top: 12px; padding-bottom: 10px; flex-wrap: nowrap; align-items: center; }
  .site-head nav { gap: 2px 16px; font-size: 0.9rem; flex-wrap: nowrap; }
  .strip-track a { height: min(62vh, 440px); }
  .title-grid, .prose-grid { grid-template-columns: 1fr; }
  .lb-nav { top: auto; bottom: 16px; transform: none; }
}
@media (max-width: 560px) {
  .site-head nav .long { display: none; }
  .site-head nav .nav-gh { padding-left: 12px; }
  .site-head nav { gap: 2px 13px; font-size: 0.88rem; }
  .site-head .home { font-size: 1.02rem; white-space: nowrap; }
  .hero-name { font-size: 28.5vw; }
  .awards { grid-template-columns: 1fr; }
  .credits div { grid-template-columns: 1fr; gap: 0; }
  .credits dt { text-align: left; }
  .jg { --row-h: 120px; }
  .strip-ui { gap: 10px; }
  .strip-btn { width: 40px; height: 40px; }
  .book-num { min-width: 0; }
  .film .stills { --row-h: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .anim .rv, .anim .rv-wipe > * { opacity: 1; transform: none; clip-path: none; }
}

/* films: picture left, words right */
.film .project-media { grid-column: 1 / span 8; }
.film .project-text { grid-column: 9 / -1; align-self: end; }
@media (max-width: 860px) { .film .project-media, .film .project-text { grid-column: 1 / -1; } }

@media (max-width: 560px) { .ch-grid { grid-template-columns: 1fr; } .ch { grid-template-columns: 42% 1fr; column-gap: 14px; align-items: center; }
  .ch-face { grid-row: 1 / span 2; margin-bottom: 0; } .ch-name { align-self: end; } .ch-line { align-self: start; } }
