/* /assets/css/m-case.css — the phone layout of the six case studies (b127 B4a, /work/*).
 *
 * One template, six pages, so the rules live here instead of in six inline blocks. Linked in each page right
 * after the motion-includes partial with media="(max-width: 767px)": a wider screen downloads the file and
 * applies none of it. It comes after mobile.css in the cascade; where a rule competes with the page's own
 * <style>, site.css or mobile.css it is written "html body …" and wins on order.
 *
 * What it does (round 2: the work leaves its boxes)
 *   1  the head       the page opens inside the work: the opening picture runs edge to edge straight under the
 *                     bar, the title stands with it, then the client line, the tour's row (caption, the client's
 *                     address, the play disc) and the standfirst. Nothing in it moves until the visitor acts.
 *   2  the tour       a phone capture cut where it reads best (the window is per page); the play disc sits in
 *                     the tour's row, 56 px, never on the picture, so never on the client's own button
 *   3  the decisions  number in a gutter, title, text
 *   4  what shipped   the shared rail (mobile.js) with slides as wide as the screen; the captions leave the
 *                     slides and stand under them as a numbered index in the decisions' own component
 *                     (m-case.js moves the nodes; without the script each caption stays under its slide);
 *                     a tap on a slide opens the full-screen viewer (the shared sheet + the shared rail)
 *   5  the way on     the next project as one compact card, the other links as 48 px rows
 *
 * Sizes come from the phone scale in mobile.css (--m-*), colours, radii, easings and durations from
 * tokens.css. Behaviour: /assets/js/m-case.js.
 */

:root {
  --mc-ratio: 780 / 838; /* the frame: a 390 px phone screen less the client's top bar */
}

/* ============================================================ 1. the head */
html body .cs-head {
  padding: calc(var(--bar-h) + env(safe-area-inset-top, 0px)) 0 0;
}
/* a stable first frame: on a phone the head is simply there (site.css raises each child in turn, 0.9 to 1.1 s;
   the selector is doubled to out-weigh that rule, which carries two classes inside :is()) */
html.pv-anim body .cs-head.cs-head > .wrap.wrap > * {
  animation: none;
}
/* where subgrid is missing: the picture and its row first, as one block, then the words */
html body .cs-head > .wrap {
  display: flex;
  flex-direction: column;
}
html body .cs-head > .wrap > .cs-frame {
  order: -1;
}
html body .cs-head > .wrap > p:first-child {
  margin: var(--m-2) 0 0;
}
/* the way back: 44 px to the touch, the label's size to the eye, and a mark that says which way it goes */
html body .cs-head a.cs-back {
  display: inline-flex;
  align-items: center;
  gap: var(--m-2);
  min-height: var(--m-tap);
  margin-block: 0;
  padding-block: 0;
  text-decoration: none;
}
html body .cs-head a.cs-back::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
/* a case title is a whole sentence: the inner-page step of the scale, so it holds two or three lines and the
   tour's row still ends inside the first screen */
html body .cs-title {
  max-width: none;
  margin-top: var(--m-1);
  font-size: var(--m-h1-inner, clamp(38px, 10.26vw, 40px));
  line-height: 1.04;
}
/* client, then kind: one under the other on every page and every width */
html body .cs-meta {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: var(--m-1);
  margin-top: var(--m-4);
}
html body .cs-meta .label {
  line-height: 1.3;
}
html body .cs-meta .label:first-child {
  color: var(--white);
}
html body .cs-sum {
  max-width: none;
  margin-top: var(--m-5);
  font-size: var(--m-lead);
  line-height: 1.45;
}

/* ============================================================ 2. the opening picture and the tour's row
   No card: the picture is as wide as the screen and starts where the bar ends. */
html body .cs-head .cs-frame {
  margin: 0 calc(-1 * var(--pad-x));
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
}
html body .cs-frame--tour video,
html body .cs-frame--wide.cs-frame--tour video {
  aspect-ratio: var(--mc-ratio);
  background: none;
}
/* a phone capture: the tour is 780 x 974 and the frame is a window on it, the same window while it rests
   (the poster is that window, cut in the file) and while it plays. Default: the lower 838 rows, the client's
   own top bar outside the picture. */
html body .cs-frame--tour video {
  object-fit: cover;
  object-position: 50% 100%;
}
/* Foxcott: rows 136 to 720. The client's first screen ends in the sentence this page has as its title; the
   window stops above it, so the sentence is read once, and the client's bar (its label is clipped at this
   width) stays outside */
html body .cs-frame--tour video[data-poster-sm*="/foxcott/"] {
  aspect-ratio: 780 / 584;
  object-position: 50% 34.87%;
}
/* Farnbrook: rows 0 to 616, the wordmark that fills the screen and the three tiles under it; the line under
   them is this page's title */
