/* Studio Jio. The case study pages (site/work/<slug>/), written by tools/studies.mjs.
   One stylesheet for all three. Each page starts in one dress and is handed to
   another: the studio's to the client's, or (for studioj.io itself) the browser's
   to the studio's. Everything after the swap is drawn from the --c-* values. */

/* ---------------------------------------------------------------- tokens -- */
:root {
  --navy: #142337; --navy-2: #1B2E47; --bone: #EAE6DF; --char: #292B2D; --amber: #F2A541;
  --display: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --lane: 0rem;
  --bar-h: 3.5rem;
  --sec: clamp(5rem, 11vw, 10rem);

  --rule: color-mix(in srgb, var(--bone) 16%, transparent);
  --rule-strong: color-mix(in srgb, var(--bone) 40%, transparent);
  --line: color-mix(in srgb, var(--bone) 7%, transparent);

  /* the chrome (bar and rail) starts in the studio's ink */
  --chrome-ground: var(--navy); --chrome-ink: var(--bone); --chrome-rule: var(--rule); --head: var(--amber);
}
@media (min-width: 1100px) { :root { --lane: 11rem; } }

/* The client's own values, measured from the live sites by tools/layers.mjs. */
/* They are set on whatever carries data-study: the page itself, and each poster
   in the ending, so one page can hold more than one dress at a time. */
