:root {
  --system-grid: rgba(18, 21, 19, 0.085);
  --system-grid-dark: rgba(223, 255, 89, 0.12);
}

.case-studies-heading {
  max-width: 66rem;
}

.case-study-list {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.case-study {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 0.75fr);
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}

.case-study-copy {
  padding: clamp(1.75rem, 4.5vw, 4.5rem);
}

.case-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.065em;
  line-height: 1.35;
  text-transform: uppercase;
}

.case-kicker span:first-child {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--blue);
  font-size: 0.68rem;
}

.case-kicker span:not(:first-child, :last-child)::after {
  margin-left: 0.9rem;
  color: var(--line-strong);
  content: "/";
}

.case-study h3 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 5.3rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.case-summary {
  max-width: 49rem;
  margin: 1.6rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.72;
}

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

.decision-trace > div {
  min-height: 9.5rem;
  padding: 1.25rem;
}

.decision-trace > div:nth-child(even) {
  border-left: 1px solid var(--line);
}

.decision-trace > div:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.decision-trace span,
.system-label,
.case-page-label,
.artifact-label {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-trace p {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.decision-trace-compact > div {
  min-height: 8.25rem;
}

.case-link {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  gap: 0.8rem;
  margin-top: 2rem;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

.case-link span {
  color: var(--blue);
  transition: transform 180ms var(--ease);
}

.case-link:hover span {
  transform: translate(0.2rem, -0.2rem);
}

.case-system {
  display: flex;
  min-height: 46rem;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--ink);
  padding: clamp(1.5rem, 3.5vw, 3rem);
  background:
    linear-gradient(var(--system-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--system-grid) 1px, transparent 1px),
    #eef1ff;
  background-size: 2rem 2rem;
}

.system-label {
  margin: 0 0 1.5rem;
}

.system-lanes {
  display: grid;
  gap: 0.8rem;
}

.system-lane {
  display: grid;
  gap: 0.65rem;
  border: 1px solid rgba(36, 72, 232, 0.35);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.88);
}

.system-lane span {
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.system-lane strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.25;
}

.system-lane-core {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.system-lane-core span {
  color: var(--acid);
}

.system-foot {
  margin: 1.5rem 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-transform: uppercase;
}

.case-study-clip {
  border-color: var(--dark);
  background: var(--dark);
  color: var(--on-dark);
}

.case-study-wolters {
  background: #eef1ff;
}

.case-system-enterprise {
  border-color: var(--ink);
  background:
    linear-gradient(rgba(223, 255, 89, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(223, 255, 89, 0.1) 1px, transparent 1px),
    var(--dark);
  color: var(--on-dark);
}

.case-system-enterprise .system-label,
.case-system-enterprise .system-foot {
  color: var(--acid);
}

.enterprise-stack {
  display: grid;
  gap: 0.8rem;
}

.enterprise-stack div {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.3rem 0.8rem;
  border: 1px solid rgba(247, 244, 235, 0.3);
  padding: 1rem;
  background: rgba(28, 33, 30, 0.78);
}

.enterprise-stack span {
  grid-row: 1 / span 2;
  color: var(--acid);
  font-size: 0.72rem;
  font-weight: 900;
}

.enterprise-stack strong {
  color: var(--on-dark);
  font-size: 0.9rem;
}

.enterprise-stack small {
  color: var(--on-dark-muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.case-study-clip .case-kicker,
.case-study-clip .case-summary {
  color: var(--on-dark-muted);
}

.case-study-clip .case-kicker span:first-child,
.case-study-clip .case-link span {
  color: var(--acid);
}

.case-study-clip .case-link {
  border-color: var(--on-dark);
  color: var(--on-dark);
}

.pipeline-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 2.25rem;
  border: 1px solid rgba(247, 244, 235, 0.35);
}

.pipeline-map span {
  position: relative;
  display: grid;
  min-height: 4.5rem;
  place-items: center;
  padding: 0.75rem 0.4rem;
  color: var(--on-dark);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pipeline-map span + span {
  border-left: 1px solid rgba(247, 244, 235, 0.25);
}

.pipeline-map span:not(:last-child)::after {
  position: absolute;
  right: -0.35rem;
  z-index: 2;
  color: var(--acid);
  content: "→";
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
  border: 1px solid rgba(247, 244, 235, 0.35);
}

.case-facts div {
  min-height: 7rem;
  padding: 1rem;
}

.case-facts div + div {
  border-left: 1px solid rgba(247, 244, 235, 0.25);
}

.case-facts strong {
  display: block;
  color: var(--acid);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

.case-facts span {
  display: block;
  margin-top: 0.55rem;
  color: var(--on-dark-muted);
  font-size: 0.71rem;
  line-height: 1.35;
}

.case-system-dark {
  border-color: rgba(247, 244, 235, 0.25);
  background:
    linear-gradient(var(--system-grid-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--system-grid-dark) 1px, transparent 1px),
    #0a0d0b;
}

.case-system-dark .system-label,
.case-system-dark .system-foot {
  color: var(--acid);
}

.state-stack {
  display: grid;
  gap: 0.8rem;
}

.state-stack div {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.25rem 0.8rem;
  border: 1px solid rgba(247, 244, 235, 0.3);
  padding: 1rem;
  background: rgba(28, 33, 30, 0.78);
}

.state-stack span {
  grid-row: 1 / span 2;
  color: var(--acid);
  font-size: 0.72rem;
  font-weight: 900;
}

.state-stack strong {
  color: var(--on-dark);
  font-size: 0.9rem;
}

.state-stack small {
  color: var(--on-dark-muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.case-study-collage {
  border-color: var(--ink);
}

.case-system-acid {
  background:
    linear-gradient(rgba(18, 21, 19, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 21, 19, 0.1) 1px, transparent 1px),
    var(--acid);
}

.case-system-acid .system-label {
  color: var(--ink);
}

.entitlement-flow {
  display: grid;
  gap: 0.7rem;
}

.entitlement-flow div {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  align-items: center;
  min-height: 4.25rem;
  border: 1px solid var(--ink);
  background: rgba(255, 253, 247, 0.84);
}

.entitlement-flow span {
  display: grid;
  align-self: stretch;
  place-items: center;
  border-right: 1px solid var(--ink);
  background: var(--ink);
  color: var(--acid);
  font-size: 0.7rem;
  font-weight: 900;
}

.entitlement-flow strong {
  padding: 0.8rem;
  font-size: 0.85rem;
}

.decision-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: clamp(2rem, 4vw, 3.5rem) 0;
  border: 1px solid var(--ink);
  background: var(--paper-raised);
}

.decision-board > div {
  min-height: 16rem;
  padding: clamp(1.2rem, 2.5vw, 2rem);
}

.decision-board > div + div {
  border-left: 1px solid var(--line-strong);
}

.decision-board span {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-board strong {
  display: block;
  margin-top: 4rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.2vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.decision-board p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.role-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.25rem;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}

.experience-card:nth-child(even) .role-link,
.experience-card-dark .role-link {
  color: var(--acid);
}

.role-link span {
  color: var(--blue);
  transition: transform 180ms var(--ease);
}

.experience-card:nth-child(even) .role-link span,
.experience-card-dark .role-link span {
  color: currentColor;
}

.role-link:hover span {
  transform: translate(0.18rem, -0.18rem);
}

.role-ledger > .section-heading {
  max-width: 72rem;
}

.role-ledger-list {
  border: 1px solid var(--ink);
  background: var(--ink);
}

.role-ledger-row {
  display: grid;
  grid-template-columns: minmax(13rem, 0.9fr) repeat(3, minmax(0, 1fr));
  background: var(--paper-raised);
}

.role-ledger-row + .role-ledger-row {
  border-top: 1px solid var(--ink);
}

.role-ledger-row > div {
  min-height: 13rem;
  padding: clamp(1.25rem, 2.6vw, 2rem);
}

.role-ledger-row > div + div {
  border-left: 1px solid var(--line-strong);
}

.role-ledger-row:nth-child(even) {
  background: var(--dark);
  color: var(--on-dark);
}

.role-ledger-row:nth-child(even) > div + div {
  border-left-color: rgba(247, 244, 235, 0.24);
}

.role-ledger-row:nth-child(even) .artifact-label,
.role-ledger-row:nth-child(even) .role-ledger-meta > span,
.role-ledger-row:nth-child(even) a {
  color: var(--acid);
}

.role-ledger-meta > span {
  color: var(--blue);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.role-ledger-meta h3 {
  max-width: 14ch;
  margin: 2.4rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 2.5vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.role-ledger-meta p,
.role-ledger-row > div:not(.role-ledger-meta) p {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.role-ledger-row:nth-child(even) .role-ledger-meta p,
.role-ledger-row:nth-child(even) > div:not(.role-ledger-meta) p {
  color: var(--on-dark-muted);
}

.role-ledger-row a {
  color: var(--blue);
  font-weight: 850;
  text-underline-offset: 0.2rem;
}

.role-ledger-row-compact > div {
  min-height: 10.5rem;
}

/* Standalone case studies */

.case-page {
  background: var(--paper);
}

.case-page .site-header {
  position: relative;
}

.case-page-main {
  padding-bottom: clamp(4rem, 8vw, 8rem);
}

.case-page-hero {
  padding-block: clamp(3.5rem, 8vw, 8rem) clamp(2.5rem, 6vw, 5rem);
}

.case-breadcrumb {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

.case-page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  margin-top: clamp(2rem, 5vw, 4.5rem);
}

.case-page-hero h1 {
  max-width: 14ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 8.7vw, 8.8rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.86;
}

.case-page-hero h1 span {
  color: var(--blue);
}

.case-page-intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.65;
}

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

.case-proofbar > div {
  min-height: 9rem;
  padding: 1.4rem;
}

.case-proofbar > div + div {
  border-left: 1px solid var(--line-strong);
}

.case-proofbar span {
  display: block;
  color: var(--blue);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-proofbar strong {
  display: block;
  margin-top: 1.2rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.case-section {
  display: grid;
  grid-template-columns: minmax(12rem, 0.32fr) minmax(0, 0.68fr);
  gap: clamp(2rem, 7vw, 7rem);
  padding-top: clamp(4rem, 9vw, 8rem);
}

.case-section-heading {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.case-section-heading span {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-section-heading h2 {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.case-section-content {
  display: grid;
  gap: 1.5rem;
}

.case-section-content > p {
  max-width: 50rem;
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--ink);
  background: var(--paper-raised);
}

.case-grid > article,
.case-grid > div {
  min-height: 13rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.case-grid > :nth-child(even) {
  border-left: 1px solid var(--line);
}

.case-grid > :nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

.case-grid h3 {
  margin: 2.5rem 0 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.case-grid p,
.case-grid li {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.case-grid p {
  margin: 0.85rem 0 0;
}

.workflow-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--ink);
  background: var(--dark);
  color: var(--on-dark);
}

.workflow-flow > div {
  position: relative;
  min-height: 11rem;
  padding: 1.25rem;
}

.workflow-flow > div + div {
  border-left: 1px solid rgba(247, 244, 235, 0.25);
}

.workflow-flow > div:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -0.45rem;
  z-index: 2;
  color: var(--acid);
  content: "→";
  font-weight: 900;
}

.workflow-flow span {
  color: var(--acid);
  font-size: 0.68rem;
  font-weight: 900;
}

.workflow-flow strong {
  display: block;
  margin-top: 3rem;
  font-size: 0.88rem;
  line-height: 1.35;
}

.artifact {
  border: 1px solid var(--ink);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background:
    linear-gradient(var(--system-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--system-grid) 1px, transparent 1px),
    #eef1ff;
  background-size: 2rem 2rem;
}

.artifact h3 {
  max-width: 23ch;
  margin: clamp(2rem, 5vw, 4rem) 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.artifact p {
  max-width: 48rem;
  margin: 1rem 0 0;
  color: var(--ink-soft);
  line-height: 1.7;
}

.decision-log {
  display: grid;
  border: 1px solid var(--ink);
}

.decision-log > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.25rem;
  padding: 1.35rem;
  background: var(--paper-raised);
}

.decision-log > div + div {
  border-top: 1px solid var(--line);
}

.decision-log span {
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.decision-log p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.case-callout {
  border: 1px solid var(--ink);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: var(--acid);
}

.case-callout strong {
  display: block;
  max-width: 28ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.2rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.case-callout p {
  max-width: 48rem;
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  line-height: 1.65;
}

.case-source-note {
  border-left: 4px solid var(--blue);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.case-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(4rem, 10vw, 9rem);
  border-top: 1px solid var(--ink);
  padding-top: 1.5rem;
}

.case-footer-nav a {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-decoration: none;
  text-transform: uppercase;
}

@media (max-width: 68rem) {
  .case-study {
    grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  }

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

  .case-facts div:nth-child(3) {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
    border-left: 0;
  }

  .case-facts div:nth-child(4) {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
  }

  .pipeline-map {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-map span:nth-child(4) {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
    border-left: 0;
  }

  .pipeline-map span:nth-child(5),
  .pipeline-map span:nth-child(6) {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
  }

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

  .decision-board > div:nth-child(3) {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .decision-board > div:nth-child(4) {
    border-top: 1px solid var(--line-strong);
  }

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

  .case-proofbar > div:nth-child(3) {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .case-proofbar > div:nth-child(4) {
    border-top: 1px solid var(--line-strong);
  }

  .workflow-flow {
    grid-template-columns: 1fr;
  }

  .workflow-flow > div {
    min-height: auto;
  }

  .workflow-flow > div + div {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
    border-left: 0;
  }

  .workflow-flow > div:not(:last-child)::after {
    top: auto;
    right: 1.25rem;
    bottom: -0.75rem;
    transform: rotate(90deg);
  }

  .workflow-flow strong {
    margin-top: 1.2rem;
  }

  .role-ledger-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .role-ledger-row > div:nth-child(3) {
    border-left: 0;
  }

  .role-ledger-row > div:nth-child(n + 3) {
    border-top: 1px solid var(--line-strong);
  }

  .role-ledger-row:nth-child(even) > div:nth-child(n + 3) {
    border-top-color: rgba(247, 244, 235, 0.24);
  }
}

@media (max-width: 58rem) {
  .case-study {
    grid-template-columns: 1fr;
  }

  .case-system {
    min-height: auto;
    border-top: 1px solid var(--ink);
    border-left: 0;
    padding-block: 3rem;
  }

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

  .case-page-hero-grid {
    align-items: start;
  }

  .case-section-heading {
    position: static;
  }
}

@media (max-width: 45rem) {
  .case-study-copy {
    padding: 1.4rem;
  }

  .case-kicker {
    margin-bottom: 2rem;
  }

  .case-study h3 {
    font-size: clamp(2.35rem, 13vw, 3.7rem);
  }

  .decision-trace,
  .decision-board,
  .case-grid,
  .case-proofbar {
    grid-template-columns: 1fr;
  }

  .decision-trace > div,
  .decision-board > div,
  .case-grid > article,
  .case-grid > div,
  .case-proofbar > div {
    min-height: auto;
  }

  .decision-trace > div:nth-child(even),
  .decision-board > div + div,
  .case-grid > :nth-child(even),
  .case-proofbar > div + div {
    border-left: 0;
  }

  .decision-trace > div + div,
  .decision-board > div + div,
  .case-grid > * + *,
  .case-proofbar > div + div {
    border-top: 1px solid var(--line-strong);
  }

  .decision-board strong {
    margin-top: 2rem;
  }

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

  .pipeline-map span:nth-child(3),
  .pipeline-map span:nth-child(5) {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
    border-left: 0;
  }

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

  .case-facts div + div,
  .case-facts div:nth-child(3) {
    border-top: 1px solid rgba(247, 244, 235, 0.25);
    border-left: 0;
  }

  .case-page-hero h1 {
    font-size: clamp(3.4rem, 17vw, 5.5rem);
  }

  .case-page-hero-grid {
    gap: 1.5rem;
  }

  .decision-log > div {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .role-ledger-row {
    grid-template-columns: 1fr;
  }

  .role-ledger-row > div {
    min-height: auto;
    padding: 1.35rem;
  }

  .role-ledger-row > div + div,
  .role-ledger-row > div:nth-child(3) {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .role-ledger-row:nth-child(even) > div + div,
  .role-ledger-row:nth-child(even) > div:nth-child(3) {
    border-top-color: rgba(247, 244, 235, 0.24);
  }

  .role-ledger-meta h3 {
    margin-top: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-link span,
  .role-link span {
    transition: none;
  }
}

/* Compact visual case system */

.case-study-list-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.case-study-visual {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.case-study-visual .case-study-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(1.35rem, 2.5vw, 2.25rem);
}

.case-study-visual .case-kicker {
  margin-bottom: clamp(1.25rem, 2vw, 1.75rem);
}

.case-study-visual h3 {
  max-width: 15ch;
  font-size: clamp(2.15rem, 3.7vw, 4rem);
}

.case-study-visual .case-summary {
  max-width: 42rem;
  margin-top: 1rem;
  font-size: 0.98rem;
  line-height: 1.58;
}

.case-study-visual .case-link {
  width: fit-content;
  margin-top: auto;
  padding-top: 1.25rem;
}

.case-card-visual {
  position: relative;
  min-height: 0;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background: #e9e4d8;
}

.case-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, calc(var(--scene-progress, 0.5) * -1.25rem), 0) scale(1.075);
  transition: filter 450ms var(--ease), transform 650ms var(--ease);
}

.case-card-visual::after {
  position: absolute;
  inset: -30% 0 auto;
  height: 35%;
  background: linear-gradient(180deg, transparent, rgba(223, 255, 89, 0.22), transparent);
  content: "";
  pointer-events: none;
  transform: translateY(-100%);
}

.case-study-visual:hover .case-card-visual img {
  filter: saturate(1.08) contrast(1.02);
  transform: translate3d(0, calc(var(--scene-progress, 0.5) * -1.25rem), 0) scale(1.105);
}

.case-card-visual figcaption,
.case-hero-media figcaption {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(247, 244, 235, 0.28);
  padding: 0.75rem 0.85rem;
  background: rgba(10, 13, 11, 0.82);
  color: var(--on-dark);
  backdrop-filter: blur(12px);
}

.case-card-visual figcaption span,
.case-hero-media figcaption span {
  color: var(--acid);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-card-visual figcaption small,
.case-hero-media figcaption small {
  color: var(--on-dark-muted);
  font-size: 0.68rem;
  text-align: right;
}

.case-mini-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.case-mini-proof li {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.48rem 0.7rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.case-study-clip .case-mini-proof li {
  color: var(--on-dark-muted);
}

.role-ledger-row,
.role-ledger-row-compact {
  grid-template-columns: minmax(15rem, 0.38fr) minmax(0, 0.62fr);
}

.role-ledger-row > div,
.role-ledger-row-compact > div {
  min-height: 8.5rem;
  padding: clamp(1.1rem, 2vw, 1.5rem);
}

.role-ledger-meta h3 {
  max-width: none;
  margin-top: 1.25rem;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.role-ledger-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.role-ledger-summary p {
  max-width: 52rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.role-ledger-row:nth-child(even) .role-ledger-summary p {
  color: var(--on-dark-muted);
}

.role-ledger-summary a {
  flex: 0 0 auto;
  font-size: 0.72rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.case-page-main {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.case-page-hero {
  padding-block: clamp(2rem, 4vw, 4rem) clamp(1.75rem, 3vw, 3rem);
}

.case-page-hero-grid-visual {
  grid-template-columns: minmax(0, 0.88fr) minmax(22rem, 1.12fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  margin-top: clamp(1.25rem, 2.5vw, 2.25rem);
}

.case-hero-copy {
  min-width: 0;
}

.case-page-hero h1 {
  max-width: 11ch;
  font-size: clamp(3.1rem, 6.2vw, 6.8rem);
  line-height: 0.9;
}

.case-hero-copy .case-page-intro {
  max-width: 38rem;
  margin-top: 1.35rem;
  font-size: clamp(0.98rem, 1.25vw, 1.12rem);
  line-height: 1.58;
}

.case-hero-media {
  position: relative;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
  background: #e9e4d8;
  box-shadow: var(--shadow-sm);
}

.case-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, calc(var(--scene-progress, 0.5) * -1.1rem), 0) scale(1.07);
}

.case-hero-media::after {
  position: absolute;
  inset: -20% 0 auto;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(223, 255, 89, 0.2), transparent);
  content: "";
  pointer-events: none;
  transform: translateY(-100%);
}

.case-proofbar > div {
  min-height: 6.75rem;
  padding: 1.1rem 1.2rem;
}

.case-proofbar strong {
  margin-top: 0.8rem;
  font-size: 0.88rem;
}

.case-section {
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-top: clamp(3.25rem, 5.5vw, 5.5rem);
}

.case-section-heading h2 {
  margin-top: 0.7rem;
  font-size: clamp(1.95rem, 3.2vw, 3.35rem);
}

.case-section-content {
  gap: 1rem;
}

.case-section-content > p {
  font-size: 1rem;
  line-height: 1.62;
}

.case-grid > article,
.case-grid > div {
  min-height: 9.5rem;
  padding: clamp(1rem, 2vw, 1.45rem);
}

.case-grid h3 {
  margin-top: 1.25rem;
  font-size: 1.45rem;
}

.case-grid p,
.case-grid li {
  line-height: 1.5;
}

.workflow-flow > div {
  min-height: 8.25rem;
  padding: 1rem;
}

.workflow-flow strong {
  margin-top: 2rem;
}

.decision-log > div {
  padding: 1.1rem 1.2rem;
}

.decision-log p {
  line-height: 1.5;
}

.artifact,
.case-callout {
  padding: clamp(1.35rem, 3vw, 2.25rem);
}

.artifact h3,
.case-callout strong {
  margin-top: 1.5rem;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.case-callout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 1.1fr);
  align-items: end;
  gap: clamp(1.25rem, 3vw, 3rem);
}

.case-callout strong {
  margin-top: 0;
}

.case-callout p {
  margin: 0;
}

.case-footer-nav {
  margin-top: clamp(3rem, 5vw, 5rem);
}

.case-deep-dive {
  margin-top: clamp(3rem, 5vw, 5rem);
  border-block: 1px solid var(--ink);
  background: #eef1ff;
}

.case-deep-dive > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-block: 1.35rem;
  cursor: pointer;
  list-style: none;
}

.case-deep-dive > summary::-webkit-details-marker {
  display: none;
}

.case-deep-dive > summary span {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1;
}

.case-deep-dive > summary small {
  max-width: 30rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.case-deep-dive > summary::after {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  content: "+";
  font-size: 1.25rem;
  font-weight: 700;
  transition: transform 220ms var(--ease);
}

.case-deep-dive[open] > summary::after {
  transform: rotate(45deg);
}

.case-deep-dive[open] > summary {
  border-bottom: 1px solid var(--line-strong);
}

.case-deep-dive .case-section:first-of-type {
  padding-top: clamp(2.5rem, 4vw, 4rem);
}

.case-deep-dive .case-section:last-child {
  padding-bottom: clamp(3rem, 5vw, 5rem);
}

.case-hero-media-dark {
  background: #080a09;
}

@keyframes case-scan {
  0%, 15% { transform: translateY(-100%); }
  70%, 100% { transform: translateY(430%); }
}

@media (prefers-reduced-motion: no-preference) {
  .case-card-visual::after,
  .case-hero-media::after {
    animation: case-scan 8s ease-in-out infinite;
  }
}

@media (max-width: 68rem) {
  .case-study-list-compact {
    grid-template-columns: 1fr;
  }

  .case-page-hero-grid-visual {
    grid-template-columns: minmax(0, 0.9fr) minmax(19rem, 1.1fr);
  }
}

@media (max-width: 58rem) {
  .case-page-hero-grid-visual {
    grid-template-columns: 1fr;
  }

  .case-hero-media {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 45rem) {
  .case-study-visual .case-study-copy {
    padding: 1.25rem;
  }

  .case-card-visual {
    aspect-ratio: 4 / 3;
  }

  .case-study-visual h3 {
    font-size: clamp(2.15rem, 11vw, 3.35rem);
  }

  .role-ledger-row,
  .role-ledger-row-compact {
    grid-template-columns: 1fr;
  }

  .role-ledger-row > div,
  .role-ledger-row-compact > div {
    min-height: auto;
  }

  .role-ledger-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

  .case-page-hero {
    padding-block: 1.5rem 1.25rem;
  }

  .case-page-hero h1 {
    font-size: clamp(3rem, 14vw, 4.5rem);
  }

  .case-hero-media {
    aspect-ratio: 4 / 3;
    border-radius: 1rem;
  }

  .case-card-visual figcaption,
  .case-hero-media figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .case-card-visual figcaption small,
  .case-hero-media figcaption small {
    text-align: left;
  }

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

  .case-page .case-proofbar > div {
    min-height: 6rem;
    padding: 0.9rem;
  }

  .case-page .case-proofbar > div + div {
    border-top: 0;
    border-left: 1px solid var(--line-strong);
  }

  .case-page .case-proofbar > div:nth-child(3) {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .case-page .case-proofbar > div:nth-child(4) {
    border-top: 1px solid var(--line-strong);
  }

  .case-section {
    padding-top: 3rem;
  }

  .case-section-heading h2 {
    font-size: clamp(1.9rem, 9vw, 2.75rem);
  }

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

  .case-page .workflow-flow {
    display: flex;
    overflow-x: auto;
    scroll-padding-inline: 1px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .case-page .workflow-flow > div {
    min-width: 78%;
    border-top: 0;
    border-left: 1px solid rgba(247, 244, 235, 0.25);
    scroll-snap-align: start;
  }

  .case-page .workflow-flow > div:first-child {
    border-left: 0;
  }

  .case-page .workflow-flow > div:not(:last-child)::after {
    top: 50%;
    right: -0.45rem;
    bottom: auto;
    transform: none;
  }

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

  .case-deep-dive > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .case-deep-dive > summary small {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .case-card-visual img,
  .case-hero-media img {
    transform: scale(1.02);
    transition: none;
  }

  .case-card-visual::after,
  .case-hero-media::after {
    display: none;
  }

  .case-deep-dive > summary::after {
    transition: none;
  }
}
