/* ===========================================================================
   SUPACA ONLY. Loaded last, from supaca.html alone.

   The Key decisions section, 2026-10-27. His brief: "screen and the decision
   on the right on desktop, and maybe swipe screens on mobile", and, for the
   screens that are longer than a phone: "if its necessary to show the whole
   screen, we can keep it scrollable in one mobile frame, users can scroll."

   So: every screen sits in a frame of one phone's proportion, and a capture
   longer than that scrolls inside it. Nothing is cropped and nothing is
   re-cut - the frame is a window, the whole picture is behind it.

   Three things the art direction settled, all of them measured:

   1. THE HEADING STAYS ON THE SPINE. Every h2, h3, p and figure on this page
      starts at the same x. Moving the decision's h3 into the right-hand
      column put it 107px right of "Key decisions" directly above it, which
      reads as a bug. The number and the heading keep the full row; the split
      happens below them.

   2. THE WORDS STICK, NOT THE PICTURE. The decision text measures 188-342px;
      a column of screens is 643-1600px. You pin the shorter one, so the
      claim rides down beside the evidence it is making. Pinning the picture
      would only push its top off the screen.

   3. ONE WIDTH FOR EVERY SCREEN, 300px. Same frame, every decision, so the
      section reads as designed rather than assembled.
   =========================================================================== */


:root[data-case] {
  --shot: 300px;            /* every screen, every decision */
  --shot-ar: 840 / 1800;    /* one phone. Longer captures scroll inside it. */
}


/* ---------------------------------------------------------------------------
   1. THE FRAME

   aspect-ratio rather than a max-height, so the frame keeps a phone's
   proportion at any width - 300px on the desktop split, 78vw in the mobile
   strip - without a second number to maintain.

   A capture that is exactly 840x1800 fills it and does not scroll. The apply
   form (840x3818) and the event page (840x4476) scroll. The scrollbar is left
   visible on purpose: it is the affordance, and the mono line under the frame
   says so for anyone who misses it.
   --------------------------------------------------------------------------- */

.d-frame {
  display: block;
  width: 100%;
  aspect-ratio: var(--shot-ar);
  overflow-y: auto;
  overscroll-behavior: contain;      /* scrolling the screen never scrolls the page */
  border: 1px solid var(--rule);
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-40) transparent;
}

/* The screenshots' own ground is rgb(252,250,248) against the page's
   rgb(247,246,243) - five units apart. Without this hairline they dissolve
   into the paper, and the join screen's empty lower third disappears. */
.d-frame:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.d-frame img { display: block; width: 100%; height: auto; }

/* swiss.css section 17 gives every figure inside .col a margin-top of
   clamp(56px, 6vw, 96px) - correct for a figure in the flow of an essay,
   wrong for a screen that is supposed to start level with the words beside
   it. Measured: it pushed the frame 86px below the top of the text at 1440. */
[data-case] .col .d-shot { margin: 0; }

.d-shot figcaption {
  margin-top: var(--s2);
  max-width: 42ch;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-60);
}

/* Only on the frames that actually scroll. */
.d-scroll {
  margin: var(--s2) 0 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-40);
}


/* ---------------------------------------------------------------------------
   2. THE DESKTOP SPLIT, 1280px and up

   1280 and not 1024: below this the words column falls under 43ch, and at
   1025 it would be 32ch, which is a column of soup. Between 1025 and 1279 the
   page is still two-column but a decision is heading, words, then the strip.
   --------------------------------------------------------------------------- */

@media (min-width: 1280px) {

  /* The row takes the page's unused twelfth column. .col is grid-column 5/12;
     this is the old .bleed formula, which redo.css only kills on figure.bleed,
     so an #decisions rule is untouched by that !important. 655.89 -> 754.16px
     at 1440, left edge unchanged. */
  [data-case] #decisions { width: calc(100% + ((100% + var(--gutter)) / 7)); }

  /* The number hangs in the gutter at the same pixel as before, but the row
     is eight columns now, not seven, so the denominator changes with it. */
  [data-case] #decisions .decision__n { left: calc(-1 * ((100% + var(--gutter)) / 8)); }

  .d-body {
    display: grid;
    grid-template-columns: var(--shot) minmax(0, 1fr);
    column-gap: var(--s4);
    align-items: start;
    margin-top: var(--s5);
  }

  .d-shots { display: grid; gap: var(--s6); }

  /* align-self is load-bearing: a stretched grid item is as tall as its row,
     and sticky on a full-height item does nothing at all. */
  .d-words {
    position: sticky;
    top: var(--s12);
    align-self: start;
  }

  .d-words > :first-child { margin-top: 0; }
}


/* ---------------------------------------------------------------------------
   3. THE MOBILE STRIP, below 1280px

   A CSS scroll-snap strip. No JavaScript, no dots: one card is 78% of the
   column, so 22% of the next one is always showing, and a sliver of the next
   screen says "swipe" better than a row of dots. A static count under it is
   true at every width; the word "swipe" would be a lie at 1279 where two
   cards are already side by side.
   --------------------------------------------------------------------------- */

