/* Case study pages. Scoped to .cases-page and loaded only by /cases/ pages. */

.cases-page {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(18, 59, 42, 0.045) 50%, transparent calc(50% + 1px)),
    linear-gradient(180deg, rgba(250, 253, 248, 0.98) 0%, rgba(239, 247, 236, 0.48) 48%, rgba(255, 255, 255, 0.98) 100%);
}

.cases-page .section-heading {
  position: relative;
}

.cases-page .section-heading::after {
  content: "";
  display: block;
  width: 100%;
  max-width: 220px;
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(90deg, rgba(46, 107, 71, 0.58), rgba(46, 107, 71, 0));
  transform: scaleX(0);
  transform-origin: left;
}

.reveal-ready .cases-page .reveal.is-visible .section-heading::after {
  animation: caseLineGrow 0.72s ease forwards;
}

.case-hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 74px;
  background:
    radial-gradient(circle at 88% 18%, rgba(147, 201, 107, 0.2), transparent 34%),
    linear-gradient(135deg, rgba(18, 59, 42, 0.98), rgba(46, 107, 71, 0.9));
}

.case-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 23, 16, 0.22), transparent 58%),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.08) 50%, transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 72px);
  pointer-events: none;
}

.case-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 44px;
  align-items: center;
}

.case-hero-copy {
  color: var(--white);
  animation: caseFadeUp 0.72s ease both;
}

.case-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.case-breadcrumb a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
}

.case-breadcrumb a:hover,
.case-breadcrumb a:focus-visible {
  text-decoration: underline;
}

.case-breadcrumb span + span::before,
.case-breadcrumb a + span::before,
.case-breadcrumb a + a::before {
  content: ">";
  margin-right: 8px;
  color: rgba(255, 255, 255, 0.48);
}

.case-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.15;
}

.case-hero-copy p:not(.section-label):not(.case-breadcrumb) {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.02rem;
  line-height: 1.9;
}

.case-hero-board {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: center;
  min-height: 230px;
  padding: 24px 0 24px 28px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.18), transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 1px);
  border-left: 1px solid rgba(255, 255, 255, 0.26);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.case-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(10px);
  animation: caseChipIn 0.54s ease forwards;
}

.case-chip:nth-child(2) {
  animation-delay: 0.07s;
}

.case-chip:nth-child(3) {
  animation-delay: 0.14s;
}

.case-chip:nth-child(4) {
  animation-delay: 0.21s;
}

.case-chip:nth-child(5) {
  animation-delay: 0.28s;
}

.case-chip:nth-child(6) {
  animation-delay: 0.35s;
}

.case-chip:nth-child(7) {
  animation-delay: 0.42s;
}

.case-chip:nth-child(8) {
  animation-delay: 0.49s;
}

.case-approach-section {
  padding-top: 58px;
}

.case-approach-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 28px;
  padding: 30px 26px;
  background:
    linear-gradient(90deg, rgba(18, 59, 42, 0.08), transparent 1px) left top / 25% 100% no-repeat,
    linear-gradient(180deg, rgba(18, 59, 42, 0.12), transparent 1px) left top / 100% 1px no-repeat,
    linear-gradient(180deg, transparent calc(100% - 1px), rgba(18, 59, 42, 0.12) 100%);
  border-left: 1px solid rgba(18, 59, 42, 0.16);
}

.case-approach-label h2 {
  margin: 0;
  color: var(--deep-green);
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.35;
}

.case-approach-body p {
  margin: 0;
  color: var(--subtext);
  font-size: 1rem;
  line-height: 1.9;
}

.case-policy-tags,
.case-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.case-policy-tags span,
.case-tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  color: var(--deep-green);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(239, 247, 236, 0.76);
  border: 1px solid rgba(46, 107, 71, 0.14);
  border-radius: 2px;
}

.case-process-section {
  padding-top: 34px;
}

.case-process-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid rgba(18, 59, 42, 0.16);
  border-bottom: 1px solid rgba(18, 59, 42, 0.1);
}