html body .cs-frame--tour video[data-poster-sm*="/farnbrook/"] {
  aspect-ratio: 780 / 616;
  object-position: 50% 0;
}
/* a desktop tour: the opening picture is a crop of the first screen and fills the frame; the tour itself
   plays whole inside it, never cut */
html body .cs-frame--wide.cs-frame--tour video {
  object-fit: contain;
  object-position: 50% 50%;
}
/* the opening picture is there with the first paint: until the first tap gives the video a file, the box
   carries the picture as its ground. It is the file the page preloads and case.js then sets as the poster, so
   nothing changes when the poster arrives. The poster the markup names is the desktop's cut of the screen:
   on a phone it is kept out of the box, so it can never flash before the script has run. (version-assets.mjs
   stamps url() in a stylesheet with the same hash as in the page: one request, not two.) */
html body .cs-frame--tour video[data-poster-sm*="/foxcott/"] {
  --mc-open: url("/assets/b127/work/foxcott/open2-780.webp?v=0fc00d9849");
}
html body .cs-frame--tour video[data-poster-sm*="/fairfield/"] {
  --mc-open: url("/assets/b127/work/fairfield/open-780.webp?v=2b889c75b1");
}
html body .cs-frame--tour video[data-poster-sm*="/farnbrook/"] {
  --mc-open: url("/assets/b127/work/farnbrook/open2-780.webp?v=06fb75ca22");
}
html body .cs-frame--tour video[data-poster-sm*="/apex-ridge/"] {
  --mc-open: url("/assets/b127/work/apex-ridge/open2-780.webp?v=b53831f94e");
}
html body .cs-frame--tour video[data-poster-sm*="/ridgecraft/"] {
  --mc-open: url("/assets/b127/work/ridgecraft/open-780.webp?v=9ebd668a55");
}
html body .cs-frame--tour video[data-poster-sm*="/youngpl/"] {
  --mc-open: url("/assets/b127/work/youngpl/open-780.webp?v=17fca8b7fc");
}
html body .cs-frame--tour video:not([src]) {
  background: var(--mc-open, none) 50% 50% / cover no-repeat;
}
html body .cs-frame--tour video[poster*="/assets/case/"] {
  object-fit: none;
  object-position: 0 200vh;
}
/* the tour's row: what the tour shows, the client's address, and the control at its end */
html body .cs-frame figcaption {
  position: relative;
  min-height: calc(var(--m-btn) + 2 * var(--m-3) + 4px);
  margin: 0;
  padding: var(--m-3) calc(var(--pad-x) + var(--m-btn) + var(--m-4)) var(--m-4)
    var(--pad-x);
  font-size: var(--m-aux);
  line-height: 1.45;
}
/* the client's address: the rule stays under the word, and the 44 px to the touch come from a box around
   the link */
html body a.cs-domain {
  position: relative;
  padding-block: 0 1px;
}
html body a.cs-domain::after {
  content: "";
  position: absolute;
  inset: -14px -8px;
}
/* the play disc: out of the picture and into the row, so it cannot sit on the client's headline or on the
   client's own button. 56 px, the fill of every button on the site. */
html body .sbp-disc {
  top: calc(100% + var(--m-3) + 2px);
  right: var(--pad-x);
  bottom: auto;
  width: var(--m-btn);
  height: var(--m-btn);
  min-width: var(--m-btn);
  min-height: var(--m-btn);
  border-color: transparent;
  background: var(--btn-light);
  color: var(--ink);
}
html body .sbp-disc svg {
  width: 16px;
  height: 16px;
}
html body .sbp-disc .i-play {
  margin-left: 2px; /* the triangle's weight sits left of its box */
}
html body .sbp-bar {
  height: 2px;
}

/* with subgrid the figure spans the head's rows: its picture is row 1, its row is row 5, and the way back,
   the title and the client line stand between the two. The figure stays one figure (no display: contents). */
