/*
 * Post-SUV case study (/work/post-suv/).
 * Shared building blocks (facts, eyebrows, stage, reflection, credits,
 * teaser, protected parts) come from case-base.css and nda-gate.css; this
 * file holds the page layout and the exhibits. Values come from tokens.css;
 * fixed values only inside the drawings.
 *
 * A calm page (27.10.2026, CASE-STUDY-STANDARD.md 3.5):
 * - Public is text and own drawings only (NDA). No boxes around content: the
 *   process, the morph and the profile demo stand on the chapter surface.
 * - No kickers, counters or labels above graphics; their words live in the
 *   caption. One caption per figure, 12 px under the picture.
 * - Surfaces set the rhythm: white, grey, the dark chapter 03, white, grey,
 *   white.
 * - The workshop sequence is the one sticky stage (js/case-stage.js) with
 *   four sketches; the morph in 03 runs once with a pause control and the
 *   profile slider in 04 is the one demo (js/post-suv-story.js).
 * - The protected parts (nda/post-suv/*.html) keep their markup; this file
 *   lays them out without boxes, under the "Under NDA" label of nda-gate.css.
 * Rules on shared case-base.css classes carry .ps-page, so they win there.
 */

.ps-page {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-sans);
  overflow-x: clip;
}

.ps-page *,
.ps-page *::before,
.ps-page *::after {
  box-sizing: border-box;
}

.ps-page p {
  overflow-wrap: break-word;
}

:where(.ps-page) figure {
  margin: 0;
}

.ps-page figcaption,
.ps-stage__caption {
  margin: 12px 0 0;
  color: var(--color-ink-muted);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
  text-align: left;
}

.ps-wrap {
  width: var(--content-width);
  margin-inline: auto;
}

/* ---------- Without JavaScript ---------- */

/* main.js never colours the fixed navigation without JavaScript, and its
   white text would run over the light chapters: give it the dark of the
   chapter bar. */
@media (scripting: none) {
  .ps-page #main-nav {
    background: var(--color-surface-dark);
  }
}

/* ---------- Hero ---------- */

.ps-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 96svh;
  overflow: hidden;
  background: #172534 url('/assets/post-suv/cover.svg?v=20261027a') center / cover no-repeat;
  color: var(--color-ink-on-dark);
}

/* Keeps title, lead and facts above 4.5 : 1 on every width. */
.ps-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 19, 28, 0.91) 0%, rgba(12, 19, 28, 0.74) 38%, rgba(12, 19, 28, 0.12) 100%);
}

.ps-hero__inner {
  position: relative;
  padding-block: 180px 56px;
}

.ps-hero__copy {
  max-width: 870px;
}

.ps-hero h1 {
  max-width: 850px;
  margin: 0;
}

.ps-hero__lead {
  max-width: 675px;
  margin: 32px 0 38px;
  color: #e2e8ec;
  font-size: clamp(18px, 1.8vw, 23px);
  line-height: var(--leading-lead);
}

.ps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ps-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid var(--color-ink-on-dark);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: var(--weight-bold);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.ps-button:hover {
  transform: translateY(-2px);
}

.ps-button--light {
  background: var(--color-surface);
  color: #20272b !important;
}

.ps-button--outline {
  background: rgba(14, 22, 30, 0.28);
  color: var(--color-ink-on-dark);
}

.ps-button--outline:hover {
  background: var(--color-surface);
  color: #20272b;
}

.ps-hero .case-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(64px, 11vh, 132px) 0 0;
  padding: 28px 0 0;
  border-color: rgba(255, 255, 255, 0.42);
}

.ps-hero .case-facts dt {
  color: #c4d1e2;
}

.ps-hero .case-facts dd {
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.45;
}

/* ---------- Sections and headings ---------- */

.ps-section {
  padding-block: var(--space-section);
}

.ps-section--white {
  background: var(--color-surface);
}

.ps-section--grey {
  background: var(--color-surface-alt);
}

.ps-section--dark {
  background: var(--color-surface-dark);
  color: var(--color-ink-on-dark);
}

.ps-section--dark figcaption {
  color: var(--color-ink-on-dark-muted);
}

.ps-head {
  margin-bottom: var(--space-block);
}

/* A chapter that ends with its text (05): no gap above the bottom padding. */
.ps-head--end {
  margin-bottom: 0;
}

.ps-h2 {
  max-width: 920px;
  margin: 0;
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-h2);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}

