/* ─── Page Hero Overrides for Case Study Pages ─── */
#page-hero { min-height: 72vh; }

/* Case study hero uses a <div> with background-image instead of <video> */
.page-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 40%;
  filter: grayscale(65%) brightness(0.35) contrast(1);
  transform: scale(1.04);
  /* override main.css video-element properties */
  width: auto; height: auto;
  object-fit: unset; object-position: unset;
  display: block; pointer-events: none;
}
.page-hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, rgba(200,33,59,0.14) 0%, transparent 55%),
    linear-gradient(to top, rgba(8,8,9,0.98) 0%, transparent 60%),
    linear-gradient(to right, rgba(8,8,9,0.6) 0%, transparent 65%);
}
.page-hero-title {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 6.5vw, 5rem);
  font-weight: 600; line-height: 0.93; letter-spacing: -0.025em;
  margin-bottom: 32px;
}
.page-hero-body { max-width: 600px; font-size: 1rem; line-height: 1.75; }
.breadcrumb { margin-bottom: 20px; }

.cs-num-badge {
  display: inline-flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
  opacity: 0; animation: fadeUp 0.7s ease 1.05s forwards;
}
.cs-num-badge-line { width: 40px; height: 1px; background: var(--red); }
.cs-num-badge-text {
  font-size: 0.62rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--red);
}
.red-italic { color: var(--red); font-style: italic; }
.tag-num { color: var(--red); font-weight: 500; }

/* ─── META STRIP ─── */
#cs-meta { background: var(--surface); border-bottom: 1px solid var(--border); }
.cs-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.cs-meta-item {
  padding: 32px 40px; border-right: 1px solid var(--border);
  transition: background 0.3s ease;
}
.cs-meta-item:last-child { border-right: none; }
.cs-meta-item:hover { background: var(--surface2); }
.cs-meta-label {
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.cs-meta-label::before {
  content: ''; width: 16px; height: 1px; background: var(--red); display: block;
}
.cs-meta-value {
  font-family: var(--serif); font-size: 1rem; font-weight: 500;
  color: var(--text); line-height: 1.5;
}

/* ─── CHALLENGE ─── */
#challenge { padding: 140px 0; background: var(--bg); position: relative; overflow: visible; }
#challenge::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.challenge-inner {
  display: grid; grid-template-columns: 340px 1fr;
  gap: 80px; align-items: start;
}
.challenge-col-left { position: sticky; top: 108px; }
.challenge-col-left h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  font-weight: 500; line-height: 1.08; letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.challenge-col-left h2 em { color: var(--red); font-style: italic; }
.challenge-col-left p { font-size: 0.92rem; line-height: 1.75; color: var(--muted); }
.challenge-items { display: flex; flex-direction: column; }
.challenge-item {
  padding: 28px 0 28px 32px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.challenge-item:first-child { border-top: 1px solid var(--border); }
.challenge-item::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--red);
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.7s ease;
}
.challenge-item.visible::before { transform: scaleY(1); }
.challenge-item p { font-size: 1rem; line-height: 1.8; color: var(--muted); }

/* ─── APPROACH ─── */
#approach { padding: 140px 0; background: var(--surface); position: relative; }
#approach::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.approach-header {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: end;
  margin-bottom: 64px; padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.approach-header h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  font-weight: 500; line-height: 1.08; letter-spacing: -0.02em;
}
.approach-header h2 em { color: var(--red); font-style: italic; }
.approach-header p { font-size: 1rem; line-height: 1.8; color: var(--muted); margin-bottom: 20px; }
.approach-fast-label {
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold); display: inline-flex; align-items: center; gap: 10px;
}
.approach-fast-label::before {
  content: ''; width: 24px; height: 1px; background: var(--gold); display: block;
}
/* Default 2-column approach grid (3-col pages override with energy-storage.css) */
.approach-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.approach-card {
  background: var(--bg); padding: 48px 40px;
  position: relative; overflow: hidden;
  transition: background 0.35s ease;
}
.approach-card:hover { background: var(--surface2); }
.approach-card-bg {
  position: absolute; bottom: -24px; right: 4px;
  font-family: var(--serif); font-size: 9rem; font-weight: 700; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.04);
  pointer-events: none;
  transition: -webkit-text-stroke-color 0.35s ease;
}
.approach-card:hover .approach-card-bg { -webkit-text-stroke-color: rgba(200,33,59,0.1); }
.approach-card-num {
  font-size: 0.65rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--red); margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 8px;
}
.approach-card-num::before {
  content: ''; width: 20px; height: 1px; background: var(--red); display: block;
}
.approach-card h3 {
  font-family: var(--serif); font-size: 1.3rem; font-weight: 500;
  margin-bottom: 14px; color: var(--text); line-height: 1.2;
}
.approach-card p { font-size: 0.9rem; line-height: 1.8; color: var(--muted); }

