/* Hallmark · macrostructure: bespoke (sideways pager, one backdrop per screen) · tone: austere · theme: studied-DNA (source: image, user reference)
 * mist oklch(89.3% 0.008 165) · dusk oklch(80% 0.022 34) · ink oklch(26% 0.02 215)
 * one family on the whole site: Martian Mono (--font), width 87.5%, weights 340 and 520
 * three sizes only: --fs-s (labels, meta), --fs-m (reading text), --fs-l (headings, figures); nothing below 12px */
:root {
  --color-mist: oklch(89.3% 0.008 165);
  --color-dusk: oklch(80% 0.022 34);
  --color-paper: oklch(96% 0.006 165);
  --color-ink: oklch(26% 0.02 215);
  --color-ink-2: oklch(32% 0.02 210);
  --color-rule: oklch(68% 0.018 200);
  --color-rose: oklch(72% 0.055 22);
  --color-veil: color-mix(in oklch, var(--color-dusk) 88%, transparent);

  --font: "Martian Mono", ui-monospace, monospace;
  --font-stretch: 87.5%;
  --w-text: 340;
  --w-strong: 520;
  --fs-s: 0.75rem;
  --fs-m: 0.875rem;
  --fs-l: 1.375rem;
  --lh-s: 1.55;
  --lh-m: 1.6;
  --lh-l: 1.25;
  --track: 0.06em;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-short: 240ms;
  --gutter: clamp(1.1rem, 3.2vw, 2.75rem);
  --edge: 0.5rem;
  --bar-h: 3.25rem;
  --ctl-h: 3.5rem;
  --space-xs: 0.5rem; --space-sm: 0.75rem; --space-md: 1rem; --space-lg: 1.5rem;
  --space-xl: 2.5rem; --space-2xl: 4rem; --space-3xl: 6.5rem;
  --z-bg: 0; --z-page: 2; --z-edge: 6; --z-chrome: 7; --z-grain: 8;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* the poster figure: head height and head top, in viewport terms */
  --head: 66dvh;
  --head-top: 9dvh;
  --top: calc(var(--bar-h) + var(--edge)); /* where content may start */
  --bottom: calc(var(--ctl-h) + var(--edge)); /* where the control strip begins, from the bottom */
  --label: 10rem; /* the narrow credits column on case pages */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; overflow-x: clip; color: var(--color-ink); background: var(--color-mist); font-family: var(--font); font-stretch: var(--font-stretch); font-weight: var(--w-text); font-size: var(--fs-m); line-height: var(--lh-m); }
body::after { content: ""; position: fixed; inset: 0; z-index: var(--z-grain); pointer-events: none; opacity: 0.16; mix-blend-mode: multiply; background: var(--grain); }
::selection { background: var(--color-rose); color: var(--color-ink); }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 1px solid var(--color-ink); outline-offset: 4px; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2 { font-weight: var(--w-text); font-size: var(--fs-l); line-height: var(--lh-l); text-wrap: balance; }
b, strong { font-weight: var(--w-strong); }
ul, ol { list-style: none; padding: 0; }
img { -webkit-user-drag: none; }

/* the one label style: small, uppercase, tracked. Used for chrome and the poster credits only. */
.bar, .ctl, .pc__credits, .p-side, .p-with {
  font-size: var(--fs-s); line-height: var(--lh-s); text-transform: uppercase; letter-spacing: var(--track);
}
/* small meta text: same size, sentence case, quieter colour */
.nums span, .credits dt, .part h2, .svc__how, .fin__list, .op, .all__key, .reg__l, .reg__s, .case__nav span:first-child {
  font-size: var(--fs-s); line-height: var(--lh-s); color: var(--color-ink-2);
}

