/* ══════════════════════════════════════════════
   CASE STUDY PAGE
   Inherits all tokens from style.css
══════════════════════════════════════════════ */

/* Extra bottom padding so footer clears the fixed cs-nav bar */
.cs-page ~ footer {
  padding-bottom: 96px;
}

/* ── Section navigator (sticky, appears after hero) ── */
.cs-nav {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: linear-gradient(160deg, rgba(255,255,255,0.58) 0%, rgba(255,255,255,0.36) 100%);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow:
    inset 0  1px 0 rgba(255,255,255,0.85),
    inset 0 -1px 0 rgba(0,0,0,0.04),
    0 4px 16px rgba(0,0,0,0.08);

  /* Hidden by default, slides in after hero */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-50%) translateY(10px);

  /* Horizontal scroll on small screens */
  max-width: calc(100vw - 32px);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.cs-nav::-webkit-scrollbar { display: none; }

.cs-nav--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0px);
}

.cs-nav__pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-ink-muted);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.cs-nav__pill:hover {
  color: var(--color-ink);
  background: rgba(0,0,0,0.05);
}

.cs-nav__pill.is-active {
  background: var(--color-ink);
  color: var(--color-bg);
}

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */

@keyframes csFadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes csFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Hero load animations (CSS, no JS) ── */
.cs-hero__eyebrow {
  animation: csFadeUp 0.5s ease both;
  animation-delay: 0.05s;
}

.cs-hero__title {
  animation: csFadeUp 0.55s ease both;
  animation-delay: 0.15s;
}

.cs-hero__summary {
  animation: csFadeUp 0.55s ease both;
  animation-delay: 0.28s;
}

.cs-hero__meta {
  animation: csFadeUp 0.55s ease both;
  animation-delay: 0.4s;
}

.cs-hero__disciplines {
  animation: csFadeUp 0.55s ease both;
  animation-delay: 0.52s;
}

.cs-media--hero {
  animation: csFadeUp 0.6s ease both;
  animation-delay: 0.65s;
}

/* ── Scroll-triggered base ── */
.cs-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cs-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for grid children */
.cs-animate--d1 { transition-delay: 0.05s; }
.cs-animate--d2 { transition-delay: 0.12s; }
.cs-animate--d3 { transition-delay: 0.19s; }
.cs-animate--d4 { transition-delay: 0.26s; }

/* Findings slide in from left */
.cs-animate--slide {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.cs-animate--slide.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Media scale-up */
.cs-animate--scale {
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.cs-animate--scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Quote fade */
.cs-animate--fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.cs-animate--fade.is-visible {
  opacity: 1;
}

/* ── Page wrapper ── */
.cs-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 110px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

/* ── Tags / pills ── */
.cs-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-ink);
  line-height: 1.4;
  overflow: hidden;

  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.58) 0%,
    rgba(255, 255, 255, 0.36) 100%
  );
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0  1px 0  rgba(255, 255, 255, 0.85),
    inset 0 -1px 0  rgba(0, 0, 0, 0.04),
    0 2px 10px      rgba(0, 0, 0, 0.08),
    0 0  0  0.5px   rgba(0, 0, 0, 0.05);
}

.cs-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 45%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.35),
    rgba(255, 255, 255, 0)
  );
  border-radius: 0 0 50% 50%;
  pointer-events: none;
}


/* ── Hero ── */
.cs-hero {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cs-hero__eyebrow {
  display: flex;
  gap: 6px;
}

.cs-hero__title {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.cs-hero__summary {
  font-size: var(--text-hero);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.6;
  max-width: 560px;
}

.cs-hero__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
  padding: 24px 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs-meta-label {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cs-meta-value {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-ink);
}

.cs-hero__disciplines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Media blocks ── */
.cs-media {
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-placeholder);
  border: 1px solid var(--color-border);
}

.cs-media--hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-top: 8px;
  background: var(--color-bg);
}

.cs-media--full {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.cs-media--decision {
  width: 100%;
  overflow: visible;
  background: none;
  border: none;
}

.cs-media video,
.cs-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-media__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
}

/* ── Section layout ── */
.cs-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.cs-section--highlight {
  background: var(--color-placeholder);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 40px;
}

.cs-section__header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.cs-section__index {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-ink-muted);
  letter-spacing: 0.06em;
}

.cs-section__title {
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.2;
}

.cs-section__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Typography ── */
.cs-lead {
  font-size: var(--text-hero);
  font-weight: 400;
  color: var(--color-ink);
  line-height: 1.6;
}

.cs-body {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.7;
}

.cs-quote {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.7;
  border-left: 2px solid var(--color-border);
  padding-left: 20px;
  font-style: italic;
}

/* ── Grids ── */
.cs-grid {
  display: grid;
  gap: 12px;
}

.cs-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.cs-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.cs-grid--tight {
  gap: 8px;
}

/* ── Callout cards ── */
.cs-callout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-bg);
}

.cs-callout__icon {
  font-size: 20px;
  line-height: 1;
}

.cs-callout__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-ink);
}

.cs-callout__body {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.6;
}

/* ── Research findings ── */
.cs-findings {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-finding {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.cs-finding:first-child {
  border-top: 1px solid var(--color-border);
}

.cs-finding__stat {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-ink);
  min-width: 64px;
  line-height: 1;
  padding-top: 2px;
}

.cs-finding__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-finding__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-ink);
}

.cs-finding__body {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.6;
}

/* ── Design decisions ── */
.cs-decision {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
}

.cs-decision:first-child {
  border-top: 1px solid var(--color-border);
}

.cs-decision__meta {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.cs-decision__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-ink-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.cs-decision__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 6px;
}

.cs-decision__problem,
.cs-decision__rationale {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.6;
}

/* ── Stats ── */
.cs-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.cs-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-stat__value {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1;
}

.cs-stat__label {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.5;
}

/* ── List ── */
.cs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-list li {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-ink-soft);
  line-height: 1.7;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
  padding-left: 16px;
  position: relative;
}

.cs-list li:first-child {
  border-top: 1px solid var(--color-border);
}

.cs-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--color-ink-muted);
  font-size: var(--text-sm);
}

/* ── Back link ── */
.cs-back {
  display: flex;
  padding: 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cs-page {
    padding: 80px 16px 60px;
    gap: 56px;
  }

  .cs-hero__title {
    font-size: 36px;
  }

  .cs-hero__meta {
    grid-template-columns: 1fr 1fr;
  }

  .cs-grid--2,
  .cs-grid--3 {
    grid-template-columns: 1fr;
  }

  .cs-stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .cs-stat__value {
    font-size: 28px;
  }

  .cs-section--highlight {
    padding: 24px 16px;
  }

  .cs-finding__stat {
    font-size: 22px;
    min-width: 48px;
  }
}


/* ── Mockup pairs (low-fi / high-fi) ── */
.cs-mockup-pair {
  display: flex;
  gap: 40px;
  width: 100%;
  justify-content: center;
}

.cs-mockup {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-mockup__label {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cs-mockup img {
  width: 100%;
  max-width: 254px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  display: block;
}

/* Hero thumbnail */
.cs-media--hero img {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
  display: block;
}

@media (max-width: 600px) {
  .cs-mockup-pair {
    flex-direction: column;
    align-items: center;
  }
}
