/* Case-study compositions built from the shared Soft Gallery foundation. */
.case-study { background: var(--paper); }
.case-study main { flex: 1; }
.case-study h1 { font-size: var(--font-display); font-weight: 700; letter-spacing: -.035em; line-height: 1.06; }
.case-study h2 { font-size: var(--font-heading); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
.case-study h3 { font-weight: 600; letter-spacing: -.025em; line-height: 1.2; }
.case-study :is(.hero, .circa-hero, .chapter, .story-footer, .related-case-inner) {
  width: calc(100% - var(--gutter) * 2);
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 0;
}
.case-study :is(.hero, .circa-hero) {
  min-height: auto;
  padding-block: clamp(2.5rem, 4.28vw, 4rem) var(--section-space);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
}
.case-study .hero-copy { padding: 0; }
.case-study .hero-statement { margin-top: 1.5rem; font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.25; }
.case-study :is(.intro, .hero-copy > p:not(.hero-statement)) { margin-top: 1.25rem; max-width: 31.25rem; color: var(--muted); font-size: 1.125rem; line-height: 1.55; letter-spacing: -.015em; }
.case-study .project-meta { gap: 2rem; margin-top: 2rem; flex-wrap: wrap; }
.case-study .project-meta dd { font-size: .9375rem; }
.case-study :is(figcaption, .interactive-caption, .section-label, .chapter-nav, .project-meta dt, .project-status, .principle-line > span, .icon-coda-copy > span, .tuning-note > span) {
  font-family: inherit;
  font-size: .875rem;
  line-height: 1.45;
  letter-spacing: -.01em;
  text-transform: none;
}
.case-study :is(figcaption, .interactive-caption) { margin-top: .875rem; color: var(--muted); gap: .75rem; flex-wrap: wrap; }
.case-study .section-label { color: var(--muted); margin-bottom: 1.25rem; }
.case-study .project-status { margin-bottom: 1.5rem; }
.case-study .chapter { padding-block: var(--section-space); scroll-margin-top: 5rem; }
.case-study .chapter + .chapter, .case-study .light-story { border-top: 0; }
.case-study :is(.prose p, .learning-notes p, .details-grid article p, .motion-copy > p:last-child, .related-case-copy > p:not(.section-label), .chapter-heading p, .icon-coda-copy p) {
  max-width: 39rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  letter-spacing: -.012em;
}
.case-study :is(.screen-stage, .app-stage, .sync-stage, .detail-stage, .boot-stage, .device-stage, .media-frame, .artifact-study video, .wide-figure img, .hardware-studies img, .circa-hero-figure img, .full-media img, .final-icon-study img, .related-case-visual) {
  border-radius: var(--media-radius);
}
.case-study :is(.screen-stage, .app-stage, .sync-stage, .detail-stage) { background: var(--stage); }
.case-study :is(.media-frame, .related-case-visual) { overflow: hidden; border: 0; }
.case-study .media-frame { isolation: isolate; }
.case-study :is(.building-band, .companion-band) { background: var(--stage); }
.case-study :is(.building-band, .companion-band) :is(.app-stage, .screen-stage) { background: var(--stage-raised); }
.case-study .viewer-comparison figure:last-child .screen-stage { background: var(--stage); }
.case-study .chapter-nav { background: rgb(255 255 255 / 95%); border-top: 0; border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.case-study .chapter-nav-inner { width: calc(100% - var(--gutter) * 2); max-width: 80rem; padding-inline: 0; }
.case-study .chapter-nav a { min-height: 3.25rem; padding-block: 1rem; }
.case-study .chapter-nav a[aria-current="location"]::after { bottom: 0; border-radius: 2px; }
.case-study .image-dialog { border: 0; border-radius: var(--media-radius); background: var(--paper); color: var(--ink); box-shadow: 0 24px 96px rgb(0 0 0 / 20%); }
.case-study .image-dialog::backdrop { background: rgb(15 15 18 / 65%); }
.case-study .dialog-toolbar button { min-height: 2.75rem; border: 0; border-radius: 999px; padding-inline: 1rem; background: var(--stage); }
.case-study .dialog-image-area img { border-radius: .75rem; }
.case-study :is(.identity-band, .dark-story, .circa-motion) { background: var(--night); color: #fff; }
.case-study :is(.identity-band, .dark-story, .circa-motion) :is(figcaption, .section-label, .prose p, .chapter-heading p, .icon-coda-copy p, .icon-coda-copy > span, .tuning-note > span, .motion-copy > p:last-child) { color: var(--night-muted); }
.case-study .chapter-instrument::before { display: none; }
.case-study :is(.motion-copy h3, .sync-study h3, .icon-coda-copy h3) { font-size: clamp(1.75rem, 2.5vw, 2.5rem); font-weight: 600; line-height: 1.15; }
.case-study :is(.closing-line p, .story-footer p) { font-size: var(--font-heading); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; }
.case-study .story-footer { padding-block: var(--section-space); }
.case-study .story-footer p { max-width: 24ch; margin-bottom: 2rem; }
.case-study .story-footer a { font-family: inherit; font-size: 1rem; letter-spacing: -.015em; text-transform: none; }
.case-study .related-case { background: var(--paper); color: var(--ink); }
.case-study .related-case-inner { gap: clamp(2rem, 5vw, 5rem); padding-block: var(--section-space); }
.case-study .related-case :is(.section-label, .related-case-copy > p:not(.section-label)) { color: var(--muted); }
.case-study .related-case h2 { max-width: 17ch; }
.case-study .related-case-visual { width: 100%; max-width: none; background: var(--stage); aspect-ratio: 49 / 53; }
.case-study .related-case-visual :is(img, video) { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-study .related-case-visual:focus-visible { outline-color: var(--ink); }

/* Full-bleed cover opens the product story; zoom still reveals the original UI. */
.product-story .hero-stage { padding: 0; min-height: 0; overflow: hidden; }
.product-story .hero-stage .timeline { max-width: none; border-radius: 0; }
.product-story .hero-stage img { aspect-ratio: 49 / 53; object-fit: cover; filter: none; }
.circa-story .circa-hero h1 { font-size: var(--font-display); line-height: 1.06; }
.circa-story .circa-hero-figure img { aspect-ratio: 49 / 53; }
.identity-story .hero { grid-template-areas: "copy media"; }
.identity-story .hero h1 { max-width: 14ch; }
.identity-story .hero-visual { width: 100%; max-width: none; justify-self: stretch; }
.identity-story .hero-media { aspect-ratio: 49 / 53; }
.identity-story .interactive-hero { background: var(--stage); }
.identity-story .interactive-hero::after {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 10%);
  content: "";
  pointer-events: none;
}
.identity-story .chapter-heading { grid-template-columns: 2.5rem minmax(0, 1fr); gap: 1.5rem; margin-bottom: var(--heading-space); }
.identity-story .chapter-number { font-size: 1rem; font-weight: 500; line-height: 1.5; letter-spacing: -.01em; padding-top: .5rem; color: var(--muted); }
.identity-story .dark-story .chapter-number { color: var(--night-muted); }
.identity-story .chapter-heading h2 { max-width: 24ch; }
.identity-story .chapter-heading h2::before { content: none; }
.identity-story .chapter-heading p { margin-top: 1.25rem; }
.identity-story .full-media img { border: 0; }
.identity-story .icon-study img { object-fit: cover; }
.identity-story .phone-media video { border-radius: var(--media-radius); border: 0; }
.identity-story .media-control { font-family: inherit; font-size: .8125rem; letter-spacing: 0; }
.identity-story .media-control button { min-height: 2.75rem; }
.identity-story .parameter-list { font-size: .8125rem; }

[data-theme="dark"] .case-study .chapter-nav { background: rgb(13 13 15 / 92%); }
[data-theme="dark"] .case-study .image-dialog { border: 1px solid var(--line); box-shadow: 0 24px 96px rgb(0 0 0 / 55%); }
[data-theme="dark"] .case-study .image-dialog::backdrop { background: rgb(0 0 0 / 78%); }
[data-theme="dark"] .case-study :is(.identity-band, .dark-story, .circa-motion) { color: var(--ink); }

@media (max-width: 900px) {
  .case-study :is(.hero, .circa-hero) { grid-template-columns: 1fr; gap: 2.5rem; }
  .identity-story .hero { grid-template-areas: "copy" "media"; }
  .case-study :is(.hero-figure, .circa-hero-figure, .hero-visual) { width: 100%; max-width: 38rem; justify-self: start; }
  .case-study .project-meta { flex-direction: row; }
  .case-study .tuning-note { position: static; width: 100%; transform: none; }
}
@media (max-width: 640px) {
  .case-study h1, .circa-story .circa-hero h1 { font-size: clamp(2.75rem, 11vw, 3.5rem); }
  .case-study :is(.hero, .circa-hero) { padding-top: 2.5rem; }
  .case-study .hero-statement { font-size: 1.5rem; max-width: 25ch; }
  .case-study :is(.intro, .hero-copy > p:not(.hero-statement)) { font-size: 1.0625rem; }
  .case-study :is(figcaption, .interactive-caption, .project-meta dt, .section-label) { font-size: .8125rem; }
  .case-study .project-meta { gap: 1.5rem; }
  .case-study .project-meta dd { font-size: .8125rem; }
  .case-study .chapter-nav-inner { gap: 1.5rem; }
  .case-study .hero-figure figcaption { flex-direction: row; }
  .identity-story .chapter-heading { grid-template-columns: 1fr; gap: .5rem; }
  .identity-story .chapter-number { padding-top: 0; }
  .identity-story .chapter-heading h2 { font-size: var(--font-heading); }
  .case-study .related-case-inner { grid-template-columns: 1fr; }
  .case-study .related-case-visual { max-width: 38rem; justify-self: stretch; aspect-ratio: 4 / 3; }
}