/* chrome: top bar, paper edge, pager controls */
.edge { position: fixed; inset: 0; z-index: var(--z-edge); border: var(--edge) solid var(--color-paper); pointer-events: none; }
.bar { position: relative; z-index: var(--z-chrome); display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); min-height: var(--bar-h); padding: var(--edge) var(--gutter) 0; line-height: 1; }
.pg .bar { position: fixed; inset: 0 0 auto 0; }
.bar a { display: inline-block; padding-block: 0.9rem; text-decoration: none; white-space: nowrap; }
.bar a:hover, .bar a[aria-current] { text-decoration: underline; }
.bar nav { display: flex; gap: clamp(0.9rem, 2.2vw, 2rem); }
.bar__go { font-weight: var(--w-strong); }
.ctl { position: fixed; inset: auto 0 0 0; z-index: var(--z-chrome); display: flex; align-items: center; justify-content: space-between; min-height: var(--ctl-h); padding: 0 var(--gutter) var(--edge); line-height: 1; pointer-events: none; }
.ctl__name { margin-left: 1rem; }
.ctl__nav { display: flex; gap: 0.25rem; pointer-events: auto; }
.ctl button { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; background: none; color: inherit; cursor: pointer; transition: translate var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out); }
.ctl button svg { width: 1.6rem; height: 1.6rem; }
.ctl button:disabled { opacity: 0.3; cursor: default; }
.ctl [data-next]:not(:disabled):hover { translate: 4px 0; }
.ctl [data-prev]:not(:disabled):hover { translate: -4px 0; }

/* backdrops: one per screen, drifting left and dissolving while the next arrives.
   The images are neutral fog; the warm veil at the bottom is painted here, aligned to the viewport. */
.pg { height: 100dvh; overflow: hidden; timeline-scope: --pager; }
.bgs { position: fixed; inset: 0; z-index: var(--z-bg); overflow: hidden; pointer-events: none; }
.bgs::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 0 42%, var(--color-veil) 100%); }
.bg { position: absolute; inset: 0; opacity: 0; will-change: translate, opacity; }
.bg--0 { opacity: 1; }
.bg img { position: absolute; display: block; max-width: none; }
/* p0 and far: square images, head = 22.73% of the height, head top at 18.18% */
.bg--0 img, .bg--3 img { width: calc(var(--head) / 0.2273); height: auto; aspect-ratio: 1; left: var(--x, 50%); top: calc(var(--head-top) - var(--head) * 0.8); translate: -50% 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.bg--3 img { --x: 74%; width: calc(var(--head) * 0.86 / 0.2273); top: calc(var(--head-top) + 8dvh - var(--head) * 0.69); opacity: 0.9; }
/* cast and map: soft masses across the whole screen */
.bg--1 img, .bg--2 img { inset: -6%; width: 112%; height: 112%; object-fit: cover; }
.bg--1 img { opacity: 0.9; }
.bg--2 img { opacity: 0.85; }
/* p3: the sharp portrait, head = 68.87% of its height, standing on the bottom edge, left of the contact text */
.bg--4 img { bottom: 0; left: 27%; height: calc(62dvh / 0.6887); width: auto; aspect-ratio: 1300 / 1319; translate: -50% 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
@media (orientation: portrait) {
  :root { --head: min(68vw, 34dvh); --head-top: calc(var(--top) + 3dvh); }
  .bgs::after { background: linear-gradient(to bottom, transparent 0 34%, var(--color-veil) 88%); }
}
@supports (animation-timeline: --a) and (timeline-scope: --a) {
  .bg { animation: linear both; animation-timeline: --pager; }
  .bg--0 { animation-name: bg-leave; animation-range: 0% 25%; }
  .bg--1 { animation-name: bg-pass; animation-range: 0% 50%; }
  .bg--2 { animation-name: bg-pass; animation-range: 25% 75%; }
  .bg--3 { animation-name: bg-pass; animation-range: 50% 100%; }
  .bg--4 { animation-name: bg-arrive; animation-range: 75% 100%; }
  @keyframes bg-leave { from { opacity: 1; translate: 0 0; } to { opacity: 0; translate: -18vw 0; } }
  @keyframes bg-pass { 0% { opacity: 0; translate: 18vw 0; } 50% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: -18vw 0; } }
  @keyframes bg-arrive { from { opacity: 0; translate: 18vw 0; } to { opacity: 1; translate: 0 0; } }
  @media (prefers-reduced-motion: reduce) {
    @keyframes bg-leave { from { opacity: 1; } to { opacity: 0; } }
    @keyframes bg-pass { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; } }
    @keyframes bg-arrive { from { opacity: 0; } to { opacity: 1; } }
  }
}