@supports (grid-template-rows: subgrid) {
  html body .cs-head > .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(6, auto);
  }
  html body .cs-head > .wrap > * {
    grid-column: 1;
    z-index: 1; /* above the figure's empty middle rows, so the way back takes the touch */
  }
  html body .cs-head > .wrap > p:first-child {
    grid-row: 2;
  }
  html body .cs-head > .wrap > .cs-title {
    grid-row: 3;
  }
  html body .cs-head > .wrap > .cs-meta {
    grid-row: 4;
  }
  html body .cs-head > .wrap > .cs-sum {
    grid-row: 6;
  }
  html body .cs-head > .wrap > .cs-frame {
    position: relative;
    z-index: 0;
    grid-row: 1 / span 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
  }
  html body .cs-head .cs-frame > .sbp-frame {
    position: static; /* the disc and the progress line measure from the figure: its bottom edge is the row's */
    grid-row: 1;
  }
  html body .cs-head .cs-frame > figcaption {
    grid-row: 5;
    margin-top: var(--m-5);
  }
  /* the row is ruled like the lists further down; the progress line draws over its lower rule */
  html body .cs-head .cs-frame > figcaption::before,
  html body .cs-head .cs-frame > figcaption::after {
    content: "";
    position: absolute;
    left: var(--pad-x);
    right: var(--pad-x);
    top: 0;
    height: 1px;
    background: var(--m-rule);
  }
  html body .cs-head .cs-frame > figcaption::after {
    top: auto;
    bottom: 0;
  }
  html body .cs-head .sbp-disc {
    top: auto;
    bottom: calc(var(--m-3) + 2px);
    z-index: 2; /* over the row it sits in (the row is positioned for its rules) */
  }
  html body .cs-head .sbp-bar {
    left: var(--pad-x);
    right: var(--pad-x);
  }
}

/* ============================================================ 3. three decisions */
html body .cs-notes {
  padding-top: var(--m-sec);
}
html body .cs-notes-list {
  gap: 0;
  margin-top: var(--m-5);
}
html body .cs-notes-list li {
  display: grid;
  grid-template-columns: var(--m-6) minmax(0, 1fr);
  padding: var(--m-4) 0 var(--m-5);
}
html body .cs-notes-list li:last-child {
  padding-bottom: 0;
}
html body .cs-notes-list li::before {
  grid-row: 1 / span 2;
  margin: 0;
  padding-top: 7px; /* the numeral sits on the title's first line */
  line-height: 1.3;
}
html body .cs-notes-list h3 {
  font-size: var(--m-h3);
  line-height: 1.2;
}
html body .cs-notes-list p {
  grid-column: 2;
  max-width: none;
  margin-top: var(--m-2);
  font-size: var(--m-body);
  line-height: 1.5;
}

/* ============================================================ 4. what shipped
   The strip carries data-m-rail="bleed full"; mobile.js adds the snap and the control row. The layout is
   written here as well, so the strip already scrolls sideways before any script has run. A slide is the
   picture and nothing else: as wide as the screen, no frame, no radius. */
html body .cs-screens {
  padding: var(--m-sec) 0;
}
html body .cs-head + .cs-screens {
  padding-top: var(
    --m-sec-tight
  ); /* straight after the head it continues it; after the decisions it is a section */
}
html body .cs-screens > .wrap {
  position: relative; /* the viewer's sign measures from the column */
}
html body .cs-screens .label + .cs-list,
html body .cs-screens h2.label + * {
  margin-top: var(--m-5);
}
html body .cs-list {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-inline: 0;
  scroll-padding-inline: 0;
}
html body .cs-list > li {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}
html body .cs-shot {
  border: 0;
  border-radius: 0;
}
html body .cs-shot img {
  aspect-ratio: var(--mc-ratio);
  object-position: 50% 50%;
}
/* a caption still inside its slide (no script, or the index not built yet) */
html body .cs-list .cs-cap {
  margin: 0;
  padding: var(--m-3) var(--pad-x) 0;
}
html body .cs-cap b {
  font-size: var(--m-body);
  line-height: 1.3;
}

/* the whole slide opens the viewer (a button m-case.js lays over the picture, named by the picture) */
.mc-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mc-open:focus-visible {
  outline: var(--focus-ring-dark);
  outline-offset: -4px;
}
/* the sign that it does: two corners pulling apart, at the end of the section's label, never on the picture
   (a mark on the picture would land on the client's own button on some slides). It opens the slide in front. */
.mc-full {
  position: absolute;
  top: calc((1.3 * var(--fs-micro) - var(--m-tap)) / 2);
  right: calc(var(--pad-x) - 14px); /* the glyph's edge on the column's edge */
  width: var(--m-tap);
  height: var(--m-tap);
  padding: 0;
  border: 0;
  border-radius: var(--radius-btn);
  background: none;
  color: var(--white);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--t-press) var(--ease);
}
.mc-full::before {
  content: "";
  position: absolute;
  inset: 14px;
  background:
    linear-gradient(currentColor, currentColor) 100% 0 / 8px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 0 / 1.5px 8px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 8px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 1.5px 8px no-repeat;
}
.mc-full:active {
  opacity: 0.6;
}
.mc-full:focus-visible {
  outline: var(--focus-ring-dark);
  outline-offset: -4px;
}

/* the index: the captions, numbered, in the component of "Three decisions" (the list carries that class too,
   so the numeral, its face and the rules are the same ones). A line moves the strip to its slide; the slide
   in front marks its line: full ink and the site's square for "you are here". Only opacity changes. */
