/* khns.dev v2, lower half: selected work (three pinned scenes), all projects, about (pinned), contact footer, and the 404 page.
   Builds on base.css; shared classes are used as they are and never restyled here.
   Timing: every step is a function of the scene's --p / --enter / --exit (written by scenes.js), expressed with
   --a (start) and --d (length) so one element can keep different beats on desktop and on a phone. */

/* Everything in the lower half sits above the fixed scene backdrops. */
.wk-top, .pl-in, .ct-in { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ Selected work */
.wk { position: relative; }
.wk-top { padding-top: clamp(88px, 13svh, 168px); padding-bottom: clamp(8px, 3svh, 32px); display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 48px; }
.wk-index { display: flex; flex-wrap: wrap; gap: 6px 10px; --i: 2; }
.wk-index a { display: inline-flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 16px 0 14px; border: 1px solid var(--line); border-radius: var(--r-s); color: var(--text-2); font: 600 12.5px/1 var(--display); letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; transition: border-color .25s var(--ease), color .25s var(--ease), background-color .25s var(--ease); }
.wk-index a:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.wk-index-n { font: 500 11px/1 var(--mono); letter-spacing: .04em; color: var(--accent); }
.wk-top .head > .rv:nth-child(2) { --i: 1; }
/* The first scene starts under the header, so the header reads as its title and the gap between them stays small. */
#moonshift-story { margin-top: -16svh; }
html[data-motion="off"] #moonshift-story, html:not(.js) #moonshift-story { margin-top: 0; }

/* Backdrop: a blurred enlargement of the piece's poster, fixed to the viewport so neighbouring scenes cross-fade. */
.wk-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; visibility: hidden; opacity: calc(var(--enter) * var(--enter) * (3 - 2 * var(--enter)) * (1 - var(--exit) * var(--exit) * (3 - 2 * var(--exit)))); will-change: opacity; }
.scene.is-active > .wk-bg { visibility: visible; }
.wk-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .74; }
.wk-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7, 8, 11, .92) 0%, rgba(7, 8, 11, .7) 36%, rgba(7, 8, 11, .2) 100%), linear-gradient(180deg, rgba(7, 8, 11, .8) 0%, rgba(7, 8, 11, 0) 26%, rgba(7, 8, 11, 0) 70%, rgba(7, 8, 11, .88) 100%); }

/* Rows: free space, title, copy, free space. The screen spans all four, so its height never stretches the text rows. */
.wk-in { grid-template-rows: 1fr auto auto 1fr; align-items: start; opacity: calc(1 - var(--exit) * 2.8); }
/* The last scene has no scene held over it: its content scrolls away with the page instead of fading on the spot,
   so the window is not left empty above the project list that follows. */
#haiku-luna-evaluation .wk-in { opacity: 1; }
/* While it fades (lower.js: is-leaving) the scene's content is a layer of its own: a new opacity is then a value the
   compositor takes, not a new layer list. Only while: kept at opacity 1 or 0 it would be a pass of its own for nothing. */
.wk-scene.is-leaving .wk-in, .ab.is-leaving .ab-in { will-change: opacity; }
#haiku-luna-evaluation .wk-in { will-change: auto; }
.wk-title { grid-column: 1 / span 5; grid-row: 2; }
.wk-title .label { margin-bottom: var(--label-gap); }
.wk-copy { grid-column: 1 / span 5; grid-row: 3; padding-top: 24px; }
.wk-media { grid-column: 6 / -1; grid-row: 1 / -1; align-self: center; position: relative; margin-left: clamp(16px, 2.6vw, 40px); }

/* Arrive while the scene scrolls in, so the frame is composed the moment it pins (and when a link lands on it).
   The second and third scene are held in place while they scroll in (data-hold): the scene before them has faded
   by exit .36, and these start arriving at .26, so the two cross-fade and the stage is never left empty. */
.fx.wk-e1 { --in: clamp(0, calc((var(--enter) - .26) / .3), 1); }
.fx.wk-e2 { --in: clamp(0, calc((var(--enter) - .33) / .3), 1); }
.fx.wk-e3 { --in: clamp(0, calc((var(--enter) - .40) / .3), 1); }
.fx.wk-media { --in: clamp(0, calc((var(--enter) - .28) / .5), 1); --dy: 56px; --blur: 8px; }
/* On desktop the arriving text sharpens out of a blur, so it can start earlier and overlap the leaving scene more:
   the heading is readable again within a third of a screen. (Phones have no blur; there the two would read as
   double print, so they keep the later start.) */