.case-process-track::before {
  content: "";
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(46, 107, 71, 0.42), rgba(46, 107, 71, 0));
  transform: scaleX(0);
  transform-origin: left;
  animation: caseLineGrow 0.82s ease 0.18s forwards;
}

.case-process-step {
  position: relative;
  z-index: 1;
  padding: 24px 20px 24px 0;
  border-right: 1px solid rgba(18, 59, 42, 0.1);
  opacity: 0;
  transform: translateY(12px);
  animation: caseFadeUp 0.6s ease forwards;
}

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

.case-process-step:nth-child(2) {
  animation-delay: 0.08s;
}

.case-process-step:nth-child(3) {
  animation-delay: 0.16s;
}

.case-process-step:nth-child(4) {
  animation-delay: 0.24s;
}

.case-step-number {
  display: inline-grid;
  margin-bottom: 14px;
  color: rgba(46, 107, 71, 0.76);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.28s ease, color 0.28s ease;
}

.case-process-step:hover .case-step-number {
  color: var(--deep-green);
  transform: translateX(4px);
}

.case-process-step h3 {
  margin: 0 0 8px;
  color: var(--deep-green);
  font-size: 1.08rem;
  line-height: 1.4;
}

.case-process-step p {
  margin: 0;
  color: var(--subtext);
  font-size: 0.94rem;
  line-height: 1.68;
}

.case-models-section {
  padding-top: 72px;
}

.case-model-stack {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(18, 59, 42, 0.16);
}

.case-model-card {
  position: relative;
  overflow: hidden;
  padding: 34px 26px;
  background:
    linear-gradient(90deg, rgba(18, 59, 42, 0.055), transparent 1px) left top / 28% 100% no-repeat,
    rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(18, 59, 42, 0.14);
  opacity: 0;
  transform: translateY(16px);
  animation: caseFadeUp 0.62s ease forwards;
  transition:
    transform 0.28s ease,
    background 0.28s ease;
}

.case-model-card:nth-child(2) {
  animation-delay: 0.08s;
}

.case-model-card:nth-child(3) {
  animation-delay: 0.16s;
}

.case-model-card:nth-child(4) {
  animation-delay: 0.24s;
}

.case-model-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 1px;
  background: rgba(46, 107, 71, 0.45);
  transition:
    width 0.28s ease,
    background 0.28s ease;
}

.case-model-card::after {
  content: attr(data-case);
  position: absolute;
  top: 20px;
  right: 0;
  z-index: 0;
  max-width: 58%;
  color: rgba(18, 59, 42, 0.035);
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 0.92;
  text-align: right;
  pointer-events: none;
  white-space: normal;
}

.case-model-card:hover,
.case-model-card:focus-within {
  transform: translateY(-2px);
  background:
    linear-gradient(90deg, rgba(46, 107, 71, 0.08), transparent 1px) left top / 28% 100% no-repeat,
    rgba(245, 250, 242, 0.82);
}

.case-model-card:hover::before,
.case-model-card:focus-within::before {
  width: 150px;
  background: rgba(46, 107, 71, 0.62);
}

.case-model-header,
.case-model-content,
.case-safety-layout {
  position: relative;
  z-index: 1;
}

.case-model-featured .case-model-content,
.case-model-row {
  display: grid;
  grid-template-columns: minmax(230px, 0.36fr) minmax(0, 1fr);
  gap: 28px;
}

.case-model-row.reverse {
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.36fr);
}

.case-model-row.reverse .case-model-header {
  order: 2;
}

.case-kicker {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
}

.case-index {
  color: rgba(46, 107, 71, 0.72);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.84;
  transition:
    color 0.28s ease,
    transform 0.28s ease;
}

