/* ═══════════════════════════════════════════════════════════════
   Norton-Gauss · Cases main page — coverflow carousel
   On-brand: dark canvas, hairline borders, lime used sparingly,
   node/network motif. Easing follows brand tokens.
   ═══════════════════════════════════════════════════════════════ */

.cases-page { position: relative; overflow: hidden; }

/* ── Hero header ──────────────────────────────────────────────── */
.cases-hero { position: relative; padding: 132px 0 8px; }
.cases-hero .container { position: relative; z-index: 3; }
.cases-hero h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(48px, 6.4vw, 104px); line-height: 0.94;
  letter-spacing: -0.026em; margin-top: 22px; max-width: 16ch;
}
.cases-hero .lede { margin-top: 24px; }
.cases-hero .idx-stats {
  display: flex; gap: 40px; margin-top: 34px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ng-ink-dim);
}
.cases-hero .idx-stats b {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 30px; letter-spacing: -0.01em; color: var(--ng-ink);
  margin-bottom: 6px;
}
.cases-hero .idx-stats b em { color: var(--ng-lime-ink); font-style: normal; }

/* ── Carousel stage ───────────────────────────────────────────── */
.cc-stage {
  position: relative;
  height: clamp(560px, 64vh, 660px);
  margin: 40px 0 0;
  perspective: 2200px;
  perspective-origin: 50% 42%;
  user-select: none;
  touch-action: pan-y;
}
.cc-track {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}

/* Each card is absolutely centered; transform set inline per offset */
.cc-card {
  position: absolute;
  top: 50%; left: 50%;
  width: clamp(360px, 38vw, 560px);
  height: clamp(440px, 52vh, 540px);
  margin-left: calc(clamp(360px, 38vw, 560px) / -2);
  margin-top: calc(clamp(440px, 52vh, 540px) / -2);
  transform-style: preserve-3d;
  transition:
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
.cc-card.is-side { cursor: pointer; }
.cc-card.is-hidden { pointer-events: none; }

.cc-card-inner {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 22%),
    var(--ng-surface);
  border: 1px solid var(--ng-line);
  border-radius: 22px;
  overflow: hidden;
  transition: border-color 0.5s var(--ease-out), box-shadow 0.6s var(--ease-out);
}
.cc-card.is-active .cc-card-inner {
  border-color: rgba(217,255,53,0.34);
  box-shadow:
    0 0 0 1px rgba(217,255,53,0.10),
    0 40px 120px -30px rgba(0,0,0,0.85),
    0 0 90px -20px rgba(217,255,53,0.16);
}

/* Side cards get a cool veil so the active one reads as the focal point */
.cc-card.is-side .cc-card-inner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(3,8,7,0.30), rgba(3,8,7,0.55));
  transition: opacity 0.5s var(--ease-out);
}

/* Visualization area */
.cc-viz {
  position: relative;
  height: 46%;
  border-bottom: 1px solid var(--ng-line);
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 78% 18%, rgba(217,255,53,0.07), transparent 55%),
    linear-gradient(180deg, #0a1513, #07100e);
}
.cc-viz .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(120% 100% at 50% 30%, #000 40%, transparent 90%);
}
.cc-viz svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cc-viz .num-badge {
  position: absolute; top: 16px; left: 18px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--ng-ink-dim);
}
.cc-viz .yr-badge {
  position: absolute; top: 16px; right: 18px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--ng-ink-dim);
}

/* Card body */
.cc-body {
  flex: 1; display: flex; flex-direction: column;
  padding: 24px 26px 26px;
  min-height: 0;
}
.cc-tag {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ng-lime-ink);
}
.cc-client {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ng-ink-dim); margin-top: 7px;
}
.cc-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(20px, 1.7vw, 26px); line-height: 1.08;
  letter-spacing: -0.018em; color: var(--ng-ink); margin-top: 14px;
  text-wrap: balance;
}
.cc-title em { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--ng-lime-ink); }
.cc-summary {
  font-size: 14.5px; line-height: 1.5; color: var(--ng-ink-mute);
  margin-top: 14px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.6s var(--ease-out), opacity 0.5s var(--ease-out), margin 0.5s var(--ease-out);
}
.cc-card.is-active .cc-summary { max-height: 120px; opacity: 1; }

.cc-foot { margin-top: auto; padding-top: 18px; }
.cc-metrics {
  display: flex; gap: 26px; border-top: 1px solid var(--ng-line);
  padding-top: 16px;
}
.cc-metrics .v {
  font-family: var(--font-display); font-weight: 500; font-size: 24px;
  line-height: 1; letter-spacing: -0.018em; color: var(--ng-ink);
}
.cc-card.is-active .cc-metrics .v:first-child,
.cc-card.is-active .cc-metrics > div:first-child .v { color: var(--ng-lime-ink); }
.cc-metrics .k {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ng-ink-dim); margin-top: 7px;
}
.cc-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ng-lime-ink);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), gap 0.2s;
}
.cc-card.is-active .cc-cta { opacity: 1; transform: none; }
.cc-cta:hover { gap: 14px; }
.cc-cta .ln { width: 26px; height: 1px; background: currentColor; }

