/* CASE STUDY SHARED STYLES */

/* DESIGN SYSTEM TOKENS — matches main site (styles.css) palette */
:root {
  --bg: #fafaf8;
  --surface: #f2f1ee;
  --surface-2: #e8e6e1;
  --text: #1a1a18;
  --text-muted: #636360;
  --accent: #2c2c28;
  --brand: #005AFC;
  --green: #059669;
  --border: #e8e6e1;
  --white: #ffffff;
  --tag-bg: #eeede9;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'DM Serif Display', serif;
  --nav-h: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
}

/* TYPOGRAPHY */
h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 400;
  line-height: 1.3;
  margin: 0;
}

h3 {
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}

small {
  font-size: 13px;
}

em {
  font-style: italic;
}

/* ========================================
   NAVIGATION — matches main site exactly
   ======================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  z-index: 100;
  font-family: var(--font-sans);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: color 200ms ease-out;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
}

@media (max-width: 768px) {
  nav {
    padding: 0 24px;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-links a {
    font-size: 13px;
  }
}

/* ========================================
   PASSWORD OVERLAY
   ======================================== */
#password-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 1;
  transition: opacity 400ms ease;
}

#password-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.pw-box {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.pw-line {
  width: 32px;
  height: 3px;
  background: var(--brand);
  margin: 0 auto 24px;
}

.pw-box h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.pw-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

#pw-form {
  margin-bottom: 24px;
}

.pw-input-wrap {
  margin-bottom: 16px;
}

#pw-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border 200ms ease;
  background: var(--white);
}

#pw-input:focus {
  border-color: var(--brand);
}

.pw-submit {
  width: 100%;
  padding: 12px 16px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.pw-submit:hover {
  opacity: 0.9;
}

.pw-error {
  display: none;
  color: #dc2626;
  font-size: 12px;
  margin-top: 8px;
}

.pw-error.show {
  display: block;
}

.pw-footer {
  color: var(--text-muted);
  font-size: 12px;
  position: absolute;
  bottom: 48px;
  left: 0;
  right: 0;
  text-align: center;
}

/* ========================================
   LAYOUT
   ======================================== */
main {
  min-height: 100vh;
  padding-top: var(--nav-h);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 769px) {
  .container {
    padding: 0 48px;
  }
}

/* ========================================
   HERO SECTION
   ======================================== */
.cs-hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
}

.cs-back {
  display: inline-block;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 200ms ease;
}

.cs-back:hover {
  color: var(--text);
}

.cs-accent-bar {
  width: 4px;
  height: 32px;
  background: var(--brand);
  margin-bottom: 24px;
}

.cs-logo {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.cs-logo img {
  max-height: 48px;
  object-fit: contain;
}

.cs-company {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.cs-title {
  margin-bottom: 32px;
  color: var(--text);
}

.cs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  background: var(--white);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  border: 1px solid var(--border);
}

.cs-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.cs-meta-item {
  font-size: 14px;
  color: var(--text-muted);
}

.cs-meta-item strong {
  font-weight: 600;
  color: var(--text);
  margin-right: 6px;
}

@media (max-width: 768px) {
  .cs-hero {
    padding: 48px 0 40px;
  }
  .cs-meta-row {
    gap: 16px;
    flex-direction: column;
  }
}

/* ========================================
   CAROUSEL — Quick Brief
   ======================================== */
.cs-carousel-section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
}

.cs-carousel-header {
  margin-bottom: 24px;
}

.cs-carousel-wrap {
  position: relative;
}

.cs-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 12px;
}

.cs-carousel::-webkit-scrollbar {
  height: 4px;
}

.cs-carousel::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 2px;
}

.cs-carousel::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 2px;
}

.cs-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 200ms ease-out;
}

.cs-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cs-card-icon {
  font-size: 24px;
}

.cs-card-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cs-card-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.cs-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  transition: all 200ms ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cs-carousel-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.cs-prev {
  left: -48px;
}

.cs-next {
  right: -48px;
}

@media (max-width: 768px) {
  .cs-carousel {
    gap: 12px;
  }
  .cs-card {
    flex: 0 0 240px;
    padding: 20px;
  }
  .cs-prev, .cs-next {
    display: none;
  }
}

/* ========================================
   OVERVIEW STRIP — bordered card, serif values
   ======================================== */
.cs-overview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 48px 0;
}

.cs-overview-cell {
  text-align: left;
}

.cs-overview-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.cs-overview-value {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
}

@media (max-width: 768px) {
  .cs-overview-strip {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px;
  }
}