.case-kicker span:last-child {
  color: rgba(46, 107, 71, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.case-model-card:hover .case-index,
.case-model-card:focus-within .case-index {
  color: var(--deep-green);
  transform: translateX(5px);
}

.case-model-header h3 {
  margin: 0;
  color: var(--deep-green);
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.36;
}

.case-model-header > p:not(.case-kicker),
.case-model-content > p,
.case-model-content div > p,
.case-model-summary p {
  margin: 12px 0 0;
  color: var(--subtext);
  font-size: 0.96rem;
  line-height: 1.72;
}

.case-model-summary {
  padding: 14px 16px;
  background: rgba(239, 247, 236, 0.6);
  border: 1px solid rgba(46, 107, 71, 0.14);
  border-radius: 2px;
}

.case-model-summary span,
.case-safety-result span {
  display: block;
  margin-bottom: 7px;
  color: rgba(46, 107, 71, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.case-model-summary p,
.case-safety-result p {
  margin: 0;
  color: var(--deep-green);
  font-weight: 700;
  line-height: 1.65;
}

.case-detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

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

.case-detail-list div {
  padding-top: 14px;
  border-top: 1px solid rgba(18, 59, 42, 0.1);
}

.case-detail-list dt {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding-left: 10px;
  color: var(--deep-green);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  border-left: 2px solid rgba(46, 107, 71, 0.44);
}

.case-detail-list dd {
  margin: 8px 0 0;
  color: var(--subtext);
  font-size: 0.96rem;
  line-height: 1.72;
}

.case-detail-list div:nth-child(4) {
  padding: 14px 16px;
  background: rgba(239, 247, 236, 0.5);
  border: 1px solid rgba(46, 107, 71, 0.12);
}

.case-model-link,
.case-text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 20px;
  color: var(--green);
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
}

.case-model-link::after,
.case-text-link::after {
  content: "→";
  transition: transform 0.24s ease;
}

.case-model-link::before,
.case-text-link::before {
  content: "";
  position: absolute;
  left: 0;
  right: 1.4em;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.24s ease;
}

.case-model-link:hover::before,
.case-model-link:focus-visible::before,
.case-text-link:hover::before,
.case-text-link:focus-visible::before {
  transform: scaleX(1);
}

.case-model-link:hover::after,
.case-model-link:focus-visible::after,
.case-text-link:hover::after,
.case-text-link:focus-visible::after {
  transform: translateX(4px);
}

.case-note-section {
  padding-top: 40px;
  padding-bottom: 26px;
}

.case-disclaimer {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 59, 42, 0.1);
  border-left: 3px solid rgba(46, 107, 71, 0.5);
  border-radius: 2px;
}

.case-disclaimer p {
  margin: 0;
  color: var(--subtext);
  font-size: 0.95rem;
  line-height: 1.78;
}

.case-detail-section {
  position: relative;
  padding-top: 64px;
  padding-bottom: 0;
}

.case-detail-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(0, 1fr);
  gap: 30px;
  padding: 30px 0;
  border-top: 1px solid rgba(18, 59, 42, 0.16);
}

.case-detail-panel:last-child {
  border-bottom: 1px solid rgba(18, 59, 42, 0.12);
}

.case-detail-heading {
  position: relative;
}

.case-detail-heading p {
  margin: 0 0 10px;
  color: rgba(46, 107, 71, 0.78);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.5;
}

.case-detail-heading h2 {
  margin: 0;
  color: var(--deep-green);
  font-size: clamp(1.28rem, 2.6vw, 2rem);
  line-height: 1.34;
}

.case-detail-body {
  min-width: 0;
}

.case-detail-body > p {
  margin: 0;
  color: var(--subtext);
  font-size: 1rem;
  line-height: 1.9;
}

.case-detail-body > p + p {
  margin-top: 14px;
}

.case-list-grid,
.case-record-grid,
.case-check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(18, 59, 42, 0.12);
  border-left: 1px solid rgba(18, 59, 42, 0.08);
}

.case-list-grid li,
.case-record-grid li,
.case-check-grid li {
  position: relative;
  padding: 15px 16px 15px 36px;
  color: var(--subtext);
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.56);
  border-right: 1px solid rgba(18, 59, 42, 0.08);
  border-bottom: 1px solid rgba(18, 59, 42, 0.08);
}

.case-list-grid li::before,
.case-record-grid li::before,
.case-check-grid li::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 16px;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(46, 107, 71, 0.62);
  border-radius: 50%;
}

.case-sequence {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(18, 59, 42, 0.14);
  border-bottom: 1px solid rgba(18, 59, 42, 0.1);
}

