:root {
  --case-panel: rgba(7, 16, 27, 0.82);
  --case-panel-strong: rgba(9, 22, 35, 0.94);
  --case-line: rgba(255, 255, 255, 0.1);
  --case-cyan: #55e6ee;
  --case-text: #f4f7fb;
  --case-muted: #b9c4cf;
  --case-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

html {
  scroll-padding-top: 104px;
}

body.case-detail-page {
  overflow-x: hidden;
  color: var(--case-text);
  background:
    radial-gradient(circle at 16% 0%, rgba(0, 220, 255, 0.13), transparent 28%),
    radial-gradient(circle at 100% 100%, rgba(0, 95, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #050a11 0%, #07111c 52%, #050a11 100%);
}

.case-page {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 96px;
}

.case-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.case-hero,
.case-section {
  border: 1px solid var(--case-line);
  border-radius: 26px;
  background: var(--case-panel);
  box-shadow: var(--case-shadow);
}

.case-hero {
  display: grid;
  gap: 28px;
  padding: 40px 42px;
  background:
    linear-gradient(135deg, rgba(85, 230, 238, 0.13), transparent 44%),
    rgba(6, 13, 22, 0.88);
}

.case-hero-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: start;
}

.case-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: start;
}

.case-hero-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 18px;
}

.case-logo {
  width: clamp(54px, 5vw, 78px);
  height: auto;
  border-radius: 18px;
}

.case-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: fit-content;
  margin: 0;
  color: var(--case-cyan);
  font-size: 13px;
  font-weight: 900;
}

.case-breadcrumb span {
  color: rgba(230, 247, 255, 0.62);
}

.case-hero h1 {
  max-width: 1060px;
  margin: 0;
  color: #f8fbff;
  font-size: clamp(34px, 4.8vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.case-subtitle {
  max-width: 1040px;
  margin: 2px 0 0;
  color: #e7f6fb;
  font-size: clamp(18px, 1.7vw, 25px);
  line-height: 1.36;
  font-weight: 850;
}

.case-lead {
  max-width: 1060px;
  margin: 0;
  color: #d8e2ec;
  font-size: clamp(15px, 1.12vw, 18px);
  line-height: 1.62;
}

.case-section {
  margin-top: 28px;
  padding: 38px 40px 42px;
}

.case-section-title {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(21px, 2vw, 31px);
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-section-lead {
  max-width: 980px;
  margin: 0 0 24px;
  color: var(--case-muted);
  font-size: 15px;
  line-height: 1.62;
}

.case-context-grid,
.case-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.case-context-card,
.case-info-card,
.case-intro-card {
  border: 1px solid rgba(85, 230, 238, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(85, 230, 238, 0.08), transparent 52%),
    var(--case-panel-strong);
}

.case-context-card,
.case-info-card {
  padding: 28px;
}

.case-context-card strong,
.case-info-card strong {
  display: block;
  margin-bottom: 18px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-context-card p,
.case-info-card p,
.case-intro-card p {
  margin: 0;
  color: var(--case-muted);
  font-size: 15px;
  line-height: 1.62;
}

.case-intro-card {
  padding: 26px;
}

.case-intro-card p + p {
  margin-top: 18px;
}

.case-video-frame {
  position: relative;
  width: min(100%, 1040px);
  aspect-ratio: 16 / 9;
  margin: 18px auto 0;
  overflow: hidden;
  border: 1px solid rgba(85, 230, 238, 0.22);
  border-radius: 18px;
  background: rgba(5, 10, 17, 0.56);
}

.case-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.case-limits-section {
  border-color: rgba(185, 196, 207, 0.14);
}

.case-dashboard-grid,
.case-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.case-dashboard-card,
.case-project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 26px;
  border: 1px solid rgba(85, 230, 238, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(85, 230, 238, 0.07), transparent 52%),
    var(--case-panel-strong);
  color: inherit;
  text-align: left;
}

.case-project-card {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.case-project-card:hover,
.case-project-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.82);
  background:
    linear-gradient(135deg, rgba(85, 230, 238, 0.14), transparent 50%),
    rgba(13, 30, 47, 0.98);
  box-shadow: 0 20px 48px rgba(85, 230, 238, 0.14);
  outline: none;
}

.case-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(85, 230, 238, 0.42);
  background: rgba(85, 230, 238, 0.14);
  color: #dff8ff;
  font-size: 14px;
  font-weight: 950;
}

.case-dashboard-card h3,
.case-project-card h3 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: clamp(16px, 1.15vw, 20px);
  line-height: 1.14;
  font-weight: 950;
}

.case-dashboard-card p,
.case-project-card p {
  margin: 0 0 14px;
  color: #c9d3de;
  font-size: 14px;
  line-height: 1.58;
}

.case-dashboard-card p:last-child,
.case-project-card p:last-child {
  margin-bottom: 0;
}

.case-dashboard-card img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin-top: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
}

.case-card-action {
  display: inline-flex;
  margin-top: auto;
  padding-top: 18px;
  color: var(--case-cyan);
  font-size: 13px;
  font-weight: 900;
}

.case-context-note {
  margin: 0 0 24px;
  padding: 22px 24px;
  border: 1px solid rgba(85, 230, 238, 0.24);
  border-radius: 20px;
  background: rgba(85, 230, 238, 0.10);
  color: #c4ced9;
  font-size: 16px;
  line-height: 1.6;
}

.case-context-note strong {
  color: #ffffff;
}

.case-detail-page section[aria-label="Retour page précédente"],
.case-detail-page nav[aria-label="Retour page précédente"] {
  display: flex;
  justify-content: center;
  align-items: center;
}

.case-detail-page section[aria-label="Retour page précédente"] .case-actions,
.case-detail-page section[aria-label="Retour page précédente"] .case-final-nav,
.case-detail-page section[aria-label="Retour page précédente"] .case-bottom-nav,
.case-detail-page section[aria-label="Retour page précédente"] .p2p-final-nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.case-detail-page a[data-back-previous] {
  width: auto;
  min-width: 260px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: 1px solid rgba(85, 230, 238, 0.46);
  border-radius: 999px;
  background: transparent;
  color: #eaffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
}

.case-detail-page a[data-back-previous]:hover,
.case-detail-page a[data-back-previous]:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(85, 230, 238, 0.78);
  background: rgba(85, 230, 238, 0.08);
  color: #eaffff;
  box-shadow: 0 18px 45px rgba(85, 230, 238, 0.14);
  outline: none;
}

@media (max-width: 1180px) {
  .case-page {
    width: min(100% - 36px, 1260px);
  }

  .case-context-grid,
  .case-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-dashboard-grid,
  .case-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 86px;
  }

  .case-page {
    width: calc(100% - 24px);
    padding: 46px 0 88px;
  }

  .case-actions {
    justify-content: stretch;
  }

  .case-actions .detail-action {
    width: 100%;
  }

  .case-hero,
  .case-section {
    border-radius: 20px;
    padding: 30px 22px;
  }

  .case-hero-top {
    grid-template-columns: 1fr;
  }

  .case-hero-heading {
    grid-template-columns: 1fr;
  }

  .case-hero-tools {
    justify-content: flex-start;
    gap: 14px;
  }

  .case-logo {
    width: 58px;
  }

  .case-context-grid,
  .case-card-grid,
  .case-dashboard-grid,
  .case-project-grid {
    grid-template-columns: 1fr;
  }

  .case-detail-page a[data-back-previous] {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 14px;
    white-space: normal;
  }
}
