/* ==========================================================================
   Case study — presented as a project, not as a page with a project in it.

   The chrome is a thin rail that reports position and gets out of the way.
   Content takes the full column, media runs full-bleed, and a statement spread
   can take the whole viewport. Placeholders stay unmistakably placeholders.
   ========================================================================== */

.cs {
  position: relative;
  width: 100%;
  padding-bottom: clamp(3rem, 10vh, 6rem);
  text-align: left;
  opacity: 0;
}
.cs[data-ready="true"] { opacity: 1; transition: opacity var(--dur-l) var(--ease-out); }

/* Everything that is words sits in this measure; media is free to escape it. */
.cs > *:not(.cs__chapters):not(.rail),
.cs__chead,
.cs__cbody {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.cs .worlds__crumb { padding-top: calc(var(--header-h) + .5rem); }

/* --- hero: the project's title card -------------------------------------- */
/* Bounded, not just proportional. 62svh is a good title card on a 900px-tall
   laptop and half a wasted screen on a 1366px tablet — viewport-proportional
   spacing scales in the wrong direction once the viewport gets tall. The min()
   caps every one of these so they stay generous without running away. */
.cs__hero {
  min-height: min(62svh, 32rem);
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(2.5rem, 9vh, 6rem) clamp(2rem, 6vh, 3.5rem);
}
.cs__kicker { color: var(--ink-muted); margin: 0 0 1.25rem; }
.cs__title {
  margin: 0; font-weight: 300;
  font-size: clamp(2.75rem, 8vw, 6.5rem);
  line-height: .96; letter-spacing: -.035em;
}
.cs__sub {
  margin: 1rem 0 0; max-width: 32rem;
  font-size: clamp(1rem, 1.5vw, 1.375rem); line-height: 1.45; color: var(--ink-soft);
}

.cs__meta {
  display: flex; flex-wrap: wrap; gap: clamp(1.25rem, 4vw, 3.5rem);
  margin: clamp(1.75rem, 5vh, 3rem) 0 0;
}
.cs__meta dt { color: #000000; font-weight: 600; }
.cs__meta dd { margin: .35rem 0 0; font-size: 1rem; }

.cs__banner {
  margin: clamp(1.5rem, 4vh, 2.25rem) 0 0; max-width: 34rem;
  padding: .85rem 1rem;
  border-left: 2px solid var(--focus);
  background: rgba(31, 92, 107, .05);
  font-size: .8125rem; line-height: 1.6; color: var(--ink-soft);
}

/* --- the rail: chrome, and it behaves like it ---------------------------- */
.rail {
  position: fixed; right: clamp(.9rem, 2vw, 1.75rem); top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  opacity: 1;
  transition: opacity var(--dur-m) var(--ease-out);
}
.rail[data-hidden="true"] { opacity: 0; pointer-events: none; }
.rail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.rail__dot {
  display: block; width: 26px; height: 10px;
  position: relative;
}
.rail__dot::after {
  content: ""; position: absolute; right: 0; top: 50%;
  width: 14px; height: 1px; margin-top: -.5px;
  background: var(--ink-quiet);
  transition: width var(--dur-s) var(--ease-out), background var(--dur-s) var(--ease-out);
}
.rail__dot:hover::after { width: 26px; background: var(--ink-soft); }
.rail__dot[data-current]::after { width: 26px; background: var(--ink); }

/* --- chapters ------------------------------------------------------------ */
.cs__chapter {
  content-visibility: auto;
  contain-intrinsic-size: auto 28rem;
  padding-block: clamp(2.5rem, 9vh, 5.5rem);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.cs__chead { margin-bottom: clamp(1.5rem, 4vh, 2.5rem); }
.cs__ckicker {
  display: flex; align-items: baseline; gap: .9rem;
  color: #000000; margin: 0 0 .9rem;
  font-weight: 600;
}
.cs__cno { color: #000000; font-weight: 600; }
.cs__h {
  margin: 0; font-weight: 300;
  font-size: clamp(1.75rem, 4.2vw, 3rem);
  line-height: 1.04; letter-spacing: -.028em;
}
.cs__prose { max-width: 38rem; color: var(--ink-soft); line-height: 1.75; font-size: 1.0625rem; }

/* --- full-bleed media ----------------------------------------------------- */
.cs__media {
  width: 100%;
  max-width: min(104rem, 100% - 2 * var(--gutter));
  margin: clamp(1.5rem, 4vh, 2.5rem) auto 0;
  display: grid; gap: clamp(.6rem, 1.4vw, 1.1rem);
  grid-template-columns: repeat(2, 1fr);
}
.cs__frame {
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--rule);
  background: repeating-linear-gradient(-45deg,
    rgba(22,25,30,.018) 0 9px, transparent 9px 18px);
}
.cs__frame--wide { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.cs__mediacap {
  max-width: min(104rem, 100% - 2 * var(--gutter));
  margin: .8rem auto 0;
  font-size: var(--t-micro); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--ink-muted);
}

/* --- statement spread: one fact, the whole screen ------------------------- */
.spread {
  min-height: min(78svh, 40rem);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(2.5rem, 8vh, 5rem) var(--gutter);
  width: 100%; max-width: 64rem; margin-inline: auto;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.spread__lead { color: var(--ink-muted); margin: 0 0 clamp(1rem, 3vh, 1.75rem); }
.spread__value {
  margin: 0; font-weight: 300;
  font-size: clamp(2.75rem, 11vw, 9rem);
  line-height: .92; letter-spacing: -.04em;
}
.spread__note {
  margin: clamp(1.25rem, 3vh, 2rem) 0 0; max-width: 30rem;
  font-size: clamp(1rem, 1.4vw, 1.25rem); color: var(--ink-soft);
}

/* --- placeholders -------------------------------------------------------- */
.ph {
  max-width: 40rem;
  border: 1px dashed var(--rule);
  border-radius: 2px;
  padding: clamp(1rem, 2.4vw, 1.4rem);
  background: repeating-linear-gradient(-45deg,
    rgba(22,25,30,.016) 0 8px, transparent 8px 16px);
}
.ph--slim { padding: .9rem 1.1rem; }
.ph--loud { border-color: rgba(31, 92, 107, .45); background: rgba(31, 92, 107, .04); }

.ph__chip {
  display: inline-block; margin: 0 0 .7rem;
  padding: .22rem .5rem;
  border: 1px solid var(--rule);
  font-size: var(--t-label); font-weight: 500;
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--paper-flat);
}
.ph--loud .ph__chip { border-color: rgba(31,92,107,.4); color: var(--focus); }
.ph__prompt { margin: 0; font-size: .9375rem; line-height: 1.7; color: var(--ink-soft); }
.ph__note {
  margin: .8rem 0 0; font-size: var(--t-micro); line-height: 1.6; color: var(--ink-muted);
}
.ph--loud .ph__note { color: var(--ink-soft); }

/* --- foot ---------------------------------------------------------------- */
.cs__foot {
  margin-top: clamp(2rem, 6vh, 3.5rem);
  padding-top: clamp(1.5rem, 4vh, 2rem);
  border-top: 1px solid var(--rule-soft);
}

@media (max-width: 62rem) {
  .rail { display: none; }              /* thumb territory; the scroll is the index */
  .cs__media { grid-template-columns: 1fr; }
  .cs__frame--wide { aspect-ratio: 16 / 9; }
}

/* Viewport-proportional spacing is generous on a wide screen and merely empty
   on a narrow one — a 62svh title card costs half a phone screen before the
   first word. Tighter here, without losing the sense of chapters. */
@media (max-width: 46rem) {
  .cs__hero {
    min-height: auto;
    padding-block: clamp(1.25rem, 5vh, 2.25rem) clamp(1.5rem, 4vh, 2rem);
  }
  .cs__chapter { padding-block: clamp(2rem, 6vh, 3rem); }
  .spread { min-height: min(52svh, 22rem); }
  .cs__title { font-size: clamp(2.5rem, 13vw, 3.5rem); }
}
