/* =================================================================
   Portfolio case study (public detail page)
   ================================================================= */

.case-hero {
  background: linear-gradient(135deg, #2d3748 0%, #4c1d95 50%, #be185d 100%);
  color: #fff;
  padding: 6rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.case-hero::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.4), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.3), transparent 50%);
  pointer-events: none;
}

.case-hero__back {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  transition: color 0.15s ease;
}
.case-hero__back:hover { color: #fff; }

.case-hero__category {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.8rem;
}

.case-hero__title {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 1rem 0;
}

.case-hero__summary {
  font-size: 1.05rem;
  max-width: 720px;
  opacity: 0.92;
  line-height: 1.6;
}

.case-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.case-hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.case-hero__btn--primary {
  background: #fff;
  color: #2d1b69;
}
.case-hero__btn--primary:hover {
  color: #2d1b69;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.case-hero__btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}
.case-hero__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.case-hero__thumb {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  transform: rotate(-1deg);
  transition: transform 0.4s ease;
}
.case-hero__thumb:hover { transform: rotate(0deg) scale(1.02); }
.case-hero__thumb img { width: 100%; height: auto; display: block; }

/* ===== Body sections ===== */
.case-body { padding: 4rem 0; }

.case-meta {
  position: sticky;
  top: 5rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 1rem;
  padding: 1.4rem;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

body[data-theme="dark"] .case-meta {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.16);
}

.case-meta__row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
}
.case-meta__row:last-child { border-bottom: 0; }

body[data-theme="dark"] .case-meta__row { border-color: rgba(148, 163, 184, 0.18); }

.case-meta__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-size: 0.8rem;
}

.case-meta__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0;
}

body[data-theme="dark"] .case-meta__label { color: #94a3b8; }

.case-meta__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
}

body[data-theme="dark"] .case-meta__value { color: #f1f5f9; }

.case-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.case-tech__pill {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
body[data-theme="dark"] .case-tech__pill {
  background: rgba(124, 58, 237, 0.2);
  color: #c4b5fd;
}

/* ===== Section blocks ===== */
.case-section {
  margin-bottom: 3rem;
}

.case-section__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.case-section__icon {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
}

.case-section__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: #0f172a;
}

body[data-theme="dark"] .case-section__title { color: #f1f5f9; }

.case-section__body {
  font-size: 0.98rem;
  line-height: 1.75;
  color: #475569;
}

.case-section__body p { margin: 0 0 1rem 0; }
.case-section__body ul, .case-section__body ol { padding-left: 1.4rem; }

body[data-theme="dark"] .case-section__body { color: #cbd5e1; }

.case-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.case-metric {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(34, 197, 94, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
}

body[data-theme="dark"] .case-metric {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.case-metric__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #047857;
  font-family: ui-monospace, monospace;
  line-height: 1.1;
}
body[data-theme="dark"] .case-metric__value { color: #6ee7b7; }

.case-metric__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
  font-weight: 600;
  margin-top: 0.25rem;
}
body[data-theme="dark"] .case-metric__label { color: #cbd5e1; }

/* ===== Gallery ===== */
.case-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}
.case-gallery__item {
  border-radius: 0.85rem;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease;
}
.case-gallery__item:hover { transform: translateY(-3px); }
.case-gallery__item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* ===== Related projects ===== */
.case-related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

body[data-theme="dark"] .case-related { border-color: rgba(148, 163, 184, 0.18); }

.case-related__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #0f172a;
}

body[data-theme="dark"] .case-related__title { color: #f1f5f9; }

.case-related__card {
  display: block;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 0.85rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  height: 100%;
}

.case-related__card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
  text-decoration: none;
  color: inherit;
}

body[data-theme="dark"] .case-related__card {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.18);
}

.case-related__thumb { aspect-ratio: 16 / 10; overflow: hidden; }
.case-related__thumb img { width: 100%; height: 100%; object-fit: cover; }

.case-related__body { padding: 1rem 1.1rem; }
.case-related__cat { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #7c3aed; font-weight: 700; }
body[data-theme="dark"] .case-related__cat { color: #c4b5fd; }
.case-related__name { font-size: 1rem; font-weight: 700; margin: 0.2rem 0 0.3rem; color: #0f172a; }
body[data-theme="dark"] .case-related__name { color: #f1f5f9; }
.case-related__sum { font-size: 0.83rem; color: #64748b; margin: 0; }
body[data-theme="dark"] .case-related__sum { color: #94a3b8; }

/* ===== Lightbox ===== */
.case-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
}
.case-lightbox.is-open { display: flex; }
.case-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.6rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