/* pager */
.pager { position: fixed; inset: 0; z-index: var(--z-page); display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; scroll-timeline: --pager inline; outline: none; cursor: grab; }
.pager::-webkit-scrollbar { display: none; }
.pager.is-drag { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.screen { position: relative; flex: 0 0 100%; display: flex; flex-direction: column; height: 100%; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; scroll-snap-align: start; scroll-snap-stop: always; padding: calc(var(--top) + var(--space-md)) var(--gutter) calc(var(--bottom) + var(--space-md));
  /* text that scrolls under the bar or the control strip fades out before it gets there */
  -webkit-mask-image: linear-gradient(to bottom, transparent var(--top), #000 calc(var(--top) + var(--space-md)), #000 calc(100% - var(--bottom) - var(--space-md)), transparent calc(100% - var(--bottom)));
  mask-image: linear-gradient(to bottom, transparent var(--top), #000 calc(var(--top) + var(--space-md)), #000 calc(100% - var(--bottom) - var(--space-md)), transparent calc(100% - var(--bottom))); }
.screen::-webkit-scrollbar { display: none; }
.col { width: min(100%, 60rem); margin-block: auto; }
.col--narrow { width: min(100%, 46rem); }
.screen h2 { margin-bottom: var(--space-lg); }

/* screen 1: the poster */
.s-poster { display: grid; grid-template-columns: minmax(17rem, 1fr) minmax(0, 40rem) minmax(17rem, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; gap: var(--space-lg) var(--space-xl); align-items: end; }
.p-hero { display: contents; }
.pc { grid-column: 2; grid-row: 1; align-self: start; margin-top: calc(var(--head-top) + var(--head) * 0.33 - var(--top) - var(--space-md)); text-align: center; }
/* poster billing: one role per line, centred under the title */
.pc__credits { margin-top: var(--space-md); }
.p-side { position: absolute; left: calc(var(--gutter) + 0.1rem); top: 42%; writing-mode: vertical-rl; rotate: 180deg; translate: 0 -50%; line-height: 1; white-space: nowrap; }
.p-with { grid-column: 1; grid-row: 2 / 4; max-width: 23rem; }
.p-with p:first-child { margin-bottom: 0.3rem; }
.p-tag { grid-column: 3; grid-row: 2; justify-self: end; width: min(100%, 25rem); }
.act { grid-column: 3; grid-row: 3; justify-self: end; width: min(100%, 25rem); min-width: min-content; display: flex; flex-direction: column; gap: var(--space-sm); }
/* buttons after iOS: sentence case, soft corners, a filled one and a grey one; they answer a press by dimming and shrinking a little */
.go, .more { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0 1.35rem; border-radius: 0.875rem; font-weight: var(--w-strong); line-height: 1; text-decoration: none; white-space: nowrap; transition: opacity var(--dur-short) var(--ease-out), scale var(--dur-short) var(--ease-out); }
.go { background: var(--color-ink); color: var(--color-paper); }
.more { background: color-mix(in oklch, var(--color-ink) 9%, transparent); color: var(--color-ink); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.go:hover, .more:hover { opacity: 0.84; }
.go:active, .more:active { opacity: 0.7; scale: 0.97; }

/* screen 2: cases, set like the track list on an album sleeve: centred lines, "title: figure" */
.col--center { margin-inline: auto; text-align: center; }
.prog a { display: block; padding: 0.5rem 0; color: var(--color-ink-2); text-decoration: none; text-wrap: balance; }
.prog__t { color: var(--color-ink); }
.prog__n { white-space: nowrap; }
.prog a:hover .prog__t, .prog a:focus-visible .prog__t { text-decoration: underline; }
.prog__all { margin-top: var(--space-lg); }

/* screens 3 and 4 follow the track list: centred, a title line with a quieter line under it, no rules */
.svc div + div, .exp li + li { margin-top: var(--space-lg); }
.svc dt, .exp__t { text-wrap: balance; }
.svc dt { font-weight: var(--w-strong); }
.svc dd, .exp__n { max-width: 54ch; margin-inline: auto; color: var(--color-ink-2); text-wrap: balance; }
.svc__how { max-width: 54ch; margin: var(--space-xl) auto 0; text-wrap: balance; }
.exp__y { color: var(--color-ink-2); white-space: nowrap; }

/* screen 5 and the closing block of inner pages */
.s-fin { align-items: flex-start; padding-left: max(var(--gutter), 57vw); }
.s-fin .fin { margin-block: auto; } /* auto margins, not justify-content, so tall content stays reachable */
.fin__line { margin-bottom: var(--space-xl); max-width: 22ch; }
.fin__list { display: flex; flex-wrap: wrap; gap: var(--space-sm) var(--space-xl); margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-rule); color: var(--color-ink); }
.fin__list a { white-space: nowrap; }

/* inner pages: a case, the full list */
.doc { min-height: 100vh; background: linear-gradient(to bottom, var(--color-mist) 0, var(--color-mist) calc(100% - 44rem), var(--color-dusk) 100%); }
.case, .all { position: relative; max-width: 68rem; margin-inline: auto; padding: var(--space-2xl) var(--gutter) var(--space-3xl); }
.case__haze { position: absolute; inset: -2rem -6vw auto -6vw; height: 38rem; z-index: -1; overflow: hidden; -webkit-mask-image: radial-gradient(ellipse 50% 52% at 50% 42%, #000 15%, transparent 100%); mask-image: radial-gradient(ellipse 50% 52% at 50% 42%, #000 15%, transparent 100%); }
.case__haze img { width: 100%; height: 100%; object-fit: cover; filter: blur(56px) grayscale(1) contrast(0.4) brightness(1.35); opacity: 0.45; /* flattened so even a dark still stays a light fog behind the text */ mix-blend-mode: multiply; scale: 1.3; }
.case__head h1, .all h1 { max-width: 30ch; }
.op { margin-top: var(--space-sm); }
.nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); margin-top: var(--space-2xl); }
.nums b { display: block; font-size: var(--fs-l); line-height: var(--lh-l); font-weight: var(--w-text); white-space: nowrap; }
.nums span { display: block; margin-top: 0.4rem; max-width: 26ch; }
.case__still { margin-top: var(--space-3xl); padding: var(--edge); background: var(--color-paper); }
.case__still img { display: block; width: 100%; height: auto; }
/* the story and the credits share the poster's credit layout: label in a narrow column set flush right, content beside it.
   The content column is capped at 62ch so a line stays inside 45..75 characters. */
.story { display: grid; gap: var(--space-2xl); margin-top: var(--space-3xl); }
.part, .credits div { display: grid; grid-template-columns: var(--label) minmax(0, 62ch); column-gap: var(--space-xl); align-items: baseline; }
.part h2, .credits dt { text-align: right; text-wrap: nowrap; }
.part--plain .part__v { grid-column: 2; }
.part__v p, .did li { text-wrap: pretty; }
.did li + li { margin-top: var(--space-md); }
.credits { margin-top: var(--space-2xl); }
.credits div { padding-block: 0.7rem; border-top: 1px solid var(--color-rule); }
.credits div:last-child { border-bottom: 1px solid var(--color-rule); }
@media (max-width: 47.99rem) {
  .story { gap: var(--space-xl); }
  .part, .credits div { grid-template-columns: minmax(0, 1fr); row-gap: 0.35rem; }
  .part h2, .credits dt { text-align: left; }
  .part--plain .part__v { grid-column: 1; }
}
/* neighbouring works: two more credit rows; the title keeps to one line and is cut with an ellipsis if the screen is too narrow */
.case__nav { margin-top: var(--space-3xl); }
.case__nav a { display: grid; grid-template-columns: var(--label) minmax(0, 62ch); column-gap: var(--space-xl); align-items: baseline; padding-block: 0.7rem; border-top: 1px solid var(--color-rule); text-decoration: none; }
.case__nav a:last-child { border-bottom: 1px solid var(--color-rule); }
.case__nav span:first-child { text-align: right; white-space: nowrap; }
.case__nav-t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.case__nav a:hover .case__nav-t, .case__nav a:focus-visible .case__nav-t { text-decoration: underline; }
@media (max-width: 47.99rem) {
  .case__nav a { grid-template-columns: minmax(0, 1fr); row-gap: 0.2rem; }
  .case__nav span:first-child { text-align: left; }
}
.doc .fin { margin-top: var(--space-3xl); }
.all__key { margin-top: var(--space-sm); }
.all section:not(.fin) { margin-top: var(--space-2xl); }
.all h2 { margin-bottom: var(--space-sm); }
.reg li { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) minmax(0, 15rem); gap: var(--space-md); align-items: baseline; padding: 0.55rem 0; border-bottom: 1px solid var(--color-rule); }
.reg__s { text-align: right; overflow-wrap: anywhere; }

@media (max-width: 64rem) {
  .bar .bar__sec { display: none; }
  .bg--1 img, .bg--2 img, .bg--3 img { opacity: 0.8; }
  :root { --p4h: min(108vw, 44dvh, 100dvh - 25rem); }
  .bg--4 img { top: var(--top); bottom: auto; left: 50%; height: var(--p4h); -webkit-mask-image: linear-gradient(to bottom, #000 64%, transparent 98%); mask-image: linear-gradient(to bottom, #000 64%, transparent 98%); }
  /* phone poster: title, billing and buttons sit in the middle of the first view, like the cases after it; the rest scrolls */
  .s-poster { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-xl); }
  .p-hero { display: flex; flex-direction: column; justify-content: center; gap: var(--space-lg); flex: none; min-height: calc(100dvh - var(--top) - var(--bottom) - 2 * var(--space-md)); }
  .pc { margin-top: 0; }
  .act { align-self: center; width: min(100%, 20rem); }
  .p-side { display: none; }
  .p-tag { width: auto; max-width: 30rem; }
  .p-with { max-width: 30rem; }
  /* phone contact, laid out like the poster: centred lines, a full-width button, links in a centred row; the face stays clear above */
  .s-fin { align-items: stretch; padding-left: var(--gutter); padding-top: calc(var(--top) + var(--p4h) * 0.84); text-align: center; }
  .s-fin .fin { display: flex; flex-direction: column; align-items: center; }
  .s-fin .fin__line { max-width: none; margin-bottom: var(--space-lg); }
  .s-fin .go { width: min(100%, 20rem); }
  .s-fin .fin__list { justify-content: center; margin-top: var(--space-lg); padding-top: 0; border-top: 0; }
  .reg li { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .reg__s { grid-column: 2; text-align: left; }
}
@media (max-height: 50rem) {
  .prog a { padding: 0.32rem 0; }
  .screen h2 { margin-bottom: var(--space-md); }
  .svc div + div, .exp li + li { margin-top: var(--space-md); }
}
@media (max-height: 46rem) and (max-width: 64rem) {
  .s-poster { gap: var(--space-lg); }
}
@media (max-width: 26rem) {
  .bar { gap: var(--space-sm); padding-inline: max(var(--gutter) - 0.25rem, 0.85rem); letter-spacing: 0; font-stretch: 75%; }
  .bar nav { gap: 0.7rem; }
}
@media (max-width: 36rem) {
  :root { --edge: 0.3rem; }
  .ctl__name { display: none; }
  .nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