[data-study="safespeed"] {
  --c-btn-bg: #E10600; --c-btn-fg: #FFFFFF; --c-btn-line: #E10600;
  --c-dot-w: 2.2em; --c-dot-h: 1px; --c-dot-r: 0px;
  --c-btn-clip: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  --c-ground: #0E0D0E; --c-raised: #171516; --c-ink: #FFFFFF; --c-soft: #B4B1B1;
  --c-accent: #E10600; --c-accent-ink: #FFFFFF;
  --c-rule: rgb(255 255 255 / 0.12); --c-rule-strong: rgb(255 255 255 / 0.3);
  --c-display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --c-text: "Inter", ui-sans-serif, system-ui, sans-serif;
  --c-tag: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --c-h-weight: 700; --c-h-stretch: 100%; --c-h-track: -0.025em; --c-h-case: uppercase; --c-h-lh: 0.95;
  --c-tag-track: 0.32em; --c-tag-weight: 600; --c-btn-case: uppercase; --c-btn-track: 0.06em; --c-btn-weight: 600;
  --c-r: 0px; --c-btn-r: 0px; --c-notch: 18px;
  --c-wash: radial-gradient(70rem 46rem at 72% 34%, rgb(225 6 0 / 0.17), transparent 68%);
}
[data-study="bravotex"] {
  --c-btn-bg: #FC7938; --c-btn-fg: #221F18; --c-btn-line: #FC7938;
  --c-dot-w: 0.55em; --c-dot-h: 0.55em; --c-dot-r: 50%; --c-btn-clip: none;
  --c-ground: #F3F0E7; --c-raised: #E8E4D6; --c-ink: #282D23; --c-soft: #63695E;
  --c-accent: #FC7938; --c-accent-ink: #221F18;
  --c-rule: rgb(40 45 35 / 0.16); --c-rule-strong: rgb(40 45 35 / 0.34);
  --c-display: "Manrope", Arial, sans-serif;
  --c-text: "Manrope", Arial, sans-serif;
  --c-tag: "Manrope", Arial, sans-serif;
  --c-h-weight: 650; --c-h-stretch: 100%; --c-h-track: -0.065em; --c-h-case: none; --c-h-lh: 1.02;
  --c-tag-track: 0.16em; --c-tag-weight: 700; --c-btn-case: none; --c-btn-track: 0; --c-btn-weight: 750;
  --c-r: 30px; --c-btn-r: 50px; --c-notch: 0px;
  --c-wash: linear-gradient(transparent, transparent);
}
[data-study="studiojio"], [data-study="studio"] {
  --c-dot-w: 2.2em; --c-dot-h: 1px; --c-dot-r: 0px; --c-btn-clip: none;
  /* this site's buttons are outlined; amber is kept for the lit power state */
  --c-btn-bg: transparent; --c-btn-fg: #EAE6DF; --c-btn-line: #EAE6DF;
  --c-ground: #142337; --c-raised: #1B2E47; --c-ink: #EAE6DF; --c-soft: #A9B1BC;
  --c-accent: #F2A541; --c-accent-ink: #142337;
  --c-rule: var(--rule); --c-rule-strong: var(--rule-strong);
  --c-display: var(--display); --c-text: var(--display); --c-tag: var(--mono);
  --c-h-weight: 800; --c-h-stretch: 112%; --c-h-track: -0.035em; --c-h-case: none; --c-h-lh: 0.98;
  --c-tag-track: 0.08em; --c-tag-weight: 400; --c-btn-case: none; --c-btn-track: 0.01em; --c-btn-weight: 600;
  --c-r: 0px; --c-btn-r: 0px; --c-notch: 0px;
  --c-wash: linear-gradient(transparent, transparent);
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--navy); -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 1.5rem); }
html.is-client { background: var(--c-ground); }
html.is-exit { background: var(--navy); }
body {
  margin: 0; background: var(--c-ground); color: var(--bone);
  font-family: var(--display); font-weight: 420; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
main { position: relative; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: 1rem; top: 1rem; z-index: 100; padding: 0.75rem 1rem;
  background: var(--bone); color: var(--navy); font-weight: 600; text-decoration: none; transform: translateY(-300%);
}
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.cl :focus-visible, .plate--cl :focus-visible { outline-color: var(--c-ink); }

.wrap {
  width: 100%; max-width: 104rem; margin-inline: auto;
  padding-left: var(--gutter); padding-right: calc(var(--gutter) + var(--lane));
}
.sec { position: relative; padding-block: var(--sec); }

.label, .data {
  font-family: var(--mono); font-weight: 400; font-size: 0.72rem; line-height: 1.5;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.data { color: #A9B1BC; }

.mark {
  display: block; background-color: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat;
}
.mark--primary { -webkit-mask-image: url(/assets/brand/wordmark.svg); mask-image: url(/assets/brand/wordmark.svg); aspect-ratio: 1767.6 / 445.26; width: 7.25rem; }
.mark--domain { -webkit-mask-image: url(/assets/brand/wordmark-chevron.svg); mask-image: url(/assets/brand/wordmark-chevron.svg); aspect-ratio: 1986.4 / 445.26; width: 100%; }

.btn {
  display: inline-flex; align-items: center; gap: 0.7em; min-height: 3rem; padding: 0 1.35rem;
  border: 1px solid var(--bone); background: transparent; color: var(--bone);
  font-family: var(--display); font-weight: 600; font-stretch: 105%; font-size: 0.95rem; line-height: 1; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 140ms var(--ease), color 140ms var(--ease);
}
.btn--sm { min-height: 2.25rem; padding: 0 1rem; font-size: 0.85rem; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--bone); color: var(--navy); } }

/* ------------------------------------------------------------------- bar -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 61; height: var(--bar-h);
  background: var(--chrome-ground); color: var(--chrome-ink); border-bottom: 1px solid var(--chrome-rule);
}
.bar__in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bar__mark { display: block; padding-block: 0.85rem; color: inherit; }
.bar__tools { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.5rem); }
.bar__back {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; padding: 0.75rem 0; white-space: nowrap; opacity: 0.82;
}
.bar .btn { border-color: currentColor; color: inherit; }
@media (hover: hover) and (pointer: fine) {
  .bar__back:hover { opacity: 1; }
  .bar .btn:hover { background: var(--chrome-ink); color: var(--chrome-ground); }
}
@media (max-width: 699px) { .bar .btn--sm { min-height: 2.5rem; padding: 0 0.8rem; } .mark--primary { width: 6rem; } }
@media (max-width: 379px) { .bar__back span { display: none; } }

/* The chrome's colours are registered as colours so they can ease from one set to the
   next: the bar, the rail and the command line all read them, so they turn together.
   A browser that does not know @property changes them at once, as before. */
@property --chrome-ground { syntax: "<color>"; inherits: true; initial-value: #142337; }
@property --chrome-ink { syntax: "<color>"; inherits: true; initial-value: #EAE6DF; }
@property --chrome-rule { syntax: "<color>"; inherits: true; initial-value: rgb(234 230 223 / 0.14); }
@property --head { syntax: "<color>"; inherits: true; initial-value: #F2A541; }
html { transition: --chrome-ground 520ms ease, --chrome-ink 520ms ease, --chrome-rule 520ms ease, --head 520ms ease; }
@media (prefers-reduced-motion: reduce) { html { transition: none; } }

/* the chrome changes hands with the page */
html.is-client { --chrome-ground: var(--c-ground); --chrome-ink: var(--c-ink); --chrome-rule: var(--c-rule); --head: var(--c-accent); }
html.is-exit { --chrome-ground: var(--navy); --chrome-ink: var(--bone); --chrome-rule: var(--rule); --head: var(--amber); }
/* in the ending it follows whichever study is on screen */
html[data-chrome="safespeed"] { --chrome-ground: #0E0D0E; --chrome-ink: #FFFFFF; --chrome-rule: rgb(255 255 255 / 0.12); --head: #E10600; }
html[data-chrome="bravotex"] { --chrome-ground: #F3F0E7; --chrome-ink: #282D23; --chrome-rule: rgb(40 45 35 / 0.16); --head: #FC7938; }
html[data-chrome="studiojio"], html[data-chrome="studio"] { --chrome-ground: var(--navy); --chrome-ink: var(--bone); --chrome-rule: var(--rule); --head: var(--amber); }
html[data-study="studiojio"]:not(.is-client):not([data-chrome]) { --chrome-ground: var(--char); --chrome-rule: rgb(234 230 223 / 0.14); }
/* and so does the page behind everything, so a strip of the wrong colour can never show past a screen's edge */
html[data-chrome] body { background: var(--chrome-ground); }

/* ------------------------------------------------------------------ rail -- */
.rail {
  --rail-ink: var(--chrome-ink);
  position: fixed; z-index: 60; width: 1px; top: 5.75rem; bottom: 4.75rem; right: calc(var(--gutter) * 0.5);
}
.rail__track { position: absolute; inset: 0; background: color-mix(in srgb, var(--rail-ink) 26%, transparent); }
.rail__current {
  position: absolute; inset: 0 -0.5px; background: color-mix(in srgb, var(--rail-ink) 88%, transparent);
  transform-origin: 50% 0; transform: scaleY(0); will-change: transform;
}
.rail__head {
  position: absolute; left: -3px; top: -4.5px; width: 7px; height: 9px; background: var(--head);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--head) 50%, transparent); will-change: transform;
}
.rail__read {
  position: absolute; right: -0.5px; bottom: 100%; margin-bottom: 0.6rem;
  font-family: var(--mono); font-size: 0.66rem; line-height: 1; letter-spacing: 0.08em; white-space: nowrap;
  color: color-mix(in srgb, var(--rail-ink) 72%, transparent);
}
.rail__ticks li { position: absolute; right: 0; top: calc(var(--at, 0) * 100%); }
.rail__ticks li::before { content: ""; position: absolute; right: 0; top: 0; width: 7px; height: 1px; background: var(--rail-ink); opacity: 0.4; }
.rail__ticks li.is-on::before { opacity: 1; }
.rail__ticks a {
  position: absolute; right: 1rem; top: 0; translate: 0 -50%; padding: 0.5rem 0.25rem;
  display: flex; align-items: center; gap: 0.5em;
  font-family: var(--mono); font-size: 0.66rem; line-height: 1; letter-spacing: 0.08em;
  color: var(--rail-ink); text-decoration: none; white-space: nowrap; opacity: 0.4; transition: opacity 200ms linear;
}
.rail__ticks li.is-on a { opacity: 0.68; }
.rail__ticks li.is-now a, .rail__ticks a:hover, .rail__ticks a:focus-visible { opacity: 1; }
.rail__ticks a::after { content: ""; flex: none; width: 0.5em; height: 1em; opacity: 0; }
.rail__ticks li.is-on a::after {
  opacity: 1; width: 0.38em; height: 0.72em; margin: 0 0.06em;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; rotate: 45deg; translate: 0 -0.12em;
}
.rail__ticks li.is-now a::after {
  opacity: 1; width: 0.5em; height: 1em; margin: 0; border: 0; rotate: none; translate: none;
  background: var(--head); animation: blink 1.05s steps(1, end) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (min-width: 1100px) { .rail { top: 6.9rem; } }
@media (max-width: 1099px) {
  .rail__ticks a { opacity: 0 !important; pointer-events: none; }
  .rail__ticks a:focus-visible { opacity: 1 !important; background: var(--chrome-ground); }
  .rail__read {
    right: -0.4rem; margin-bottom: 0.4rem; padding: 0.3rem 0.38rem; font-size: 0.6rem;
    color: var(--rail-ink); background: color-mix(in srgb, var(--chrome-ground) 90%, transparent);
    border: 1px solid color-mix(in srgb, var(--rail-ink) 22%, transparent);
  }
  .rail { transition: bottom 220ms ease-out; bottom: calc(4.75rem + max(env(safe-area-inset-bottom, 0px), min(100dvh - 100svh, 1.9rem))); }
}
@media (max-width: 699px) {
  .rail { right: 0.55rem; top: calc(var(--bar-h) + 2.1rem); bottom: calc(2.75rem + max(env(safe-area-inset-bottom, 0px), min(100dvh - 100svh, 1.9rem))); }
}

/* -------------------------------------------------------------- the swap --
   Two plates carry the same words. Without JavaScript or motion only the first
   one shows. With it, both are pinned in register and a line climbing the
   screen cuts the first away to show the second. */
.swap { position: relative; }
.swap__stage { position: relative; min-height: 100vh; min-height: 100svh; }
.plate { position: relative; min-height: 100vh; min-height: 100svh; }
.plate--b, .swap__edge { display: none; }
html.is-swap .swap { height: 250vh; }
/* Pinned stages are as tall as the screen ever gets (100lvh), so nothing shows
   under them when a phone's browser puts its bars away. Their contents are laid
   out in the smallest screen (100svh), so nothing is cut when the bars are showing. */
html.is-swap .swap__stage { position: sticky; top: 0; height: 100vh; height: 100lvh; min-height: 0; overflow: clip; }
html.is-swap .plate__in { height: 100vh; height: 100svh; min-height: 0; }
html.is-swap .plate { position: absolute; inset: 0; min-height: 0; display: block; }
html.is-swap .plate--a { z-index: 2; will-change: clip-path; }
html.is-swap .swap__edge { display: block; position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; max-width: none; pointer-events: none; }

.plate__in {
  position: relative; height: 100%; min-height: inherit;
  display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(1.25rem, 2.6vh, 2.25rem);
  padding-top: calc(var(--bar-h) + 1.5rem); padding-bottom: clamp(2rem, 6vh, 4rem);
}
.plate__tag { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: auto; padding-top: clamp(0.5rem, 3vh, 2rem); }
.plate__title { font-size: clamp(2.75rem, 13.2vw, 11rem); line-height: 0.92; }
.plate__lede { max-width: 34ch; font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.4rem); line-height: 1.4; text-wrap: pretty; }
.plate__spec { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(1rem, 3vw, 3rem); }
.plate__spec > div { padding-top: 0.8rem; }
.plate__spec dd { font-size: 0.98rem; line-height: 1.45; text-wrap: pretty; }
.plate__spec a { text-underline-offset: 0.2em; }
.plate__hint { display: flex; align-items: center; gap: 0.6em; min-height: 1.2rem; }
.plate__hint svg { rotate: 90deg; fill: currentColor; }
.plate__hint i { width: 0.5em; height: 1em; background: var(--amber); animation: blink 1.05s steps(1, end) infinite; }
@media (max-width: 699px) {
  .plate__spec { grid-template-columns: 1fr; }
  .plate__spec > div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; padding: 0.6rem 0; }
  .plate__in { padding-bottom: 1.75rem; gap: 1.1rem; }
  .plate--cl .plate__tag, .plate--cl dt { letter-spacing: min(var(--c-tag-track), 0.14em); font-size: 0.66rem; }
}

/* the studio's dress: navy, quarter lines, Archivo, mono labels */
.plate--std { background: var(--navy); color: var(--bone); }
.plate--std .plate__in {
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 25% 100% repeat-x content-box,
    linear-gradient(var(--line), var(--line)) 100% 0 / 1px 100% no-repeat content-box;
}
.plate--std .plate__tag, .plate--std .plate__hint, .plate--std dt {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #A9B1BC;
}
.plate--std .plate__title { font-family: var(--display); font-weight: 800; font-stretch: 112%; letter-spacing: -0.045em; }
.plate--std .plate__lede { color: var(--bone); font-weight: 480; }
.plate--std .plate__spec > div { border-top: 1px solid var(--rule-strong); }
.plate--std dt { margin-bottom: 0.3rem; }

/* the client's dress */
.plate--cl { background: var(--c-wash), var(--c-ground); color: var(--c-ink); font-family: var(--c-text); }
.plate--cl .plate__tag, .plate--cl dt {
  font-family: var(--c-tag); font-weight: var(--c-tag-weight); font-size: 0.7rem;
  letter-spacing: var(--c-tag-track); text-transform: uppercase; color: var(--c-soft);
}
.plate--cl .plate__title {
  font-family: var(--c-display); font-weight: var(--c-h-weight); font-stretch: var(--c-h-stretch);
  letter-spacing: var(--c-h-track); text-transform: var(--c-h-case); line-height: var(--c-h-lh);
}
.plate--cl .plate__lede { color: var(--c-soft); }
.plate--cl .plate__spec > div { border-top: 1px solid var(--c-rule-strong); }
.plate--cl dt { margin-bottom: 0.3rem; }
.plate--cl .plate__spec a { color: var(--c-ink); text-decoration-color: var(--c-accent); text-decoration-thickness: 2px; }
/* each client's own signature on the title plate */
/* the second word is its own element, so the red starts exactly where the word does */
html[data-study="safespeed"] .plate--cl .plate__title { color: #fff; }
html[data-study="safespeed"] .plate--cl .plate__title span { color: var(--c-accent); }
html[data-study="safespeed"] .plate--cl .plate__tag span:first-child::before { content: ""; display: inline-block; width: 2.2em; height: 1px; margin-right: 1em; vertical-align: middle; background: var(--c-accent); }
html[data-study="bravotex"] .plate--cl .plate__title::after { content: "."; color: var(--c-accent); }
html[data-study="bravotex"] .plate--cl .plate__tag span:first-child::before { content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.9em; border-radius: 50%; background: var(--c-accent); }
html[data-study="studiojio"] .plate--cl .plate__in {
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 25% 100% repeat-x content-box,
    linear-gradient(var(--line), var(--line)) 100% 0 / 1px 100% no-repeat content-box;
}
html[data-study="studiojio"] .plate--cl .plate__lede { color: var(--bone); font-weight: 480; }

/* the source: this page as it is written, before the stylesheet has run.
   The tags and line numbers are drawn around the real words, which stay the
   page's actual heading and text. */
.plate--src {
  --src-dim: #8794A6; --src-tag: #8794A6;
  background: var(--char); color: var(--bone); counter-reset: ln;
  font-family: var(--mono); font-weight: 400; font-size: clamp(0.78rem, 0.7rem + 0.35vw, 0.98rem); line-height: 1.75;
}
.plate--src .plate__in { display: block; padding-top: calc(var(--bar-h) + clamp(3.4rem, 9vh, 5.5rem)); padding-bottom: 2rem; }
.plate--src .plate__in::before {
  content: "index.html \00B7  source \00B7  no stylesheet loaded"; position: absolute; left: var(--gutter); top: var(--bar-h);
  padding: 0.7rem 1rem; background: color-mix(in srgb, var(--bone) 7%, transparent); border-bottom: 2px solid var(--amber);
  color: var(--src-dim); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
}
.plate--src :is(.plate__tag, .plate__title, .plate__lede, .plate__spec > div, .plate__hint),
.plate--src .plate__spec::before, .plate--src .plate__spec::after {
  display: block; margin: 0; padding: 0 0 0 3.4em; text-indent: -3.4em; max-width: 62rem;
  font: inherit; letter-spacing: 0; text-transform: none; color: inherit; text-wrap: wrap;
}
.plate--src :is(.plate__tag, .plate__title, .plate__lede, .plate__spec > div, .plate__hint)::before,
.plate--src .plate__spec::before, .plate--src .plate__spec::after { counter-increment: ln; color: var(--src-dim); font-weight: 400; }
.plate--src .plate__tag { color: #6C7889; }
.plate--src .plate__tag::before { content: counter(ln, decimal-leading-zero) "  <!-- "; }
.plate--src .plate__tag::after { content: " -->"; }
.plate--src .plate__tag span + span::before { content: " \00B7  "; }
.plate--src .plate__title { font-weight: 500; }
.plate--src .plate__title::before { content: counter(ln, decimal-leading-zero) "  <h1>"; color: var(--src-tag); }
.plate--src .plate__title::after { content: "</h1>"; color: var(--src-tag); font-weight: 400; }
.plate--src .plate__lede::before { content: counter(ln, decimal-leading-zero) "  <p>"; color: var(--src-tag); }
.plate--src .plate__lede::after { content: "</p>"; color: var(--src-tag); }
.plate--src .plate__spec { display: block; }
.plate--src .plate__spec::before { content: counter(ln, decimal-leading-zero) "  <dl>"; color: var(--src-tag); }
.plate--src .plate__spec::after { content: counter(ln, decimal-leading-zero) "  </dl>"; color: var(--src-tag); }
.plate--src .plate__spec > div::before { content: counter(ln, decimal-leading-zero) "    "; white-space: pre; }
.plate--src :is(dt, dd) { display: inline; margin: 0; font: inherit; text-indent: 0; }
.plate--src dt::before { content: "<dt>"; color: var(--src-tag); }
.plate--src dt::after { content: "</dt>"; color: var(--src-tag); }
.plate--src dd::before { content: "<dd>"; color: var(--src-tag); }
.plate--src dd::after { content: "</dd>"; color: var(--src-tag); }
.plate--src .plate__hint { margin-top: 1.75em; color: var(--amber); }
.plate--src .plate__hint::before { content: counter(ln, decimal-leading-zero) "  "; white-space: pre; }
.plate--src .plate__hint svg { display: inline-block; vertical-align: -0.05em; margin-right: 0.6em; }
.plate--src .plate__hint i { display: inline-block; vertical-align: -0.15em; margin-left: 0.5em; }
.plate--src :is(.plate__tag, .plate__title, .plate__lede, .plate__spec > div, .plate__hint)::before { white-space: pre; }
@media (max-width: 699px) {
  .plate--src :is(.plate__tag, .plate__title, .plate__lede, .plate__spec > div, .plate__hint),
  .plate--src .plate__spec::before, .plate--src .plate__spec::after { padding-left: 2.6em; text-indent: -2.6em; }
  .plate--src .plate__spec > div { grid-template-columns: none; gap: 0; }
  .plate--src .plate__in::before { content: "index.html \00B7  source"; left: 0; padding-left: var(--gutter); }
  .plate--src .plate__tag span + span { display: none; }
}

/* ------------------------------------------------------- client sections -- */
.cl { background: var(--c-ground); color: var(--c-ink); font-family: var(--c-text); }
.tag, .c-data {
  font-family: var(--c-tag); font-weight: var(--c-tag-weight); font-size: 0.7rem; line-height: 1.5;
  letter-spacing: var(--c-tag-track); text-transform: uppercase; color: var(--c-soft);
}
.tag { display: flex; align-items: center; gap: 0.9em; margin-bottom: 1.1rem; }
.tag::before { content: ""; width: var(--c-dot-w); height: var(--c-dot-h); border-radius: var(--c-dot-r); background: var(--c-accent); }
.c-h2 {
  font-family: var(--c-display); font-weight: var(--c-h-weight); font-stretch: var(--c-h-stretch);
  letter-spacing: var(--c-h-track); text-transform: var(--c-h-case); line-height: var(--c-h-lh);
  font-size: clamp(2.1rem, 1.2rem + 3.8vw, 4.5rem); text-wrap: balance;
}
.c-body { max-width: 46ch; color: var(--c-soft); font-size: 1.0625rem; line-height: 1.62; text-wrap: pretty; }
.sec__head { margin-bottom: clamp(2.25rem, 5vw, 4rem); }

.cbtn {
  display: inline-flex; align-items: center; min-height: 3.1rem; padding: 0 1.6rem;
  background: var(--c-btn-bg, var(--c-accent)); color: var(--c-btn-fg, var(--c-accent-ink)); border: 1px solid var(--c-btn-line, var(--c-accent)); border-radius: var(--c-btn-r);
  clip-path: var(--c-btn-clip);
  font-family: var(--c-display); font-weight: var(--c-btn-weight); font-size: 0.9rem; line-height: 1;
  letter-spacing: var(--c-btn-track); text-transform: var(--c-btn-case); text-decoration: none; white-space: nowrap;
}
.cbtn--line { background: transparent; color: var(--c-ink); border-color: var(--c-rule-strong); clip-path: none; }
a.cbtn:focus-visible { outline-offset: -5px; outline-color: var(--c-accent-ink); }
@media (hover: hover) and (pointer: fine) { a.cbtn { transition: filter 140ms linear; } a.cbtn:hover { filter: brightness(1.12); } }

/* ---------------------------------------------------------------- the site -- */
.show { background: var(--c-wash), var(--c-ground); overflow-x: clip; }
.show__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2.5vw, 2.5rem); align-items: start; }
.show__media { grid-column: 1 / 9; position: relative; }
.show__copy { grid-column: 9 / 13; display: grid; gap: 1.75rem; padding-top: 0.5rem; }
.frame {
  display: block; position: relative; overflow: hidden; color: inherit; text-decoration: none;
  border: 1px solid var(--c-rule-strong); border-radius: var(--c-r); background: var(--c-raised);
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.14), 0 40px 80px -24px rgb(0 0 0 / 0.38);
}
.frame__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 2.4rem; padding: 0 1rem;
  border-bottom: 1px solid var(--c-rule); font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em; color: var(--c-ink);
}
.frame__state { display: inline-flex; align-items: center; gap: 0.55em; text-transform: uppercase; letter-spacing: 0.08em; }
.frame__state::before { content: ""; width: 6px; height: 6px; background: var(--c-accent); animation: blink 1.6s steps(2, end) infinite; }
.frame__view { display: block; position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--c-raised); }
.frame__view img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.frame__film { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; opacity: 0; transition: opacity 420ms linear; }
.frame__view.is-playing .frame__film { opacity: 1; }
.phone {
  position: absolute; right: 5%; bottom: -9%; width: 21%; aspect-ratio: 9 / 17; overflow: hidden;
  border: 1px solid var(--c-rule-strong); border-radius: calc(var(--c-r) * 0.6); background: var(--c-raised);
  box-shadow: 0 6px 14px rgb(0 0 0 / 0.3), 0 22px 48px -10px rgb(0 0 0 / 0.5);
}
.phone img { width: 100%; height: auto; }
.show__list { border-top: 1px solid var(--c-rule-strong); }
.show__list li { display: flex; gap: 1.25rem; padding: 0.75rem 0; border-bottom: 1px solid var(--c-rule); font-size: 1rem; font-weight: 500; }
.show__list span { flex: none; width: 1.6rem; color: var(--c-soft); font-family: var(--c-tag); font-weight: var(--c-tag-weight); font-size: 0.7rem; letter-spacing: 0.1em; padding-top: 0.28rem; }
@media (max-width: 899px) {
  .show__media, .show__copy { grid-column: 1 / -1; }
  .show__copy { margin-top: clamp(4rem, 16vw, 6rem); }
  .phone { width: 26%; bottom: -12%; }
}