.case-sequence article {
  padding: 22px 20px;
  border-right: 1px solid rgba(18, 59, 42, 0.1);
}

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

.case-sequence h3 {
  margin: 0 0 12px;
  color: var(--deep-green);
  font-size: 1.05rem;
  line-height: 1.4;
}

.case-sequence ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.15em;
  color: var(--subtext);
  line-height: 1.65;
}

.case-risk-lead {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(18, 59, 42, 0.12);
}

.case-risk-lead p {
  margin: 0;
  color: var(--subtext);
  font-size: 1rem;
  line-height: 1.86;
}

.case-risk-spiral {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 8px 0 4px;
}

.case-risk-spiral::before {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 38px;
  left: 34px;
  width: 1px;
  background: linear-gradient(180deg, rgba(46, 107, 71, 0.38), rgba(46, 107, 71, 0.06));
  pointer-events: none;
}

.case-risk-node {
  --risk-offset: 0px;
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 18px;
  width: calc(100% - var(--risk-offset));
  margin-left: var(--risk-offset);
  padding: 18px 20px;
  background:
    linear-gradient(90deg, rgba(18, 59, 42, 0.055), transparent 1px) left top / 26% 100% no-repeat,
    rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(18, 59, 42, 0.12);
  border-left: 3px solid rgba(46, 107, 71, 0.38);
  transition:
    background 0.24s ease,
    border-color 0.24s ease;
}

.case-risk-node:nth-child(1) {
  --risk-offset: 0%;
}

.case-risk-node:nth-child(2) {
  --risk-offset: 8%;
}

.case-risk-node:nth-child(3) {
  --risk-offset: 16%;
}

.case-risk-node:nth-child(4) {
  --risk-offset: 24%;
}

.case-risk-node:nth-child(5) {
  --risk-offset: 16%;
}

.case-risk-node:nth-child(6) {
  --risk-offset: 8%;
}

.case-risk-node::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: -24px;
  width: 48px;
  height: 24px;
  border-right: 1px solid rgba(46, 107, 71, 0.28);
  border-bottom: 1px solid rgba(46, 107, 71, 0.28);
  transform: skewX(-22deg);
  pointer-events: none;
}

.case-risk-node:last-child::after {
  display: none;
}

.case-risk-number {
  display: inline-grid;
  align-self: start;
  color: rgba(46, 107, 71, 0.7);
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 0.9;
  transition:
    color 0.24s ease,
    transform 0.24s ease;
}

.case-risk-node h3 {
  margin: 0 0 8px;
  color: var(--deep-green);
  font-size: 1.08rem;
  line-height: 1.4;
}

.case-risk-node p {
  margin: 0;
  color: var(--subtext);
  font-size: 0.96rem;
  line-height: 1.72;
}

.case-risk-node:hover,
.case-risk-node:focus-within {
  background:
    linear-gradient(90deg, rgba(46, 107, 71, 0.085), transparent 1px) left top / 26% 100% no-repeat,
    rgba(245, 250, 242, 0.82);
  border-color: rgba(46, 107, 71, 0.28);
}

.case-risk-node:hover .case-risk-number,
.case-risk-node:focus-within .case-risk-number {
  color: var(--deep-green);
  transform: translateX(4px);
}

.case-essay-block,
.case-definition-block,
.case-field-note {
  position: relative;
  overflow: hidden;
  padding: 24px 24px;
  background:
    linear-gradient(90deg, rgba(18, 59, 42, 0.07), transparent 1px) left top / 28% 100% no-repeat,
    rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(18, 59, 42, 0.12);
  border-left: 3px solid rgba(46, 107, 71, 0.46);
}

.case-essay-block::after {
  content: attr(data-label);
  position: absolute;
  right: -8px;
  bottom: -8px;
  color: rgba(18, 59, 42, 0.035);
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 0.9;
  pointer-events: none;
}

.case-essay-block p,
.case-definition-block p,
.case-field-note p:not(.case-field-note-label) {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--subtext);
  font-size: 1rem;
  line-height: 1.9;
}

