:root {
  color-scheme: dark;
  --bg: #05050d;
  --surface: #101014;
  --surface-raised: #17171e;
  --text: #f3f1f7;
  --muted: #aaa6b5;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #8f6ee8;
  --accent-bright: #b49aff;
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 72px);
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: Inter, Montserrat, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 17%, rgba(94, 55, 196, 0.2), transparent 31rem),
    radial-gradient(circle at 87% 74%, rgba(59, 42, 133, 0.15), transparent 27rem),
    var(--bg);
  font-family: var(--body);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--accent-bright);
  outline-offset: 4px;
}

.case-header,
.case-hero,
.case-details,
.case-footer {
  width: min(calc(100% - (var(--gutter) * 2)), var(--container));
  margin-inline: auto;
}

.case-header {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.case-logo {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.case-back {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: color 180ms ease;
}

.case-back:hover {
  color: var(--text);
}

.case-hero {
  display: grid;
  min-height: 660px;
  grid-template-columns: minmax(0, 0.94fr) minmax(420px, 1.06fr);
  align-items: center;
  gap: clamp(44px, 7vw, 96px);
  padding-block: 74px 112px;
}

.case-kicker {
  margin: 0 0 18px;
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.case-hero h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 4.2vw, 64px);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-wrap: balance;
}

.case-lead {
  max-width: 680px;
  margin: 28px 0 0;
  color: #c8c4d0;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.65;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.case-tags li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d7d3df;
  font-size: 12px;
  font-weight: 650;
}

.case-tags .case-tag--dashboard {
  border-color: rgba(255, 103, 119, 0.5);
  background: rgba(255, 76, 96, 0.12);
  color: #ff8a99;
}

.case-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: clamp(28px, 4vw, 54px);
  background: var(--surface);
  box-shadow: 0 34px 100px rgba(55, 33, 125, 0.24);
}

.case-media--image {
  aspect-ratio: 16 / 10;
}

.case-media--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-media figcaption {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 3;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #ded9e8;
  background: rgba(5, 5, 13, 0.72);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  backdrop-filter: blur(12px);
}

.case-cover {
  --cover-accent: #8f6ee8;
  position: relative;
  display: flex;
  min-height: 440px;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(32px, 5vw, 64px);
  overflow: hidden;
  background:
    linear-gradient(155deg, transparent 22%, color-mix(in srgb, var(--cover-accent) 38%, transparent)),
    #111116;
}

.case-cover::before,
.case-cover::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.case-cover::before {
  top: -18%;
  right: -14%;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--cover-accent) 70%, white 10%);
  border-radius: 36% 64% 58% 42%;
  transform: rotate(18deg);
}

.case-cover::after {
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.case-cover-label,
.case-cover strong,
.case-cover small {
  position: relative;
  z-index: 2;
}

.case-cover-label {
  align-self: flex-start;
  margin-bottom: auto;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--cover-accent) 58%, white 12%);
  border-radius: 999px;
  color: #e4def5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-cover strong {
  max-width: 88%;
  margin-bottom: 12px;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 62px);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.case-cover small {
  max-width: 75%;
  color: #d0cbd9;
  font-size: 15px;
}

.case-cover-diagram {
  position: absolute;
  top: 25%;
  right: 9%;
  z-index: 1;
  display: grid;
  width: 42%;
  gap: 10px;
  transform: rotate(-7deg);
}

.case-cover-diagram i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cover-accent) 55%, transparent);
  box-shadow: 0 0 34px color-mix(in srgb, var(--cover-accent) 42%, transparent);
}

.case-cover-diagram i:nth-child(1) { width: 100%; }
.case-cover-diagram i:nth-child(2) { width: 72%; }
.case-cover-diagram i:nth-child(3) { width: 48%; }

.case-cover--emerald { --cover-accent: #38b997; }
.case-cover--cyan { --cover-accent: #4fbcdd; }
.case-cover--amber { --cover-accent: #d79843; }
.case-cover--rose { --cover-accent: #ca638f; }
.case-cover--slate { --cover-accent: #7184a9; }
.case-cover--blue { --cover-accent: #527fd7; }
.case-cover--violet { --cover-accent: #8f6ee8; }

.case-details {
  padding-bottom: 120px;
}

.case-facts {
  display: grid;
  grid-template-columns: 1.4fr 0.55fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--line);
}

.case-facts div {
  min-width: 0;
  padding: 24px 26px;
  background: var(--surface);
}

.case-facts span,
.case-facts strong {
  display: block;
}

.case-facts span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-facts strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  font-weight: 750;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.button:hover {
  border-color: rgba(180, 154, 255, 0.7);
  background: rgba(143, 110, 232, 0.11);
  transform: translateY(-2px);
}

.button--primary {
  border-color: transparent;
  background: var(--accent);
  color: white;
}

.button--primary:hover {
  background: #9a7aed;
}

.case-story {
  max-width: 780px;
  margin: 112px auto 0;
}

.case-story h2 {
  margin: 52px 0 17px;
  font-family: var(--display);
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.case-story p {
  margin: 0 0 26px;
  color: #c1bdca;
  font-size: 17px;
  line-height: 1.8;
}

.case-story ul {
  display: grid;
  gap: 12px;
  margin: 0 0 30px;
  padding: 0;
  list-style: none;
}

.case-story li {
  position: relative;
  padding-left: 24px;
  color: #c8c4d0;
  font-size: 17px;
  line-height: 1.65;
}

.case-story li::before {
  position: absolute;
  top: 0.72em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(143, 110, 232, 0.75);
  content: "";
}

.source-note {
  margin-top: 56px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  line-height: 1.65;
}

.case-footer {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.case-footer p {
  margin: 0;
}

.case-footer a {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 899px) {
  .case-hero {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 50px;
    padding-block: 44px 84px;
  }

  .case-media {
    width: min(100%, 680px);
  }

  .case-cover {
    min-height: 390px;
  }

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

  .case-facts div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 599px) {
  .case-header {
    min-height: 72px;
  }

  .case-logo {
    font-size: 14px;
  }

  .case-back {
    font-size: 12px;
  }

  .case-hero {
    gap: 38px;
    padding-block: 34px 66px;
  }

  .case-hero h1 {
    font-size: clamp(34px, 11vw, 48px);
    line-height: 1.02;
  }

  .case-lead {
    margin-top: 22px;
    font-size: 15px;
  }

  .case-media {
    border-radius: 30px;
  }

  .case-cover {
    min-height: 330px;
    padding: 30px;
  }

  .case-cover strong {
    max-width: 100%;
    font-size: clamp(30px, 10vw, 42px);
  }

  .case-cover small {
    max-width: 90%;
  }

  .case-media figcaption {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    font-size: 9px;
  }

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

  .case-facts div:first-child {
    grid-column: auto;
  }

  .case-actions {
    display: grid;
  }

  .case-story {
    margin-top: 76px;
  }

  .case-story p,
  .case-story li {
    font-size: 15px;
  }

  .case-footer {
    min-height: 150px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