/* ------------------------------------------------------------ taken apart --
   Static by default: the layers sit already separated and every note is listed.
   With motion the stage pins and the scroll drives --tilt, --sep and --full. */
.apart { position: relative; padding-block: var(--sec); }
.apart__in { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2.5vw, 2.5rem); row-gap: 2rem; }
.apart__head { grid-column: 1 / -1; }
.note__more > div { overflow: hidden; }
.apart__read { margin-top: 1rem; min-height: 1.2em; }
.stack {
  --tilt: 1; --sep: 1; --full: 0; --gap: clamp(2.6rem, 6.4vw, 6.5rem); --pw: min(50vw, 46rem);
  grid-column: 1 / 9; display: grid; place-items: center; perspective: 2600px;
  min-height: calc(var(--pw) * 0.62 + var(--gap) * 2.6);
}
.stack__tilt {
  position: relative; width: var(--pw); aspect-ratio: 1440 / 900; transform-style: preserve-3d;
  transform:
    translateY(calc(var(--sep) * var(--gap) * 0.85))
    rotateX(calc(var(--tilt) * 57deg)) rotateZ(calc(var(--tilt) * -31deg))
    scale(calc(1 - var(--tilt) * 0.18));
  will-change: transform;
}
.ply {
  --on: 1;
  position: absolute; inset: 0; transform: translateZ(calc(var(--i) * var(--gap) * var(--sep)));
  opacity: calc(0.24 + var(--on) * 0.76); transition: opacity 180ms linear;
  outline: 1px solid color-mix(in srgb, var(--c-ink) calc(16% + var(--on) * 30%), transparent);
  background: color-mix(in srgb, var(--c-ink) 3%, transparent);
}
.ply picture, .ply img { display: block; width: 100%; height: 100%; }
.ply--ground, .ply--film { background: var(--c-ground); box-shadow: 0 30px 60px -18px rgb(0 0 0 / 0.5); }
.ply--grid { opacity: calc((0.24 + var(--on) * 0.76) * var(--sep)); background: none; }
.ply--full { opacity: var(--full); outline: 0; background: none; transition: none; pointer-events: none; }
.ply__grid { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--c-ink); stroke-width: 1; }
.ply__grid rect, .ply__grid path { vector-effect: non-scaling-stroke; }
.ply__grid .g-block { stroke-dasharray: 5 5; opacity: 0.35; }
.ply__grid .g-text { opacity: 0.6; }
.ply__grid .g-head { stroke-width: 1.5; }
.ply__grid .g-control { stroke: var(--c-accent); fill: color-mix(in srgb, var(--c-accent) 26%, transparent); }
.ply__grid .g-media { stroke: var(--c-accent); }
.ply__grid .g-x { stroke: var(--c-accent); opacity: 0.6; }
.ply__grid--m { display: none; }
.ply__tab {
  position: absolute; left: 0; top: 100%; margin-top: 0.55rem; white-space: nowrap;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--c-ink); opacity: calc(var(--sep) * (0.25 + var(--on) * 0.75));
}
.notes { grid-column: 9 / 13; display: grid; gap: 0; align-content: center; }
.note { padding: 1.15rem 0 1.25rem; border-top: 1px solid var(--c-rule); }
.note:last-child { border-bottom: 1px solid var(--c-rule); }
.note__no { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-soft); display: flex; gap: 0.9em; }
.note__no span { color: var(--c-ink); }
.note__h { margin-top: 0.5rem; font-family: var(--c-display); font-weight: var(--c-h-weight); font-stretch: var(--c-h-stretch); letter-spacing: calc(var(--c-h-track) * 0.6); text-transform: var(--c-h-case); font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem); line-height: 1.12; }
.note__p { margin-top: 0.55rem; color: var(--c-soft); font-size: 0.98rem; line-height: 1.55; text-wrap: pretty; }
.note__facts { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.note__facts li { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; padding: 0.3rem 0.5rem; border: 1px solid var(--c-rule-strong); border-radius: min(var(--c-btn-r), 1rem); color: var(--c-ink); white-space: nowrap; }

html.is-apart .apart { height: 420vh; padding-block: 0; }
html.is-apart .apart__stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: clip; }
html.is-apart .apart__in { height: 100vh; height: 100svh; padding-top: calc(var(--bar-h) + clamp(1rem, 3vh, 2.5rem)); padding-bottom: clamp(1.25rem, 4vh, 3rem); grid-template-rows: auto 1fr; row-gap: 0.5rem; }
html.is-apart .stack { min-height: 0; align-self: stretch; }
html.is-apart .note { opacity: 0.4; transition: opacity 180ms linear; }
html.is-apart .note.is-on, html.is-apart .notes.is-all .note { opacity: 1; }
/* only the layer in hand is spelled out; the others keep their headings */
html.is-apart .note__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease); }
html.is-apart .note.is-on .note__more { grid-template-rows: 1fr; }
@media (min-width: 900px) {
  html.is-apart .apart__head { grid-column: 1 / 9; }
  html.is-apart .stack { grid-row: 2; }
  html.is-apart .notes { grid-row: 1 / 3; }
}
html.is-apart .note.is-on .note__no span { color: var(--c-accent); }
html[data-study="bravotex"].is-apart .note.is-on .note__no span { color: var(--c-ink); text-decoration: underline 2px var(--c-accent); text-underline-offset: 0.3em; }

