/* Plyn's centered project sheet, with the existing project content inside. */
html[data-theme] body.portfolio-page.plyn-case-page {
  --paper: #121212;
  --ink: #fafafa;
  --muted: #8f8f8f;
  --accent: #fafafa;
  --gutter: 14px;
  --case-header-height: 52px;
  margin: 0;
  min-height: 100svh;
  background: #121212;
  color: #fafafa;
  font-family: 'Test Untitled Sans', Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color-scheme: dark;
}
html[data-theme="dark"] body.portfolio-page.plyn-case-page {
  --paper: #f0f0f0;
  --ink: #121212;
  --accent: #121212;
  background: #f0f0f0;
  color: #121212;
  color-scheme: light;
}
.plyn-case-page .pf-main.plyn-case-main {
  box-sizing: border-box;
  width: 100%;
  min-height: 100svh;
  padding: max(var(--case-header-height), 10vw) 0 24px;
  margin: 0;
}
.plyn-case-main > .plyn-case-nav,
.plyn-case-main > .pf-case.plyn-case-panel {
  box-sizing: border-box;
  width: 80%;
  min-width: 960px;
  margin-inline: auto;
}
.plyn-case-nav {
  position: sticky;
  top: var(--case-header-height);
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 14px/20px 'Test Untitled Sans', Arial, sans-serif;
}
.plyn-case-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: inherit;
  font: inherit;
  text-decoration: none;
  transition: opacity 160ms ease;
}
.plyn-case-nav a:hover { opacity: .6; }
.plyn-case-nav a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.plyn-case-nav u { text-underline-offset: 2px; }
.plyn-case-nav a span { color: #8f8f8f; }
.plyn-case-nav-end { position: static; }
.plyn-case-page .site-header { height: var(--case-header-height); }
/* Use the Work palette for the expanded mobile menu. */
html[data-theme] .portfolio-page.plyn-case-page .pf-mobile-menu {
  --paper: #fafafa;
  --ink: #121212;
  --accent: var(--ink);
  --muted: #636363;
  color: var(--ink);
  background: var(--paper);
}
html[data-theme="dark"] .portfolio-page.plyn-case-page .pf-mobile-menu {
  --paper: #121212;
  --ink: #fafafa;
  --muted: #aaa;
}
.plyn-case-pagination { display: flex; align-items: center; gap: 14px; }
.plyn-case-page .pf-case.plyn-case-panel {
  --paper: #fafafa;
  --ink: #1a1a1a;
  --muted: #646464;
  --accent: #1a1a1a;
  --rule: #dedede;
  --media-surface: #eee;
  --rt1122-media-inset: 0px;
  position: relative;
  min-height: 0;
  padding: 0;
  background: #fafafa;
  color: #1a1a1a;
  border-radius: 0;
  color-scheme: light;
}
.plyn-case-panel, .plyn-case-panel *, .plyn-case-panel *::before, .plyn-case-panel *::after { box-sizing: border-box; }
html[data-theme="dark"] .plyn-case-page .pf-case.plyn-case-panel {
  --paper: #121212;
  --ink: #f0f0f0;
  --muted: #aaa;
  --accent: #f0f0f0;
  --rule: #414141;
  background: #121212;
  color: #f0f0f0;
  color-scheme: dark;
}
.plyn-case-panel .plyn-case-intro {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  margin: 0;
  font: 400 14px/20px 'Test Untitled Sans', Arial, sans-serif;
}
.plyn-case-intro :is(.plyn-case-title, .plyn-case-copy) { min-width: 0; }
.plyn-case-title .case-version-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.plyn-case-panel .plyn-case-title h1 {
  position: static;
  inset: auto;
  margin: 0;
  padding: 0;
  transform: none;
  max-width: none;
  color: var(--ink);
  font: 500 14px/20px 'Test Untitled Sans', Arial, sans-serif;
  letter-spacing: 0;
  outline: none;
}
.plyn-case-panel .plyn-case-title :is(.byline, .plyn-case-byline) {
  margin: 0;
  color: var(--muted);
  font: inherit;
}
.plyn-case-panel .plyn-case-description { max-width: 68ch; font-size: 16px; line-height: 1.5; }
.plyn-case-panel .plyn-case-description p { margin: 0; font: inherit; }
.plyn-case-panel .plyn-case-description > p + p { margin-top: 8px; }
.plyn-case-panel .plyn-case-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 14px 0 0;
  padding: 0;
  font: inherit;
}
.plyn-case-meta > div { display: block; }
.plyn-case-panel .plyn-case-meta :is(dt, dd) { display: inline; margin: 0; padding: 0; font: inherit; color: var(--muted); }
.plyn-case-panel .plyn-case-meta dt { margin-right: 4px; }
.plyn-case-panel .plyn-case-copy :is(.pf-reference-credit, .plyn-case-credit) {
  margin: 14px 0 0;
  color: var(--muted);
  font: inherit;
  text-transform: none;
}
.plyn-case-panel .plyn-case-copy a { color: inherit; text-underline-offset: 2px; }
.plyn-case-panel dl.plyn-case-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0 0; }
.plyn-case-panel .plyn-case-results > div { display: flex; flex-direction: column; min-width: 0; }
.plyn-case-panel .plyn-case-results dd { order: -1; margin: 0; color: var(--ink); font: 400 28px/36px 'OlderNew TRIAL', Georgia, serif; }
.plyn-case-panel .plyn-case-results dt { margin: 0; color: var(--muted); font: 400 12px/16px 'Test Untitled Sans', Arial, sans-serif; }
.plyn-case-panel .plyn-case-story { margin-top: 14px; }
.plyn-case-panel .plyn-case-story summary { width: max-content; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.plyn-case-panel .plyn-case-story :is(h2, h3) { margin: 14px 0 8px; font: 500 14px/20px 'Test Untitled Sans', Arial, sans-serif; }
.plyn-case-panel .plyn-case-story p { margin: 8px 0 0; font: inherit; }
.plyn-case-panel .plyn-case-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  margin: 0;
  color: var(--ink);
}
.plyn-case-panel .plyn-case-content > .pf-project-hero {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: var(--ratio, 4 / 3);
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #eee;
}
.plyn-case-panel .plyn-case-content > .pf-project-hero > :is(img, video) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.plyn-case-panel .plyn-case-content > .pf-case-gallery {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
}
.plyn-case-panel .pf-case-gallery:not(.pf-rich-story):not(.dw-editorial-story) { display: flex; flex-direction: column; gap: 1px; }
.plyn-case-panel .pf-case-media,
.plyn-case-panel .pf-case-media.is-flush { gap: 1px; margin: 0; padding: 0; }
.plyn-case-panel .pf-case-media figure { margin: 0; min-width: 0; border-radius: 0; }
.plyn-case-panel .pf-case-media figure > :is(img, video) { object-fit: contain; }
.plyn-case-panel .pf-case-carousel { margin: 0; }
.plyn-case-panel header { background: transparent; }