/* ─── OUTCOME ─── */
#outcome { padding: 140px 0; background: var(--bg); position: relative; }
#outcome::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.outcome-header {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 80px; align-items: end;
  margin-bottom: 64px; padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.outcome-header h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  font-weight: 500; line-height: 1.08; letter-spacing: -0.02em;
}
.outcome-header h2 em { color: var(--red); font-style: italic; }
.outcome-header p { font-size: 1rem; line-height: 1.8; color: var(--muted); }
.outcome-items { display: flex; flex-direction: column; }
.outcome-item {
  display: grid; grid-template-columns: 88px 1fr;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}
.outcome-item:first-child { border-top: 1px solid var(--border); }
.outcome-item:hover { background: var(--surface); }
.outcome-num {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 700;
  color: transparent; -webkit-text-stroke: 1px rgba(200,33,59,0.22);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 0 0; border-right: 1px solid var(--border);
  transition: -webkit-text-stroke-color 0.3s ease;
}
.outcome-item:hover .outcome-num { -webkit-text-stroke-color: rgba(200,33,59,0.6); }
.outcome-text { padding: 28px 32px; }
.outcome-text p { font-size: 1rem; line-height: 1.8; color: var(--muted); }

/* ─── RELATED ─── */
#related { padding: 100px 0; background: var(--surface); position: relative; }
#related::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.related-header {
  margin-bottom: 48px;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.related-header h3 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 500;
}
.related-all-link {
  font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.25s ease;
}
.related-all-link svg { transition: transform 0.3s ease; }
.related-all-link:hover { color: var(--red); }
.related-all-link:hover svg { transform: translateX(4px); }
.related-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.related-card {
  background: var(--bg); padding: 40px;
  display: flex; flex-direction: column; gap: 12px;
  transition: background 0.3s ease;
}
.related-card:hover { background: var(--surface2); }
.related-chip {
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--red); display: inline-flex; align-items: center; gap: 8px;
}
.related-chip::before {
  content: ''; width: 14px; height: 1px; background: var(--red); display: block;
}
.related-card h4 {
  font-family: var(--serif); font-size: 1.2rem; font-weight: 500;
  color: var(--text); line-height: 1.2;
}
.related-card p { font-size: 0.88rem; line-height: 1.65; color: var(--muted); flex: 1; }
.related-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); transition: color 0.25s ease;
}
.related-link svg { transition: transform 0.3s ease; }
.related-card:hover .related-link { color: var(--red); }
.related-card:hover .related-link svg { transform: translateX(4px); }

/* ─── CTA ─── */
#cta {
  padding: 140px 0;
  background: var(--bg);
  position: relative; overflow: hidden;
}
#cta::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.cta-bg-text {
  position: absolute; bottom: -40px; right: -20px;
  font-family: var(--serif); font-size: 18vw; font-weight: 700; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.12);
  pointer-events: none; user-select: none; white-space: nowrap;
}
.cta-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 80px; position: relative;
}
.cta-left h2 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4vw, 4rem);
  font-weight: 500; line-height: 1.08; letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.cta-left h2 em { color: var(--red); font-style: italic; }
.cta-left p { font-size: 1rem; line-height: 1.8; color: var(--muted); }
.cta-right {
  padding-left: 60px; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center; gap: 24px;
}
.contact-item {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.contact-item:last-of-type { border-bottom: none; padding-bottom: 0; }
.contact-item-icon {
  width: 40px; height: 40px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--red); flex-shrink: 0;
}
.contact-item-text .label {
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.contact-item-text .value { font-size: 1rem; color: var(--text); }
.cta-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

/* ─── Responsive ─── */
@media (max-width: 1100px) {
  #challenge, #approach, #outcome, #related, #cta { padding: 100px 0; }
  .challenge-inner { grid-template-columns: 1fr; gap: 48px; }
  .challenge-col-left { position: static; }
  .approach-header, .outcome-header { grid-template-columns: 1fr; gap: 32px; }
  .approach-grid { grid-template-columns: 1fr; }
  .cs-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-meta-item:nth-child(2) { border-right: none; }
  .cs-meta-item:nth-child(3) { border-right: 1px solid var(--border); border-top: 1px solid var(--border); }
  .cs-meta-item:nth-child(4) { border-right: none; border-top: 1px solid var(--border); }
  .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  #challenge, #approach, #outcome, #related, #cta { padding: 72px 0; }
  .outcome-item { grid-template-columns: 60px 1fr; }
  .outcome-num { font-size: 1.6rem; }
}
@media (max-width: 480px) {
  #challenge, #approach, #outcome, #related, #cta { padding: 56px 0; }
  .cs-meta-grid { grid-template-columns: 1fr; }
  .cs-meta-item { border-right: none !important; border-top: none; border-bottom: 1px solid var(--border); }
  .approach-card { padding: 32px 24px; }
  .outcome-item { grid-template-columns: 52px 1fr; }
  .outcome-num { font-size: 1.3rem; padding: 20px 0 0; }
  .outcome-text { padding: 20px; }
  .related-card { padding: 28px; }
}