@media (max-width: 899px) {
  .stack, .notes { grid-column: 1 / -1; }
  .stack { --pw: min(44vw, 15rem); --gap: clamp(2.1rem, 9.5vw, 3.6rem); min-height: calc(var(--pw) * 1.7 + var(--gap) * 2.4); }
  .stack__tilt { aspect-ratio: 390 / 844; transform: translateY(calc(var(--sep) * var(--gap) * 1.1)) rotateX(calc(var(--tilt) * 55deg)) rotateZ(calc(var(--tilt) * -34deg)) scale(calc(1 - var(--tilt) * 0.04)); }
  .ply__grid--d { display: none; }
  .ply__grid--m { display: block; }
  .ply__tab { font-size: 0.6rem; }
  html.is-apart .apart__in { grid-template-rows: auto 1fr auto; }
  /* the stack is sized to the room left between the heading and the note, so it never lies over the text */
  html.is-apart .stack { container-type: size; }
  html.is-apart .stack__tilt { --pw: min(44vw, 15rem); --pw: min(44vw, 15rem, 100cqh / 2.35); --gap: calc(var(--pw) * 0.216); }
  html.is-apart .notes { position: relative; z-index: 1; background: var(--c-ground); }
  html.is-apart .apart__head .c-h2 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  html.is-apart .apart__read { margin-top: 0.5rem; }
  /* one note at a time, in the same place */
  html.is-apart .notes { display: grid; align-content: end; min-height: 11.5rem; }
  html.is-apart .note { grid-area: 1 / 1; opacity: 0; visibility: hidden; border: 0; border-top: 1px solid var(--c-rule-strong); padding: 0.9rem 0 0; transition: none; }
  html.is-apart .note.is-on { opacity: 1; visibility: visible; }
  html.is-apart .notes.is-all .note:not(.is-on) { opacity: 0; }
  html.is-apart .note__more { transition: none; }
  html.is-apart .note__p { font-size: 0.94rem; }
}
@media (min-width: 600px) and (max-width: 899px) and (min-height: 900px) {
  .stack { --pw: min(38vw, 20rem); --gap: 4.25rem; }
}
@media (max-width: 899px) and (max-height: 700px) {
  html.is-apart .note__facts { display: none; }
  html.is-apart .notes { min-height: 9rem; }
}

