/* Case content */
.case-content {
  padding: 124px 0 96px 0;
  animation: fadeUp 0.5s ease forwards;
}

.case-header {
  padding: 16px 0 56px;
  max-width: 720px;
}

.case-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.case-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 24px;
}

.case-summary {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 600px;
  font-weight: 300;
}

/* Overview — highlighted lead section */
.case-section--overview {
  max-width: 100%;
  /* background: var(--card-bg); */
  /* border-radius: 10px; */
  padding: 24px 0px;
  margin-bottom: 48px;
}


.case-section.case-section--overview p:not(.section-label) {
  font-size: 1.1875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 14px;
  max-width: none;
}

.case-section.case-section--overview p:not(.section-label):last-child {
  margin-bottom: 0;
}

/* Meta row */
.case-meta {
  display: flex;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meta-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.meta-value {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text);
}

/* Images */
.case-image {
  width: 100%;
  /* background: var(--thumb-bg); */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.case-image img {
  width: 100%;
  height: auto;
  display: block;
}

.case-image--hero {
  aspect-ratio: 16 / 9;
  margin-bottom: 10px;
}

.case-image--inline {
  margin: 40px 0 10px;
}

.image-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.55;
  margin-bottom: 56px;
  text-align: left;
}

/* figure-based images (preferred) */
figure.case-image {
  width: 100%;
  margin: 0;
  display: block;
}

figure.case-image img,
figure.case-image video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  /* background: var(--thumb-bg); */
}

figure.case-image figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.55;
  margin-top: 10px;
  text-align: left;
}

figure.case-image--hero {
  margin-bottom: 56px;
}

figure.case-image--inline {
  margin: 40px 0 56px;
}

.ba-panel--after figure.case-image--inline {
  margin-bottom: 0;
}

.image-placeholder {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.4;
}

/* Content sections */
.case-section {
  margin-bottom: 48px;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.case-section .section-label {
  color: var(--accent);
  margin-bottom: 12px;
}

.case-section h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  max-width: 660px;
  color: var(--text);
}

.case-section > p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 660px;
}

.case-section > p.lead {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 660px;
}

.case-section p:last-child {
  margin-bottom: 0;
}

.case-section:not(.case-section--overview) > ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  max-width: 660px;
}

.case-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.case-section ul li {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.8;
  padding-left: 18px;
  position: relative;
}

.case-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
  max-width: 660px;
}

/* Before / After component */
.before-after {
  margin: 32px 0 48px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.ba-panel {
  padding: 28px 32px;
}

.ba-panel--before {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.ba-panel--after {
  background: var(--teal-50);
}

.ba-panel--after .case-image--inline {
  margin-bottom: 0;
}

.ba-label {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 20px;
  background: rgba(86, 103, 249, 0.1);
  color: var(--accent);
}



.ba-panel p {
  max-width: none;
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.ba-panel p:last-child {
  margin-bottom: 0;
}

.ba-panel ul {
  max-width: none;
  margin-left: 8px;
}

.code-block {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #30363d;
}

.code-lang {
  display: block;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 8px 16px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8b949e;
}

.code-block pre {
  margin: 0;
  padding: 0;
}

.code-block pre code.hljs {
  border-radius: 0;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.75;
  padding: 20px 24px;
}

/* Outcomes */
.outcome-block {
  border-top: 2px solid var(--accent);
  padding: 40px 0 0;
  margin-top: 80px;
}

.outcome-block .section-label {
  margin-bottom: 20px;
  color: var(--accent);
}

.outcome-block p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
  max-width: 660px;
}

.outcome-block p.lead {
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 660px;
}

.outcome-block p:last-child {
  margin-bottom: 0;
}

.outcome-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.outcome-list li {
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--text);
  padding-left: 18px;
  position: relative;
  line-height: 1.7;
}

.outcome-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Formula rows — modeling syntax example */
.formula-list {
  background: #e8ebf0;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
  max-width: 660px;
}

.formula-row {
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: top;
  gap: 10px;
  padding: 11px 14px;
}

.formula-icon {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.9rem;
  font-style: italic;
  color: #9ca3af;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.formula-text {
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #374151;
  flex: 1;
  word-break: break-all;
}

.formula-actions {
  display: flex;
  align-items: top;
  gap: 5px;
  flex-shrink: 0;
  user-select: none;
}

.formula-actions svg { display: block; }

/* Syntax tokens — used in "after" formulas */
.syn-fn     { color: #000000; font-weight: 500; }
.syn-source { color: #c96728; }
.syn-column { color: #2563eb; }
.syn-field  { color: #2f88c8; }
.syn-string { color: #3e9a60; }
.syn-kw     { color: #9ca3af; }

/* Chip variant — tokens rendered as colored pills */
.formula-list--chips .syn-source {
  background: #FFEFE0;
  color: #914B00;
  border-radius: 4px;
  padding: 1px 6px;
}

.formula-list--chips .syn-field {
  background: #dbeafe;
  color: #2563eb;
  border-radius: 4px;
  padding: 1px 6px;
}

.formula-list--chips .syn-column {
  background: #E3FAE1;
  color: #12400F;
  border-radius: 4px;
  padding: 1px 6px;
}

.formula-list--chips .syn-string {
  background: #F4F2FF;
  color: #3F376B;
  border-radius: 4px;
  padding: 1px 6px;
}

/* Video */
.case-video {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  margin: 32px 0;
  background: var(--thumb-bg);
}

.case-video video {
  display: block;
  width: 100%;
  height: auto;
}

/* Inline password gate */
.case-gate {
  border-top: 1px solid var(--border);
  padding: 56px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.case-gate .gate-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.case-gate .gate-desc {
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.gate-row {
  display: flex;
  gap: 8px;
}

.gate-row input {
  padding: 10px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
  width: 200px;
  text-align: center;
  letter-spacing: 0.08em;
}

.gate-row input:focus { border-color: var(--accent); }

.gate-row input.shake {
  border-color: #e03a3a;
  animation: gateShake 0.4s ease;
}

.gate-row button {
  padding: 10px 20px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.gate-row button:hover { opacity: 0.88; }

.gate-error {
  font-size: 0.8rem;
  color: #e03a3a;
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (max-width: 600px) {
  .case-meta { gap: 24px; }
  .gate-row { flex-direction: column; width: 100%; max-width: 300px; }
  .gate-row input { width: 100%; }
}
