/* Layout: a white page with wide side margins. One grid of films with a hairline gap, identical
   across and down, 3, 2 or 1 films wide depending on the window. The logo, titles, grid and footer
   all share the same left and right edges. Type is Jost, a geometric face close to the logo. */
:root {
  --paper: #FFFFFF;
  --ink: #101216;
  --muted: #666B73;
  --rule: #E3E5E8;
  --accent: #101216;
  --frame: #0C0D10;
  --on-frame: #F2F3F5;
  --signal: #F6CB4E;
  --on-signal: #201E23;
  --mark-bg: transparent;
  --font: "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, system-ui, sans-serif;
  --t-sm: 14px;
  --t-base: 17px;
  --t-lg: 21px;
  --t-xl: clamp(34px, 5vw, 60px);
  --gap: 6px;
  --gutter: clamp(20px, 4.5vw, 72px);
  --track: 0.035em;
}
@media (max-width: 559px) {
  :root { --gap: 4px; }
}
/* Computers (mouse or trackpad, wide window): the white side margins widen progressively with the window, from the base
   gutter at 1024px up to 240px. Touch devices (iPhone, iPad, foldables) keep the compact margin so the films stay large. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  :root { --gutter: min(240px, calc(46px + (100vw - 1024px) * 0.18)); --top: min(68px, calc(28px + 2.2vw)); }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D0E10;
    --ink: #ECEDEF;
    --muted: #9AA0A9;
    --rule: #26292F;
    --accent: #ECEDEF;
    --mark-bg: #FFFFFF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D0E10;
  --ink: #ECEDEF;
  --muted: #9AA0A9;
  --rule: #26292F;
  --accent: #ECEDEF;
  --mark-bg: #FFFFFF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-base)/1.55 var(--font);
  letter-spacing: var(--track); /* a slight, even letter-spacing everywhere (the logo name has its own, wider one) */
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, textarea { letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell { max-width: 1680px; margin: 0 auto; padding-block: 0 48px; }
main { outline: none; }

/* Header: logo, name and navigation sit on one centre line */
.site-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 40px; padding-block: var(--top, 40px) 28px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand .mark { display: block; flex: none; height: 44px; width: auto; background: var(--mark-bg); }
.brand .words { display: grid; justify-items: start; gap: 4px; }
.brand .name { font-size: 15px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.2; }
.brand .role { font-size: var(--t-sm); font-weight: 300; letter-spacing: 0.14em; white-space: nowrap; line-height: 1.2; color: var(--muted); }
.site-head ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.site-head nav a { display: inline-block; padding: 8px 0; font-size: 16px; text-decoration: none; border-bottom: 2px solid transparent; }
.site-head nav a:hover,
.site-head nav a[aria-current="page"] { border-bottom-color: var(--signal); }

/* Frames and the film grid */
.stage { position: relative; background: var(--frame); overflow: hidden; }
.stage img, .stage iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
.player { aspect-ratio: 16 / 9; }
.play {
  position: absolute; left: 16px; bottom: 16px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px 11px 15px; border: 0; border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font: 500 15px/1 var(--font); cursor: pointer;
}
.play::before { content: ""; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.play:hover { background: var(--signal); color: var(--on-signal); }
.player .play { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); }

.projects { display: grid; gap: var(--gap); }
/* 3 columns on large screens, 2 on tablets, 1 on phones; images are 16:9 and fill their column */
.projects.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 999px) { .projects.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 559px) { .projects.grid { grid-template-columns: minmax(0, 1fr); } }
.project { display: block; text-decoration: none; --loop: 5s; }
/* Scroll reveal (after Rina Yang's site): each film rises 0.5rem and fades in over 0.5s as it
   enters the window, each row 0.1s after the one above. Only switched on by script, so content is never hidden without it. */
