/* ==========================================================================
   PROJECT CASE STUDY STYLES (projects.css)
   ========================================================================== */

/* Hide the native cursor site-wide on case study pages.
   Browser UA sets cursor:pointer on <a> which beats the inherited cursor:none
   from body in styles.css — this explicit rule wins over UA. */
.case-body:not(.touch-device) * {
  cursor: none !important;
}

.case-body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.case-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.case-nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.case-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  text-decoration: none;
}

.case-back-link:hover {
  color: var(--accent-primary);
  transform: translateX(-3px);
}

.case-main {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 44px 24px 80px;
  width: 100%;
}

/* Hero Header */
.case-hero {
  margin-bottom: 32px;
}

.case-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.case-cat-pill {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(102, 217, 255, 0.12);
  color: var(--accent-primary);
  border: 1px solid rgba(102, 217, 255, 0.25);
}

.case-timeline-badge {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.case-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(34px, 5.5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.case-lead {
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 820px;
  margin-bottom: 28px;
}

.case-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.case-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-btn-primary {
  background: var(--text-primary);
  color: var(--bg-base);
  border: 1px solid var(--text-primary);
}

.case-btn-primary:hover {
  background: var(--accent-primary);
  color: #04040f;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.case-btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.case-btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Banner Image */
.case-banner-frame {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 36px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.case-banner-frame img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

/* Key Metadata Ribbon */
.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 36px;
}

.case-meta-item h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.case-meta-item p {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

.case-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.case-tech-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

/* Section Blocks */
.case-section {
  margin-bottom: 36px;
}

.case-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.case-section-title i {
  color: var(--accent-primary);
  font-size: 18px;
}

.case-text {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Cards Grid for Features / Architecture */
.case-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.case-card {
  padding: 20px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.case-card:hover {
  transform: translateY(-3px);
  border-color: rgba(102, 217, 255, 0.4);
}

.case-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(102, 217, 255, 0.1);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.case-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.case-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

/* Engineering Challenges Box */
.case-challenge-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-primary);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 14px;
}

.case-challenge-box h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-challenge-box h4 i {
  color: #f59e0b;
}

.case-challenge-box p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

/* Bottom Project Switcher */
.case-pagination {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.case-page-btn {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  transition: all 0.3s ease;
}

.case-page-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.case-page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.case-page-btn:hover .case-page-title {
  color: var(--accent-primary);
}

@media(max-width: 768px) {
  .case-main {
    padding: 32px 16px 64px;
  }
  .case-meta-grid {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }
  .case-pagination {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ==========================================================================
   ENHANCED CASE STUDY COMPONENTS (KPIs, IDE Code, Quick-Jump, Pipeline)
   ========================================================================== */

/* ── Reading Progress Bar ─────────────────────────────────────────── */
.case-reading-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.1s linear;
  z-index: 101;
}

/* ── Sticky Quick-Jump Navigation ────────────────────────────────── */
.case-quick-nav-wrap {
  position: sticky;
  top: 48px;
  z-index: 95;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  margin: -12px -24px 32px;
}

.case-quick-nav {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.case-quick-nav::-webkit-scrollbar {
  display: none;
}

.case-quick-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.case-quick-link:hover,
.case-quick-link.active {
  color: var(--accent-primary);
  background: rgba(102, 217, 255, 0.1);
  border-color: rgba(102, 217, 255, 0.35);
  box-shadow: 0 0 12px rgba(102, 217, 255, 0.15);
}

/* ── KPI / Metrics Stat Strip ─────────────────────────────────────── */
.case-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 28px 0 36px;
}

.case-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.case-stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(102, 217, 255, 0.35);
  box-shadow: 0 10px 25px -10px var(--accent-glow);
}

.case-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0.7;
}

.case-stat-num {
  font-family: 'Fraunces', serif;
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(135deg, #ffffff 40%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.15;
  margin-bottom: 6px;
}

.case-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.case-stat-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* ── System Architecture Pipeline Flow ───────────────────────────── */
.arch-pipeline {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 20px 0 28px;
  overflow-x: auto;
  padding: 8px 4px 14px;
  scrollbar-width: thin;
}

.arch-node {
  flex: 1;
  min-width: 145px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.arch-node:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 20px rgba(102, 217, 255, 0.15);
}

.arch-node-step {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.arch-node-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.arch-node-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.arch-arrow {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.5;
}

/* ── IDE / Terminal Code Block Window ────────────────────────────── */
.code-window {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #080816;
  margin: 18px 0 22px;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.6);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.code-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.code-dot-red { background: #ff5f56; }
.code-dot-yellow { background: #ffbd2e; }
.code-dot-green { background: #27c93f; }

.code-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.code-copy-btn:hover {
  background: rgba(102, 217, 255, 0.15);
  color: var(--accent-primary);
  border-color: rgba(102, 217, 255, 0.35);
}

.code-body {
  padding: 16px 20px;
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: #e2e8f0;
}

.code-body code {
  font-family: inherit;
  color: inherit;
}

/* Syntax tokens */
.token-kw { color: #f472b6; font-weight: 500; }
.token-fn { color: #60a5fa; }
.token-str { color: #34d399; }
.token-comment { color: #64748b; font-style: italic; }
.token-num { color: #fbbf24; }
.token-op { color: #94a3b8; }

/* ── Lightbox Image Modal ────────────────────────────────────────── */
.case-banner-frame img {
  cursor: zoom-in;
  transition: transform 0.4s ease;
}

.case-banner-frame:hover img {
  transform: scale(1.015);
}

.case-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 15, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.case-lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.case-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

.case-lightbox.open img {
  transform: scale(1);
}

.case-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

/* ==========================================================================
   STYLE 1: PRODUCT SHOWCASE ENHANCEMENTS (Split Hero + Tabbed Sections)
   ========================================================================== */

/* ── Split Hero Layout ────────────────────────────────────────── */
.showcase-hero-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
  margin-bottom: 32px;
}

@media (max-width: 900px) {
  .showcase-hero-split {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.showcase-hero-visual {
  position: relative;
}

.showcase-hero-visual .case-banner-frame {
  margin-bottom: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.65), 0 0 20px var(--accent-glow);
  transition: transform 0.4s ease, border-color 0.3s ease;
}

.showcase-hero-visual .case-banner-frame:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 217, 255, 0.4);
}

.showcase-hero-visual .case-banner-frame img {
  max-height: 420px;
  width: 100%;
  object-fit: cover;
}

.showcase-hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.showcase-hero-content .case-title {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 12px;
}

.showcase-hero-content .case-lead {
  font-size: 15.5px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.showcase-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.showcase-mini-meta-item {
  font-size: 12.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.showcase-mini-meta-item strong {
  color: var(--text-primary);
}

/* ── Interactive Showcase Tab Bar ────────────────────────────── */
.showcase-tabs-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 32px 0 28px;
  position: sticky;
  top: 52px;
  z-index: 90;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow-x: auto;
  scrollbar-width: none;
}

.showcase-tabs-nav::-webkit-scrollbar {
  display: none;
}

.showcase-tab-btn {
  flex: 1;
  min-width: 130px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.showcase-tab-btn i {
  font-size: 13px;
}

.showcase-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.showcase-tab-btn.active {
  color: var(--accent-primary);
  background: rgba(102, 217, 255, 0.12);
  border-color: rgba(102, 217, 255, 0.3);
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ── Tab Content Panes ────────────────────────────────────────── */
.showcase-tab-pane {
  display: none;
  animation: tabFadeIn 0.35s ease;
}

.showcase-tab-pane.active {
  display: block;
}

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