/* ============================================================
   STRATALIS GROUP, Visual Enhancement Layer
   Parallax, animated counters, image treatments, dynamic effects
   ============================================================ */

/* ---- Animated number counters ---- */
.count-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ---- Parallax wrappers ---- */
.parallax-wrap {
  overflow: hidden;
  position: relative;
}
.parallax-img {
  transform: translateY(0);
  will-change: transform;
  transition: transform 0s linear;
}

/* ---- Hero video/gradient visual (right side) ---- */
.hero-visual {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48%;
  overflow: hidden;
  pointer-events: none;
}

.hero-visual-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
    rgba(212,69,29,0.06) 0%,
    rgba(151,168,34,0.04) 50%,
    rgba(99,105,105,0.03) 100%
  );
  position: relative;
}

/* Animated geometric shapes */
.hero-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: shape-enter 1.5s var(--ease-out) forwards;
}

.hero-shape-1 {
  width: 420px;
  height: 420px;
  right: -80px;
  top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(212,69,29,0.08) 0%, transparent 70%);
  animation-delay: 0.3s;
  animation-name: shape-pulse;
  animation-duration: 6s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  opacity: 1;
}

.hero-shape-2 {
  width: 240px;
  height: 240px;
  right: 120px;
  top: 15%;
  background: radial-gradient(circle, rgba(151,168,34,0.1) 0%, transparent 70%);
  animation-delay: 0.6s;
  animation-name: shape-pulse-2;
  animation-duration: 8s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  opacity: 1;
}

.hero-shape-3 {
  width: 160px;
  height: 160px;
  right: 60px;
  bottom: 20%;
  background: radial-gradient(circle, rgba(212,69,29,0.07) 0%, transparent 70%);
  animation-name: shape-pulse-3;
  animation-duration: 5s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
  opacity: 1;
}

@keyframes shape-enter { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes shape-pulse { 0%,100% { transform: translateY(-50%) scale(1); } 50% { transform: translateY(-50%) scale(1.08); } }
@keyframes shape-pulse-2 { 0%,100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.12) translateY(-12px); } }
@keyframes shape-pulse-3 { 0%,100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.06) rotate(8deg); } }

/* SVG constellation / network lines in hero */
.hero-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

/* ---- Animated grid/mesh background ---- */
.mesh-bg {
  position: relative;
}
.mesh-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212,69,29,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,69,29,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

/* ---- Case study cards, enhanced ---- */
.case-card {
  position: relative;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transition: transform var(--trans-base), box-shadow var(--trans-base), border-color var(--trans-base);
  cursor: pointer;
}
.case-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--grey-300); }

.case-card-img {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--grey-100);
}

.case-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 600ms var(--ease-in-out);
  filter: grayscale(20%);
}
.case-card:hover .case-card-img img { transform: scale(1.05); filter: grayscale(0%); }

.case-card-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(64,64,64,0.5) 0%, transparent 60%);
}

.case-card-sector-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1;
  padding: var(--space-1) var(--space-3);
  background: rgba(255,255,255,0.95);
  color: var(--charcoal-dark);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
}

.case-card-body {
  padding: var(--space-5) var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.case-card-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
}
.case-card-tag.green { color: var(--green-dark); }

.case-card-title {
  font-size: var(--text-md);
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--charcoal-dark);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-card-excerpt {
  font-size: var(--text-sm);
  color: var(--charcoal);
  line-height: 1.6;
  max-width: 100%;
  flex: 1;
}

