/* Tom Prezman — portfolio. One quiet screen: the footage is the room, the type stays small.
   Lime only for headlines and the active title. */
:root {
  --bg: #222222;
  --ink: #ece6db;
  --muted: #a8a299;
  --line: rgba(236, 230, 219, .16);
  --accent: #cdfa0a;  /* the lime of the hoops in the home loop, same as the cursor */
  --sans: 'Trebuchet MS', 'Lucida Grande', 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --fade: .5s cubic-bezier(.45, .05, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover, a.is-on { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
ol { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }

/* Footage frames. Placeholders hold the space until the clips arrive. */
.placeholder {
  display: grid; place-items: center; width: 100%; height: 100%;
  color: var(--muted); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  background: #2a2a2a; border: 1px dashed var(--line); text-align: center; padding: 16px;
}
figure video, figure img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Home */
.stage { position: fixed; inset: 0; z-index: 0; }
.stage figure { position: absolute; inset: 0; opacity: 0; transition: opacity var(--fade); }
.stage figure.is-on { opacity: 1; }
.stage .placeholder { border: 0; background: #262626; font-size: 12px; }
.stage img, .thumb img { object-position: 50% 30%; }
/* Light footage (data-tone="light" on its figure) would swallow the light type, so the type turns dark instead of
   the room being darkened. */
.home { color: var(--ink); transition: color var(--fade); }
.home .num, .home .kind, .home .list-label, .home .meta span, .home .foot { transition: color var(--fade), border-color var(--fade); }
.is-home.on-light { --ink: #222222; --muted: rgba(34, 34, 34, .62); --line: rgba(34, 34, 34, .22); --accent: #4a5e00; }  /* on light footage the lime would vanish, so a deep olive of the same green */ /* the faces sit high in the frame; keep them when wide screens crop */
@media (prefers-reduced-motion: reduce) { .stage figure { transition: none; } }

.home {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  grid-template-rows: auto 1fr auto;
  gap: 24px 48px;
  padding: 28px var(--gutter);
}
.name { grid-column: 1; margin: 0; font: inherit; font-size: 15px; }
.meta { grid-column: 2; margin: 0; }
.meta span { color: var(--muted); }
.list { grid-column: 2; align-self: center; }
.list-label { margin: 0 0 12px; color: var(--muted); }
.list li + li { margin-top: 4px; }
.list a { display: block; }
.num { color: var(--muted); margin-right: .4em; font-variant-numeric: tabular-nums; }
.list a:hover .num, .list a.is-on .num { color: inherit; }
.kind { color: var(--muted); margin-left: .5em; opacity: 0; transition: opacity .25s; }
.list a:hover .kind, .list a.is-on .kind, .list a:focus-visible .kind { opacity: 1; }
.thumb { display: none; }
.foot { grid-column: 2; display: flex; gap: 32px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Touch screens and phones: the same room as on desktop, the footage full screen with the type on top. There is no
   hover, so js/landing.js walks through the projects by itself; a tap opens the one that is showing or any other. */
@media (hover: none), (max-width: 760px) {
  .home { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto; gap: 16px; padding-bottom: 22px; }
  .name, .meta, .list, .foot { grid-column: 1; }
  .list li + li { margin-top: 2px; }
  .list a { font-size: 17px; padding: 3px 0; }
  .list a.is-on .kind { opacity: 1; }
  .thumb { display: none; }
}

/* Project and about pages: a narrow text column beside large frames. */
.bar {
  display: flex; justify-content: space-between; gap: 24px;
  padding: 28px var(--gutter);
}
.page {
  display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 32px 56px;
  padding: 24px var(--gutter) 72px;
}
.copy { position: sticky; top: 28px; align-self: start; }
.copy .num { display: block; margin: 0 0 10px; }
.copy h1 {
  margin: 0 0 18px; color: var(--ink);  /* titles in the text colour; lime stays for hover and highlights */
  font: 400 clamp(26px, 3vw, 36px)/1.05 var(--sans); letter-spacing: .02em; text-transform: uppercase;
}
.copy p { margin: 0 0 14px; max-width: none; }
.copy .lede { font-size: 16px; }
.credits { margin: 24px 0 0; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.credits dt { color: var(--muted); }
.credits dd { margin: 0; }
.copy .watch { margin-top: 22px; }
.copy .watch a { border-bottom: 1px solid var(--accent); padding-bottom: 2px; }
.frames { display: grid; gap: 20px; }
.frames figure { aspect-ratio: 16 / 9; }
.frames figure.still { aspect-ratio: auto; } /* stills keep their own proportions instead of being cropped to 16:9 */
.next { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); }
.next .num { margin-right: .6em; }

@media (max-width: 760px) {
  .page { grid-template-columns: 1fr; }
  .copy { position: static; }
}
.kind-line { color: var(--muted); }

/* The pointer: a lime arrow drawn by js/cursor.js, the green of the hoops in the home loop. The system cursor hides
   only once the script is running, so without it the normal pointer stays. */
html.has-cursor, html.has-cursor * { cursor: none !important; }
html.has-cursor video[controls] { cursor: auto !important; }  /* players keep the system cursor; js/cursor.js hides the arrow there */
.cursor { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; transform-origin: 2px 2px;
  margin: -2px 0 0 -2px; opacity: 0; transition: opacity .2s; will-change: transform; }
.cursor.is-on { opacity: 1; }
.cursor svg { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }

/* A case study (dear notebook): the frames column carries captions, small groups of details, and a closing note. */
.case .frames { gap: 44px; }
.frames figcaption { margin-top: 12px; max-width: none; color: var(--muted); font-size: 13px; }
.frames figcaption .label { color: var(--ink); margin-right: .5em; }
.trio, .pair { display: grid; gap: 16px; }
.trio { grid-template-columns: repeat(3, 1fr); }
.pair { grid-template-columns: repeat(2, 1fr); }
.trio img { aspect-ratio: 4 / 5; object-fit: cover; }
.pair img { aspect-ratio: 16 / 10; object-fit: cover; }
.rules { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.rules-label { margin: 0 0 10px; color: var(--muted); }
.rules li + li { margin-top: 2px; }
.process { max-width: none; padding-top: 14px; border-top: 1px solid var(--line); }
.process p { margin: 0 0 14px; }
.process q { color: var(--ink); font-style: italic; }
/* a flipbook: the frames of an animation, played back at their own pace (12 a second), with a pause on the last */
.flipbook img { background: #f3effc; }
@media (max-width: 760px) {
  .trio { grid-template-columns: 1fr 1fr; }
  .trio figure:last-child { grid-column: 1 / -1; }
  .pair { grid-template-columns: 1fr; }
}
.frames figure.still img { height: auto; }  /* a captioned still sizes to its picture; the caption sits below */
.rules .num { display: inline; margin: 0 .6em 0 0; }

/* research: each reference beside what it became */
.research { display: grid; gap: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.research-intro { margin: 0; max-width: none; }
.ref-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ref-pair img { aspect-ratio: 4 / 3; object-fit: cover; }
.ref-pair .ref img { filter: saturate(.92); }
@media (max-width: 760px) { .ref-pair { grid-template-columns: 1fr; } }
.frames figure.still video { height: auto; aspect-ratio: 16 / 10; }  /* a captioned clip sizes to its picture, like a still */
.frames figure.still video.whole { aspect-ratio: auto; object-fit: contain; }  /* plays in its own frame (Someone’s Jacket is 4:3), nothing cut */

/* Case study: the text column stays beside the pictures the whole way down. It's taller than a screen, so it
   is scaled down to fit a short screen (sticky-copy.js), so it never runs off the top or bottom. */
.case .copy { position: sticky; top: 28px; }
@media (max-width: 760px) { .case .copy { position: static; } }
.case .next { grid-column: 2; }  /* beside the pinned text, not under it */
@media (max-width: 760px) { .case .next { grid-column: 1; } }
.frames figure.still video.clip { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: #fff; }  /* the line tests are 4:3 */
.pair.boards { align-items: start; }
.pair.boards img { aspect-ratio: auto; object-fit: contain; }  /* storyboard sheets keep their whole page, uncropped */

/* The Hoop: the first frames side by side, like the BOL page */
.pair.frames-top img { aspect-ratio: 4 / 3; }
.frames-note { margin: -8px 0 0; max-width: none; color: var(--muted); font-size: 13px; }
.frames-note .label { color: var(--ink); margin-right: .5em; }

/* Carousel: one sheet in the middle, the next ones peeking in at the sides. Swipe, drag or use the arrows;
   the arrows wrap around at either end. */
.carousel { position: relative; }
.carousel-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 0 12%; scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.carousel-track li { flex: 0 0 76%; scroll-snap-align: center; opacity: .45; transition: opacity .35s; }
.carousel-track li.is-current { opacity: 1; }
.carousel-track img { display: block; width: 100%; height: auto; user-select: none; }
.carousel-track figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(34, 34, 34, .75); color: var(--ink); font: 24px/1 var(--sans);
  display: grid; place-items: center; padding: 0 0 3px; }
.carousel-btn:hover { color: var(--accent); border-color: var(--accent); }
.carousel-btn.prev { left: 0; }
.carousel-btn.next { right: 0; }
@media (max-width: 760px) { .carousel-track { padding: 0 6%; } .carousel-track li { flex-basis: 88%; } .carousel-btn { display: none; } }
/* bigger sheets: the middle one fills most of the column, the next just peeks in */
.carousel-track { padding: 0 5%; gap: 14px; }
.carousel-track li { flex-basis: 90%; }
.frames figure.still video.film { width: 100%; height: auto; aspect-ratio: 4 / 3; background: #000; }

/* who did what: a line under a section's label, and the full credits at the end of a project page */
.section-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: none; }
.end-credits { grid-column: 2; padding-top: 14px; border-top: 1px solid var(--line); }
.end-credits dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 32px; }
.end-credits dt { color: var(--muted); font-size: 13px; }
.end-credits dd { margin: 0; }
@media (max-width: 760px) { .end-credits { grid-column: 1; } }
.frames figure.still video.clip.wide { aspect-ratio: 16 / 9; }
.approach p:not(.rules-label) { max-width: none; margin: 0 0 12px; }
/* a 4:3 frame beside a square one, at the same height */
.concept-pair { display: grid; grid-template-columns: 4fr 3fr; gap: 16px; }
.concept-pair img { display: block; width: 100%; height: auto; }
@media (max-width: 760px) { .concept-pair { grid-template-columns: 1fr; } }
/* acted reference beside the animation it became, at the same height (portrait 1200:1536 beside 16:9) */
.ref-row { display: grid; grid-template-columns: 39fr 89fr; gap: 12px; align-items: start; }
.ref-row video { display: block; width: 100%; height: auto; }
.ref-row figure:first-child video { aspect-ratio: 1200 / 1536; }
.ref-row figure:last-child video { aspect-ratio: 16 / 9; background: #fff; }
.ref-row figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 760px) { .ref-row { grid-template-columns: 1fr; } }
.approach { margin-top: -28px; }  /* sits right under the concept art it describes */
.approach p:not(.rules-label) { max-width: none; }
.process.approach { max-width: none; }  /* the approach runs the full width of the column, no empty space beside it */
/* character development: the four sheets as a 2×2 grid */
.dev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 16px; align-items: start; }
.dev-grid img { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 760px) { .dev-grid { grid-template-columns: 1fr; } }
.dev-grid .wide { grid-column: 1 / -1; }  /* a picture that spans both columns */
.board-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .board-pair { grid-template-columns: 1fr; } }
.frames figure.still video.film.wide { aspect-ratio: 16 / 9; }
.scan-grid img.contain { object-fit: contain; background: #fff; }
.frames figure.lettering img { background: #fff; }
.frames figure.lettering img + img { margin-top: 0; }
.logo-row > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.logo-row img { width: 100%; height: auto; display: block; }
@media (max-width: 760px) { .logo-row > div { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } }
/* the home loop is bright behind the list; an even dim (not a fade) keeps the type readable everywhere */
.stage [data-for="reel"] video { filter: brightness(.85); }
/* Light footage: the pointed-at name turns lime like every other. */
.is-home.on-light .list a:hover, .is-home.on-light .list a.is-on { color: #cdfa0a; }
.frames figure.still video.writing { width: 100%; height: auto; aspect-ratio: 1140 / 800; background: #efeafb; }
/* dear notebook on the home page: full-screen like the others, 15% smaller, on the notebook's own lavender */
.stage figure[data-for="notebook"] { background: #efebfc; }
.stage figure[data-for="notebook"] video { object-fit: contain; transform: scale(.85); }  /* the whole recording, nothing cut */

/* Home: the selected work, and under it a plain filmography — a list, not links, with the role beside each title */
.work-col { grid-column: 2; align-self: center; }
.work-col .list { align-self: auto; }
.filmography { margin-top: 28px; }
.filmography li + li { margin-top: 4px; }
.filmography .year { color: var(--muted); margin-right: .6em; font-variant-numeric: tabular-nums; }
.filmography .kind { opacity: 1; }
@media (hover: none), (max-width: 760px) {
  .work-col { grid-column: 1; align-self: end; }
  .filmography { margin-top: 22px; }
  .foot { gap: 22px; }
}
/* Instagram and LinkedIn, at the right end of the footer line; they take the lime on hover like every link */
.foot { align-items: center; }
/* A quiet credit: the site is part of the work */
.foot .made { margin-left: auto; color: var(--ink); font-size: .85em; }  /* the design credit sits at the right end */
.foot .social { display: flex; gap: 16px; }  /* right after About */
.foot .social a { display: flex; color: var(--ink); }
.foot .social a:hover { color: var(--accent); }
.foot .social svg { display: block; }

/* Page change: the spark (js/spark.js) — lime with a fine grain, seen through a star-shaped mask that grows. While it
   grows the page is frozen; on arrival the screen starts covered in the same grainy lime. */
html.spark-cover body::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E") 0 0 / 180px 180px, #cdfa0a; background-blend-mode: multiply;  /* the site lime, same as the cursor and titles */ }
.spark { background-repeat: repeat, no-repeat; background-blend-mode: multiply; }
.spark { position: fixed; inset: 0; z-index: 10000; pointer-events: none;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
html.spark-freeze, html.spark-freeze * { pointer-events: none !important; }
html.spark-freeze .stage figure, html.spark-freeze .cursor { transition: none !important; }
html.spark-cover body::after { content: ""; position: fixed; inset: 0; z-index: 10001; }
.filmography a .year { color: var(--muted); }
.filmography a:hover .year { color: inherit; }

/* Film pages: an embedded player at 16:9, and a short list of press links */
.embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.press { padding-top: 14px; border-top: 1px solid var(--line); }
.press ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.press a { border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.press a:hover { border-color: var(--accent); }
.press a::after { content: " ↗"; color: var(--muted); }
.awards { padding-top: 14px; border-top: 1px solid var(--line); }
.awards ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.awards .year { color: var(--muted); margin-right: .8em; font-variant-numeric: tabular-nums; }
.awards .where { color: var(--muted); margin-left: .5em; }
.copy .watch.stream { margin-top: 10px; color: var(--muted); }
.copy .watch.stream a { color: var(--ink); }

/* Case study as a timeline (Maurice's Bar, how it was made): numbered steps down the right column, each a year, a
   heading, a few lines and its proof. */
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 56px; }
.timeline > li { counter-increment: step; display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.timeline .step { margin: 0; font-size: 20px; line-height: 1.2; }
.timeline .step::before { content: counter(step, decimal-leading-zero); color: var(--accent); margin-right: .7em; font-size: 13px; vertical-align: .25em; }
.timeline .when { color: var(--muted); font-size: 13px; margin-right: .8em; font-variant-numeric: tabular-nums; }
.timeline p { margin: 0; max-width: none; }
.timeline .note { color: var(--muted); font-size: 13px; }
.poster-pair { display: grid; grid-template-columns: 2fr 3.55fr; gap: 16px; align-items: end; }  /* the poster (2:3) beside a 16:9 still, same height */
@media (max-width: 760px) { .poster-pair { grid-template-columns: 1fr; } }
.timeline p strong { font-weight: 400; color: var(--accent); }  /* the lines that say what Tom did, in the lime */
.timeline p { max-width: none; }  /* the steps run the full width of the column */
.deck-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .deck-trio { grid-template-columns: 1fr; } }
.poster-big img { width: 100%; height: auto; display: block; }  /* the poster runs the full width of the column */

/* Placeholders on project pages take the shape of the video that will replace them */
.case .frames .placeholder { aspect-ratio: 16 / 9; height: auto; display: flex; align-items: center; justify-content: center; }
/* The loops are square: each one as large as fits the screen's height, so the whole frame is seen at once */
.loops .frames .still { width: min(100%, calc(100vh - 140px)); }
.loops .frames .still video.clip, .loops .frames .still .placeholder { display: block; width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; }

/* No single word left alone on the last line of any text */
p, figcaption, dd, li, .lede { text-wrap: pretty; }
h1, h2, .step { text-wrap: balance; }

/* Big play button over a clip (js/play.js) */
.vid { position: relative; }
.vid .play { position: absolute; top: 50%; left: 50%; width: 88px; height: 88px; margin: -44px 0 0 -44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.vid .play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -15px 0 0 -9px; border-style: solid; border-width: 15px 0 15px 26px; border-color: transparent transparent transparent #111; }
.vid .play:hover { transform: scale(1.06); background: #fff; }
.vid .play:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.vid.playing .play { opacity: 0; pointer-events: none; }
@media (max-width: 600px) { .vid .play { width: 64px; height: 64px; margin: -32px 0 0 -32px; } .vid .play::after { margin: -11px 0 0 -7px; border-width: 11px 0 11px 19px; } }
.vid .sound { position: absolute; right: 14px; bottom: 14px; padding: 9px 16px; border: 0; border-radius: 999px; background: rgba(255,255,255,.9); color: #111; font: inherit; font-size: 13px; letter-spacing: .02em; cursor: pointer; transition: background .2s ease; }
.vid .sound:hover { background: #fff; }
.vid .sound:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.vid .sound[aria-pressed="true"] { background: rgba(17,17,17,.75); color: #fff; }
.copy .lede.bio { font-size: clamp(22px, 2.1vw, 30px); line-height: 1.3; margin-bottom: 28px; }
/* About image: its dark background fades into the page at the edges, so it has no hard frame */
.about-art img { -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent); mask-composite: intersect; }
.copy .bio-more { font-size: clamp(16px, 1.35vw, 19px); line-height: 1.45; max-width: 34em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }  /* read by screen readers, not shown */
#contact .note { color: var(--muted); font-size: 13px; }

/* On a phone the type sits over the middle of the footage, so a shade under the lower half keeps it readable, and
   the type stays light on every clip (switching it dark over a shade would fight it). */
@media (hover: none), (max-width: 760px) {
  .stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,.5) 0, rgba(0,0,0,.3) 12%, rgba(0,0,0,.05) 24%, rgba(0,0,0,.05) 32%, rgba(0,0,0,.62) 58%, rgba(0,0,0,.7) 100%); }
  .is-home.on-light { --ink: #ece6db; --muted: #c4beb4; --line: rgba(236, 230, 219, .22); --accent: #cdfa0a; }
  .home { text-shadow: 0 1px 10px rgba(0,0,0,.35); }
  .home .meta span, .home .list-label, .home .filmography .year, .home .kind { color: #c4beb4; }
}