html body .cs-notes-list.mc-index {
  margin-top: var(--m-3);
  border-bottom: 1px solid var(--line-strong);
}
html body .cs-notes-list.mc-index li {
  position: relative;
  align-items: center;
  min-height: var(--m-7);
  padding: var(--m-2) var(--m-5) var(--m-2) 0;
}
html body .cs-notes-list.mc-index li::before {
  grid-row: 1;
  padding-top: 0;
}
html body .cs-notes-list.mc-index .cs-cap {
  grid-column: 2;
  display: block;
  margin: 0;
  padding: 0;
  color: var(--white);
  opacity: 0.62; /* 6.9:1 on the page's ground */
  transition: opacity var(--t-micro) var(--ease);
}
html body .cs-notes-list.mc-index .cs-cap b {
  font-weight: 600;
  letter-spacing: -0.01em;
}
html body .cs-notes-list.mc-index li::after {
  content: "";
  position: absolute;
  right: var(--m-1);
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  background: var(--white);
  opacity: 0;
  transition: opacity var(--t-micro) var(--ease);
}
html body .cs-notes-list.mc-index li.is-on .cs-cap,
html body .cs-notes-list.mc-index li.is-on::after {
  opacity: 1;
}
.mc-go {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mc-go:active {
  background: var(--line);
}
.mc-go:focus-visible {
  outline: var(--focus-ring-dark);
  outline-offset: -2px;
}
html:not(.pv-anim) body .cs-notes-list.mc-index li::after,
html:not(.pv-anim) body .cs-notes-list.mc-index .cs-cap,
html:not(.pv-anim) body .mc-full {
  transition: none;
}

/* the viewer: inside the shared sheet, the shared rail with slides as wide as the screen. A slide shows a
   larger piece of the capture than the page does and scrolls on its own when the piece is taller than the
   screen; the caption stays under it, the rail's control row stays at the bottom. */
.mc-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 var(--pad-x) var(--m-4);
}
.mc-view-strip {
  --m-rail-w: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  gap: 0;
  margin-inline: calc(-1 * var(--pad-x));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.mc-view-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-align: start;
  -webkit-overflow-scrolling: touch;
}
.mc-view-in {
  margin-block: auto; /* in the middle when there is room, from the top when there is not */
  padding-block: var(--m-4);
}
.mc-view-pic {
  background: var(--panel);
}
.mc-view-pic img {
  display: block;
  width: 100%;
  height: auto;
}
html body .mc-view-slide .cs-cap {
  margin: 0;
  padding: var(--m-4) var(--pad-x) 0;
}

/* ============================================================ 5. the way on */
html body .cs-cta {
  padding-top: 0;
}
/* the next project is one card, set as a row: it is a way out of the page, not a fifth screen of this one */
html body .cs-nextcard {
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--m-4);
  padding: var(--m-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
}
/* the same mark as the rows under it: the card and the rows are one list of ways on. (A 44 px disc here
   left the name and its line 142 px at 360, and both wrapped.) */
html body .cs-nextcard::before {
  content: "";
  order: 3;
  width: 6px;
  height: 6px;
  margin: 0 var(--m-1) 0 0;
  border-top: 1.5px solid var(--gray-3);
  border-right: 1.5px solid var(--gray-3);
  transform: rotate(45deg);
}
html body .cs-nextcard-media {
  aspect-ratio: var(--mc-ratio);
  border: 0;
  border-radius: var(--radius-btn);
}
html body .cs-nextcard-media img {
  object-position: 50% 50%;
}
html body .cs-nextcard-text {
  gap: var(--m-1);
  padding-bottom: 0;
}
html body .cs-nextcard-t {
  font-size: var(--m-h3);
  line-height: 1.2;
  letter-spacing: -0.012em;
}
html body .cs-nextcard-m {
  font-size: var(--m-aux);
  line-height: 1.45;
}
html body .cs-nextcard:focus-visible {
  border-radius: var(--radius-card);
}
/* the other ways on: rows, 48 px each, in sentence case so each stays on one line */
html body .cs-cta .cs-nextcard + .cs-next,
html body .cs-cta .cs-next {
  display: block;
  margin: var(--m-4) 0 var(--m-sec);
  padding: 0;
  border-top: 0;
  border-bottom: 1px solid var(--m-rule);
}
html body .cs-cta .cs-next .cs-back {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--m-4);
  min-height: var(--m-7);
  margin-block: 0;
  padding-block: var(--m-2);
  border-top: 1px solid var(--m-rule);
  color: var(--gray-3);
  font-size: var(--m-aux);
  line-height: 1.3;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}
html body .cs-cta .cs-next .cs-back:first-child {
  border-top: 0;
}
html body .cs-cta .cs-next .cs-back::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: var(--m-1);
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}
html body .cs-cta .cs-next .cs-back:active {
  color: var(--white);
}