.case-card-metrics {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.case-metric {
  display: flex;
  flex-direction: column;
}

.case-metric-val {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.case-metric-label {
  font-size: var(--text-xs);
  color: var(--charcoal);
  margin-top: 2px;
  line-height: 1.3;
}

.case-card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.case-card-client {
  font-size: var(--text-xs);
  color: var(--charcoal);
  font-style: italic;
}

/* Cases grid */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

@media (max-width: 960px) { .cases-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .cases-grid { grid-template-columns: 1fr; } }

/* ---- Case study full-screen modal ---- */
.case-detail-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
  overflow: hidden;
}

.case-detail-modal[aria-hidden="false"] { pointer-events: all; }

.case-detail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20,20,20,0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 400ms ease;
  z-index: 0;
}
.case-detail-modal[aria-hidden="false"] .case-detail-backdrop { opacity: 1; }

.case-detail-panel {
  position: relative;
  z-index: 1;
  background: white;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 45% 55%;
  grid-template-rows: 1fr;
  overflow: hidden;
  opacity: 0;
  transform: translateX(60px) scale(0.98);
  transition: opacity 380ms cubic-bezier(0.22,1,0.36,1), transform 380ms cubic-bezier(0.22,1,0.36,1);
}
.case-detail-modal[aria-hidden="false"] .case-detail-panel {
  opacity: 1;
  transform: translateX(0) scale(1);
}

/* Left column, hero image fills full height */
.case-detail-img-col {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
}
.case-detail-img-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: grayscale(10%) brightness(0.9);
}
.case-detail-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.75) 0%, rgba(10,10,10,0.1) 60%, transparent 100%);
}
.case-detail-img-caption {
  position: absolute;
  bottom: var(--space-8);
  left: var(--space-8);
  right: var(--space-8);
  color: white;
}
.case-detail-img-caption .case-detail-client {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-2);
}
.case-detail-img-caption .case-detail-headline-quote {
  font-size: var(--text-base);
  font-weight: 600;
  color: white;
  line-height: 1.4;
  font-family: var(--font-display);
}

/* Right column, scrollable content */
.case-detail-content-col {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #fafaf8;
}
.case-detail-content-inner {
  padding: var(--space-12) var(--space-10);
  flex: 1;
}

/* case-detail-hero-img replaced by .case-detail-img-col img */

.case-detail-header {
  padding: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.case-detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.case-detail-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--color-border);
  color: var(--charcoal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
  z-index: 2;
  transition: background var(--trans-fast), color var(--trans-fast);
}
.case-detail-close:hover { background: var(--red); color: white; }

.case-detail-title {
  font-size: var(--text-2xl);
  line-height: 1.2;
  margin-bottom: var(--space-2);
}

.case-detail-headline {
  font-size: var(--text-md);
  color: var(--charcoal);
  font-style: italic;
  max-width: 100%;
  margin: 0;
}

.case-detail-body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.case-detail-section h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: var(--space-3);
}

.case-detail-section p {
  font-size: var(--text-sm);
  color: var(--charcoal);
  max-width: 100%;
  line-height: 1.7;
  margin: 0;
}

.case-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--grey-50);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.case-detail-metric-val {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.case-detail-metric-label {
  font-size: var(--text-xs);
  color: var(--charcoal);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case-detail-footer {
  padding: var(--space-6) var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---- Insights/News cards enhanced ---- */
.news-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--trans-base), transform var(--trans-base);
  display: flex;
  flex-direction: column;
}
.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.news-card-body { padding: var(--space-5); flex: 1; display: flex; flex-direction: column; gap: var(--space-3); }
.news-card-meta { font-size: var(--text-xs); color: var(--charcoal); text-transform: uppercase; letter-spacing: 0.08em; }
.news-card-title { font-size: var(--text-md); font-family: var(--font-body); font-weight: 700; color: var(--charcoal-dark); line-height: 1.35; }
.news-card-excerpt { font-size: var(--text-sm); color: var(--charcoal); max-width: 100%; line-height: 1.5; flex: 1; }
.news-card-link { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--red); transition: background var(--trans-fast); text-decoration: none; }
.news-card:hover .news-card-link { background: rgba(212,69,29,0.04); }

