/* MCA — Case Studies CMS styles
 * Scoped to the dark editorial theme (body.blog-dark).
 * Card system prefixed .csx-* to avoid clashing with the home .cs-* tiles.
 */

/* ---------- Hero: centered, animated trajectory field ---------- */
body.blog-dark .csx-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 208px 0 128px;
  min-height: 92vh;
  display: flex;
  align-items: center;
  background: #06080B;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.csx-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.csx-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.csx-hero__grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(to right, rgba(120, 200, 198, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 200, 198, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(75% 65% at 50% 45%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(75% 65% at 50% 45%, #000 20%, transparent 78%);
  animation: csx-grid-rise 26s linear infinite;
}
@keyframes csx-grid-rise {
  from { background-position: 0 0; }
  to   { background-position: 0 -60px; }
}
.csx-hero__beam {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  mix-blend-mode: screen;
  opacity: 0.5;
  will-change: transform;
}
.csx-hero__beam--1 {
  width: 640px; height: 640px;
  left: 50%; top: 38%;
  margin-left: -320px; margin-top: -320px;
  background: radial-gradient(circle, rgba(0, 165, 161, 0.5) 0%, rgba(0, 165, 161, 0) 65%);
  animation: csx-beam-1 20s ease-in-out infinite alternate;
}
.csx-hero__beam--2 {
  width: 520px; height: 520px;
  right: 8%; bottom: 4%;
  background: radial-gradient(circle, rgba(26, 59, 77, 0.85) 0%, rgba(26, 59, 77, 0) 65%);
  animation: csx-beam-2 26s ease-in-out infinite alternate;
}
@keyframes csx-beam-1 {
  0%   { transform: translate(-60px, 20px) scale(1); }
  100% { transform: translate(70px, -40px) scale(1.12); }
}
@keyframes csx-beam-2 {
  0%   { transform: translate(40px, 20px) scale(1.05); }
  100% { transform: translate(-50px, -30px) scale(0.92); }
}
.csx-hero__noise {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.csx-hero__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 80% at 50% 42%, transparent 38%, rgba(6, 8, 11, 0.55) 82%, rgba(6, 8, 11, 1) 100%);
}
.csx-hero__fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 160px;
  z-index: 1;
  background: linear-gradient(to bottom, transparent, #07090C);
  pointer-events: none;
}

.csx-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Eyebrow */
.csx-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "JetBrains Mono", "JetBrains Mono Fallback", monospace;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--teal);
  margin-bottom: 26px;
  opacity: 0;
  animation: csx-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.05s forwards;
}
.csx-hero__eyebrow-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(0, 165, 161, 0.5);
  animation: csx-pulse 2.4s ease-in-out infinite;
}
@keyframes csx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 165, 161, 0.5); opacity: 1; }
  50%      { box-shadow: 0 0 0 8px rgba(0, 165, 161, 0); opacity: 0.6; }
}

