/* Acessio case studies · shared visual system, 2026-08-23 */

.case-study {
  --case-surface: #ddf8fa;
  --case-surface-alt: #ecf9db;
  --case-ink: #0e0e11;
  overflow: clip;
}

.case-study--purple { --case-surface: #eae7ff; }
.case-study--green { --case-surface: #ecf9db; }

.case-study__hero {
  min-height: 100svh;
  padding-top: clamp(150px, 14vw, 220px);
  padding-bottom: clamp(90px, 10vw, 150px);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  gap: clamp(52px, 7vw, 110px);
  align-items: center;
}

.case-study__back {
  display: inline-flex;
  margin-bottom: 30px;
  border-bottom: 1px solid currentColor;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.case-study__eyebrow {
  margin-bottom: 20px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.case-study__title {
  max-width: 12ch;
  font-size: clamp(48px, 4.6vw, 74px);
  line-height: .98;
  letter-spacing: -.055em;
  hyphens: none;
  text-wrap: balance;
}

.case-study__lead {
  max-width: 51ch;
  margin-top: 30px;
  color: var(--ink-2);
  font-size: clamp(18px, 1.5vw, 23px);
  line-height: 1.58;
  text-wrap: pretty;
}

.case-study__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.case-study__visual {
  position: relative;
  min-height: clamp(470px, 50vw, 690px);
  isolation: isolate;
}

.case-study__visual::before,
.case-study__visual::after {
  content: "";
  position: absolute;
  z-index: -2;
}

.case-study__visual::before {
  inset: 4% 16% 24% 4%;
  background: var(--case-surface);
  transform: rotate(-5deg);
}

.case-study__visual::after {
  inset: 42% 0 0 31%;
  background: var(--case-surface-alt);
  transform: rotate(7deg);
}

.case-study__screen {
  position: absolute;
  z-index: 1;
  inset: 7% -4% 14% 0;
  overflow: hidden;
  border: 1px solid rgba(25, 25, 28, .13);
  background: #fff;
  box-shadow: 0 30px 80px rgba(25, 25, 28, .17);
  transform: perspective(1400px) rotateY(-6deg) rotateZ(1.7deg);
  transform-origin: center;
}

.case-study__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.case-study__ticket {
  position: absolute;
  z-index: 3;
  left: -5%;
  bottom: 2%;
  width: min(390px, 72%);
  padding: clamp(24px, 3vw, 38px);
  background: var(--case-ink);
  color: var(--canvas);
  box-shadow: 0 28px 60px rgba(14, 14, 17, .22);
}

.case-study__ticket-label {
  margin-bottom: 14px;
  color: #22c7d6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.case-study__ticket-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.02;
  text-wrap: balance;
}

.case-study__ticket-sub {
  margin-top: 16px;
  color: rgba(243, 241, 240, .68);
  font-size: 14px;
}

.case-study__badge {
  display: inline-flex;
  margin-top: 18px;
  padding: 6px 9px 5px;
  border: 1px solid rgba(243, 241, 240, .35);
  color: var(--canvas);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.case-study__toc {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.case-study__toc a {
  min-height: 74px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .11em;
  text-align: center;
  text-transform: uppercase;
}

.case-study__toc a:last-child { border-right: 0; }
.case-study__toc a:hover { background: var(--case-surface); }

.case-study > .section--tight {
  padding-top: clamp(70px, 8vw, 118px);
}

.case-study .fallbild {
  border-color: color-mix(in srgb, var(--case-surface) 55%, var(--line));
  box-shadow: 0 24px 70px rgba(25, 25, 28, .09);
}

.case-study .section[id] {
  scroll-margin-top: 110px;
}

.case-study .section[id] > .stack-lg {
  position: relative;
}

.case-study .section[id] > .stack-lg::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -18px;
  left: -24px;
  width: clamp(112px, 13vw, 190px);
  height: clamp(40px, 5vw, 68px);
  background: var(--case-surface);
}

@media (max-width: 980px) {
  .case-study__hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 150px;
  }

  .case-study__copy { max-width: 760px; }
  .case-study__visual { min-height: min(680px, 76vw); }
  .case-study__screen { inset: 4% 2% 13% 5%; }
  .case-study__ticket { left: 1%; }
}

@media (max-width: 640px) {
  .case-study__hero {
    padding-top: 118px;
    padding-bottom: 76px;
    gap: 54px;
  }

  .case-study__back { margin-bottom: 24px; }
  .case-study__title { font-size: clamp(42px, 11vw, 54px); }
  .case-study__lead { font-size: 18px; }
  .case-study__actions .btn { width: 100%; justify-content: center; }
  .case-study__visual { min-height: 500px; }
  .case-study__screen { inset: 3% 1% 20% 4%; }
  .case-study__ticket { left: 0; bottom: 0; width: min(300px, 82%); }

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

  .case-study__toc a:nth-child(2) { border-right: 0; }
  .case-study__toc a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .case-study__toc a { min-height: 64px; padding: 20px 10px; font-size: 10px; }
}

@media (prefers-reduced-motion: no-preference) {
  .case-study__screen { animation: case-screen-enter 900ms var(--ease) both; }
  .case-study__ticket { animation: case-ticket-enter 900ms 120ms var(--ease) both; }
}

@keyframes case-screen-enter {
  from { opacity: 0; transform: perspective(1400px) rotateY(-11deg) rotateZ(4deg) translateY(30px); }
}

@keyframes case-ticket-enter {
  from { opacity: 0; transform: translateY(26px); }
}