/* ----------------------------------------------------------------- the kit -- */
.kit__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2.5vw, 2.5rem); row-gap: 3rem; }
.kit__part { border-top: 1px solid var(--c-rule-strong); padding-top: 1rem; display: grid; gap: 1.5rem; align-content: start; }
.kit__part--colour { grid-column: 1 / 5; }
.kit__part--type { grid-column: 5 / 10; }
.kit__part--shape { grid-column: 10 / 13; }
.kit__h { font-family: var(--c-tag); font-weight: var(--c-tag-weight); font-size: 0.7rem; letter-spacing: var(--c-tag-track); text-transform: uppercase; color: var(--c-soft); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: 0.9rem; }
.swatches li { display: grid; gap: 0.25rem; }
.sw { aspect-ratio: 1; background: var(--sw); border: 1px solid var(--c-rule-strong); border-radius: calc(var(--c-r) * 0.5); margin-bottom: 0.4rem; }
.sw__hex { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.04em; }
.sw__role { font-size: 0.82rem; color: var(--c-soft); }
.specimen { display: grid; gap: 0.6rem; }
.specimen--display .specimen__s {
  font-family: var(--c-display); font-weight: var(--c-h-weight); font-stretch: var(--c-h-stretch);
  letter-spacing: var(--c-h-track); text-transform: var(--c-h-case); line-height: var(--c-h-lh);
  font-size: clamp(2rem, 1.2rem + 3vw, 3.75rem); text-wrap: balance;
}
.specimen--text .specimen__s { font-family: var(--c-text); font-size: 1.125rem; line-height: 1.6; color: var(--c-soft); max-width: 38ch; }
.shapes { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.kit__go { margin-top: clamp(3rem, 6vw, 5rem); }
@media (max-width: 999px) {
  .kit__part--colour, .kit__part--type, .kit__part--shape { grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------- out -- */
/* The ending. A row to pick any study, then one full screen per other study,
   each in that site's own dress, then the studio's navy and the one action.
   Static by default: the screens follow each other down the page. With motion
   nothing slides: the kit is held still, the stage pins over it, and every
   screen arrives by the same dissolve that opened the page, a front of digits
   climbing as far as the scroll has gone. The bar and rail change with it. */
.exit { position: relative; }
.exit__stage { position: relative; }
.exit__line { display: none; }
.xplate { position: relative; min-height: 100vh; min-height: 100svh; display: grid; }
.poster { background: var(--c-wash), var(--c-ground); color: var(--c-ink); font-family: var(--c-text); }
.poster__in {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2.5vw, 2.5rem); align-items: center;
  padding-top: calc(var(--bar-h) + 5rem); padding-bottom: clamp(2rem, 6vh, 4rem);
}
.poster__copy { grid-column: 1 / 8; display: grid; justify-items: start; gap: clamp(1rem, 2.4vh, 1.75rem); position: relative; z-index: 1; }
.poster__copy .tag { margin: 0; }
.poster__name {
  font-family: var(--c-display); font-weight: var(--c-h-weight); font-stretch: var(--c-h-stretch);
  letter-spacing: var(--c-h-track); text-transform: var(--c-h-case); line-height: var(--c-h-lh);
  font-size: min(8.2vw, 6.6rem); white-space: nowrap;
}
.poster[data-study="safespeed"] .poster__name { color: #fff; }
.poster[data-study="safespeed"] .poster__name span { color: var(--c-accent); }
.poster[data-study="bravotex"] .poster__name::after { content: "."; color: var(--c-accent); }
.poster__kind { color: var(--c-soft); font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); max-width: 30ch; }
.poster__frame { grid-column: 8 / 13; }
.poster__frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
@media (hover: hover) and (pointer: fine) {
  .poster__frame { transition: translate 500ms var(--ease); }
  .poster__frame:hover { translate: 0 -6px; }
}

.pick { position: relative; z-index: 30; background: var(--c-ground); color: var(--c-ink); border-bottom: 1px solid var(--c-rule); }
.pick__in { display: flex; align-items: center; gap: clamp(0.75rem, 2.5vw, 2.5rem); min-height: 3.25rem; }
.pick__k, .pick a { font-family: var(--mono); font-size: 0.68rem; line-height: 1; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.pick__k { color: var(--c-soft); }
.pick ol { display: flex; gap: clamp(0.4rem, 2vw, 2rem); }
.pick a { display: flex; align-items: center; gap: 0.6em; min-height: 3.25rem; padding: 0 0.15rem; color: var(--c-ink); text-decoration: none; opacity: 0.6; box-shadow: inset 0 -2px 0 transparent; }
.pick a b { font-weight: 400; color: var(--c-soft); }
.pick a.is-view { opacity: 1; box-shadow: inset 0 -2px 0 var(--c-accent); }
.pick a[aria-current]::after { content: "here"; padding: 0.2rem 0.35rem; border: 1px solid var(--c-rule-strong); font-size: 0.56rem; color: var(--c-soft); }
@media (hover: hover) and (pointer: fine) { .pick a:hover { opacity: 1; } }
@media (max-width: 699px) {
  .pick__k { display: none; }
  .pick ol { width: 100%; justify-content: space-between; gap: 0.25rem; }
  .pick a { font-size: 0.6rem; letter-spacing: 0.04em; gap: 0.45em; }
  .pick a b, .pick a[aria-current]::after { display: none; }
  /* the rail's readout sits at the right of this row, so the three names keep left */
  .pick ol { width: auto; justify-content: flex-start; gap: clamp(0.6rem, 4vw, 1.25rem); }
  .pick a[aria-current] { opacity: 0.42; }
  .pick a[aria-current]::before { content: ""; width: 5px; height: 5px; background: currentColor; }
}

.xplate--studio { background: var(--navy); color: var(--bone); align-content: end; }
.out { padding-top: calc(var(--bar-h) + 5rem); }
.out .label { color: #A9B1BC; }
.out__h { margin-top: 1rem; font-weight: 800; font-stretch: 112%; letter-spacing: -0.04em; line-height: 0.96; font-size: clamp(2.3rem, 1rem + 6.2vw, 6rem); text-wrap: balance; max-width: 14ch; }
.out__h i { font-style: normal; display: inline-block; width: 0.42em; height: 0.82em; margin-left: 0.12em; background: var(--amber); animation: blink 1.05s steps(1, end) infinite; }
.exit__row { display: flex; align-items: center; gap: 1.75rem; margin-top: clamp(1.75rem, 4vh, 3rem); }
.exit__all { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.75rem 0; text-underline-offset: 0.3em; }
.foot { margin-top: clamp(2rem, 7vh, 6rem); padding-bottom: 1.5rem; }
.foot__mark { display: block; color: var(--bone); }
.foot__meta { margin-top: clamp(1rem, 2.4vh, 2rem); }
.foot__meta a { color: var(--bone); text-underline-offset: 0.2em; padding: 0.75rem 0; display: inline-block; }

/* The kit sticks with its foot on the foot of the screen (--kit-top is set by
   case.js), and the ending starts one screen early, on top of it. */
html.is-xpin .kit { position: sticky; top: var(--kit-top, 0px); min-height: 100vh; min-height: 100lvh; z-index: 0; }
html.is-xpin .exit { height: 500vh; height: 500lvh; margin-top: -100vh; margin-top: -100lvh; z-index: 1; pointer-events: none; }
html.is-xpin .exit__stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: clip; }
html.is-xpin .poster__in, html.is-xpin .out { height: 100vh; height: 100svh; }
html.is-xpin .xplate--studio { align-content: start; }
html.is-xpin .out { display: flex; flex-direction: column; justify-content: flex-end; }
html.is-xpin .exit__body { position: absolute; inset: 0; pointer-events: auto; will-change: clip-path; }
html.is-xpin .pick { position: absolute; left: 0; right: 0; top: var(--bar-h); }
html.is-xpin .xplate { position: absolute; inset: 0; min-height: 0; z-index: calc(10 - var(--n)); will-change: clip-path; }
html.is-xpin .exit__line { display: block; position: absolute; inset: 0; z-index: 20; width: 100%; height: 100%; max-width: none; pointer-events: none; }
html.is-xpin .foot .mark--domain { max-height: 30vh; }

@media (max-width: 899px) {
  .poster__in { align-content: center; row-gap: clamp(1.5rem, 4vh, 2.5rem); padding-top: calc(var(--bar-h) + 4.25rem); padding-bottom: 1.5rem; }
  .poster__copy, .poster__frame { grid-column: 1 / -1; }
  .poster__name { font-size: min(14vw, 5rem); }
  .poster__frame { max-width: 30rem; }
  html.is-xpin .poster__frame { max-height: 34vh; }
  .out { padding-top: calc(var(--bar-h) + 4.25rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