.case-essay-block p + p,
.case-definition-block + p,
.case-field-note + p,
.case-diagnostic-flow + .case-tag-list,
.case-detail-body > p + .case-diagnostic-flow,
.case-detail-body > p + .case-record-sheet {
  margin-top: 16px;
}

.case-definition-block span,
.case-field-note-label {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 0 12px;
  color: rgba(46, 107, 71, 0.78);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

.case-definition-block p {
  color: var(--deep-green);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  font-weight: 700;
}

.case-contrast-panel,
.case-diagnostic-flow,
.case-cause-chain,
.case-record-sheet {
  display: grid;
  gap: 0;
  margin-top: 0;
  border-top: 1px solid rgba(18, 59, 42, 0.14);
  border-left: 1px solid rgba(18, 59, 42, 0.08);
}

.case-contrast-panel {
  grid-template-columns: repeat(3, 1fr);
}

.case-contrast-panel article,
.case-diagnostic-flow article,
.case-cause-chain article,
.case-record-sheet > div,
.case-record-sheet > article {
  position: relative;
  min-width: 0;
  padding: 20px 18px;
  background: rgba(255, 255, 255, 0.58);
  border-right: 1px solid rgba(18, 59, 42, 0.08);
  border-bottom: 1px solid rgba(18, 59, 42, 0.08);
  transition:
    background 0.24s ease,
    border-color 0.24s ease;
}

.case-contrast-panel article:hover,
.case-diagnostic-flow article:hover,
.case-cause-chain article:hover,
.case-record-sheet > div:hover,
.case-record-sheet > article:hover {
  background: rgba(239, 247, 236, 0.7);
  border-color: rgba(46, 107, 71, 0.18);
}

.case-contrast-panel span,
.case-diagnostic-flow span,
.case-cause-chain span,
.case-record-sheet span {
  display: block;
  margin-bottom: 10px;
  color: rgba(46, 107, 71, 0.76);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.5;
}

.case-contrast-panel h3,
.case-diagnostic-flow strong,
.case-cause-chain strong,
.case-record-sheet strong,
.case-record-sheet h3 {
  display: block;
  margin: 0;
  color: var(--deep-green);
  font-size: 1.04rem;
  line-height: 1.45;
}

.case-contrast-panel p,
.case-diagnostic-flow p {
  margin: 10px 0 0;
  color: var(--subtext);
  font-size: 0.94rem;
  line-height: 1.68;
}

.case-diagnostic-flow {
  grid-template-columns: repeat(4, 1fr);
}

.case-diagnostic-flow-eight {
  grid-template-columns: repeat(4, 1fr);
}

.case-diagnostic-flow article::after,
.case-cause-chain article::after {
  content: "→";
  position: absolute;
  top: 20px;
  right: -11px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: rgba(46, 107, 71, 0.78);
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(250, 253, 248, 0.96);
  border: 1px solid rgba(46, 107, 71, 0.16);
}

.case-diagnostic-flow article:last-child::after,
.case-cause-chain article:last-child::after {
  display: none;
}

.case-cause-chain {
  grid-template-columns: repeat(5, 1fr);
  margin-top: 20px;
}

.case-cause-chain article {
  min-height: 118px;
}

.case-record-sheet {
  grid-template-columns: repeat(2, 1fr);
}

.case-record-sheet > div strong {
  font-size: 0.98rem;
}

.case-record-sheet-sequence {
  grid-template-columns: repeat(3, 1fr);
}

.case-record-sheet-sequence h3 {
  margin-bottom: 12px;
}

.case-record-sheet-sequence ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.1em;
  color: var(--subtext);
  line-height: 1.64;
}

.case-result-band {
  margin-top: 18px;
  padding: 20px 22px;
  color: var(--deep-green);
  font-weight: 700;
  line-height: 1.78;
  background:
    linear-gradient(90deg, rgba(46, 107, 71, 0.12), rgba(46, 107, 71, 0.02));
  border-left: 3px solid rgba(46, 107, 71, 0.5);
}

.case-nav-section {
  padding-top: 36px;
}

.case-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid rgba(18, 59, 42, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.case-nav-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 22px;
  color: var(--deep-green);
  text-decoration: none;
  border-right: 1px solid rgba(18, 59, 42, 0.12);
  overflow: hidden;
  transition: background 0.24s ease;
}

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