@media (min-width: 901px) {
  .fx.wk-e1 { --in: clamp(0, calc((var(--enter) - .12) / .28), 1); }
  .fx.wk-e2 { --in: clamp(0, calc((var(--enter) - .18) / .28), 1); }
  .fx.wk-e3 { --in: clamp(0, calc((var(--enter) - .25) / .3), 1); }
  .fx.wk-media { --in: clamp(0, calc((var(--enter) - .14) / .5), 1); }
}
/* Then, pinned, the rest in steps, spread so that something arrives until about two thirds of the scene; the last
   third is for looking (and for pressing play). */
.wk-s1 { --a: .06; --d: .14; }
.wk-s2 { --a: .22; --d: .14; }
.wk-chip-a { --a: .38; --d: .12; }
.wk-chip-b { --a: .52; --d: .12; }
.wk-swatches li { --dy: 16px; --blur: 6px; --d: .1; }
.wk-swatches li:nth-child(1) { --a: .06; } .wk-swatches li:nth-child(2) { --a: .13; }
.wk-swatches li:nth-child(3) { --a: .20; } .wk-swatches li:nth-child(4) { --a: .27; }
@media (min-width: 901px) {
  #moonlight-story .wk-s2 { --a: .42; }
  /* The downloads come with the last row of the board, and stay for the rest of the scene. */
  #haiku-luna-evaluation .wk-s2 { --a: .60; --d: .12; }
}

.wk-copy > * + * { margin-top: 18px; }
.wk-copy .lead { max-width: 33em; }
.wk-note { max-width: 36em; }
.wk-meta { font: 500 12.5px/1.5 var(--mono); letter-spacing: .02em; color: var(--text-2); padding-top: 14px; border-top: 1px solid var(--line); max-width: 36em; }
.wk-acts { padding-top: 6px; }
.wk-acts .btn { white-space: normal; text-align: left; padding-block: 12px; line-height: 1.3; }