/* Image-led projects follow the reference's two-column, one-pixel gallery. */
.plyn-case-panel .plyn-case-content:not(:has(.pf-rich-story, .dw-editorial-story)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1px;
}
.plyn-case-panel .plyn-case-content:not(:has(.pf-rich-story, .dw-editorial-story)) > .pf-case-gallery,
.plyn-case-panel .plyn-case-content:not(:has(.pf-rich-story, .dw-editorial-story)) > .pf-case-gallery > .pf-case-media {
  display: contents;
}
.plyn-case-panel .plyn-case-content:not(:has(.pf-rich-story, .dw-editorial-story)) .pf-case-carousel { grid-column: 1 / -1; }
.plyn-case-panel .plyn-case-content:not(:has(.pf-rich-story, .dw-editorial-story)) .pf-case-media figure {
  width: 100%;
  height: auto;
  aspect-ratio: var(--ratio, 4 / 3);
  background: var(--media-surface);
}

.plyn-case-panel .plyn-case-content.plyn-case-content-single {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.curated-case-story {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.curated-case-story .curated-case-image { margin: 0; }
.curated-case-image > :is(img, video) { display: block; width: 100%; height: auto; }
.curated-case-text {
  display: grid;
  grid-template-columns: minmax(0, 714fr) minmax(0, 528fr);
  align-items: start;
  column-gap: 8%;
  padding: 42px 64px 10px;
}
.curated-case-text :is(h2, h3) {
  margin: 0;
  font: 400 clamp(22px, 2vw, 28px)/1.2 'OlderNew TRIAL', Georgia, serif;
}
.curated-case-text p { margin: 0; font: 400 16px/1.5 'Test Untitled Sans', Arial, sans-serif; }
.curated-case-text p + p { margin-top: 1em; }
.tapnow-story .tapnow-chapter {
  padding: clamp(24px, 5.75vw, 86px) clamp(14px, 4.3vw, 64px);
  background: #2b2b2b;
  color: #fafafa;
}
.tapnow-chapter h2 {
  margin: 14px 0;
  font: 400 clamp(23px, 2.1vw, 30px)/1.2 'OlderNew TRIAL', Georgia, serif;
}
.tapnow-chapter p {
  max-width: 1000px;
  margin: 0;
  font: 400 16px/1.5 'Test Untitled Sans', Arial, sans-serif;
}
.tapnow-chapter .curated-case-image, .tapnow-diagram { margin-top: 24px; }
.tapnow-diagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: clamp(12px, 2.2vw, 36px);
}
.tapnow-diagram img { display: block; width: 100%; height: auto; }
@media (max-width: 809px) {
  .curated-case-text { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 24px 12px 8px; }
}

/* Preserve the authored Dotwise stage compositions and chapter layouts. */
.plyn-case-panel .plyn-case-content > .pf-project-hero.dw-composed-hero { border-radius: 0; }
.plyn-case-panel .plyn-case-content > .pf-project-hero.dw-product-stage {
  display: grid;
  place-items: center;
  aspect-ratio: 8 / 5;
  border-radius: 0;
  background: var(--dw-stage-art) center / cover no-repeat #d8dfe5;
}
.plyn-case-panel .dw-product-stage .dw-product-window { width: 62.5%; }
.plyn-case-panel .pf-case-gallery.dw-editorial-story { padding-top: 48px; }
.plyn-case-panel .dw-editorial-copy { font-size: 15px; line-height: 1.5; }

/* RichTap's story owns its layouts; the enclosing sheet adds its only outer inset. */
.plyn-case-panel .pf-case-gallery.pf-rich-story { --story-inset: 0px; }
.plyn-case-panel.rt1122-case .rt-1122 { width: 100%; margin: 0; }
.rt1122-end-followup h2 { overflow-wrap: anywhere; }

@media (max-width: 1023px) {
  html[data-theme] body.portfolio-page.plyn-case-page { --case-header-height: 68px; }
}

@media (min-width: 810px) and (max-width: 1199px) {
  .plyn-case-page .pf-main.plyn-case-main { padding-inline: 52px; }
  .plyn-case-main > .plyn-case-nav,
  .plyn-case-main > .pf-case.plyn-case-panel { width: 100%; min-width: 0; max-width: 960px; }
}
@media (max-width: 809px) {
  .plyn-case-page .pf-main.plyn-case-main { padding: var(--case-header-height) 14px 14px; }
  .plyn-case-main > .plyn-case-nav,
  .plyn-case-main > .pf-case.plyn-case-panel { width: 100%; min-width: 0; max-width: none; }
  .plyn-case-panel .plyn-case-intro { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .plyn-case-nav a span { display: none; }
  .plyn-case-panel .pf-case-media.is-pair { grid-template-columns: minmax(0, 1fr); }
  .plyn-case-panel .pf-case-gallery.dw-editorial-story { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .plyn-case-nav a { transition: none; }
}
