:root {
  color-scheme: light;
  --bg: #efeee8;
  --ink: #101214;
  --muted: #43484f;
  --line: #101214;
  --panel: rgba(255, 255, 255, 0.32);
  --soft: rgba(16, 18, 20, 0.05);
  --accent: #716b3c;
  --max: 1240px;
  --pad: clamp(20px, 4vw, 48px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1d21;
  --ink: #f2f3f5;
  --muted: #c1c7d0;
  --line: rgba(242, 243, 245, 0.78);
  --panel: rgba(31, 34, 38, 0.9);
  --soft: rgba(242, 243, 245, 0.06);
  --accent: #d0c98a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", sans-serif;
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
}

.case-shell {
  max-width: var(--max);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.case-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-brand {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.case-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.case-nav a {
  text-decoration: none;
  opacity: 0.82;
}

.case-nav a:hover,
.case-nav a:focus-visible {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  opacity: 0.72;
}

.case-hero {
  padding: clamp(44px, 8vw, 100px) var(--pad) clamp(36px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}

.case-kicker {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-hero h1 {
  max-width: 13ch;
  font-family: "Sora", sans-serif;
  font-size: clamp(2.7rem, 7.2vw, 6.7rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.case-lede {
  max-width: 760px;
  margin-top: 28px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

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

.case-fact {
  min-height: 130px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.case-fact:last-child {
  border-right: 0;
}

.case-fact dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-fact dd {
  font-family: "Sora", sans-serif;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.4;
}

.case-section {
  display: grid;
  grid-template-columns: 220px 1fr;
  border-bottom: 1px solid var(--line);
}

.case-section-label {
  padding: 30px 20px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-copy {
  max-width: 920px;
  padding: clamp(30px, 5vw, 64px) var(--pad);
}

.case-copy h2 {
  max-width: 20ch;
  margin-bottom: 20px;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.65rem, 3.4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.case-copy h3 {
  margin: 30px 0 10px;
  font-family: "Sora", sans-serif;
  font-size: 1.08rem;
  line-height: 1.35;
}

.case-copy p {
  max-width: 74ch;
  margin-bottom: 16px;
  color: var(--muted);
}

.case-copy ul {
  max-width: 72ch;
  margin: 0 0 18px 1.2rem;
  color: var(--muted);
}

.case-copy li {
  margin-bottom: 10px;
  padding-left: 5px;
}

.case-copy strong {
  color: var(--ink);
}

.confidentiality-note {
  max-width: 76ch;
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  color: var(--muted);
  font-size: 0.9rem;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  margin: 30px 0 12px;
}

.flow-step {
  position: relative;
  min-height: 145px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--soft);
}

.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -19px;
  width: 16px;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
  transform: translateY(-50%);
}

.flow-index {
  display: block;
  margin-bottom: 26px;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.flow-step strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
  line-height: 1.3;
}

.flow-step span:last-child {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.flow-caption {
  color: var(--muted);
  font-size: 0.78rem;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.decision {
  min-height: 170px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.decision span {
  display: block;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.decision h3 {
  margin: 0 0 8px;
}

.decision p {
  margin: 0;
  font-size: 0.9rem;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.outcome {
  min-height: 150px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.outcome strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Sora", sans-serif;
  font-size: 1.02rem;
  line-height: 1.3;
}

.outcome span {
  color: var(--muted);
  font-size: 0.88rem;
}

.source-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  list-style: none;
}

.source-list li {
  margin: 0;
  padding: 0;
}

.source-list a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.source-list a:hover,
.source-list a:focus-visible {
  background: var(--soft);
}

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

.case-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.case-legal a {
  color: inherit;
  text-underline-offset: 3px;
}

.case-footer a {
  min-height: 150px;
  padding: 28px var(--pad);
  text-decoration: none;
}

.case-footer a + a {
  border-left: 1px solid var(--line);
  text-align: right;
}

.case-footer span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.case-footer strong {
  font-family: "Sora", sans-serif;
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.case-footer a:hover,
.case-footer a:focus-visible {
  background: var(--soft);
}

@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .case-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .case-nav {
    justify-content: flex-start;
  }

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

  .case-fact:nth-child(2) {
    border-right: 0;
  }

  .case-fact:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .case-section-label {
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .flow {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .flow-step {
    min-height: auto;
  }

  .flow-step:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: auto;
    bottom: -23px;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 620px) {
  .case-hero h1 {
    font-size: clamp(2.5rem, 13vw, 4.4rem);
  }

  .case-facts,
  .decision-grid,
  .outcome-grid,
  .case-footer {
    grid-template-columns: 1fr;
  }

  .case-fact {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .case-fact:last-child {
    border-bottom: 0;
  }

  .case-footer a + a {
    border-top: 1px solid var(--line);
    border-left: 0;
    text-align: left;
  }
}

@media print {
  :root,
  html[data-theme="dark"] {
    --bg: #ffffff;
    --ink: #000000;
    --muted: #2b2f33;
    --line: #000000;
    --panel: #ffffff;
    --soft: #f4f4f4;
  }

  body {
    padding: 0;
  }

  .case-shell {
    max-width: none;
    border: 0;
  }

  .theme-toggle {
    display: none;
  }

  .case-section,
  .decision,
  .outcome,
  .flow-step {
    break-inside: avoid;
  }
}