/* Title */
.csx-hero__title {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
  text-wrap: balance;
}
.csx-hero__line {
  display: block;
  opacity: 0;
  transform: translateY(26px);
  animation: csx-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.csx-hero__line:nth-child(1) { animation-delay: 0.14s; }
.csx-hero__line:nth-child(2) { animation-delay: 0.28s; }
.csx-hero__title-accent {
  background: linear-gradient(100deg, #2EE0DC 0%, #00A5A1 45%, #2EE0DC 75%, #00A5A1 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: csx-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.28s forwards,
    csx-shimmer 7s linear infinite;
}
@keyframes csx-shimmer {
  to { background-position: 220% center; }
}
@keyframes csx-rise {
  to { opacity: 1; transform: translateY(0); }
}

.csx-hero__sub {
  margin: 28px auto 0;
  font-size: 19px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.66);
  max-width: 640px;
  text-wrap: pretty;
  opacity: 0;
  animation: csx-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.42s forwards;
}

/* Stats — centered */
.csx-hero__eyebrow + .csx-hero__title { margin-top: 0; }
.csx-hero__stats {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 36px;
  margin-top: 52px;
  flex-wrap: wrap;
  opacity: 0;
  animation: csx-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.56s forwards;
}
.csx-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}
.csx-hero__stat-num {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #F4F1EA;
}
.csx-hero__stat-label {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(244, 241, 234, 0.55);
  max-width: 180px;
}
.csx-hero__stat-div {
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.16), transparent);
}
@media (max-width: 640px) {
  body.blog-dark .csx-hero { min-height: auto; padding: 150px 0 96px; }
  .csx-hero__stat-div { display: none; }
  .csx-hero__stats { gap: 28px 40px; margin-top: 40px; }
  .csx-hero__sub { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .csx-hero__grid,
  .csx-hero__beam--1,
  .csx-hero__beam--2,
  .csx-hero__eyebrow-dot,
  .csx-hero__title-accent { animation: none; }
  .csx-hero__eyebrow,
  .csx-hero__line,
  .csx-hero__sub,
  .csx-hero__stats { opacity: 1; transform: none; animation: none; }
  .csx-hero__title-accent {
    -webkit-text-fill-color: transparent;
    background: linear-gradient(180deg, #2EE0DC, #00A5A1);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* ---------- Featured case ---------- */
.csx-feature {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: linear-gradient(180deg, #0D1218 0%, #0A0E13 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.csx-feature:hover {
  border-color: color-mix(in oklab, var(--accent) 50%, transparent);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7),
    0 0 0 1px color-mix(in oklab, var(--accent) 20%, transparent);
  transform: translateY(-2px);
}
@media (max-width: 880px) {
  .csx-feature { grid-template-columns: 1fr; }
}
.csx-feature__media {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}
.csx-feature__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.csx-feature:hover .csx-feature__media img { transform: scale(1.04); }
.csx-feature__media-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 120%,
    color-mix(in oklab, var(--accent) 40%, transparent) 0%, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.6;
}
@media (max-width: 880px) {
  .csx-feature__media { min-height: 240px; }
}
.csx-feature__body {
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 640px) {
  .csx-feature__body { padding: 32px 26px; }
}
.csx-feature__tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.csx-feature__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #F4F1EA;
  margin: 0;
}
.csx-feature__summary {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(244, 241, 234, 0.62);
}
.csx-feature__result {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 26px 0 22px;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.csx-feature__result-stat {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  white-space: nowrap;
}
.csx-feature__result-label {
  font-size: 14px;
  line-height: 1.4;
  color: rgba(244, 241, 234, 0.7);
}
.csx-feature__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  font-weight: 600;
  font-size: 14px;
  color: #F4F1EA;
}
.csx-feature__cta svg { color: var(--accent); transition: transform 0.25s ease; }
.csx-feature:hover .csx-feature__cta svg { transform: translate(2px, -2px); }

/* ---------- Service chips ---------- */
.csx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.csx-chip {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(244, 241, 234, 0.78);
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
.csx-chip--more {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}
.csx-chips--compact .csx-chip { padding: 5px 10px; font-size: 11px; }

/* Center the service chips in the centered detail header */
.art2-head__inner .csx-chips { justify-content: center; }

/* Keep filter chip labels on one line (e.g. "Layer 1") */
.blog-filters .blog-chip { white-space: nowrap; }

/* ---------- Grid ---------- */
.csx-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1000px) { .csx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .csx-grid { grid-template-columns: 1fr; } }

.csx-card {
  display: flex;
  flex-direction: column;
  background: #0D1218;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.csx-card:hover {
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
  box-shadow: 0 28px 60px -36px rgba(0, 0, 0, 0.75),
    0 0 0 1px color-mix(in oklab, var(--accent) 18%, transparent);
  transform: translateY(-3px);
}
.csx-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.csx-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.csx-card:hover .csx-card__media img { transform: scale(1.05); }
.csx-card__sector {
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(7, 9, 12, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}
.csx-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 20px;
}
.csx-card__result {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.csx-card__result-stat {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  white-space: nowrap;
}
.csx-card__result-label {
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(244, 241, 234, 0.58);
}
.csx-card__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #F4F1EA;
  margin: 0;
}
.csx-card__summary {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 241, 234, 0.55);
}
.csx-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}
.csx-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #F4F1EA;
  white-space: nowrap;
}
.csx-card__cta svg { color: var(--accent); transition: transform 0.25s ease; }
.csx-card:hover .csx-card__cta svg { transform: translate(2px, -2px); }

/* ---------- Detail: hero image accent ---------- */
.csx-detail__hero .art2-hero-img__wrap {
  position: relative;
}
.csx-detail__hero .art2-hero-img__wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* ---------- Detail: metrics band ---------- */
.csx-band {
  padding: 8px 0 4px;
}
.csx-band__grid {
  display: grid;
  grid-template-columns: 0.8fr 1.4fr;
  gap: 28px;
  align-items: center;
  padding: 32px 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0));
}
@media (max-width: 760px) {
  .csx-band__grid { grid-template-columns: 1fr; gap: 24px; padding: 26px 22px; }
}
.csx-band__lead {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
@media (max-width: 760px) {
  .csx-band__lead { padding-right: 0; border-right: 0; padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
}
.csx-band__lead-stat {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
}
.csx-band__lead-label {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(244, 241, 234, 0.66);
}
.csx-band__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 480px) {
  .csx-band__metrics { grid-template-columns: 1fr; gap: 16px; }
}
.csx-band__metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.csx-band__metric-val {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: #F4F1EA;
}
.csx-band__metric-label {
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(244, 241, 234, 0.52);
}

/* ---------- Detail: quote ---------- */
.csx-quote {
  margin: 60px 0;
  padding: 32px 36px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0 14px 14px 0;
  background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 10%, transparent), rgba(255, 255, 255, 0));
}
.csx-quote p {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 21px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: #F4F1EA;
  margin: 0;
  font-style: normal;
}
.csx-quote footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.csx-quote__name { font-weight: 600; font-size: 14px; color: #F4F1EA; }
.csx-quote__role { font-size: 13px; color: rgba(244, 241, 234, 0.5); }
.csx-quote__role::before { content: "· "; }

/* ---------- Detail: related grid ---------- */
.csx-rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 900px) { .csx-rel-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (max-width: 680px) { .csx-rel-grid { grid-template-columns: 1fr; } }
.csx-rel-grid .csx-card__media { aspect-ratio: 16 / 9; }

/* Tighten gap between featured & grid (heading removed) */
.csx-grid-section { padding-top: 0; }