.ps-head__intro {
  max-width: 560px;
  margin: var(--space-intro) 0 0;
  color: var(--color-ink-body);
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
}

.ps-copy {
  margin-top: var(--space-intro);
}

.ps-copy p {
  max-width: 640px;
  margin: 0;
  color: var(--color-ink-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.ps-copy p + p {
  margin-top: 22px;
}

.ps-section--dark .ps-head__intro,
.ps-section--dark .ps-copy p {
  color: var(--color-ink-on-dark-body);
}

@media (min-width: 1024px) {
  .ps-head--split {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    column-gap: clamp(40px, 6vw, 96px);
    align-items: start;
  }

  .ps-head--split .case-eyebrow {
    grid-column: 1 / -1;
  }

  .ps-head--split .ps-head__intro,
  .ps-head--split .ps-copy {
    margin-top: 10px;
  }
}

/* ---------- 01 The question ---------- */

/* The project question at the end of the chapter, set large; no label, no
   rules. */
.ps-question {
  max-width: 980px;
  margin: var(--space-block) 0 0;
  color: var(--color-ink);
  font-size: clamp(28px, 3.4vw, 48px);
  font-weight: var(--weight-semibold);
  line-height: 1.15;
  letter-spacing: var(--tracking-h3);
  text-wrap: balance;
}

.ps-question em {
  font-style: normal;
  color: var(--color-accent);
}

/* ---------- 02 The workshop sequence: the stage ---------- */

/* The sketches are 16 : 10 like the frame; white on the grey chapter. */
.ps-page .case-stage__screen {
  background: var(--color-surface);
}

/* From 1024 px the sketch takes two thirds of the width; the frame sticks
   in the middle of the window below navigation and chapter bar, never
   taller than the window. The stage is the container the frame measures
   (cqi); --ps-gap is its column gap. */
.ps-page .ps-stage.is-staged {
  --ps-gap: var(--space-8);
  container-type: inline-size;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  column-gap: var(--ps-gap);
}

.ps-page .ps-stage.is-staged > .case-stage__frame {
  --ps-frame-w: min((100cqi - var(--ps-gap)) * 2 / 3, (100vh - var(--scroll-offset) - var(--space-24)) * 1.6);
  width: var(--ps-frame-w);
  top: calc(var(--scroll-offset) + max(var(--space-6), (100vh - var(--scroll-offset) - var(--ps-frame-w) * 10 / 16 - var(--space-12)) / 2));
}

@media (min-width: 1280px) {
  .ps-page .ps-stage.is-staged {
    --ps-gap: var(--space-12);
  }
}

/* The circles beside the steps and the bars under the frame show the
   position; the "02 / 04" counter is left out. */
.ps-page .case-stage__count {
  display: none;
}

/* case-base.css dims the inactive steps to 0.78, which keeps 4.5 : 1 on
   white; on the grey chapter 0.86 keeps text and numbers above 4.5 : 1. */
.ps-page .case-stage.is-staged .case-stage__step:not(.is-active) .case-stage__text {
  opacity: 0.86;
}

.ps-stage__caption {
  max-width: var(--measure);
  margin-top: var(--space-6);
}

/* ---------- 03 Fragment, silhouette, model ---------- */

/* The same pieces in three states (data-state on the figure). Without
   JavaScript and with reduced motion the figure rests on "model". */
.ps-morph__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.ps-morph__ground {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 2;
}

.ps-morph__floor path {
  fill: none;
  stroke: rgba(170, 178, 255, 0.22);
  stroke-width: 1.5;
}

.ps-morph__depth path,
.ps-morph__depth circle {
  fill: none;
  stroke: rgba(170, 178, 255, 0.55);
  stroke-width: 2;
}

.ps-morph__piece path {
  fill: rgba(170, 178, 255, 0.14);
  stroke: var(--color-accent-on-dark);
  stroke-width: 3;
  stroke-linejoin: round;
}

.ps-morph__piece .ps-morph__window {
  fill: none;
  stroke-opacity: 0.5;
  stroke-width: 2;
}

.ps-morph__piece circle {
  fill: var(--color-surface-dark);
  stroke: var(--color-ink-on-dark);
  stroke-width: 8;
}

.ps-morph__piece {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 900ms var(--ease-emphasized);
}

.ps-morph__floor,
.ps-morph__depth {
  transition: opacity var(--dur-reveal) var(--ease-out);
}

.ps-morph[data-state="fragment"] .ps-morph__floor,
.ps-morph[data-state="fragment"] .ps-morph__depth,
.ps-morph[data-state="silhouette"] .ps-morph__floor,
.ps-morph[data-state="silhouette"] .ps-morph__depth {
  opacity: 0;
}

.ps-morph[data-state="fragment"] .ps-morph__piece--front {
  transform: translate(-110px, 34px) rotate(-10deg);
}

.ps-morph[data-state="fragment"] .ps-morph__piece--cabin {
  transform: translate(14px, -50px) rotate(5deg);
}

.ps-morph[data-state="fragment"] .ps-morph__piece--rear {
  transform: translate(124px, 26px) rotate(11deg);
}

.ps-morph[data-state="fragment"] .ps-morph__piece--wheel1 {
  transform: translate(-70px, 40px);
}

.ps-morph[data-state="fragment"] .ps-morph__piece--wheel2 {
  transform: translate(150px, 34px);
}

/* From 1024 px the drawing takes two thirds on the right, the steps stand
   beside it on the left: mirrored to the stage in 02, so two graphics in a
   row do not repeat "medium left, list right". The caption sits under the
   drawing. */
@media (min-width: 1024px) {
  .ps-morph {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    grid-template-areas:
      "steps drawing"
      ". caption";
    column-gap: var(--space-12);
    align-items: center;
  }

  .ps-morph__svg {
    grid-area: drawing;
  }

  .ps-morph .ps-steps {
    grid-area: steps;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
    margin: 0;
  }

  .ps-morph .ps-caption-row {
    grid-area: caption;
  }
}

/* The first state is set without transitions, so nothing visibly flies
   apart before the run. */
.ps-morph.is-instant,
.ps-morph.is-instant * {
  transition: none !important;
}

/* ---------- Steps under a graphic (03) ---------- */

/* The same numbered circles as the stage. While a sequence runs, the
   current step is filled and the others are muted; without JavaScript all
   of them read as plain text. */
.ps-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6) var(--space-12);
  margin: var(--space-10) 0 0;
  padding: 0;
  list-style: none;
}

