.case-study-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% 0%, var(--project-glow), transparent 32rem),
    var(--bg);
}

.case-study-shell {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

.case-study-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.case-study-brand {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.case-study-brand span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 400;
}

.back-link,
.case-study-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--transition), transform var(--transition);
}

.back-link { color: var(--muted); background: var(--surface); }
.case-study-action { color: var(--bg); background: var(--gradient); }
.back-link:hover,
.case-study-action:hover { border-color: var(--accent-dark); transform: translateY(-2px); }

.case-study {
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.case-study-hero {
  padding: 22px;
}

.case-study-kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-study h1 {
  color: var(--text);
  font-size: clamp(30px, 7vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.case-study-lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.8;
}

.project-meta {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.project-meta li {
  padding: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.project-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-meta strong { color: var(--text); font-size: 12px; font-weight: 500; }

.case-study-content {
  display: flex;
  flex-direction: column;
  gap: 42px;
  padding: 30px 22px 38px;
  border-top: 1px solid var(--border);
}

.case-study-hero > *,
.case-study-section:not(.case-study-section-media),
.case-study-footer {
  width: min(100%, 720px);
  margin-inline: auto;
}

.case-study-section > h2 {
  margin-bottom: 16px;
  color: var(--text);
  font-size: 21px;
}

.case-study-section > p,
.case-study-section li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.75;
}

.contribution-list { display: grid; gap: 12px; }
.contribution-list li { position: relative; padding-left: 18px; }
.contribution-list li::before {
  position: absolute;
  top: 9px;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  content: "";
}

.technology-list { display: flex; flex-wrap: wrap; gap: 8px; }
.technology-list li {
  padding: 7px 11px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
}

.architecture-flow { display: grid; gap: 12px; margin-top: 18px; }
.architecture-node {
  padding: 17px;
  background: var(--card-gradient), var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.architecture-node strong { display: block; margin-bottom: 5px; color: var(--accent); font-size: 13px; }
.architecture-node span { color: var(--muted); font-size: 11px; line-height: 1.6; }

.showcase {
  padding: 22px 22px 0;
}

.showcase-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.showcase-title { color: var(--text); font-size: 21px; font-weight: 600; }
.showcase-status { color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.showcase-slider { position: relative; }
.showcase-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.showcase-track::-webkit-scrollbar { display: none; }
.showcase-slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.showcase-media {
  display: grid;
  aspect-ratio: 8 / 5;
  min-height: 220px;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 22% 18%, var(--project-glow), transparent 42%),
    linear-gradient(var(--project-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--project-grid) 1px, transparent 1px),
    var(--project-background);
  background-size: auto, 24px 24px, 24px 24px, auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.showcase-media img {
  width: 100%;
  height: 100%;
  padding: 20px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px var(--project-shadow));
}
.showcase-video {
  aspect-ratio: 16 / 9;
  min-height: 0;
}
.showcase-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.showcase-caption {
  padding: 12px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.showcase-caption strong { color: var(--text); font-weight: 500; }
.showcase-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}
.showcase-arrow {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  font-size: 19px;
}
.showcase-arrow:disabled { color: var(--muted-2); cursor: not-allowed; opacity: 0.45; }
.showcase-dots { display: flex; justify-content: center; gap: 8px; }
.showcase-dot {
  width: 9px;
  height: 9px;
  background: var(--muted-2);
  border-radius: 50%;
  cursor: pointer;
}
.showcase-dot[aria-current="true"] { background: var(--accent); transform: scale(1.25); }

.showcase-placeholder,
.video-placeholder {
  display: grid;
  min-height: 220px;
  padding: 24px;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(var(--project-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--project-grid) 1px, transparent 1px),
    var(--surface-2);
  background-size: 24px 24px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  text-align: center;
}

.showcase-placeholder ion-icon,
.video-placeholder ion-icon { margin: 0 auto 12px; color: var(--accent); font-size: 30px; }
.showcase-placeholder strong,
.video-placeholder strong { display: block; color: var(--text); font-size: 13px; font-weight: 500; }
.showcase-placeholder span,
.video-placeholder span { display: block; margin-top: 5px; font-size: 11px; line-height: 1.6; }
.video-frame { position: relative; aspect-ratio: 16 / 9; }
.video-frame iframe,
.video-frame video,
.video-frame .video-placeholder { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 14px; }

.project-note {
  padding: 16px;
  color: var(--muted);
  background: var(--surface-2);
  border-left: 3px solid var(--accent-dark);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.7;
}

.case-study-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

@media (min-width: 700px) {
  .case-study-shell { padding-top: 36px; }
  .showcase { padding: 34px 34px 0; }
  .case-study-hero { padding: 42px 34px 34px; }
  .case-study-content { padding: 44px 34px 48px; }
}

@media (min-width: 980px) {
  .showcase { padding: 46px 46px 0; }
  .case-study-hero { padding: 48px 46px 40px; }
  .case-study-content { padding: 52px 46px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .back-link,
  .case-study-action { transition: none; }
  .showcase-track { scroll-behavior: auto; }
}
