/* Wendy Zheng — personal site.
   Direction: "The pinned poster" (tasteskill seed 166610212). Palette: Three stones, accent taken from
   Knox Overstreet's red tie. Type: Libre Franklin (display) over Source Serif 4 (text), self-hosted.
   Page order: first screen -> films -> photographs -> about -> footer. */

@font-face { font-family: "Libre Franklin"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/libre-franklin-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #eeecea;
  --surface: #e4e1dd;
  --ink: #333231;
  --muted: #6b6763;
  --accent: #a3182a;
  --accent-ink: #ffffff;
  --field: #cdc3b6;
  --stage: #1c1b1a;
  --stage-ink: #eeecea;
  --stage-muted: #a8a39d;

  --font-display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2rem, 2.9vw, 3.5rem);

  --margin: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(7.5rem, 13vw, 14rem);
  --header-h: 4rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.55; font-kerning: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, figure, ul, dl, dd { margin: 0; }
ul[class] { padding: 0; list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: calc(var(--header-h) + 1.5rem); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--stage-ink); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.95; text-wrap: balance; }
.head { font-size: var(--step-head); }
.small { font-size: var(--step-small); line-height: 1.45; }
.nums { font-variant-numeric: tabular-nums; }

.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.2em; text-decoration-thickness: 0.07em; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration-color: currentColor; } }

/* ---------- header ---------- */
.site-head { position: sticky; top: 0; z-index: 50; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-inline: var(--margin); background: var(--bg); }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: var(--step-lead); letter-spacing: -0.035em; text-transform: uppercase; text-decoration: none; line-height: 1; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.2vw, 2.25rem); font-size: var(--step-body); }
.site-nav a { padding-block: 0.6rem; }
@media (max-width: 47.99em) { .site-nav { font-size: var(--step-small); } .wordmark { font-size: 1.125rem; } }

/* ---------- first screen: a sentence split by a frame ---------- */
.hero { --stage-h: calc(100svh - var(--header-h)); --fw: min(45vw, calc((var(--stage-h) - 7rem) * 0.9)); --fh: calc(var(--fw) / 0.9); --gap: 2.5rem; --rest: calc((var(--stage-h) - var(--fh)) / 2); position: relative; display: grid; }
/* the stage and the reel share one grid cell, so the pinned words can never leave the first screen's section */
.hero__stage { grid-area: 1 / 1; align-self: start; position: sticky; top: var(--header-h); height: var(--stage-h); z-index: 2; pointer-events: none; }
.hero__title, .hero__foot { pointer-events: auto; }
.hero__title { position: absolute; inset-inline: var(--margin); top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; font-size: var(--step-head); text-transform: uppercase; white-space: nowrap; }
.hero__foot { position: absolute; left: var(--margin); bottom: 2rem; width: min(calc((100vw - var(--fw)) / 2 - var(--margin) - 2rem), 25rem); }
/* the first frame rests in the middle of the screen; the next one shows its top edge below it */
.hero__reel { grid-area: 1 / 1; position: relative; z-index: 1; width: var(--fw); justify-self: center; margin-top: var(--rest); padding-bottom: var(--rest); display: grid; row-gap: var(--gap); }
.hero__frame { position: relative; height: var(--fh); }
.hero__frame img { width: 100%; height: 100%; object-fit: cover; background: var(--surface); }
.hero__frame figcaption { position: absolute; top: calc(100% + 0.55rem); left: 0; right: 0; font-size: var(--step-small); line-height: 1.3; color: var(--muted); }

@media (max-width: 63.99em) {
  .hero { padding: 1rem var(--margin) 0; }
  .hero__stage { display: contents; }
  .hero__title, .hero__reel, .hero__foot { grid-area: auto; }
  .hero__title { position: static; transform: none; display: block; order: 1; white-space: normal; font-size: clamp(2rem, 9vw, 3.75rem); }
  .hero__half { display: block; }
  .hero__half--b { text-align: right; }
  .hero__reel { order: 2; width: 100%; justify-self: stretch; margin: 0.9rem 0 0; padding: 0; row-gap: 0.5rem; }
  .hero__frame { height: auto; }
  .hero__frame:nth-child(1) img { aspect-ratio: 4 / 3; height: auto; }
  .hero__frame:nth-child(2) img { height: 1.75rem; object-position: 50% 0; }
  .hero__frame:nth-child(3), .hero__frame figcaption { display: none; }
  .hero__foot { position: static; order: 3; width: auto; margin-top: 1.25rem; max-width: 34rem; }
}