.ps-steps li {
  display: grid;
  grid-template-columns: var(--space-8) minmax(0, 1fr);
  column-gap: var(--space-4);
  row-gap: var(--space-1);
  align-items: start;
}

.ps-steps__num {
  display: inline-flex;
  grid-row: span 2;
  align-items: center;
  justify-content: center;
  width: var(--space-8);
  height: var(--space-8);
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-round);
  color: var(--color-accent);
  font: var(--weight-semibold) var(--text-caption)/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.ps-steps strong {
  padding-top: var(--space-1);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-h4);
  transition: color var(--dur-base) var(--ease-out);
}

.ps-steps p {
  margin: 0;
  font-size: var(--text-small);
  line-height: var(--leading-small);
  transition: color var(--dur-base) var(--ease-out);
}

.ps-steps--on-dark .ps-steps__num {
  border-color: var(--color-accent-on-dark);
  color: var(--color-accent-on-dark);
}

.ps-steps--on-dark strong {
  color: var(--color-ink-on-dark);
}

.ps-steps--on-dark p {
  color: var(--color-ink-on-dark-body);
}

.ps-steps--on-dark.is-live li:not(.is-current) strong,
.ps-steps--on-dark.is-live li:not(.is-current) p {
  color: var(--color-ink-on-dark-muted);
}

.ps-steps--on-dark li.is-current .ps-steps__num {
  background: var(--color-accent-on-dark);
  color: var(--color-surface-dark);
}

/* ---------- Caption with the pause control at its end ---------- */

.ps-caption-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--space-4);
}

.ps-morph .ps-caption-row {
  margin-top: var(--space-10);
}

.ps-caption-row > span {
  max-width: var(--measure);
}

.ps-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  /* The same width for "Pause" and "Play", so the caption never reflows. */
  min-width: 76px;
  min-height: var(--tap-min);
  /* Centre the 44 px target on the first caption line. */
  margin: -12px calc(-1 * var(--space-2)) -12px 0;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-ink-on-dark-muted);
  font: var(--weight-semibold) var(--text-caption)/var(--leading-caption) var(--font-sans);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard);
}

.ps-control[hidden] {
  display: none;
}

.ps-control:hover {
  color: var(--color-accent-on-dark);
}

/* Two bars for "Pause", a triangle for "Play". */
.ps-control__icon {
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 3px solid currentColor;
  border-left: 3px solid currentColor;
}