.wk-swatches { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 4px; font: 500 12.5px/1 var(--mono); color: var(--text-2); }
.wk-swatches li { display: inline-flex; align-items: center; gap: 9px; }
.wk-sw { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .22); }
.wk-sw-navy { background: #0d1526; }
.wk-sw-ice { background: #8fd3ff; }
.wk-sw-lavender { background: #b9a6ff; }
.wk-sw-mint { background: #86efc4; }

/* The framed screen */
.wk-frame {
  --t: clamp(0, calc(var(--p) / .4), 1);
  --ts: calc(var(--t) * var(--t) * (3 - 2 * var(--t)));
  --ratio: 16 / 9;
  position: relative; margin-left: auto; width: 100%; max-width: calc((100svh - var(--nav-h) - 150px) * var(--ratio));
  border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; background: #05060a;
  box-shadow: 0 0 0 1px rgba(77, 184, 255, .08), 0 34px 90px -28px rgba(0, 0, 0, .9), 0 0 110px -18px rgba(77, 184, 255, .3);
  transform: perspective(1500px) rotateY(calc((1 - var(--ts)) * -12deg)) rotateX(calc((1 - var(--ts)) * 4deg)) scale(calc(.92 + var(--ts) * .08));
  transform-origin: 70% 50%; will-change: transform;
}
.wk-media-tall .wk-frame { --ratio: 960 / 680; }
.wk-screen { position: relative; background: #000; }
.wk-screen-16x9 { aspect-ratio: 16 / 9; }
.wk-screen-moonlight { aspect-ratio: 960 / 680; }
.wk-screen video, .wk-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wk-screen video { object-fit: contain; background: #000; }
.wk-poster { transition: opacity .4s var(--ease), filter .4s var(--ease); filter: brightness(.82); }
/* The plate's look is in base.css (.plate); here only its place: the middle of the picture. */
.wk-plate { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.wk-frame:hover .wk-poster { filter: brightness(1); }
.wk-frame.is-playing .wk-poster, .wk-frame.is-playing .wk-plate { opacity: 0; visibility: hidden; pointer-events: none; }

/* Floating data chips */
.wk-chips { position: absolute; inset: 0; pointer-events: none; }
.wk-chip { position: absolute; --dy: 18px; --blur: 6px; }
.wk-chip-a { left: -30px; top: 22%; }
.wk-chip-b { right: -18px; bottom: 15%; }
.wk-chip dd { color: var(--text); }
.wk-chip dd span { color: var(--accent); }
.wk-media:has(.is-playing) .wk-chips { opacity: 0; transition: opacity .3s var(--ease); }

/* The evaluation dashboard */
.ev { background: rgba(9, 11, 16, .86); }
.ev-body { padding: 14px 20px 16px; }
.ev-cols { display: grid; grid-template-columns: 104px minmax(0, 1fr) 62px; column-gap: 16px; padding-bottom: 10px; font: 600 9.5px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.ev-cols span:last-child { text-align: right; }
.ev-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 62px; column-gap: 16px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.ev-label strong { display: block; font: 600 15px/1.2 var(--display); color: var(--text); }
.ev-label span { display: block; margin-top: 5px; font: 500 11px/1 var(--mono); color: var(--text-2); }
.ev-cells { display: flex; gap: 7px; }
.ev-grp { display: flex; gap: 3px; min-width: 0; }
.ev-task { flex: 1 1 0; display: grid; gap: 3px; min-width: 0; }
/* Only the scale is animated: 192 cells easing their colour, shadow and radius as well cost a slow machine its frame rate. */
.ev-task span { display: block; aspect-ratio: 1; border-radius: 2px; background: rgba(255, 255, 255, .07); transition: transform .35s var(--ease-out); transform: scale(.7); }
.ev-task span + span { transition-delay: 50ms; }
/* A jump across the scene (a nav link, the End key, a deep link) fills or empties up to 96 tasks while the board is not
   on screen: cells nobody sees take their state at once instead of running 192 transitions. (scenes.js sets is-active
   before the board is updated, so a jump that lands on the scene still eases.) */
.wk-scene:not(.is-active) .ev-task span { transition: none; }
.ev-task.is-on span { transform: none; }
.ev-task.is-on .ev-p, .ev-key.ev-p { background: var(--ok); }
.ev-task.is-on .ev-f, .ev-key.ev-f { background: linear-gradient(135deg, transparent 0 41%, var(--bad) 41% 59%, transparent 59%); box-shadow: inset 0 0 0 1.5px var(--bad); }
.ev-task.is-on .ev-t, .ev-key.ev-t { background: transparent; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--wait); }
.ev-score { text-align: right; font: 500 12px/1 var(--mono); color: var(--text-2); white-space: nowrap; }
.ev-score b { font: 600 25px/1 var(--display); color: var(--text); font-variant-numeric: tabular-nums; margin-right: 1px; }
.ev-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.2; color: var(--text-2); }
.ev-legend li { display: inline-flex; align-items: center; gap: 8px; }
.ev-key { width: 12px; height: 12px; border-radius: 2px; flex: none; }

/* Phones and narrow windows: the copy and the screen share one place and take turns (two beats). */
@media (max-width: 900px) {
  .wk-in { row-gap: 0; }
  .wk-title, .wk-copy, .wk-media { grid-column: 1 / -1; }
  .wk-copy, .wk-media { grid-row: 3; }
  /* The copy holds the stage for the first half of the scene (its buttons need that long to be pressed), then the
     screen takes its place. lower.js switches the beat (is-b) at .55. */
  .wk-copy { padding-top: 20px; max-width: 620px; --out: clamp(0, calc((var(--p) - .50) / .08), 1); }
  .wk-media { align-self: start; margin: 24px 0 0; max-width: 620px; }
  .fx.wk-media { --in: clamp(0, calc((var(--p) - .56) / .12), 1); --dy: 34px; --blur: 0px; }
  .wk-s1 { --a: .03; --d: .12; }
  .wk-s2 { --a: .14; --d: .12; }
  .wk-chip-a { --a: .66; --d: .1; }
  .wk-chip-b { --a: .74; --d: .1; }
  .wk-swatches li:nth-child(1) { --a: .03; } .wk-swatches li:nth-child(2) { --a: .06; }
  .wk-swatches li:nth-child(3) { --a: .09; } .wk-swatches li:nth-child(4) { --a: .12; }
  #moonlight-story .wk-s2 { --a: .08; }
  .wk-frame { transform: none; max-width: none; }
  .wk-scene:not(.is-b) .wk-media, .wk-scene.is-b .wk-copy { pointer-events: none; }
  .wk-chips { position: static; display: flex; gap: 10px; margin-top: 12px; }
  .wk-chip { position: static; flex: 1 1 0; }
  .wk-bg::after { background: linear-gradient(180deg, rgba(7, 8, 11, .9) 0%, rgba(7, 8, 11, .62) 30%, rgba(7, 8, 11, .62) 70%, rgba(7, 8, 11, .92) 100%); }
  .ev-body { padding: 12px 14px 14px; }
  .ev-cols { display: none; }
  .ev-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 9px; padding: 11px 0; }
  .ev-row:first-child { border-top: 0; padding-top: 4px; }
  .ev-label { display: flex; align-items: baseline; gap: 10px; }
  .ev-label span { margin: 0; }
  .ev-cells { grid-column: 1 / -1; grid-row: 2; gap: 5px; }
  .ev-grp, .ev-task { gap: 2px; }
  .ev-score b { font-size: 20px; }
  .ev-legend { gap: 8px 16px; font-size: 12px; padding-top: 12px; }
}

/* A phone on its side: no film frame taller than the window under the nav. */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
  .wk-media:not(:has(.ev)) .wk-frame { max-width: calc((100svh - var(--nav-h) - 64px) * var(--ratio)); margin-inline: auto; }
}

/* ------------------------------------------------------------------ All projects */
.pl-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 28px 40px; }
.pl-top .head > .rv:nth-child(2) { --i: 1; }
.pl-filters { display: flex; flex-wrap: wrap; gap: 8px; --i: 2; }
.pl-filter { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 15px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: transparent; color: var(--text-2); font: 600 12.5px/1 var(--display); letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; transition: border-color .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease), box-shadow .3s var(--ease); }
.pl-filter:hover { border-color: var(--accent-line); color: var(--text); }
.pl-filter[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); box-shadow: var(--glow-soft); }
.pl-n { font: 500 11px/1 var(--mono); letter-spacing: 0; color: var(--dim); }
.pl-filter[aria-pressed="true"] .pl-n { color: var(--accent); }

.pl-list { display: grid; gap: 6px; margin-top: clamp(28px, 5svh, 48px); }
.pl-row { --mx: 50%; --my: 50%; position: relative; border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .016)); overflow: hidden; }
.pl-row.rv { transition: opacity .7s var(--ease-out), transform .7s var(--ease-out), filter .7s var(--ease-out), border-color .25s var(--ease); transition-delay: calc(var(--i, 0) * 55ms), calc(var(--i, 0) * 55ms), calc(var(--i, 0) * 55ms), 0s; }
.pl-row.rv:focus-within { transition-duration: .2s; transition-delay: 0s; }
/* The pointer's light on a row, and the lit left edge. */
.pl-row::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(360px circle at var(--mx) var(--my), rgba(77, 184, 255, .13), rgba(77, 184, 255, 0) 70%); transition: opacity .3s var(--ease); }
.pl-row::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); box-shadow: 0 0 14px var(--accent); transform: scaleY(0); transform-origin: 50% 50%; transition: transform .3s var(--ease-out); pointer-events: none; }
.pl-row.is-open { border-color: var(--line-2); }
.pl-row.is-open::after { transform: none; }
@media (hover: hover) {
  .pl-row:hover { border-color: var(--line-2); }
  .pl-row:hover::before { opacity: 1; }
  .pl-row:hover::after { transform: none; }
}
.pl-head { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 2.2fr) minmax(0, .95fr) 172px 18px; grid-template-areas: "no name line kind status chev"; column-gap: 20px; align-items: center; width: 100%; min-height: 60px; padding: 10px 20px; border: 0; border-radius: var(--r); background: none; text-align: left; color: var(--text); }
button.pl-head { cursor: pointer; }
.pl-head:focus-visible { outline-offset: -3px; border-radius: var(--r); }
.pl-no { grid-area: no; font: 500 11px/1 var(--mono); color: var(--dim); }
.pl-name { grid-area: name; font: 600 18px/1.25 var(--display); letter-spacing: -.005em; }
.pl-line { grid-area: line; font-size: 15px; line-height: 1.45; color: var(--text-2); text-wrap: balance; }
.pl-kind { grid-area: kind; font: 500 12px/1.4 var(--mono); color: var(--text-2); }
.pl-chev { grid-area: chev; justify-self: end; }
.pl-status { grid-area: status; display: inline-flex; align-items: center; gap: 10px; font: 600 11px/1.3 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.pl-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.pl-status[data-tone="live"] { color: var(--text); }
.pl-status[data-tone="live"]::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.pl-status[data-tone="dev"]::before { background: var(--gold); box-shadow: 0 0 10px rgba(255, 194, 74, .6); }
.pl-chev { color: var(--dim); transition: transform .3s var(--ease-out), color .25s var(--ease); }
.pl-row.is-open .pl-chev { transform: rotate(180deg); color: var(--accent); }
.pl-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 40px; row-gap: 20px; align-items: start; padding: 6px 20px 22px 66px; animation: pl-open .5s var(--ease-out) both; }
.pl-notes { max-width: 62ch; font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.pl-notes p + p { margin-top: 10px; }
.pl-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pl-links .btn { max-width: 100%; white-space: normal; text-align: left; padding-block: 10px; line-height: 1.3; }
.pl-links .btn .l-ic { width: 14px; height: 14px; }
.pl-shot { width: min(340px, 30vw); height: auto; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); }
.pl-row.is-flash { animation: pl-flash 1.8s var(--ease) 1; }
.pl-row.is-swap { animation: pl-swap .5s var(--ease-out) both; animation-delay: calc(var(--j, 0) * 34ms); }
@keyframes pl-open { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
@keyframes pl-swap { from { opacity: 0; transform: translate3d(0, 14px, 0); } }
@keyframes pl-flash { 0%, 60% { border-color: var(--accent); box-shadow: var(--glow-soft); } 100% { box-shadow: none; } }
.pl-noscript { margin-top: 32px; max-width: 70ch; }

@media (max-width: 1100px) {
  .pl-head { grid-template-columns: 26px minmax(0, 1.1fr) minmax(0, 1.9fr) 160px 18px; grid-template-areas: "no name line status chev" "no name kind status chev"; row-gap: 4px; padding-block: 13px; }
  .pl-line { align-self: end; }
  .pl-kind { align-self: start; }
}
@media (max-width: 900px) {
  /* The chevron has a column of its own, so the status label under it cannot squeeze the name above it. */
  .pl-head { grid-template-columns: minmax(0, 1fr) auto 18px; grid-template-areas: "name name chev" "line line line" "kind status status"; column-gap: 12px; row-gap: 6px; padding: 14px 16px; }
  .pl-no { display: none; }
  .pl-name { font-size: 17px; }
  .pl-line { font-size: 14.5px; }
  .pl-kind { font-size: 11.5px; padding-top: 2px; align-self: center; }
  .pl-status { justify-self: end; font-size: 10.5px; padding-top: 2px; }
  .pl-body { grid-template-columns: minmax(0, 1fr); padding: 2px 16px 18px; }
  .pl-shot { width: 100%; max-width: 420px; }
}

/* ------------------------------------------------------------------ About */
.ab-in { align-content: center; align-items: start; opacity: calc(1 - var(--exit) * 1.9); }
.ab-label { grid-column: 1 / span 6; grid-row: 1; margin-bottom: var(--label-gap); }
.ab-beats { grid-column: 1 / span 6; grid-row: 2; display: grid; align-items: start; }
.ab-beat { grid-area: 1 / 1; min-width: 0; }
.ab-moon { grid-column: 8 / -1; grid-row: 1 / span 2; align-self: stretch; position: relative; pointer-events: none; }

/* The scene starts in the list's bottom padding, and its first lines have arrived by the time they are a little way
   into the window: the stretch between the end of the list and this heading is not left to the dots alone. */
html.js[data-motion="on"] #about { margin-top: calc(-1 * clamp(60px, 9svh, 116px)); }
.fx.ab-e1 { --in: clamp(0, calc((var(--enter) - .24) / .2), 1); }
.fx.ab-e2 { --in: clamp(0, calc((var(--enter) - .31) / .22), 1); }
.fx.ab-e3 { --in: clamp(0, calc((var(--enter) - .39) / .24), 1); }
.ab-s1 { --a: .03; --d: .12; }
.ab-who { --out: clamp(0, calc((var(--p) - .34) / .08), 1); }
/* The first beat is shorter than the second: it sits lower by half the difference (--shift, measured in JS) so it is
   centred too, and the label glides up to its second place while the beats change. */
.ab-in { --sw: clamp(0, calc((var(--p) - .34) / .12), 1); }
.ab-label, .ab-who { translate: 0 calc(var(--shift, 0px) * (1 - var(--sw) * var(--sw) * (3 - 2 * var(--sw)))); }
.ab-who > * + * { margin-top: 20px; }
.ab-who .copy { max-width: 34em; }
.ab-who .copy + .copy { margin-top: 14px; }
.ab-j1 { --a: .40; --d: .1; }
.ab-j2 { --a: .45; --d: .1; }
.ab-j3 { --a: .50; --d: .1; }
.ab-j4 { --a: .84; --d: .08; }
.ab-scene-b .ab-who, .ab:not(.ab-scene-b) .ab-job { pointer-events: none; }
.ab-job h3 a { display: inline-flex; align-items: baseline; gap: 8px; color: var(--accent); white-space: nowrap; border-bottom: 1px solid var(--accent-line); transition: color .25s var(--ease), border-color .25s var(--ease); }
.ab-job h3 a:hover { color: var(--accent-hi); border-color: var(--accent-hi); }
.ab-job h3 .l-ic { width: .55em; height: .55em; }
.ab-job > .copy { margin-top: 16px; max-width: 34em; }
.ab-tools { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 44em; font: 500 12.5px/1.5 var(--mono); color: var(--text-2); }

/* The three steps: numbers on a line that fills as the scene moves. */
.ab-steps { display: grid; gap: 14px; margin-top: 22px; max-width: 36em; }
.ab-steps li { --f: 0; position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 18px; align-items: start; min-height: 38px; }
.ab-steps li:not(:last-child)::before, .ab-steps li:not(:last-child)::after { content: ""; position: absolute; left: 18.5px; top: 38px; bottom: -14px; width: 1px; background: var(--line-2); }
.ab-steps li:not(:last-child)::after { background: var(--accent); box-shadow: 0 0 8px var(--accent); transform: scaleY(var(--f)); transform-origin: 50% 0; }
.ab-n { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--bg); font: 600 12.5px/1 var(--display); letter-spacing: .04em; color: var(--dim); transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease); }
.ab-steps p { padding-top: 6px; font-size: 16.5px; line-height: 1.5; color: var(--text-2); opacity: .66; transition: opacity .35s var(--ease), color .35s var(--ease); }
.ab-steps li.is-done .ab-n { border-color: var(--accent-line); color: var(--accent); }
.ab-steps li.is-done p { opacity: .82; }
.ab-steps li.is-current .ab-n { border-color: transparent; background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.ab-steps li.is-current p { opacity: 1; color: var(--text); }

/* The chip beside the dot moon. JS places it from the same numbers it gives the dot field. */
.ab-chip { position: absolute; left: var(--chip-x, 0); top: var(--chip-y, 70%); transform: translate(-50%, -50%); pointer-events: none; }
.ab-chip .chip-stat { --a: .08; --d: .12; --dy: 18px; --blur: 6px; white-space: nowrap; }
.ab-chip dd small { display: block; margin-top: 7px; font: 500 11.5px/1 var(--mono); color: var(--text-2); }

@media (max-width: 900px) {
  .ab-in { row-gap: 0; }
  .ab-label, .ab-beats, .ab-moon { grid-column: 1 / -1; }
  .ab-label { align-self: center; margin-bottom: 0; }
  .ab-beats { margin-top: 22px; max-width: 620px; }
  .ab-moon { grid-row: 1; justify-self: end; align-self: center; translate: 0 calc(var(--shift, 0px) * (1 - var(--sw) * var(--sw) * (3 - 2 * var(--sw)))); }
  .ab-chip { position: static; transform: none; }
  .ab-chip .chip-stat { padding: 9px 12px 10px; gap: 5px; }
  .ab-chip .chip-stat dt { font-size: 9.5px; }
  .ab-chip .chip-stat dd { font-size: 15px; }
  .ab-chip dd small { display: inline; margin: 0 0 0 8px; font-size: 11px; }
  .ab-who > * + * { margin-top: 16px; }
  .ab-steps { gap: 12px; margin-top: 18px; }
  .ab-steps li { column-gap: 14px; }
  .ab-steps p { font-size: 15.5px; padding-top: 7px; }
  .ab-job > .copy { margin-top: 14px; font-size: 16px; }
  .ab-tools { margin-top: 18px; }
}
@media (max-width: 420px) {
  .ab-job h3 a { white-space: normal; display: inline; }
}
/* Short phone screens: the second beat is the tallest thing on the page that has to fit one pinned stage. */
@media (max-width: 900px) and (max-height: 700px) {
  .ab-beats { margin-top: 16px; }
  .ab-job h3 { font-size: 21px; }
  .ab-job > .copy { margin-top: 10px; font-size: 15px; line-height: 1.5; }
  .ab-steps { gap: 8px; margin-top: 14px; }
  .ab-steps li { grid-template-columns: 32px minmax(0, 1fr); min-height: 32px; }
  .ab-steps li:not(:last-child)::before, .ab-steps li:not(:last-child)::after { left: 15.5px; top: 32px; bottom: -8px; }
  .ab-n { width: 32px; height: 32px; font-size: 11.5px; }
  .ab-steps p { font-size: 14.5px; line-height: 1.45; padding-top: 5px; }
  .ab-tools { margin-top: 12px; padding-top: 10px; font-size: 11.5px; }
  .wk-copy { padding-top: 14px; }
  .wk-copy > * + * { margin-top: 13px; }
  .wk-copy .lead { font-size: 16px; line-height: 1.5; }
}
/* Short desktop windows (motion stays on down to 500px tall): the second beat of the pinned About is tightened the
   same way. */
@media (min-width: 901px) and (max-height: 600px) {
  html.js[data-motion="on"] .ab-label { margin-bottom: 14px; }
  html.js[data-motion="on"] .ab-job > .copy { margin-top: 10px; font-size: 16px; line-height: 1.5; }
  html.js[data-motion="on"] .ab-steps { gap: 8px; margin-top: 14px; }
  html.js[data-motion="on"] .ab-steps li { grid-template-columns: 32px minmax(0, 1fr); min-height: 32px; }
  html.js[data-motion="on"] .ab-steps li:not(:last-child)::before, html.js[data-motion="on"] .ab-steps li:not(:last-child)::after { left: 15.5px; top: 32px; bottom: -8px; }
  html.js[data-motion="on"] .ab-n { width: 32px; height: 32px; font-size: 11.5px; }
  html.js[data-motion="on"] .ab-steps p { font-size: 15px; line-height: 1.45; padding-top: 5px; }
  html.js[data-motion="on"] .ab-tools { margin-top: 12px; padding-top: 10px; }
}
/* The shortest phone screens: the results board with its title still fits between the nav and the bottom edge. */
@media (max-width: 900px) and (max-height: 600px) {
  .wk-title .label { margin-bottom: 12px; }
  .wk-title .h-l { font-size: 26px; }
  .wk-media { margin-top: 14px; }
  .ev-body { padding: 8px 12px 10px; }
  .ev-row { padding: 8px 0; row-gap: 7px; }
  .ev-legend { padding-top: 9px; }
}

/* ------------------------------------------------------------------ Contact */
/* A column, so the wrap inside grows in height (flex: 1) and keeps its own width and centring. */
.ct { min-height: 100svh; display: flex; flex-direction: column; padding-bottom: 28px; }
.ct-in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 28px); grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; flex: 1; }
.ct-head { grid-column: 1 / span 5; grid-row: 1; }
.ct-head > .rv:nth-child(2) { --i: 1; }
.ct-line { --i: 2; margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; max-width: 30em; }
.ct-run { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 14px; border: 1px solid var(--accent-line); border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent-hi); font: 500 14px/1 var(--mono); transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .3s var(--ease), color .25s var(--ease); }
.ct-run:hover { border-color: var(--accent); color: var(--text); box-shadow: var(--glow-soft); }
.ct-run .l-ic { width: 14px; height: 14px; }
.ct-links { grid-column: 7 / -1; grid-row: 1; display: grid; gap: 8px; align-content: start; }
.ct-row { display: grid; grid-template-columns: 124px minmax(0, 1fr) auto; column-gap: 16px; align-items: center; width: 100%; min-height: 62px; padding: 10px 20px; color: var(--text); text-align: left; }
.ct-row:hover { color: var(--text); }
.ct-k { font: 600 11px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.ct-v { font: 600 19px/1.2 var(--display); overflow-wrap: anywhere; }
.ct-row .l-ic { color: var(--dim); transition: color .25s var(--ease), transform .3s var(--ease-out); }
.ct-row:hover .l-ic { color: var(--accent); transform: translate3d(2px, -2px, 0); }
.ct-row:hover .l-ic-right { transform: translate3d(3px, 0, 0); }
.ct-row .copy-hint { font: 500 11.5px/1 var(--mono); color: var(--text-2); padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 5px; transition: color .25s var(--ease), border-color .25s var(--ease); }
.ct-row:hover .copy-hint { color: var(--accent); border-color: var(--accent-line); }
/* Room for the dots to spell the wordmark; the canvas behind does the drawing. */
.ct-word { grid-column: 1 / -1; grid-row: 2; align-self: center; width: 100%; aspect-ratio: 5.2 / 1; max-height: 34svh; margin-block: clamp(20px, 4svh, 48px); pointer-events: none; }
.ct-base { grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); }
.ct-legal { font: 500 12.5px/1.4 var(--mono); color: var(--text-2); }
.ct-top { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 4px; color: var(--text-2); font: 600 12.5px/1 var(--display); letter-spacing: .13em; text-transform: uppercase; transition: color .25s var(--ease); }
.ct-top:hover { color: var(--accent); }
.ct-top .l-ic { transition: transform .3s var(--ease-out); }
.ct-top:hover .l-ic { transform: translate3d(0, -3px, 0); }
/* Short desktop windows: the footer still closes the page in one screen. */
@media (min-width: 901px) and (max-height: 800px) {
  .ct { padding-top: calc(var(--nav-h) + 24px); padding-bottom: 14px; }
  .ct-links { gap: 6px; }
  .ct-row { min-height: 50px; padding-block: 6px; }
  .ct-word { max-height: 25svh; margin-block: clamp(10px, 2.4svh, 20px); }
  .ct-base { padding-top: 8px; }
}
@media (max-width: 900px) {
  .ct-in { grid-template-rows: auto auto minmax(0, 1fr) auto; }
  .ct-head, .ct-links { grid-column: 1 / -1; }
  .ct-links { grid-row: 2; margin-top: 32px; }
  .ct-word { grid-row: 3; aspect-ratio: 4.4 / 1; }
  .ct-base { grid-row: 4; }
}
@media (max-width: 520px) {
  .ct-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 7px; padding: 12px 16px; }
  .ct-k { grid-column: 1 / -1; }
  .ct-v { font-size: 17px; }
}