/* ========================================
   WHO / WHAT / WHY / HOW — single card, 4 cols, serif italic labels
   ======================================== */
.cs-wwwh {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cs-wwwh-card {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.cs-wwwh-label {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 400;
  color: var(--brand);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 12px;
  opacity: 0.4;
}

.cs-wwwh-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

@media (max-width: 1024px) {
  .cs-wwwh {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .cs-wwwh {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }
}

/* ========================================
   SECTIONS
   ======================================== */
.cs-section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border);
}

.cs-section-title {
  margin-bottom: 36px;
}

.cs-challenge-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.cs-challenge-text {
  font-size: 16px;
  color: var(--text);
  line-height: 1.8;
}

/* Callout — card style, serif italic quote */
.cs-callout {
  padding: 28px;
  background: var(--surface);
  border: none;
  border-radius: 12px;
}

.cs-callout-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.cs-callout-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .cs-challenge-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ========================================
   DESIGN PROCESS DIAGRAM
   ======================================== */
.cs-diagram-wrap {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.cs-diagram-wrap .section-label {
  margin-bottom: 20px;
}

.cs-diagram-wrap svg {
  width: 100%;
  max-width: 720px;
  height: auto;
}

@media (max-width: 768px) {
  .cs-diagram-wrap {
    padding: 32px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Render SVG large enough that 10px SVG text ≈ 13px on screen */
  .cs-diagram-wrap svg {
    min-width: 900px;
    height: auto;
  }
}

/* ========================================
   INSIGHTS GRID
   ======================================== */
.cs-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cs-insight-card {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.cs-insight-icon {
  font-size: 24px;
}

.cs-insight-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.cs-insight-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .cs-insight-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ========================================
   IMAGE SECTIONS
   ======================================== */
.cs-img-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.cs-img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.cs-img-full {
  border-radius: 12px;
  overflow: hidden;
}

.cs-img-full img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-img-half {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 200ms ease;
}

.cs-img-half:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.cs-img-half img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}

@media (max-width: 768px) {
  .cs-img-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ========================================
   KEY DESIGN DECISIONS
   ======================================== */
.cs-decision {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.cs-decision:last-child {
  border-bottom: none;
}

.cs-decision-num {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--brand);
  opacity: 0.5;
}

.cs-decision-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.cs-decision-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ========================================
   OUTCOMES & IMPACT
   ======================================== */
.cs-outcome-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.cs-outcome-card {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.cs-outcome-metric {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--brand);
}

.cs-outcome-label {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.cs-outcome-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .cs-outcome-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ========================================
   LEARNINGS
   ======================================== */
.cs-learnings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.cs-learning-card {
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.cs-learning-icon {
  font-size: 24px;
}

.cs-learning-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .cs-learnings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ========================================
   STAT CIRCLES (used in Paven)
   ======================================== */
.cs-stat-row {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cs-stat-item {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cs-stat-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.cs-stat-circle.dark {
  background: #1e1e50;
}

.cs-stat-circle.mid {
  background: #7070a8;
}

.cs-stat-circle.light {
  background: #b8b8d8;
}

.cs-stat-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .cs-stat-row {
    padding: 24px;
  }
  .cs-stat-circle {
    width: 64px;
    height: 64px;
    font-size: 14px;
  }
}

/* ========================================
   SOLUTION TABLE (used in Paven)
   ======================================== */
.cs-sol-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text);
  text-align: center;
  margin-bottom: 24px;
}

.cs-sol-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--white);
}

.cs-sol-table th,
.cs-sol-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.6;
}

.cs-sol-table th:last-child,
.cs-sol-table td:last-child {
  border-right: none;
}

.cs-sol-table tr:last-child td {
  border-bottom: none;
}

.cs-sol-table th {
  background: var(--surface);
  font-weight: 600;
  font-size: 12px;
  color: var(--text-muted);
}

.cs-sol-row-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cs-sol-highlight {
  font-weight: 600;
  color: var(--brand);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .cs-sol-table {
    display: block;
    overflow-x: auto;
  }
}

/* ========================================
   FOOTER — matches main site exactly
   ======================================== */
footer {
  background: var(--text);
  color: white;
  padding: 60px 24px;
  margin-top: 80px;
}

footer a {
  color: white;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.footer-email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-size: 14px;
  text-decoration: none;
  transition: opacity 200ms ease;
}

.footer-link:hover {
  opacity: 0.8;
}

@media (max-width: 768px) {
  footer {
    padding: 40px 24px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }
  .footer-links {
    gap: 16px;
  }
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 150;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 200ms ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

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

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ========================================
   FADE-IN OBSERVER
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