.ps-control[data-action="play"] .ps-control__icon {
  border: 0;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* ---------- 04 The profile demo ---------- */

/* The drawing takes two thirds, the control sits beside it; below 1024 px
   the caption follows the drawing and the control comes last. */
.ps-lab {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-areas:
    "drawing control"
    "caption .";
  column-gap: clamp(32px, 5vw, 80px);
  align-items: center;
}

.ps-lab svg {
  grid-area: drawing;
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface-tint);
}

.ps-lab figcaption {
  grid-area: caption;
  max-width: var(--measure);
}

.ps-lab__grid {
  fill: none;
  stroke: #dfe3ef;
  stroke-width: 1;
}

.ps-lab__ground {
  stroke: #aab9cc;
  stroke-width: 3;
}

.ps-lab__body {
  fill: rgba(58, 65, 228, 0.12);
  stroke: var(--color-accent);
  stroke-width: 4;
  stroke-linejoin: round;
}

.ps-lab__wheel {
  fill: #f7f9fc;
  stroke: #243751;
  stroke-width: 8;
}

.ps-lab__detail {
  stroke: #7485ad;
  stroke-width: 2;
}

.ps-lab__control {
  grid-area: control;
}

.ps-lab__control label {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--color-ink);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-h4);
}

.ps-lab__control input {
  display: block;
  width: 100%;
  min-height: var(--tap-min);
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.ps-lab__ends {
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  color: var(--color-ink-muted);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

/* Room for two lines, so the layout never jumps with the text. */
.ps-lab__readout {
  min-height: 3em;
  margin: var(--space-6) 0 0;
  color: var(--color-ink);
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  line-height: 1.5;
}

/* ---------- 06 What remains ---------- */

.ps-page .case-credits {
  margin-top: var(--space-12);
}

/* ---------- Protected parts (after unlocking) ---------- */

/* The fragments in nda/post-suv/ arrive under the "Under NDA" label of
   nda-gate.css. They stand on the chapter like the rest: no box, no second
   label, pictures with the same hairline and radius as everywhere. */
.ps-nda__label {
  display: none;
}

.ps-nda h3 {
  max-width: 920px;
  margin: 0 0 var(--space-6);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-h3);
  letter-spacing: var(--tracking-h3);
  text-wrap: balance;
}

.ps-nda p {
  max-width: 760px;
  margin: 0 0 var(--space-5);
  color: var(--color-ink-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.ps-section--dark .ps-nda p {
  color: var(--color-ink-on-dark-body);
}

.ps-nda__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-8) var(--space-6);
  align-items: start;
  margin-top: var(--space-8);
}

.ps-nda img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}

.ps-section--dark .ps-nda img {
  border-color: var(--color-line-on-dark);
}

/* Three figures as a plain row of numbers. */
.ps-nda__stat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
  max-width: 760px;
  margin: var(--space-8) 0;
}

.ps-nda__stat strong {
  display: block;
  color: var(--color-accent);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-h3);
  letter-spacing: var(--tracking-h3);
}

.ps-nda__stat span {
  color: var(--color-ink-muted);
  font-size: var(--text-caption);
  line-height: var(--leading-caption);
}

/* ---------- Reveal ---------- */

/* Only with JavaScript and without reduced motion (js/post-suv-story.js
   sets .ps-motion); otherwise everything is simply there. */
.ps-motion .ps-reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
}

.ps-motion .ps-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023.98px) {
  .ps-hero .case-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ps-lab {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "drawing"
      "caption"
      "control";
  }

  .ps-lab__control {
    max-width: 560px;
    margin-top: var(--space-8);
  }
}

@media (max-width: 767.98px) {
  .ps-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-5);
  }

  .ps-page .case-stage__steps {
    gap: var(--space-12);
  }

  .ps-nda__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639.98px) {
  .ps-hero {
    min-height: 100svh;
    background-position: 61% center;
  }

  .ps-hero::before {
    background: linear-gradient(90deg, rgba(12, 19, 28, 0.96), rgba(12, 19, 28, 0.58));
  }

  .ps-hero__inner {
    padding-block: 135px 32px;
  }

  .ps-hero__lead {
    margin: 24px 0 30px;
  }

  .ps-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-button {
    width: 100%;
  }

  .ps-hero .case-facts {
    gap: 22px 15px;
    margin-top: 56px;
  }

  .ps-hero .case-facts dd {
    font-size: 14px;
  }

  .ps-nda__stat {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .ps-page *,
  .ps-page *::before,
  .ps-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ps-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .ps-button:hover {
    transform: none;
  }
}