/* ------------------------------------------------------------------ Motion off, and no JavaScript: everything in plain flow */
html[data-motion="off"] .wk-bg { position: absolute; visibility: visible; opacity: .8; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 78%, transparent 100%); }
html[data-motion="off"] .wk-in, html[data-motion="off"] .ab-in { opacity: 1; height: auto; padding-block: clamp(64px, 11svh, 128px); }
html[data-motion="off"] .wk-frame { transform: none; }
html[data-motion="off"] .wk-scene .wk-copy, html[data-motion="off"] .wk-scene .wk-media { pointer-events: auto; }
html[data-motion="off"] .ab-beats { display: block; }
html[data-motion="off"] .ab-label, html[data-motion="off"] .ab-who, html[data-motion="off"] .ab-moon { translate: none; }
html[data-motion="off"] .ab-job { margin-top: clamp(36px, 6svh, 56px); }
html[data-motion="off"] .ab .ab-who, html[data-motion="off"] .ab .ab-job { pointer-events: auto; }
html[data-motion="off"] .ab-moon { align-self: start; min-height: min(72svh, 640px); }
html[data-motion="off"] .ab-steps li { --f: 1; }
html[data-motion="off"] .ab-steps p { opacity: 1; }
html[data-motion="off"] .ev-task span { transform: none; }
html[data-motion="off"] .pl-row.is-swap, html[data-motion="off"] .pl-body { animation: none; }
@media (max-width: 900px) {
  html[data-motion="off"] .wk-in { grid-template-rows: none; }
  html[data-motion="off"] .wk-title, html[data-motion="off"] .wk-copy, html[data-motion="off"] .wk-media { grid-row: auto; }
  html[data-motion="off"] .wk-media { margin-top: 28px; }
  html[data-motion="off"] .ab-moon { min-height: 0; align-self: center; }
}
html:not(.js) .wk-bg { position: absolute; visibility: visible; opacity: .8; }
html:not(.js) .wk-in, html:not(.js) .ab-in { opacity: 1; height: auto; padding-block: 72px; grid-template-rows: none; }
html:not(.js) .wk-frame { transform: none; }
html:not(.js) :is(.wk-poster, .wk-plate, .ab-moon, .ev, .pl-filters, .ct-links, .ct-line, .ct-word) { display: none; }
/* The two figures beside the Moonshift film stand under it (on it they would cover the film's own controls). */
html:not(.js) .wk-chips { position: static; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
html:not(.js) .wk-chip { position: static; }
/* The films keep their native controls; their stills show behind them until one is played. */
html:not(.js) .wk-screen video { background: none; }
/* (Chrome lays a grey sheet over a film that has controls but no picture yet; without it the still behind shows.) */
html:not(.js) .wk-screen video::-webkit-media-controls { background: transparent; }
html:not(.js) #moonshift-story .wk-screen { background: #000 url("/assets/previews/moonshift-learned-crew-46s-poster.jpg") center / cover no-repeat; }
html:not(.js) #moonlight-story .wk-screen { background: #000 url("/assets/previews/moonlight-pets-080-poster.jpg") center / cover no-repeat; }
.ct-nojs { margin-top: 22px; }
html:not(.js) .ab-beats { display: block; }
html:not(.js) :is(.ab-label, .ab-who, .ab-moon) { translate: none; }
html:not(.js) .ab-job { margin-top: 40px; }
html:not(.js) .ab-steps p { opacity: 1; }
html:not(.js) :is(.wk-title, .wk-copy, .wk-media) { grid-row: auto; pointer-events: auto; }

/* ------------------------------------------------------------------ 404 */
.nf { min-height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: radial-gradient(60vw 60vw at 78% 38%, rgba(77, 184, 255, .11), rgba(77, 184, 255, 0) 62%), var(--bg); overflow: hidden; }
.nf-nav { height: var(--nav-h); display: flex; align-items: center; }
.nf-mark { font: 600 17px/1 var(--display); letter-spacing: .32em; text-transform: uppercase; color: var(--text); padding-block: 12px; }
.nf-mark:hover { color: var(--accent); }
.nf-main { position: relative; display: grid; align-content: center; padding-block: 32px 64px; }
.nf-main::before { content: ""; position: absolute; right: max(var(--gut), calc((100vw - var(--wrap)) / 2)); top: 50%; width: min(46vw, 560px); aspect-ratio: 1; border-radius: 50%; transform: translate(8%, -54%); background-image: radial-gradient(rgba(190, 226, 255, .55) 1px, transparent 1.4px); background-size: 9px 9px; -webkit-mask-image: radial-gradient(closest-side, #000 0 97%, transparent 100%), radial-gradient(closest-side at 34% 42%, transparent 0 96%, #000 100%); -webkit-mask-composite: source-in; mask-image: radial-gradient(closest-side, #000 0 97%, transparent 100%), radial-gradient(closest-side at 34% 42%, transparent 0 96%, #000 100%); mask-composite: intersect; opacity: .9; pointer-events: none; }
.nf-code { position: relative; font: 700 clamp(120px, 23vw, 300px)/.86 var(--display); letter-spacing: -.02em; color: var(--text); margin: 18px 0 0 -.04em; }
.nf-code span { color: var(--accent); text-shadow: 0 0 60px rgba(77, 184, 255, .45); }
.nf-main .lead { position: relative; margin-top: 26px; }
.nf-main .row { position: relative; margin-top: 30px; }
.nf-foot { padding-block: 22px; border-top: 1px solid var(--line); font: 500 12.5px/1.4 var(--mono); color: var(--text-2); }

