/* ═══════════════════════════════════════════════
   NOVA TERRA DIGITAL — Case Study pages
   Uses core tokens from styles.css + sp- patterns
════════════════════════════════════════════════ */

/* ── Hero extras ─────────────────────────────── */
.cs-hero .sp-hero__sub { margin-bottom: 26px; }

/* Photo hero: no pedestal/base (that's for the floating AI renders),
   let the photo fill its column */
.cs-hero .sp-hero__visual::after { display: none; }
.cs-hero .sp-hero__visual img { max-width: none; filter: none; }
@media (max-width: 900px) {
  .cs-hero .sp-hero__visual { order: 0; }
  .cs-hero .sp-hero__visual img { max-width: none; }
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.cs-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 7px 13px;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--bg-2);
  white-space: nowrap;
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 18px;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  background: var(--accent-dim);
}
.cs-badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.cs-hero__photo {
  position: relative;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5);
}
.cs-hero__photo::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;
}
.cs-hero__photo img { width: 100%; height: auto; display: block; }
.cs-hero__photo figcaption {
  position: absolute;
  left: 14px; bottom: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  background: rgba(8,8,7,0.55);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 100px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── Intro lede (compact, under hero) ────────── */
.cs-lede-section { padding-top: 64px; padding-bottom: 64px; }
.cs-lede {
  max-width: 820px;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.75;
}

/* ── Results (stat cards) ────────────────────── */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cs-stat {
  position: relative;
  padding: 34px 30px 30px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008));
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.cs-stat:hover { border-color: var(--border-accent); transform: translateY(-3px); }
.cs-stat::before {
  content: "";
  position: absolute;
  top: 0; left: 30px; right: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}
.cs-stat__num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.cs-stat__label {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.45;
}
.cs-stats__note {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

/* ── Gallery strip ───────────────────────────── */
.cs-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cs-gallery figure {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
}
.cs-gallery img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease-expo);
}
.cs-gallery figure:hover img { transform: scale(1.035); }

/* ── Testimonial ─────────────────────────────── */
.cs-testimonial {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 54px 56px 48px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.cs-testimonial::before {
  content: "";
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}
.cs-testimonial__stars {
  font-size: 20px;
  letter-spacing: 6px;
  color: #febc2e;
  margin-bottom: 26px;
}
.cs-testimonial blockquote {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 26px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 30px;
}
.cs-testimonial__who { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.cs-testimonial__name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.cs-testimonial__role {
  font-size: 13px;
  color: var(--text-3);
}
@media (max-width: 600px) {
  .cs-testimonial { padding: 38px 26px 34px; }
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .cs-stats { grid-template-columns: repeat(2, 1fr); }
  .cs-gallery { grid-template-columns: 1fr; }
  .cs-gallery img { aspect-ratio: 16 / 9; }
}
@media (max-width: 540px) {
  .cs-stats { grid-template-columns: 1fr; }
  .cs-hero__photo figcaption { display: none; }
}

/* ── Social gallery — real posts, linked to the live feed ── */
.cs-social {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin-inline: auto;
}
.cs-social__item {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
}
.cs-social__item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  display: block;
}
.cs-social__tag {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 7, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.cs-social__cap {
  display: block;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .cs-social { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* video tiles — native playback, hosted on our own domain */
.cs-social__item video {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--bg-2);
}
.cs-social__cap, .cs-social__tag { pointer-events: none; transition: opacity 0.3s var(--ease); }
.cs-social__item.is-playing .cs-social__tag { opacity: 0; }

/* real play button — sits over the poster, gone while playing */
.cs-social__play {
  position: absolute;
  left: 50%;
  top: calc(50% - 21px); /* center of the media area, above the caption bar */
  transform: translate(-50%, -50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #04181f;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(41,121,232, 0.18);
  transition: transform 0.2s var(--ease), background 0.25s var(--ease), opacity 0.3s var(--ease);
}
.cs-social__play svg { margin-left: 3px; }
.cs-social__play:hover { background: var(--accent-bright); transform: translate(-50%, -50%) scale(1.07); }
/* once playback has started the native controls own it — the custom button
   must stay gone, or a pause puts a 62px button back over the scrubber */
.cs-social__item.is-playing .cs-social__play { opacity: 0; pointer-events: none; visibility: hidden; }

/* smaller play button on phones — must come after the base rule */
@media (max-width: 900px) {
  .cs-social__play {
    width: 46px;
    height: 46px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(41,121,232, 0.18);
  }
  .cs-social__play svg { width: 20px; height: 20px; }
}

/* split gallery (Virginia): full uncropped portrait beside a stack of screenshots */
.cs-gallery--split {
  grid-template-columns: 0.95fr 1.05fr;
  align-items: start;
}
.cs-gallery__stack { display: grid; gap: 18px; }
/* the portrait is shown WHOLE — no 3:2 crop */
.cs-portrait img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
}
@media (max-width: 780px) {
  .cs-gallery--split { grid-template-columns: 1fr; }
}

/* ── Stat cards: fold-behind stacking scroll (mobile) ──
   Only below 540px, where .cs-stats actually becomes one column.
   The base .cs-stat background is a translucent gradient — stacked cards
   must be opaque or you see straight through to the one behind, so the
   same gradient is layered over --bg-2 (the dark section it sits on),
   which looks identical but occludes. */
@media (max-width: 540px) {
  .cs-stats { position: relative; gap: 18px; }
  .cs-stats .cs-stat {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008)), var(--bg-2);
    transform-origin: center top;
    will-change: transform, filter;
    transition: border-color 0.25s var(--ease);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.03), 0 18px 44px -30px rgba(0, 0, 0, 0.9);
  }
  .cs-stats .cs-stat:nth-child(2) { top: calc(var(--nav-h) + 26px); }
  .cs-stats .cs-stat:nth-child(n+3) { top: calc(var(--nav-h) + 36px); }
  .cs-stats .cs-stat:hover { transform: none; }
}