@media (max-width: 1279px) {

  .d-body { margin-top: var(--s3); display: flex; flex-direction: column; }

  /* Words first on a phone: the claim, then the evidence you swipe. */
  .d-words { order: -1; margin-bottom: var(--s6); }

  .d-shots {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(78%, 340px);
    gap: var(--s3);
    align-items: start;
    margin-inline: calc(-1 * var(--margin));   /* bleeds to the screen edge */
    padding-inline: var(--margin);             /* first card on the text edge */
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: var(--margin);
    overscroll-behavior-x: contain;            /* no browser back-swipe */
    scrollbar-width: none;
  }

  .d-shots::-webkit-scrollbar { display: none; }
  .d-shots > .d-shot { scroll-snap-align: start; }

  /* One screen on its own is not a carousel: give it the whole column rather
     than a 78% card with unexplained paper beside it. */
  .d-shots:not(:has(> .d-shot:nth-child(2))) { grid-auto-columns: 100%; }
}


/* ---------------------------------------------------------------------------
   4. THE OUTCOME PAIR

   The live beta, at the same 300px as every screen above it. No decision text
   to sit beside, so this is a figure, not a split. It took two screens until
   2026-10-27, when he cut the waitlist; auto-fit means it reads correctly
   whether there is one left or two.
   --------------------------------------------------------------------------- */

.d-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, var(--shot));   /* one or two */
  gap: var(--s4);
  justify-content: start;
  margin-top: var(--s6);
}

@media (max-width: 680px) {
  .d-pair { grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
}


/* ---------------------------------------------------------------------------
   5. THE SCREEN WALL

   The case-study opener, 2026-10-27, to his reference: screens laid over each
   other on the tilt, running off every edge, so the app reads as a whole
   product before a word of the case study is read.

   The cards are not cropped. Every screen in this wall is one of the twelve
   captures that is phone-shaped already (1:2.12 to 1:2.27), shown whole at
   its own height, which is also why the columns do not line up - a wall of
   identical rectangles would read as a contact sheet, not a pile. The long
   captures - the apply form, the event page - stay out of here and keep
   their scrollable frames further down the page, where their length is the
   point.

   Geometry: the stage is far bigger than the band it sits in and is rotated
   inside it, so the tilt never shows a bare corner; the band clips it. Each
   column is pushed up by a different amount, which is what stops the rows
   from reading as a grid.
   --------------------------------------------------------------------------- */

.mock {
  --mock-w: clamp(118px, 12.5vw, 196px);   /* one card */
  --mock-gap: clamp(10px, 1.2vw, 22px);
  position: relative;
  overflow: hidden;
  height: clamp(320px, 42vw, 580px);
  /* NO `margin: 0` here. .fullbleed centres itself with
     margin-inline: calc(50% - (var(--vw) / 2)), and this file loads after
     swiss.css, so a shorthand reset at equal specificity wiped those
     negative margins and hung the band 139px off the right of the page. */
  background:
    radial-gradient(130% 100% at 50% -10%, color-mix(in srgb, var(--ink) 2%, transparent), transparent 72%),
    color-mix(in srgb, var(--ink) 6%, transparent);
  border-block: 1px solid var(--rule);
}

.mock__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  display: flex;
  align-items: flex-start;          /* never stretch a column to the stage */
  justify-content: center;
  gap: var(--mock-gap);
  transform: translate(-50%, -50%) rotate(-13deg);
}

/* Flex rather than grid: a flex column lets each picture keep its own
   height, with no row track to share out. */
.mock__col {
  width: var(--mock-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: var(--mock-gap);
}

/* Each column rides at its own height. The numbers are not a sequence on
   purpose: a regular step reads as a staircase. */
.mock__col:nth-child(1) { transform: translateY(-14%); }
.mock__col:nth-child(2) { transform: translateY(-32%); }
.mock__col:nth-child(3) { transform: translateY(-6%); }
.mock__col:nth-child(4) { transform: translateY(-26%); }
.mock__col:nth-child(5) { transform: translateY(-16%); }
.mock__col:nth-child(6) { transform: translateY(-36%); }

/* .mock .mock__s, not .mock__s: this figure is a .fullbleed, and swiss.css
   1111 sets `.fullbleed img { border-radius: 0 }` while 1707 caps the same
   selector at max-height: 60vh on a narrow screen. Both are one class plus a
   type selector, so a bare .mock__s loses to them - the cards came out
   square-cornered, and would have been cropped short on a laptop. Two
   classes wins, and the 60vh cap has to be turned off by name.

   MEASURING THIS: the stage is rotated, so getBoundingClientRect returns the
   axis-aligned box of a tilted card - a 180x386 card at 13 degrees reads
   back as 262x414 and looks like a squash that is not there. Read
   getComputedStyle().width / .height instead. */
.mock .mock__s {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  flex: none;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  background: #fff;
  /* The one place on this site with a shadow. A tilted pile without depth
     reads as a flat pattern, and the screens' own white would otherwise run
     into the card beside it. */
  box-shadow: 0 14px 30px color-mix(in srgb, var(--ink) 14%, transparent);
}
