/* ──────────────────────────────────────────────────────────────────────── *
 * Case study — cinematic full-page view (direct navigation).
 *
 * The same HTML is parsed by the overlay reader on the home page; these
 * styles only apply when the user opens a .html file directly.
 * ──────────────────────────────────────────────────────────────────────── */

body.case-study-page {
  background: #f3f3f0;
  color: #0a0a0a;
  min-height: 100vh;
}

html.dark body.case-study-page,
body.case-study-page.dark {
  background: #0f0f0f;
  color: #e8e8e8;
}

.case-study {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Back control — circular chevron, floating top-left */
.case-back {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #0a0a0a;
  text-decoration: none;
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 6px 18px rgba(0, 12, 20, 0.08);
  transition: background 0.25s ease, transform 0.25s ease;
}

.case-back:hover {
  background: #fff;
  color: #000;
  text-decoration: none;
  transform: translateY(-1px);
}

html.dark .case-back,
body.dark .case-back {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f4f4f5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

html.dark .case-back:hover,
body.dark .case-back:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.case-back svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Hero */
.case-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 78vh;
  min-height: 460px;
  max-height: 820px;
  overflow: hidden;
}

.case-hero-media {
  position: absolute;
  inset: 0;
  z-index: -10;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-hero-media--fit {
  object-fit: contain;
  background: #eceef1;
}

.case-hero::before,
.case-hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  z-index: -5;
  pointer-events: none;
}

/* Top-down scrim so the back link reads */
.case-hero::before {
  top: 0;
  height: 160px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

/* Bottom-up scrim that fades into the page background */
.case-hero::after {
  bottom: 0;
  height: 70%;
  background: linear-gradient(to top, #0a0a0a 0%, rgba(10, 10, 10, 0.7) 40%, transparent 100%);
}

.case-study-content {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: 40px;
}

.case-hero-inner {
  position: relative;
  z-index: 1;
  padding-bottom: 56px;
}

.case-hero-title {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: #ffffff;
  max-width: 20ch;
  text-wrap: balance;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  margin: 0;
}

.case-hero-tagline {
  margin-top: 16px;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  color: rgba(228, 228, 231, 0.9);
  max-width: 60ch;
  text-wrap: balance;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

/* Body */
.case-body {
  background: #0a0a0a;
  padding-block: 64px 96px;
}

.case-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.case-section + .case-section {
  margin-top: 64px;
}

.case-section h2 {
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fafafa;
  margin: 0;
}

.case-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #fafafa;
  margin: 0;
}

.case-section p {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(228, 228, 231, 0.9);
  margin: 0;
}

.case-section p + p {
  margin-top: 16px;
}

.case-section ul,
.case-section ol {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(228, 228, 231, 0.9);
  padding-left: 20px;
}

.case-section ul li,
.case-section ol li {
  margin-top: 8px;
}

.case-section ul li::marker,
.case-section ol li::marker {
  color: rgba(161, 161, 170, 0.65);
}

.case-section a {
  color: #38bdf8;
  text-underline-offset: 2px;
}

.case-section a:hover {
  color: #7dd3fc;
}

.case-section blockquote {
  margin: 8px 0 0;
  padding-left: 20px;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(228, 228, 231, 0.85);
  font-style: italic;
}

.case-section blockquote p {
  margin: 0;
}

.case-section img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  margin-top: 8px;
}

@media (max-width: 640px) {
  .case-back {
    top: 16px;
    left: 16px;
  }

  .case-study-content {
    padding-inline: 24px;
  }

  .case-hero-inner {
    padding-bottom: 40px;
  }

  .case-body {
    padding-block: 48px 80px;
  }

  .case-section + .case-section {
    margin-top: 48px;
  }
}