/* ---- Animated ticker / marquee ---- */
.ticker-wrap {
  background: var(--charcoal-dark);
  padding: var(--space-3) 0;
  overflow: hidden;
  border-top: 2px solid var(--red);
}
.ticker-track {
  display: flex;
  gap: var(--space-10);
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.6);
  flex-shrink: 0;
}
.ticker-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---- Services two-column visual band ---- */
.services-visual-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

.svb-col {
  padding: var(--space-16) var(--space-12);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.svb-col-dark {
  background: var(--charcoal-dark);
  position: relative;
  overflow: hidden;
}

.svb-col-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 30%, rgba(212,69,29,0.2), transparent 60%);
}

.svb-col-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.svb-col-light {
  background: var(--grey-50);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.svb-service-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.svb-service-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background var(--trans-fast), border-color var(--trans-fast);
  text-decoration: none;
}
.svb-service-item:hover { background: rgba(212,69,29,0.04); border-color: rgba(212,69,29,0.15); }

.svb-service-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: rgba(212,69,29,0.18);
  line-height: 1;
  width: 36px;
  flex-shrink: 0;
}

.svb-service-text h4 {
  font-size: var(--text-sm);
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--charcoal-dark);
  margin-bottom: 2px;
}
.svb-service-text p {
  font-size: var(--text-xs);
  color: var(--charcoal);
  max-width: 100%;
  line-height: 1.4;
  margin: 0;
}

/* ---- Floating quote band ---- */
.quote-band {
  background: var(--red);
  padding: var(--space-16) 0;
  position: relative;
  overflow: hidden;
}
.quote-band::before {
  content: '"';
  position: absolute;
  font-family: var(--font-display);
  font-size: 320px;
  line-height: 1;
  color: rgba(255,255,255,0.07);
  top: -60px;
  left: 40px;
}

.quote-band-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-12);
  align-items: center;
}

.quote-band blockquote p {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: italic;
  color: white;
  line-height: 1.4;
  max-width: 680px;
}
.quote-band-attr {
  color: rgba(255,255,255,0.75);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
}
.quote-band-attr strong { color: white; }

.quote-band-cta { flex-shrink: 0; }

@media (max-width: 768px) {
  .quote-band-inner { grid-template-columns: 1fr; }
  .services-visual-band { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}

/* ---- Impact numbers animated strip ---- */
.impact-strip {
  background: #f8f8f6;   /* light warm white, matches Who We Are section */
  padding: var(--space-12) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.impact-strip-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
}

.impact-item {
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  background: #f8f8f6;
}

.impact-num {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}

.impact-suffix {
  color: var(--green);
}

.impact-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--charcoal);
}

.impact-divider {
  width: 24px;
  height: 2px;
  background: var(--red);
  margin: var(--space-2) auto 0;
}

@media (max-width: 640px) {
  .impact-strip-grid { grid-template-columns: repeat(3, 1fr); }
  .cases-grid { grid-template-columns: 1fr; }
}

/* ---- Scroll reveal states ---- */
.fade-in {
  opacity: 1;  /* always visible, animation is enhancement only */
  transform: translateY(0);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.fade-in.in-view {
  opacity: 1;
  transform: translateY(0);
}

.stagger > * {
  opacity: 1;  /* always visible, animation is enhancement only */
  transform: translateY(0);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.stagger > *.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ── Performance: content-visibility for off-screen repeating sections ── */
.cases-grid,
.news-grid,
.testimonials,
.impact-strip,
.values-grid,
.mission-visual,
.cta-band {
  content-visibility: auto;
  contain-intrinsic-size: 0 500px;
}

/* Mobile: stack image on top, content below */
@media (max-width: 768px) {
  .case-detail-panel {
    grid-template-columns: 1fr;
    grid-template-rows: 42vh 1fr;
    overflow-y: auto;
  }
  .case-detail-img-col {
    height: 42vh;
  }
  .case-detail-content-inner {
    padding: var(--space-8) var(--space-6);
  }
}