/* ---------- films: one screen, six titles ---------- */
.films { padding: var(--section) var(--margin); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; transition: background-color 700ms var(--ease-soft), color 700ms var(--ease-soft); }
.films.is-dark { background: var(--stage); color: var(--stage-ink); --muted: var(--stage-muted); --ink: var(--stage-ink); }
.films__screen { grid-column: 1 / 9; grid-row: 1 / span 3; position: sticky; top: calc(var(--header-h) + 2rem); }
.films__screen video { width: 100%; aspect-ratio: 16 / 9; background: #000; object-fit: contain; }
.films__now { margin-top: 0.75rem; color: var(--muted); font-size: var(--step-small); }
.films > h2, .films__hint, .films__rows { grid-column: 9 / 13; }
.films > h2 { margin-bottom: 1rem; }
.films__hint { color: var(--muted); margin-bottom: 2rem; }
.film { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 1rem; width: 100%; min-height: 3.6rem; padding-block: 0.85rem; text-align: left; text-decoration: none; color: var(--muted); transition: color var(--t-hover) ease; }
.film__name { font-size: var(--step-lead); line-height: 1.2; }
.film__time { font-size: var(--step-small); }
.film__desc { grid-column: 1 / -1; display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease-out); font-size: var(--step-small); line-height: 1.5; }
.film__desc > span { overflow: hidden; max-width: 36ch; }
.film.is-active { color: var(--ink); }
.film.is-active .film__name { font-weight: 600; }
.film.is-active .film__desc { grid-template-rows: 1fr; }
.film.is-active .film__desc > span { padding-top: 0.4rem; }
.film:active .film__name { transform: translateX(3px); }
.film__name { transition: transform var(--t-press) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .film:hover { color: var(--ink); } }
@media (max-width: 56.24em) {
  .films { display: block; padding-block: 5rem; }
  .films__screen { top: var(--header-h); z-index: 5; margin-inline: calc(var(--margin) * -1); padding-bottom: 0.25rem; background: var(--bg); transition: background-color 700ms var(--ease-soft); }
  .films.is-dark .films__screen { background: var(--stage); }
  .films__now { padding-inline: var(--margin); margin-top: 0.5rem; }
  .films__rows { margin-top: 1.5rem; }
}

/* ---------- photographs: the title holds, the photographs pass ---------- */
.photos { padding: 0 var(--margin) var(--section); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; }
.photos__text { grid-column: 1 / 4; position: sticky; top: calc(var(--header-h) + 2rem); display: grid; gap: 0.9rem; }
.photos__role { font-size: var(--step-lead); line-height: 1.25; }
.photos__count { color: var(--muted); }
.photos__sheet { grid-column: 4 / 13; columns: 3; column-gap: 0.75rem; }
.shot { display: block; margin-bottom: 0.75rem; break-inside: avoid; overflow: hidden; cursor: zoom-in; background: var(--surface); }
.shot img { width: 100%; transition: transform 600ms var(--ease-soft); }
.shot:active img { transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) { .shot:hover img { transform: scale(1.035); } }
@media (max-width: 56.24em) {
  .photos { display: block; padding-bottom: 6rem; }
  .photos__text { position: static; margin-bottom: 1.75rem; max-width: 34rem; }
  .photos__sheet { columns: 2; column-gap: 0.5rem; }
  .shot { margin-bottom: 0.5rem; }
}

/* ---------- about: wide photo, colour tile, facts ---------- */
.about { padding: 0 var(--margin) var(--section); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.about h2 { grid-column: 1 / -1; }
.about__lead { grid-column: 1 / 7; margin-top: 1.5rem; font-size: var(--step-lead); line-height: 1.4; }
.about__photo { grid-column: 1 / 9; margin-top: 4.5rem; position: relative; }
.about__photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.about__note { position: absolute; top: 0; right: 0; width: 20rem; padding: 1.25rem; background: var(--bg); line-height: 1.45; }
.about__side { grid-column: 9 / 13; margin-top: 4.5rem; display: flex; flex-direction: column; }
.about__tile { background: var(--field); padding: 1.5rem; display: grid; gap: 0.75rem; }
.about__tile img { width: 100%; }
.about__facts { display: grid; gap: 1.1rem; margin-top: 1.75rem; }
.about__facts div { display: flex; justify-content: space-between; gap: 1rem; }
.about__facts dt { color: var(--muted); }
.about__facts dd { text-align: right; }
@media (max-width: 56.24em) {
  .about { padding-bottom: 6rem; }
  .about__lead, .about__photo, .about__side { grid-column: 1 / -1; }
  .about__photo { margin-top: 2.5rem; }
  .about__photo img { aspect-ratio: 4 / 3; }
  .about__note { position: static; width: auto; padding: 1rem 0 0; }
  .about__side { margin-top: 2.5rem; }
}

/* ---------- footer: the name, once more, across the full width ---------- */
.foot { background: var(--field); padding: 4.5rem var(--margin) 2rem; overflow: clip; }
.foot__name { font-family: var(--font-display); font-weight: 700; font-size: calc((100vw - 2 * var(--margin)) / 7.45); line-height: 0.82; letter-spacing: -0.045em; text-transform: uppercase; white-space: nowrap; }
.foot__last { margin-top: 4.5rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; font-size: var(--step-small); }
.foot__last a { white-space: nowrap; }

/* ---------- photograph viewer ---------- */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--stage); color: var(--stage-ink); }
.lightbox::backdrop { background: var(--stage); }
.lightbox__inner { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.lightbox__top, .lightbox__bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--margin); font-size: var(--step-small); }
.lightbox__stage { position: relative; min-height: 0; margin-inline: var(--margin); overflow: hidden; cursor: zoom-out; }
.lightbox__stage img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.lightbox__btn { min-height: 2.75rem; padding: 0 1rem; background: var(--stage-ink); color: var(--stage); font-family: var(--font-display); font-weight: 700; font-size: var(--step-small); transition: transform var(--t-press) var(--ease-out); }
.lightbox__btn:active { transform: scale(0.96); }
.lightbox__nav { display: flex; gap: 0.5rem; flex: none; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  /* the first screen is readable from the first frame: its entrance only travels, it never hides anything */
  .js [data-rise] { animation: rise 900ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 90ms); }
  .lightbox[open] .lightbox__stage img { animation: rise 420ms var(--ease-out) backwards; }
}
@keyframes rise { from { transform: translateY(22px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