.reveal-on .project:not(.seen) { opacity: 0; transform: translateY(0.5rem); }
.reveal-on .project { transition: opacity 0.5s ease, transform 0.5s ease; }
.frame { position: relative; aspect-ratio: 16 / 9; background: var(--frame); overflow: hidden; }
.frame img, .frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.frame video { opacity: 0; transition: opacity 0.25s ease; }
.project.is-playing .frame video.ready { opacity: 1; }
.frame::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--signal); transform: scaleX(0); transform-origin: left;
}
.project.is-playing .frame::after { animation: loop var(--loop, 5s) linear infinite; }
@keyframes loop { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Film page */
.crumb { margin: 0 0 14px; font-size: var(--t-sm); color: var(--muted); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.meta { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px 48px; padding-block: 18px 22px; }
.meta h1 { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.25; text-wrap: balance; }
.meta dl { margin: 0; display: grid; gap: 2px; align-content: start; font-size: 15px; font-weight: 400; line-height: 1.5; }
.meta dl div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 12px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.related { margin-top: 0; }
.related h2 { margin: 0 0 12px; font-size: 16px; font-weight: 400; }

/* Info and Contact */
.page-title { margin: 0 0 24px; font-size: clamp(20px, 2vw, 26px); font-weight: 400; line-height: 1.25; }
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px clamp(32px, 6vw, 96px); align-items: start; }
.about-pics { min-width: 0; }
.about-pics figure { margin: 0; }
.about-pics img { display: block; width: 100%; height: auto; background: var(--frame); }
.about-text { max-width: 62ch; min-width: 0; }
.about-text .lead { margin: 0 0 20px; font-size: 17px; font-weight: 400; line-height: 1.55; text-wrap: pretty; }
.about-text .more { margin: 0; font-size: 16px; color: var(--muted); }
.sec { margin-top: 28px; }
.sec h2 { margin: 0 0 6px; font-size: 16px; font-weight: 500; }
.sec p { margin: 0; font-size: 16px; color: var(--muted); }
.social { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.social:hover { border-bottom-color: var(--signal); }
.ig { flex: none; display: block; }

/* Contact: two plain columns, as on the original page, each under a short yellow bar */
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px clamp(32px, 6vw, 96px); }
.who { position: relative; border-top: 1px solid var(--rule); padding-top: 22px; }
.who::before { content: ""; position: absolute; left: 0; top: -2px; width: 64px; height: 3px; background: var(--signal); }
.who h2 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.2; }
.who .sub { margin: 6px 0 22px; font-size: var(--t-sm); font-weight: 300; color: var(--muted); }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; padding: 12px 0; }
.item .label { grid-column: 1 / -1; font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.item .val { font-size: 17px; font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; user-select: all; }
.item .val.link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; user-select: auto; justify-self: start; }
.item .val.link:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 24px; }
.page-head .page-title { margin: 0; }
.sheet-btn { padding: 10px 18px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 400 15px/1 var(--font); cursor: pointer; }
.sheet-btn:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.add-btn { margin-top: 18px; padding: 9px 16px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--ink); font: 400 14px/1 var(--font); cursor: pointer; }
.add-btn:hover { border-color: var(--ink); background: var(--signal); color: var(--on-signal); }
.copy { padding: 5px 13px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--muted); font: 400 13px/1 var(--font); cursor: pointer; }
.copy:hover { border-color: var(--ink); color: var(--ink); }

.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--t-sm); }

@media (max-width: 719px) {
  .meta, .about { grid-template-columns: minmax(0, 1fr); }
  .contact { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .site-head nav a { padding: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal-on .project { transition: none; opacity: 1 !important; transform: none !important; }
  .project.is-playing .frame::after { animation: none; }
}

/* Real-site additions */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 10px 14px; background: var(--ink); color: var(--paper); }
.skip:focus { left: 8px; }
.project img { background: var(--frame); }
.player .play { z-index: 1; }
.player.on .play { display: none; }
.noscript-link { display: inline-block; margin-top: 12px; }
.prose { max-width: 62ch; }
.addr { white-space: nowrap; }
.item .val a { color: inherit; text-decoration: none; }
.item .val a:hover { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media print { .site-head nav, .copy, .sheet-btn, .add-btn { display: none; } }
[hidden] { display: none !important; }

/* Title along the bottom of a film while it plays (hover, keyboard focus, or the film in the middle on touch screens) */
.cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 16px 14px;
  background: linear-gradient(to top, rgba(8, 9, 11, 0.74), rgba(8, 9, 11, 0));
  color: var(--on-frame); font-size: 14px; font-weight: 400; line-height: 1.3; letter-spacing: 0.03em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  opacity: 0; transform: translateY(4px); transition: opacity 0.25s ease, transform 0.25s ease; pointer-events: none;
}
.project:hover .cap, .project:focus-visible .cap, .project.is-playing .cap { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .cap { transition: none; transform: none; } }

/* Film page on wide screens: the title and credits sit to the right of the player, top-aligned with it */
@media (min-width: 900px) {
  .film { display: grid; grid-template-columns: minmax(0, 1fr) clamp(230px, 21vw, 320px); column-gap: clamp(24px, 2.4vw, 40px); align-items: start; }
  .film .crumb { grid-column: 1 / -1; }
  .film .stage { grid-column: 1; grid-row: 2; }
  .film .meta { grid-column: 2; grid-row: 2; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 0; }
  .film .noscript-link { grid-column: 1; }
  .film + .related { margin-top: 28px; }
}

/* Legal notice */
.legal h2 { margin: 32px 0 8px; font-size: 16px; font-weight: 500; }
.legal p { margin: 0 0 12px; font-size: 15px; }
.legal dl { margin: 0 0 12px; display: grid; gap: 4px; font-size: 15px; }
.legal dl div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 12px; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; }
.legal a, .site-foot a { text-underline-offset: 3px; }
@media (max-width: 559px) { .legal dl div { grid-template-columns: minmax(0, 1fr); gap: 0; } }