/* ── Controls (outside scaled cards) ──────────────────────────── */
.cc-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-top: 30px;
}
.cc-arrows { display: flex; gap: 10px; }
.cc-arrow {
  width: 52px; height: 52px; border-radius: 999px;
  border: 1px solid var(--ng-line); color: var(--ng-ink-mute);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.15s;
}
.cc-arrow:hover { color: var(--ng-ink); border-color: var(--ng-line-strong); background: var(--ng-line-soft); }
.cc-arrow:active { transform: scale(0.94); }
.cc-arrow svg { width: 20px; height: 20px; }

.cc-counter {
  font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em;
  font-size: 30px; color: var(--ng-ink); white-space: nowrap;
}
.cc-counter span { color: var(--ng-ink-dim); font-size: 18px; }

.cc-playbtn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ng-ink-dim);
  border: 1px solid var(--ng-line); border-radius: 999px; padding: 9px 16px;
  transition: color 0.18s, border-color 0.18s;
}
.cc-playbtn:hover { color: var(--ng-ink); border-color: var(--ng-line-strong); }
.cc-playbtn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ng-ink-dim); }
.cc-playbtn.is-playing .dot { background: var(--ng-lime); animation: pulse 2.2s infinite; }

/* ── Thumbnail filmstrip ──────────────────────────────────────── */
.cc-rail {
  display: flex; gap: 12px; margin-top: 34px;
  overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.cc-rail::-webkit-scrollbar { display: none; }
.cc-thumb {
  flex: 1 1 0; min-width: 150px;
  position: relative; text-align: left;
  padding: 14px 16px 15px; border-radius: 13px;
  background: var(--ng-surface); border: 1px solid var(--ng-line);
  overflow: hidden;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}
.cc-thumb:hover { border-color: var(--ng-line-strong); transform: translateY(-2px); }
.cc-thumb.is-active { border-color: rgba(217,255,53,0.4); background: var(--ng-surface-2); }
.cc-thumb .t-num {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--ng-ink-dim);
}
.cc-thumb.is-active .t-num { color: var(--ng-lime-ink); }
.cc-thumb .t-title {
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  line-height: 1.15; letter-spacing: -0.01em; color: var(--ng-ink-mute);
  margin-top: 9px;
}
.cc-thumb.is-active .t-title { color: var(--ng-ink); }
.cc-thumb .t-bar {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: rgba(217,255,53,0.14); transform: scaleX(0); transform-origin: left;
}
.cc-thumb.is-active .t-bar { background: var(--ng-lime); }

/* autoplay progress fill on active thumb */
.cc-thumb.is-active.is-progressing .t-bar { animation: ccProgress var(--cc-dur, 6s) linear forwards; }
@keyframes ccProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── Viz animation hooks (only active card animates) ──────────── */
.cc-card.is-active .vz-pulse { animation: vzPulse 2.6s ease-in-out infinite; }
.cc-card.is-active .vz-pulse.d1 { animation-delay: 0.4s; }
.cc-card.is-active .vz-pulse.d2 { animation-delay: 0.8s; }
.cc-card.is-active .vz-pulse.d3 { animation-delay: 1.2s; }
@keyframes vzPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

.cc-card.is-active .vz-dash {
  stroke-dasharray: 4 5; animation: vzDash 1.6s linear infinite;
}
@keyframes vzDash { to { stroke-dashoffset: -18; } }

.cc-card.is-active .vz-grow { transform-origin: bottom; animation: vzGrow 0.9s var(--ease-out) both; }
@keyframes vzGrow { from { transform: scaleY(0.05); } to { transform: scaleY(1); } }

.cc-card.is-active .vz-sweep { animation: vzSweep 3.4s linear infinite; }
@keyframes vzSweep { to { transform: rotate(360deg); } }

/* Entrance */
.cases-enter .cc-stage { animation: ccStageIn 0.9s var(--ease-out) both; }
@keyframes ccStageIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .cc-card { transition: opacity 0.2s linear; }
  .cc-card.is-active .vz-pulse,
  .cc-card.is-active .vz-dash,
  .cc-card.is-active .vz-grow,
  .cc-card.is-active .vz-sweep,
  .cc-thumb.is-active.is-progressing .t-bar,
  .cases-enter .cc-stage { animation: none; }
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
  .cc-stage { height: 540px; perspective: 1400px; }
  .cc-card { width: 80vw; height: 460px; margin-left: -40vw; margin-top: -230px; }
  .cc-controls { flex-wrap: wrap; }
  .cc-rail { display: none; }
}
