/* ==========================================================================
   site / site.css
   The portfolio-only layer: rules that exist for one project page and are
   not a documented component (a page-specific id or class, a project accent
   set in CSS). The portfolio pages load it after the design system:
     <link rel="stylesheet" href="ds/css/ds.css">
     <link rel="stylesheet" href="assets/site.css">
   components.html and docs/ load ds.css only. Everything generic (tokens,
   base, layout, components, the light theme, utilities) lives in ds.css.
   Rules moved here from ds.css keep their relative order, so the cascade
   does not change. Project accents stay inline (--accent-1 / --accent-2 on
   <body> or a section, as COMPONENTS.md allows), not here.
   ========================================================================== */

/* Welcome lockup: chiclet beside the project name. ds has no welcome-size
   lockup; .welcome-head .chiclet adds a bottom margin that throws the
   badge-lockup's centring off. */
.welcome-head .badge-lockup,
.app-section .chapter-head > .badge-lockup {
  gap: 12px; margin-bottom: 24px;
  font-size: var(--fs-eyebrow); line-height: var(--lh-eyebrow); letter-spacing: var(--ls-eyebrow);
}
.welcome-head .badge-lockup .chiclet { margin-bottom: 0; }
/* the landing's app sections open with the same lockup as the project pages */
.app-section .chapter-head > .badge-lockup .chiclet { --chiclet-size: 54px; }

/* Full-bleed media-first welcome: ds hides the local nav over the hero but
   it keeps its 52px in the flow, so an edge-to-edge film started under an
   empty strip. Pull the media up under the bar; once the bar sticks it
   fades in, blurred, over the film. */
.welcome-media-first > .welcome-media:not(.wrap) { margin-top: calc(-1 * var(--localnav-h)); }

/* Flow "Used at": left-aligned client chiclets under the stats in What
   Changed. ds has no chiclet row. Eleven never split evenly, so the row is a
   grid: one row of 11 at the default 54px where it fits (about 816px and up),
   6 / 5 below that, so no logo is ever left alone. On phones the chiclets drop
   to 40px (ds's .chiclet-sm) and the six columns spread across at most 300px,
   so they still fit a 320px screen. The small caption above sits flush, not
   12px down as under a picture. */
.used-by > .media-caption { margin-top: 0; }
.used-by-list {
  display: grid; grid-template-columns: repeat(11, auto); justify-content: start; gap: 12px;
  margin: 12px 0 0; padding: 0; list-style: none;
}
@media (max-width: 815px) { .used-by-list { grid-template-columns: repeat(6, auto); } }
@media (max-width: 734px) {
  .used-by-list { max-width: 300px; column-gap: 0; justify-content: space-between; }
  .used-by-list .chiclet { --chiclet-size: 40px; }
}
.used-by-list .chiclet { display: grid; }

/* Flow "What I owned", The details: a 3:2 caption tile. ds has ratio tiles
   for 16:9 and 16:10 only; this mirrors them (as wide as the row height
   needs, capped at --tile-max, and then shorter than the row). */
.tile-3x2 { width: min(calc(var(--tile-h) * 3 / 2), var(--tile-max)); }
.tile-3x2 > .media { height: min(var(--tile-h), calc(var(--tile-max) * 2 / 3)); }

/* A picture that keeps its own shape, with a different shape on phones:
   set --ar (and --ar-sm for the phone cut) inline. Scout's diagrams. */
.media.media-natural { aspect-ratio: var(--ar); }
@media (max-width: 734px) { .media.media-natural { aspect-ratio: var(--ar-sm, var(--ar)); } }
/* Its image takes its own height instead of ds's 100%: iOS Safari can keep a stale percentage height
   inside an aspect-ratio box, which cut 17px off the bottom of Scout's phone message flow. The box and
   the file share a ratio, so nothing changes elsewhere. Videos keep 100% (no size until metadata). */
.media.media-natural > img,
.media.media-natural > picture,
.media.media-natural > picture > img { height: auto; }

/* A loop with its own phone crop on Vimeo: a ds stream takes one playlist, so the
   .media holds one video per crop and only the one for this width shows. Outside
   highlights the hidden one never loads (ds plays loops only on screen); in
   highlights ds plays every clip in the slide, so the hidden one streams too. Clausage. */
@media (max-width: 734px) { .media > video.crop-wide { display: none; } }
@media (min-width: 735px) { .media > video.crop-phone { display: none; } }

/* A tile row in place of the welcome film, spaced as ds spaces .welcome-media. About. */
.welcome > .gallery { margin-top: 64px; }
@media (max-width: 734px) { .welcome > .gallery { margin-top: 48px; } }

/* A 4:5 tile, as wide as the row height needs (ds has 16:9 and 16:10 only). About's places and studios. */
.tile-4x5 { width: calc(var(--tile-h) * 4 / 5); }

/* Tile captions with the heading on its own line (a place's name over its sentence). About. */
.tiles-stacked .tile-caption h3 { display: block; }

/* ds gives the section after a welcome 80px on top, sized for a welcome that ends on its film.
   A welcome that ends on a tile row gets the full section gap, like any section after a gallery. About. */
.welcome:has(> .gallery) + .section { padding-top: var(--section-pad); }

/* Landing About rows: the company or school sits between the year (600) and the body (400) */
.feature-list .org { font-weight: 500; }

/* Text-first welcomes (the landing, About): ds sets 140px above the eyebrow, which left a big empty band under the nav */
.welcome-suite { padding-top: 64px; }
@media (max-width: 734px) { .welcome-suite { padding-top: 48px; } }

/* Library gap: ds has no image zoom. A tile or picture that opens a larger copy of itself in a
   .modal-picture (futrbot, Flow, Scout) is an <a>, inline by default, so it is made a block to keep
   the panel's shape. The sheet keeps ds's width (--sheet-max), so the picture is as wide as the content
   column at most, and a picture at its own shape (.media-natural) is held to the window's height, so a
   tall one never outgrows it. Phones keep ds's full-width sheet and the tall phone cuts. */
a.media { display: block; }
@media (min-width: 735px) {
  .modal-picture .media-natural { max-width: calc((100vh - 120px) * var(--ar)); margin-inline: auto; }
}

/* A modal in chapters (Scout's proof): each later eyebrow starts a new part, so it gets a chapter's
   gap above it instead of the modal's 48px block rhythm. */
.modal-content > .modal-chapter { margin-top: 112px; }
@media (max-width: 734px) { .modal-content > .modal-chapter { margin-top: 80px; } }
/* Library gap: .feature-list has no one-column variant (--cols isn't inline-settable). In a modal read
   as chapters, the evidence runs in one column at the body's measure, like the chapters on the page. */
.feature-list.list-single { --cols: 1; max-width: 80%; }
@media (max-width: 734px) { .feature-list.list-single { max-width: 100%; } }