.case-nav-card span {
  color: rgba(46, 107, 71, 0.78);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.case-nav-card strong {
  font-size: 1.12rem;
  line-height: 1.45;
}

.case-nav-card::after {
  content: "→";
  position: absolute;
  right: 22px;
  bottom: 20px;
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 800;
  transition: transform 0.24s ease;
}

.case-nav-card:hover,
.case-nav-card:focus-visible {
  background: rgba(239, 247, 236, 0.72);
}

.case-nav-card:hover::after,
.case-nav-card:focus-visible::after {
  transform: translateX(5px);
}

.case-contact-card {
  padding: 28px 26px;
  background:
    linear-gradient(90deg, rgba(18, 59, 42, 0.08), transparent 1px) left top / 26% 100% no-repeat,
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(18, 59, 42, 0.12);
}

.case-contact-card p {
  margin: 0;
  color: var(--subtext);
  line-height: 1.8;
}

.case-contact-card .case-text-link {
  margin-top: 18px;
}

@keyframes caseFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes caseChipIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes caseLineGrow {
  to {
    transform: scaleX(1);
  }
}

@media (max-width: 1024px) {

  .case-hero-inner,
  .case-approach-card,
  .case-model-featured .case-model-content,
  .case-model-row,
  .case-model-row.reverse,
  .case-detail-panel {
    grid-template-columns: 1fr;
  }

  .case-model-row.reverse .case-model-header {
    order: 0;
  }

  .case-detail-grid,
  .case-list-grid,
  .case-record-grid,
  .case-check-grid {
    grid-template-columns: 1fr;
  }

  .case-process-track {
    grid-template-columns: repeat(2, 1fr);
  }

  .case-process-track::before {
    display: none;
  }

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

  .case-contrast-panel,
  .case-diagnostic-flow,
  .case-diagnostic-flow-eight,
  .case-cause-chain,
  .case-record-sheet,
  .case-record-sheet-sequence {
    grid-template-columns: 1fr;
  }

  .case-sequence article {
    border-right: 0;
    border-bottom: 1px solid rgba(18, 59, 42, 0.1);
  }

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

  .case-risk-node {
    --risk-offset: 0% !important;
    width: 100%;
  }

  .case-diagnostic-flow article::after,
  .case-cause-chain article::after {
    top: auto;
    right: auto;
    left: 18px;
    bottom: -11px;
    content: "↓";
  }
}

@media (max-width: 820px) {

  .case-hero {
    padding: 64px 0 54px;
  }

  .case-hero-inner {
    gap: 24px;
  }

  .case-hero-copy h1 {
    font-size: clamp(1.62rem, 7vw, 2.1rem);
    line-height: 1.16;
  }

  .case-hero-copy p:not(.section-label):not(.case-breadcrumb) {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .case-hero-board {
    min-height: auto;
    padding: 18px;
    gap: 9px;
  }

  .case-chip {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.84rem;
  }

  .case-approach-section,
  .case-process-section,
  .case-detail-section {
    padding-top: 42px;
  }

  .case-approach-card,
  .case-model-card,
  .case-contact-card {
    padding: 22px 20px;
  }

  .case-policy-tags span,
  .case-tag-list span {
    font-size: 0.82rem;
  }

  .case-process-track {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .case-process-step {
    padding: 20px 18px;
  }

  .case-models-section {
    padding-top: 54px;
  }

  .case-model-stack {
    gap: 16px;
  }

  .case-model-header h3,
  .case-detail-heading h2 {
    font-size: clamp(1.12rem, 4vw, 1.36rem);
  }

  .case-detail-panel {
    gap: 18px;
    padding: 24px 0;
  }

  .case-disclaimer p,
  .case-detail-list dd,
  .case-process-step p,
  .case-detail-body > p,
  .case-list-grid li,
  .case-record-grid li,
  .case-check-grid li {
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .case-risk-lead p,
  .case-risk-node p,
  .case-essay-block p,
  .case-definition-block p,
  .case-field-note p:not(.case-field-note-label),
  .case-contrast-panel p,
  .case-diagnostic-flow p {
    font-size: 0.92rem;
    line-height: 1.66;
  }

  .case-risk-spiral {
    gap: 0;
    padding-left: 18px;
  }

  .case-risk-spiral::before {
    top: 0;
    bottom: 0;
    left: 0;
  }

  .case-risk-node {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    padding: 18px 0 18px 18px;
    background: transparent;
    border: 0;
    border-top: 1px solid rgba(18, 59, 42, 0.12);
  }

  .case-risk-node:last-child {
    border-bottom: 1px solid rgba(18, 59, 42, 0.12);
  }

  .case-risk-node::after {
    display: none;
  }

  .case-essay-block,
  .case-definition-block,
  .case-field-note {
    padding: 20px 18px;
  }

  .case-essay-block::after {
    font-size: clamp(2.1rem, 12vw, 3.4rem);
  }

  .case-contrast-panel article,
  .case-diagnostic-flow article,
  .case-cause-chain article,
  .case-record-sheet > div,
  .case-record-sheet > article {
    padding: 18px 16px;
  }

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

  .case-nav-card {
    min-height: 128px;
    border-right: 0;
    border-bottom: 1px solid rgba(18, 59, 42, 0.12);
  }

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

@media (max-width: 560px) {

  .case-hero {
    padding: 48px 0 42px;
  }

  .case-hero-copy h1 {
    font-size: clamp(1.48rem, 7.8vw, 1.86rem);
  }

  .case-breadcrumb {
    font-size: 0.76rem;
  }

  .case-hero-board {
    padding: 14px;
  }

  .case-chip {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-width: 0;
    text-align: center;
    font-size: 0.8rem;
  }

  .case-approach-card,
  .case-model-card,
  .case-disclaimer,
  .case-contact-card {
    padding: 18px 14px;
  }

  .case-policy-tags,
  .case-tag-list {
    gap: 6px;
  }

  .case-policy-tags span,
  .case-tag-list span {
    width: 100%;
    justify-content: center;
  }

  .case-model-summary,
  .case-safety-result,
  .case-result-band {
    padding: 14px;
  }

  .case-detail-list {
    gap: 10px;
  }

  .case-detail-list dt {
    font-size: 0.8rem;
  }

  .case-index {
    font-size: 2.35rem;
  }

  .case-kicker {
    gap: 10px;
  }

  .case-list-grid li,
  .case-record-grid li,
  .case-check-grid li {
    padding: 12px 12px 12px 32px;
  }

  .case-list-grid li::before,
  .case-record-grid li::before,
  .case-check-grid li::before {
    top: 18px;
    left: 13px;
  }

  .case-risk-node {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 0 16px 16px;
  }

  .case-risk-number {
    font-size: 2rem;
  }

  .case-essay-block,
  .case-definition-block,
  .case-field-note,
  .case-result-band {
    padding: 16px 14px;
  }

  .case-contrast-panel article,
  .case-diagnostic-flow article,
  .case-cause-chain article,
  .case-record-sheet > div,
  .case-record-sheet > article {
    padding: 16px 14px;
  }

  .case-record-sheet-sequence ul {
    font-size: 0.92rem;
  }

  .case-note-section {
    padding-top: 28px;
    padding-bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {

  .case-hero-copy,
  .case-chip,
  .case-process-step,
  .case-model-card {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .case-model-card:hover,
  .case-model-card:focus-within {
    transform: none;
  }

  .case-process-track::before,
  .cases-page .section-heading::after {
    animation: none;
    transform: scaleX(1);
  }

  .case-process-step:hover .case-step-number,
  .case-model-card:hover .case-index,
  .case-model-card:focus-within .case-index,
  .case-risk-node:hover .case-risk-number,
  .case-risk-node:focus-within .case-risk-number,
  .case-model-link:hover::after,
  .case-model-link:focus-visible::after,
  .case-text-link:hover::after,
  .case-text-link:focus-visible::after,
  .case-nav-card:hover::after,
  .case-nav-card:focus-visible::after {
    transform: none;
  }
}
