.case {
  --pad: clamp(1.25rem, 5vw, 4rem);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sticky-offset: 1.5rem;
}
 
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
 
/* ===== Kopf ===== */
.case .case-hero {
  padding-block: clamp(1rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
 
.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
 
.back-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
 
.case-hero h1 {
  font-size: clamp(2.75rem, 10vw, 7rem);
  line-height: 0.95;
}
 
.case-lead {
  max-width: 40rem;
  margin: 0.75rem 0 0;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  line-height: 1.4;
}
 
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 1rem 1.5rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) 0;
  padding-top: 1.1rem;
  border-top: 1.5px solid var(--color-text);
}
 
.case-meta dt {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.05rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-sun);
  border-radius: 3px;
}
 
.case-meta dd {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}
 
/* ===== Frames (Screens wie in Figma) ===== */
.frame {
  margin: 2rem 0;
}
 
.case-hero .frame {
  margin-bottom: 0;
}
 
.frame-name {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
 
.frame-media {
  position: relative;
}
 
.frame-media img,
.frame-media video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-text);
  border: 1.5px solid var(--color-text);
  border-radius: 10px;
}
 
/* Auswahl beim Hovern, mit echter Größe darunter */
.frame-media:hover img,
.frame-media:hover video {
  outline: 1.5px solid var(--color-select);
  outline-offset: 4px;
}
 
.frame-media::after {
  content: attr(data-size);
  position: absolute;
  bottom: calc(100% + 0.35rem);
  right: 0;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  color: #FFFFFF;
  background: var(--color-select);
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
}
 
.frame-media:hover::after {
  opacity: 1;
}
 
.frame figcaption {
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}
 
/* ===== Layout: Ebenen-Panel + Inhalt ===== */
.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
 
.layers-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
 
.layers-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.9rem;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 4px;
}
 
.layers-list a:hover {
  background: rgba(31, 110, 153, 0.12);
}
 
.layers-list a.is-active {
  color: #FFFFFF;
  background: var(--color-select);
}
 
.layers-icon {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
 
.layers-list a.is-active .layers-icon {
  color: inherit;
}
 
.layers-title {
  margin: 0 0 0.4rem;
  padding-inline: 0.55rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
 
/* Handy und Tablet: Leiste oben, Liste zum Aufklappen */
@media (max-width: 999px) {
  .case {
    --sticky-offset: 4rem;
  }
 
  .layers {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-inline: calc(var(--pad) * -1);
    padding: 0.6rem var(--pad);
    background: var(--color-bg);
    border-block: 1.5px solid var(--color-text);
  }
 
  .layers-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.35rem 0.55rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: inherit;
    text-align: left;
    background: var(--color-surface);
    border: 1.5px solid var(--color-text);
    border-radius: 6px;
    cursor: pointer;
  }
 
  .layers-toggle:focus-visible {
    outline: 2px solid var(--color-select);
    outline-offset: 2px;
  }
 
  .layers-current {
    flex: 1;
  }
 
  .layers-chevron {
    transition: transform 0.2s ease;
  }
 
  .layers.is-open .layers-chevron {
    transform: rotate(180deg);
  }
 
  .layers-title {
    display: none;
  }
 
  .layers-list {
    display: none;
    margin-top: 0.5rem;
  }
 
  .layers.is-open .layers-list {
    display: block;
  }
}
 
/* Desktop: Panel links, läuft beim Scrollen mit */
@media (min-width: 1000px) {
  .case-layout {
    grid-template-columns: 13rem minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
  }
 
  .layers {
    position: sticky;
    top: var(--sticky-offset);
    margin-top: clamp(2rem, 5vw, 3.5rem);
    padding: 0.7rem 0.5rem;
    background: var(--color-surface);
    border: 1.5px solid var(--color-text);
    border-radius: 10px;
  }
 
  .layers-toggle {
    display: none;
  }
}
 
/* ===== Abschnitte ===== */
.case .case-section {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1.5px solid var(--color-text);
  scroll-margin-top: var(--sticky-offset);
}
 
.case-layout .case-section:first-child {
  border-top: 0;
}
 
.case-section h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  line-height: 1.05;
}
 
.section-num {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text-muted);
}
 
.case-text {
  max-width: 40rem;
}
 
.case-text p {
  margin: 0 0 1rem;
}
 
.case-text p:last-child {
  margin-bottom: 0;
}
 
.case-text h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.1;
}
 
.case-text h3:first-child {
  margin-top: 0;
}
 
.case-text code {
  padding: 0.05rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface);
  border: 1px solid var(--color-grid);
  border-radius: 4px;
}
 
.case-text cite {
  font-style: italic;
}
 
/* ===== Nutzertest: Befunde ===== */
.findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: finding;
}
 
.findings li {
  padding: 1rem 1.1rem 1.1rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-text);
  border-radius: 10px;
  counter-increment: finding;
}
 
.findings li::before {
  content: "0" counter(finding);
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-signal);
}
 
.finding-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
 
.findings p {
  margin: 0.15rem 0 0.7rem;
  font-size: 0.95rem;
  line-height: 1.4;
}
 
.findings p:last-child {
  margin-bottom: 0;
}
 
/* ===== Nächstes Projekt ===== */
.next-project {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1.5px solid var(--color-text);
}
 
.next-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
}
 
.next-project a {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
  text-decoration: none;
}
 
.next-project a:hover {
  color: var(--color-signal);
}
 
/* ===== Handy: etwas kleinerer Fließtext ===== */
@media (max-width: 640px) {
  .case {
    font-size: 1rem;
    line-height: 1.55;
  }
}
 
@media (prefers-reduced-motion: reduce) {
  .layers-chevron {
    transition: none;
  }
}