/* 01 Work and 02 Capabilities on the homepage, and the plates the four newer
   project pages share with them. Tokens come from studio.css. */

@property --px { syntax: "<percentage>"; inherits: true; initial-value: 78%; }
@property --py { syntax: "<percentage>"; inherits: true; initial-value: 10%; }
@property --glow { syntax: "<color>"; inherits: true; initial-value: #c8a863; }

/* ------------------------------------------------------------ 01 work */

.folio-grid {
  --stagger: clamp(48px, 6vw, 108px);
  list-style: none;
  margin: 0;
  padding: 0 var(--margin) clamp(96px, 14vh, 180px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(16px, 2.4vw, 40px);
  row-gap: clamp(56px, 7vw, 120px);
}
.folio-card { position: relative; display: flex; flex-direction: column; scroll-margin-top: calc(var(--hd-h) + 28px); }
.folio-primary { display: block; color: inherit; text-decoration: none; border-radius: 8px; }
.folio-primary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 6px; }

/* The plate: a colour field from the app's own interface, lit from the
   studio window like the page around it, with the real screen standing on
   it. */
.specimen {
  --mount: #ddd;
  --glow: #ffffff80;
  --no: #00000024;
  --on: var(--fg);
  --shadow: #10141a55;
  position: relative;
  isolation: isolate;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(120% 85% at var(--px) var(--py), var(--glow), transparent 60%),
    var(--mount);
  transition: --px .9s var(--ease-expo), --py .9s var(--ease-expo), filter .6s var(--ease-expo);
}
/* Paper grain, so the field reads as printed rather than flat. */
.specimen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: .14;
  mix-blend-mode: overlay;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Contact shadow: the device stands on the field. */
.specimen::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8.5%;
  z-index: 0;
  width: 52%;
  height: 7%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--shadow), transparent);
  filter: blur(6px);
  transition: scale .9s var(--ease-expo), opacity .9s var(--ease-expo);
}
.specimen__no {
  position: absolute;
  left: 6%;
  top: 4.5%;
  z-index: 1;
  color: var(--no);
  font: 300 clamp(2.6rem, 5vw, 5.2rem)/1 var(--serif);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.specimen__go {
  position: absolute;
  right: 5.5%;
  top: 5%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--no);
  color: var(--on);
  font-size: 1rem;
  transition: background-color .5s var(--ease-expo), border-color .5s var(--ease-expo), color .5s var(--ease-expo), rotate .7s var(--ease-expo);
}
.specimen__art {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  perspective: 1100px;
}
.specimen__tilt {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  place-items: center;
  transform: translateY(var(--lift, 0px)) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition: transform 1s var(--ease-expo);
}
.specimen__img {
  width: auto;
  height: 76%;
  max-width: 84%;
  object-fit: contain;
  filter: drop-shadow(0 22px 22px var(--shadow));
}
.specimen__img.is-raw {
  height: 72%;
  border: clamp(4px, .42vw, 6px) solid #0b0c0f;
  border-radius: clamp(18px, 2.1vw, 30px);
  outline: 1px solid #ffffff26;
  outline-offset: -1px;
}
.specimen__img.is-wide { width: 88%; height: auto; max-width: none; border-radius: 6.4% / 12.5%; }
.specimen__img.is-phone { height: 74%; border-radius: 13% / 6.2%; }
.specimen__img.is-print { height: 70%; border-radius: 8px; box-shadow: 0 0 0 1px #ffffff80; }
/* Some screens rise out of the bottom of the plate instead of floating. */
.specimen__img.is-rise {
  align-self: end;
  height: 82%;
  margin-bottom: -6%;
  border-radius: 15% 15% 0 0 / 7.2% 7.2% 0 0;
}
.specimen__img.is-raw.is-rise { border-bottom: 0; }
.specimen--elsewhere .is-raw { outline-color: #ffffff4d; }
.specimen:has(.is-rise)::after { display: none; }

/* The two desktop tools show what they are: a terminal. */
.term {
  display: grid;
  width: 86%;
  overflow: hidden;
  border-radius: 10px;
  background: #0f131a;
  color: #ebe6d8;
  text-align: left;
  box-shadow: 0 28px 44px -14px var(--shadow), 0 0 0 1px #ffffff17;
}
.specimen--ibkr .term { background: #161d18; }
.term__bar { display: flex; align-items: center; gap: 6px; padding: 11px 13px; background: #ffffff0b; }
.term__bar i { width: 9px; height: 9px; border-radius: 50%; background: #ffffff2b; }
.term__bar small { margin-left: auto; color: #ffffff85; font: 500 .66rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.term code { display: grid; gap: .75em; padding: 1.15em 1.25em 1.35em; font: 500 clamp(.66rem, .84vw, .84rem)/1.45 ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
.term__line b { color: var(--accent); font-weight: 600; }
.term__caret { width: .6em; height: 1.2em; background: var(--accent); }

.specimen--digimimic { --mount: #262c28; --glow: #e8b8722e; --no: #ffffff26; --on: #f1ebe0; --shadow: #000000b0; }
.specimen--elsewhere {
  --mount: #1c1b2f; --glow: #a198ff30; --no: #ffffff26; --on: #f1ebe0; --shadow: #000000b8;
  background:
    radial-gradient(120% 85% at var(--px) var(--py), var(--glow), transparent 60%),
    radial-gradient(circle, #ffffff70 1px, transparent 1.6px) 0 0 / 43px 47px,
    radial-gradient(circle, #ffffff3a 1px, transparent 1.6px) 19px 23px / 61px 53px,
    var(--mount);
}
.specimen--fileaway { --mount: #a6ccc7; --glow: #ffffff95; --no: #1d4b4a36; --on: #143a39; --shadow: #173f3e66; }
.specimen--bitenorth { --mount: #a8c3db; --glow: #ffffff95; --no: #1d3d5a36; --on: #13304b; --shadow: #18324d60; }
.specimen--habitforge { --mount: #d4c9e8; --glow: #ffffffa8; --no: #4b347d33; --on: #36265f; --shadow: #3c2a6a50; }
.specimen--harness { --mount: #1e2737; --glow: #8fb1ff2a; --no: #ffffff22; --on: #f1ebe0; --shadow: #000000b0; }
.specimen--ibkr { --mount: #d9cfb6; --glow: #fff8e0a0; --no: #5a4a2438; --on: #3a301e; --shadow: #4a3a1a58; }
.specimen--seekr { --mount: #e5d1b3; --glow: #ffffffa8; --no: #8a4b1a33; --on: #57300f; --shadow: #5b32144a; }
.specimen--plantos { --mount: #233725; --glow: #c5e0a541; --no: #ffffff26; --on: #f1ebe0; --shadow: #0a190eb8; }
.specimen--spectra { --mount: #1a1622; --glow: #e1a95f38; --no: #ffffff22; --on: #f1ebe0; --shadow: #000000b8; }
.specimen--traintogether { --mount: #16211c; --glow: #7be0a02e; --no: #ffffff22; --on: #f1ebe0; --shadow: #000000b8; }

/* Words under the plate: what it is, its name, one sentence. */
.folio-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.2rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
  color: var(--fg-2);
  font: 500 var(--f-label)/1.3 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.folio-meta span:first-child { color: var(--accent-ink); }
.folio-name {
  margin: .85rem 0 .5rem;
  font: 340 clamp(1.9rem, 2.7vw, 3.05rem)/1.02 var(--serif);
  letter-spacing: -.035em;
  text-wrap: balance;
  text-decoration: underline 1px transparent;
  text-underline-offset: .14em;
  transition: text-decoration-color .5s var(--ease-expo);
}
.folio-desc { display: block; max-width: 38ch; color: var(--fg-2); line-height: 1.5; text-wrap: pretty; }
.folio-extra { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: .7rem 0 0; }
.folio-extra :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: 600 .84rem/1 var(--sans);
  text-decoration: underline 1px var(--line);
  text-underline-offset: .4em;
  cursor: pointer;
  transition: text-decoration-color .3s ease, color .3s ease;
}
.folio-extra :is(a, button):hover { text-decoration-color: var(--accent-ink); color: var(--accent-ink); }
.folio-extra :is(a, button):focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

.folio-primary:is(:hover, :focus-visible) .folio-name { text-decoration-color: currentColor; }
.folio-primary:is(:hover, :focus-visible) .specimen__go { background: var(--accent); border-color: var(--accent); color: #1f2022; rotate: 45deg; }

/* Arriving from the Capabilities table, the plate rings once in brass. */
.folio-card.is-called .specimen::before { animation: folio-called 1.6s var(--ease-expo); }
@keyframes folio-called {
  0%, 100% { box-shadow: inset 0 0 0 0 var(--accent); opacity: .14; mix-blend-mode: normal; }
  25% { box-shadow: inset 0 0 0 4px var(--accent); opacity: 1; mix-blend-mode: normal; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .folio-primary:hover .specimen__tilt { --lift: -12px; }
  .folio-primary:hover .specimen::after { scale: 1.18 1; opacity: .6; }
  .folio-grid:has(.folio-primary:hover) .folio-card:not(:hover) .specimen { filter: saturate(.3) brightness(.97); }
  .term__caret { animation: folio-caret 1.1s steps(1) infinite; }
}
@keyframes folio-caret { 50% { opacity: 0; } }

/* Three columns, the middle one set lower, like a spread laid out by hand. */
@media (min-width: 1100px) {
  .folio-card:nth-child(3n + 2) { translate: 0 var(--stagger); }
  .folio-grid { padding-bottom: calc(clamp(96px, 14vh, 180px) + var(--stagger)); }
}
@media (min-width: 640px) and (max-width: 1099px) {
  .folio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .folio-card:nth-child(2n) { translate: 0 var(--stagger); }
  .folio-grid { padding-bottom: calc(clamp(96px, 14vh, 180px) + var(--stagger)); }
}
@media (max-width: 639px) {
  .folio-grid { grid-template-columns: 1fr; row-gap: 64px; }
  .specimen { aspect-ratio: 1; }
  .specimen__img { height: 80%; }
  .specimen__img.is-raw { height: 76%; }
  .folio-name { font-size: 2.3rem; }
}

/* ------------------------------------------------------------ 01 work · the turntable */

/* work-reel.js: one sticky stage, about half a screen of scroll per project.
   Shown only with .has-reel (motion and a real GPU); the cards above are the
   section otherwise, and stay in the page for links and deep entry. */
.reel { display: none; }
.has-reel .reel {
  --glow: #c8a863;
  position: relative;
  display: block;
  height: calc(100svh + 9 * 42svh);
}
.has-reel .folio-grid { display: none; }
.reel__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  transition: --glow 1s var(--ease-expo);
}
/* The project's own light falls behind the table and washes the paper. */
.reel__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Soft at top and bottom, so the stage dissolves into the paper as it
     arrives and leaves instead of ending on a line. */
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
  background:
    radial-gradient(42% 52% at 64% 54%, color-mix(in oklab, var(--glow) 42%, transparent), transparent 72%),
    linear-gradient(color-mix(in oklab, var(--glow) 9%, transparent), color-mix(in oklab, var(--glow) 9%, transparent));
}
/* Leaving for a project: the screen's light fills the stage. */
.reel__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease .45s;
}
.reel__stage.is-leaving::after { opacity: 1; }
.reel__canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease-expo);
}
.reel.is-ready .reel__canvas { opacity: 1; }

/* With the turntable, the cover's dive lands straight on the stage: the
   chapter's opening stays for screen readers and the outline, and its
   number and title ride in the stage's corner instead. */
.has-reel #projects > .cinematic-selector > .chapter {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.reel__title {
  position: absolute;
  z-index: 2;
  top: calc(var(--hd-h) + clamp(20px, 4vh, 48px));
  left: var(--margin);
  display: flex;
  align-items: baseline;
  gap: .9rem;
  color: var(--fg);
  font: 500 var(--f-label)/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reel__title span { color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* The index: all nine at once, the one at the front marked. */
.reel__index {
  position: absolute;
  z-index: 2;
  top: calc(var(--hd-h) + clamp(20px, 4vh, 48px) + 2.4rem);
  left: var(--margin);
}
.reel__index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.reel__index a {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  padding: .28rem 0;
  color: var(--fg-2);
  font: 450 clamp(.9rem, 1.05vw, 1.05rem)/1.2 var(--sans);
  text-decoration: none;
  transition: color .35s ease, translate .6s var(--ease-expo);
}
.reel__index a span {
  color: var(--fg-2);
  font-size: var(--f-label);
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  opacity: .7;
}
.reel__index a::before {
  content: "";
  align-self: center;
  width: 0;
  height: 1px;
  margin-right: -.9rem;
  background: var(--accent-ink);
  transition: width .6s var(--ease-expo), margin .6s var(--ease-expo);
}
.reel__index a[aria-current] { color: var(--fg); }
.reel__index a[aria-current]::before { width: 1.6rem; margin-right: 0; }
.reel__index a[aria-current] span { color: var(--accent-ink); opacity: 1; }
.reel__index a:is(:hover, :focus-visible) { color: var(--fg); translate: .3rem 0; }
.reel__index a:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }

/* The caption: the front project, set large; its letters change places
   as the table turns. */
.reel__caption {
  position: absolute;
  z-index: 2;
  left: var(--margin);
  bottom: clamp(36px, 8vh, 96px);
  width: min(33vw, 500px);
}
.reel__meta, .reel__desc, .reel__proof, .reel__actions { transition: opacity .5s ease, translate .7s var(--ease-expo); }
.reel__meta {
  display: flex;
  gap: 1.4rem;
  color: var(--fg-2);
  font: 500 var(--f-label)/1.3 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reel__meta span:first-child { color: var(--accent-ink); }
.reel__name {
  margin: .7rem 0 calc(.9rem - .14em);
  overflow: hidden;
  padding-bottom: .24em;
  font: 320 clamp(3rem, 5.6vw, 6.6rem)/.95 var(--serif);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.reel__name .wd { display: inline-block; white-space: nowrap; }
.reel__name .ch {
  display: inline-block;
  transition: translate .8s var(--ease-expo) calc(var(--d) * 22ms), opacity .4s ease calc(var(--d) * 22ms);
}
.reel__desc { max-width: 36ch; color: var(--fg-2); font-size: clamp(1rem, 1.15vw, 1.15rem); line-height: 1.5; text-wrap: pretty; }
/* One hard fact per project: the figure large, in brass, and what it
   counts beside it. */
.reel__proof {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  max-width: 40ch;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--fg-2);
  font-size: .92rem;
  line-height: 1.4;
}
.reel__proof b, .folio-proof b {
  flex: none;
  color: var(--accent-ink);
  font: 330 clamp(1.9rem, 2.6vw, 2.8rem)/1 var(--serif);
  letter-spacing: -.03em;
  font-variant-numeric: lining-nums;
}
.folio-proof { display: flex; align-items: baseline; gap: .6rem; margin-top: .8rem; color: var(--fg-2); font-size: .86rem; line-height: 1.4; }
.folio-proof b { font-size: 1.6rem; }
.reel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.5rem; margin: 1.4rem 0 0; }
.reel__open {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: 600 .9rem/1 var(--sans);
  text-decoration: none;
  transition: background-color .35s ease, color .35s ease, scale .16s ease-out;
}
.reel__open:active { scale: .97; }
.reel__open span { transition: rotate .6s var(--ease-expo); }
.reel__open:hover { background: var(--accent-ink); }
.reel__open:hover span { rotate: 45deg; }
.reel__open:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
.reel__extra { display: inline-flex; flex-wrap: wrap; gap: 0 1.4rem; }
.reel__extra :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: 600 .86rem/1 var(--sans);
  text-decoration: underline 1px var(--line);
  text-underline-offset: .4em;
  cursor: pointer;
}
.reel__extra :is(a, button):hover { color: var(--accent-ink); text-decoration-color: var(--accent-ink); }
.reel__extra :is(a, button):focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

.reel__caption.is-leaving .ch { translate: 0 -110%; opacity: 0; transition-duration: .28s, .2s; transition-delay: calc(var(--d) * 8ms); }
.reel__caption.is-leaving :is(.reel__meta, .reel__desc, .reel__proof, .reel__actions) { opacity: 0; translate: 0 -10px; transition-duration: .2s; }
.reel__caption.is-entering .ch { translate: 0 110%; opacity: 0; transition: none; }
.reel__caption.is-entering :is(.reel__meta, .reel__desc, .reel__proof, .reel__actions) { opacity: 0; translate: 0 14px; transition: none; }

.reel__count {
  position: absolute;
  z-index: 2;
  right: var(--margin);
  top: calc(var(--hd-h) + clamp(20px, 4vh, 48px) + 2rem);
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--fg-2);
  font: 500 var(--f-label)/1 var(--sans);
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.reel__count span { color: var(--fg); }
.reel__count i { width: 48px; height: 1px; background: var(--line); }
.reel__hint {
  position: absolute;
  z-index: 2;
  right: var(--margin);
  top: calc(var(--hd-h) + clamp(20px, 4vh, 48px));
  color: var(--fg-2);
  font: 500 var(--f-label)/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (max-width: 899px) {
  .has-reel .reel { height: calc(100svh + 9 * 40svh); }
  .reel__index { display: none; }
  .reel__title { top: calc(var(--hd-h) + 18px); }
  .reel__hint { display: none; }
  .reel__stage::before {
    background:
      radial-gradient(70% 40% at 50% 32%, color-mix(in oklab, var(--glow) 42%, transparent), transparent 72%),
      linear-gradient(color-mix(in oklab, var(--glow) 9%, transparent), color-mix(in oklab, var(--glow) 9%, transparent));
  }
  .reel__caption { right: var(--margin); width: auto; bottom: clamp(20px, 4svh, 40px); }
  .reel__name { font-size: clamp(2.5rem, 11vw, 4rem); margin: .5rem 0 .6rem; }
  .reel__desc { font-size: .98rem; }
  .reel__actions { margin-top: .8rem; }
  .reel__proof { margin-top: .7rem; padding-top: .6rem; font-size: .84rem; }
  .reel__proof b { font-size: 1.55rem; }
  .reel__count { top: calc(var(--hd-h) + 18px); }
}

/* ------------------------------------------------------------ 02 capabilities */

/* The plan chest: the wide, shallow drawers a studio keeps its prints in.
   Each discipline is a drawer front with a brass card holder and a brass
   pull; opening it slides the tray out with the projects laid in it like
   prints. Lit by the same window as the page, from the top right. The
   words are the same size as before: the cabinet is the setting, not a
   costume over the reading. */
.caps-list {
  --chest: color-mix(in oklab, var(--fg) 7%, var(--bg));
  --front: color-mix(in oklab, #fff 38%, var(--bg));
  --brass-hi: #e9d29a;
  --brass-lo: #9c7a3c;
  list-style: none;
  margin: 0 var(--margin) clamp(8px, 2vh, 24px);
  padding: 7px;
  display: grid;
  gap: 7px;
  border-radius: 6px;
  background: var(--chest);
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--fg) 6%, transparent),
    0 30px 60px -36px rgba(31, 32, 34, .35);
  interpolate-size: allow-keywords;
}
.caps-row { position: relative; }
.caps-row details { border-radius: 3px; }
.caps-row summary {
  position: relative;
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr) 14rem 11rem 4.5rem;
  align-items: center;
  column-gap: clamp(14px, 2vw, 32px);
  padding: clamp(18px, 2.4vw, 34px) clamp(16px, 2vw, 30px);
  border-radius: 3px;
  cursor: pointer;
  list-style: none;
  /* The painted front, lit from the top right: a bevel catches the light
     along its top edge and falls into shade along the bottom. */
  background:
    linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .55) 100%),
    var(--front);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(31, 32, 34, .09),
    0 1px 0 rgba(31, 32, 34, .08),
    0 2px 3px -1px rgba(31, 32, 34, .12);
  transition: translate .6s var(--ease-expo), box-shadow .6s var(--ease-expo);
}
.caps-row summary::-webkit-details-marker { display: none; }
.caps-row summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }

/* The card holder: a brass frame with the drawer's number on a slip of paper. */
.caps-no {
  justify-self: start;
  align-self: center;
  padding: .42rem .6rem .38rem;
  border-radius: 2px;
  background: var(--bg);
  border: 1.5px solid var(--brass-lo);
  box-shadow: inset 0 0 0 1px var(--brass-hi), 0 1px 1px rgba(31, 32, 34, .2);
  color: var(--fg-2);
  font: 500 var(--f-label)/1 var(--sans);
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
  transition: color .35s ease;
}
.caps-name {
  font: 320 clamp(2rem, 4.6vw, 5.2rem)/1 var(--serif);
  letter-spacing: -.04em;
  transition: translate .7s var(--ease-expo), color .35s ease;
}
.caps-tools { color: var(--fg-2); font-size: .88rem; line-height: 1.45; text-wrap: pretty; }

/* What is in the drawer, at a glance: the screens of its projects, in a
   hand of cards that fans out when the drawer is pointed at. */
.caps-faces { display: flex; align-items: center; justify-content: flex-end; height: 64px; padding-left: 14px; }
.caps-faces img {
  width: 30px;
  height: 62px;
  margin-left: -14px;
  object-fit: cover;
  border: 2px solid #0b0c0f;
  border-radius: 7px;
  background: #0b0c0f;
  box-shadow: 0 4px 10px #1f202233;
  rotate: calc((var(--f) - (var(--n) - 1) / 2) * 3deg);
  transition: margin .6s var(--ease-expo), rotate .6s var(--ease-expo), translate .6s var(--ease-expo);
}

/* The pull: a brass bar on two posts. Its label is the summary itself. */
.caps-toggle {
  position: relative;
  justify-self: end;
  width: 58px;
  height: 22px;
}
.caps-toggle::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 7px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(var(--brass-hi), var(--brass-lo) 70%, #7a5c28);
  box-shadow: 0 3px 4px -1px rgba(31, 32, 34, .35);
  transition: translate .6s var(--ease-expo), box-shadow .6s var(--ease-expo);
}
.caps-toggle::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  border-radius: 3px;
  background:
    radial-gradient(circle at 6px 50%, var(--brass-lo) 0 3px, transparent 3.5px),
    radial-gradient(circle at calc(100% - 6px) 50%, var(--brass-lo) 0 3px, transparent 3.5px);
}

/* Pointed at, the drawer comes out a little toward the reader; pressed, it
   goes back in. Only a real pointer gets the hover: a tap must not leave it stuck. */
.caps-row summary:active { translate: 0 1px; transition-duration: .12s; }
@media (hover: hover) and (pointer: fine) {
  .caps-row summary:hover {
    translate: 0 -2px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .9),
      inset 0 -1px 0 rgba(31, 32, 34, .09),
      0 10px 22px -10px rgba(31, 32, 34, .35);
  }
  .caps-row summary:hover .caps-toggle::before { translate: 0 1px; box-shadow: 0 5px 6px -1px rgba(31, 32, 34, .4); }
  .caps-list:has(summary:hover) .caps-row:not(:has(summary:hover)) .caps-name { color: color-mix(in oklab, var(--fg) 45%, transparent); }
  .caps-row summary:hover .caps-name { translate: .25em 0; }
  .caps-row summary:hover .caps-no { color: var(--accent-ink); }
  .caps-row summary:hover .caps-faces img { margin-left: 4px; rotate: calc((var(--f) - (var(--n) - 1) / 2) * 5deg); translate: 0 calc(-1 * (1 - (var(--f) - (var(--n) - 1) / 2) * (var(--f) - (var(--n) - 1) / 2) / 16) * 6px); }
}
.caps-row details[open] .caps-name { translate: .25em 0; }
.caps-row details[open] .caps-no { color: var(--accent-ink); }
.caps-row details[open] .caps-faces img {
  margin-left: 4px;
  rotate: calc((var(--f) - (var(--n) - 1) / 2) * 5deg);
  translate: 0 calc(-1 * (1 - (var(--f) - (var(--n) - 1) / 2) * (var(--f) - (var(--n) - 1) / 2) / 16) * 6px);
}

/* Open: the tray slides out under its front, darker inside, with the
   projects lying in it like prints, each a little askew. */
.caps-row details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size .7s var(--ease-expo), content-visibility .7s allow-discrete;
}
.caps-row details[open]::details-content { block-size: auto; }
.caps-row details[open] summary {
  border-radius: 3px 3px 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 14px 18px -12px rgba(31, 32, 34, .45);
}
.caps-proof {
  list-style: none;
  margin: 0;
  padding: clamp(22px, 2.6vw, 36px) clamp(16px, 2vw, 30px) clamp(26px, 3vw, 44px) calc(4.2rem + clamp(14px, 2vw, 32px) + clamp(16px, 2vw, 30px));
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(14px, 1.8vw, 26px);
  border-radius: 0 0 3px 3px;
  background: color-mix(in oklab, var(--fg) 10%, var(--bg));
  box-shadow: inset 0 10px 14px -10px rgba(31, 32, 34, .45), inset 0 -1px 0 rgba(31, 32, 34, .08);
  translate: 0 -14px;
  transition: translate .8s var(--ease-expo);
}
.caps-row details[open] .caps-proof { translate: 0 0; }
@starting-style { .caps-row details[open] .caps-proof { translate: 0 -14px; } }
.caps-proof li:nth-child(3n + 1) { rotate: -1.2deg; }
.caps-proof li:nth-child(3n + 2) { rotate: .8deg; }
.caps-proof li:nth-child(3n) { rotate: -.4deg; }
.proof {
  display: grid;
  gap: .55rem;
  padding: 8px 8px 12px;
  border-radius: 2px;
  background: var(--bg);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 1px rgba(31, 32, 34, .12), 0 8px 16px -8px rgba(31, 32, 34, .35);
  transition: translate .6s var(--ease-expo), rotate .6s var(--ease-expo), box-shadow .6s var(--ease-expo), scale .16s ease-out;
}
.proof__art {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 1px;
  background: var(--mount, #ddd);
  overflow: hidden;
}
.proof__art img {
  height: 78%;
  width: auto;
  max-width: 84%;
  object-fit: contain;
  border: 3px solid #0b0c0f;
  border-radius: 12px;
  box-shadow: 0 10px 18px #10141a40;
  transition: scale .6s var(--ease-expo);
}
.proof--digimimic .proof__art img, .proof--harness .proof__art img, .proof--ibkr .proof__art img { height: auto; border-radius: 6px; }
.proof__name { padding: 0 2px; font: 400 1.2rem/1.1 var(--serif); letter-spacing: -.02em; }
.proof__kind { margin-top: -.3rem; padding: 0 2px; color: var(--fg-2); font-size: var(--f-label); letter-spacing: .08em; text-transform: uppercase; }
@media (hover: hover) and (pointer: fine) {
  .caps-proof li:has(.proof:hover) { rotate: 0deg; }
  .proof:hover { translate: 0 -5px; box-shadow: 0 1px 1px rgba(31, 32, 34, .12), 0 18px 26px -12px rgba(31, 32, 34, .4); }
  .proof:hover .proof__art img { scale: 1.05; }
  .proof:hover .proof__name { text-decoration: underline 1px; text-underline-offset: .15em; }
}
.proof:active { scale: .98; transition-duration: .12s; }
.proof:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }
.caps-proof li { transition: rotate .6s var(--ease-expo); }
.proof--bitenorth { --mount: #a8c3db; }
.proof--digimimic { --mount: #262c28; }
.proof--elsewhere { --mount: #1c1b2f; }
.proof--fileaway { --mount: #a6ccc7; }
.proof--habitforge { --mount: #d4c9e8; }
.proof--harness { --mount: #1e2737; }
.proof--ibkr { --mount: #d9cfb6; }
.proof--seekr { --mount: #e5d1b3; }
.proof--plantos { --mount: #233725; }
.proof--spectra { --mount: #1a1622; }
.proof--traintogether { --mount: #16211c; }

@media (max-width: 1099px) {
  .caps-row summary { grid-template-columns: 3.4rem minmax(0, 1fr) auto 4rem; row-gap: .7rem; }
  .caps-tools { grid-column: 2 / 4; grid-row: 2; }
  .caps-faces { grid-column: 3; grid-row: 1; }
  .caps-toggle { grid-column: 4; grid-row: 1; }
}
@media (max-width: 640px) {
  .caps-list { margin-inline: 12px; padding: 5px; gap: 5px; }
  .caps-row summary { grid-template-columns: auto minmax(0, 1fr) 3.4rem; padding: 18px 14px; column-gap: 12px; }
  .caps-no { grid-column: 1; grid-row: 1; padding: .32rem .45rem .3rem; }
  .caps-name { grid-column: 2; grid-row: 1; font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .caps-toggle { grid-column: 3; grid-row: 1; width: 48px; }
  .caps-tools { grid-column: 1 / -1; grid-row: 2; font-size: .82rem; }
  .caps-faces { grid-column: 1 / -1; grid-row: 3; height: 52px; justify-content: flex-start; }
  .caps-faces img { width: 24px; height: 50px; }
  .caps-proof { padding: 18px 14px 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cover-dive-complete { visibility: hidden; }

/* ------------------------------------------------------------ project pages */

.folio-detail-art { align-self: start; margin: 0; }
/* On a project page the plate keeps the other case studies' proportions:
   square, and never taller than the screen, so the device is in view. */
.folio-detail-art .specimen { aspect-ratio: 1; max-height: 82svh; width: 100%; }
/* The four newer case studies open on a studio render: the same devices as
   the turntable, the real screens, the window's light across a sweep in the
   project's colour (rendered offline from the turntable's code). */
.specimen--render { background: #ddd; }
.specimen--render::after { display: none; }
.specimen__render { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.specimen--render .specimen__no { color: rgba(255, 255, 255, .5); mix-blend-mode: soft-light; }
.folio-process { padding: clamp(80px, 8vw, 140px) var(--margin); scroll-margin-top: var(--hd-h); }
/* The same heading as the case studies' chapters (.cs-h2), with their rule. */
.folio-process h2 { padding-top: clamp(20px, 3vw, 44px); border-top: 1px solid var(--line); font: 320 var(--f-display)/.95 var(--serif); letter-spacing: -.035em; }
.folio-process--design { padding-top: 0; }
.folio-process--design > :not(h2) { max-width: 76ch; }
.folio-process--design h2,
.folio-process--design h3 { scroll-margin-top: var(--hd-h); }
.folio-process--design h3 { font: 500 clamp(1.55rem, 2.25vw, 2.9rem)/1.1 var(--serif); margin: 2rem 0 .8rem; }
.folio-process--design > p { margin-top: 1.4rem; }
.folio-process--design ul { list-style: disc; padding-inline-start: 1.35em; }
.folio-process--design li + li { margin-top: .55rem; }
.case-source-register details { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.folio-process--design li a { text-decoration: underline; text-underline-offset: .15em; }
.case-source-register summary { cursor: pointer; font-weight: 600; }
.case-source-register details ul { margin-top: .65rem; }
.process-stack { color: var(--fg-2); font: 600 .73rem/1.4 var(--sans); text-transform: uppercase; letter-spacing: .09em; }
.process-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); margin: 2.5rem 0; }
.process-grid article { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.process-grid h3 { font: 500 clamp(1.55rem, 2.25vw, 2.9rem)/1.05 var(--serif); letter-spacing: -.045em; }
.process-grid p { color: var(--fg-2); line-height: 1.5; max-width: 48ch; margin-top: .7rem; }
.process-grid img { display: block; max-width: 100%; width: min(75%, 215px); height: auto; margin: 0 auto 1.6rem; border-radius: 8px; }
.process-grid code { display: block; padding: 1.4rem; background: #0f131a; color: #ebe6d8; border-radius: 8px; overflow-wrap: anywhere; margin: 0 0 1.5rem; }
@media (max-width: 620px) {
  .process-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* A case study's data sources, under its System design ledger: the same
   margins, and indented to the ledger's first column. */
.cs-section .cs-sources {
  padding: clamp(32px, 5vh, 56px) var(--margin) 0 calc(var(--margin) + (100% - 2 * var(--margin)) / 12);
}
.cs-section .cs-sources > h3:first-child { margin-top: 0; }
