/* ═══════════════════════════════════════════════════════════
   DETAIL PANEL SYSTEM — Drawer + Modal
   ═══════════════════════════════════════════════════════════ */

/* ── Backdrop ───────────────────────────────────────────── */
.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ── Scroll Lock ────────────────────────────────────────── */
body.panel-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* ── Drawer (slide-in from right / bottom on mobile) ───── */
.detail-drawer {
  position: fixed;
  z-index: 999;
  visibility: hidden;
  top: 0;
  right: 0;
  width: 480px;
  height: 100%;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-drawer.is-open {
  visibility: visible;
  transform: translateX(0);
}

.detail-drawer__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg, #0a0a0f);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* ── Modal (centered, for case studies) ─────────────────── */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1),
              visibility 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.detail-modal__inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  background: var(--bg, #0a0a0f);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-modal.is-open .detail-modal__inner {
  transform: translateY(0) scale(1);
}

/* ── Header ─────────────────────────────────────────────── */
.detail-header {
  position: relative;
  flex-shrink: 0;
  padding: 1.5rem 1.5rem 1.25rem;
}

.detail-header__accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--panel-accent, #2563eb);
}

.detail-header__content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 2.5rem;
}

.detail-header__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.detail-header__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: var(--panel-accent, #2563eb);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-header__title {
  font-family: var(--font-display, 'Plus Jakarta Sans'), sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

/* ── Close Button ───────────────────────────────────────── */
.detail-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  padding: 0;
}

.detail-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.detail-close:focus-visible {
  outline: 2px solid var(--panel-accent, #2563eb);
  outline-offset: 2px;
}

/* ── Body (scrollable content) ──────────────────────────── */
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.5rem 1.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.detail-body::-webkit-scrollbar {
  width: 6px;
}

.detail-body::-webkit-scrollbar-track {
  background: transparent;
}

.detail-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* ── Section blocks inside body ─────────────────────────── */
.detail-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-section__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--panel-accent, #2563eb);
  margin-bottom: 0.75rem;
}

.detail-section__label-icon {
  font-size: 0.85rem;
}

.detail-section__heading {
  font-family: var(--font-display, 'Plus Jakarta Sans'), sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.5rem 0;
}

.detail-section__text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

.detail-section__text strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* ── Stats grid ─────────────────────────────────────────── */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 1.25rem 0;
}

.detail-stat {
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.detail-stat__value {
  font-family: var(--font-display, 'Plus Jakarta Sans'), sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--panel-accent, #2563eb);
  line-height: 1.2;
}

.detail-stat__label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

/* ── Use-case list (for industry panels) ────────────────── */
.detail-usecases {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.detail-usecases li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
}

.detail-usecases li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--panel-accent, #2563eb);
  opacity: 0.7;
}

/* ── Technology tags ────────────────────────────────────── */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Process steps (for how-we-work panels) ─────────────── */
.detail-process {
  padding: 0;
  margin: 0.75rem 0 0;
  list-style: none;
  counter-reset: process-step;
}

.detail-process li {
  counter-increment: process-step;
  position: relative;
  padding: 0.75rem 0 0.75rem 2.5rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
}

.detail-process li::before {
  content: counter(process-step);
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel-accent, #2563eb);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Quote block (for case studies) ─────────────────────── */
.detail-quote {
  position: relative;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  margin: 1rem 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--panel-accent, #2563eb);
}

.detail-quote__text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
  margin: 0;
}

.detail-quote__author {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.75rem;
  font-style: normal;
}

/* ── Sticky CTA Bar ─────────────────────────────────────── */
.detail-cta {
  flex-shrink: 0;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg, #0a0a0f);
}

.detail-cta__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-family: var(--font-display, 'Plus Jakarta Sans'), sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--panel-accent, #2563eb);
  text-decoration: none;
  transition: opacity 150ms ease, transform 150ms ease;
  cursor: pointer;
}

.detail-cta__button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.detail-cta__button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── Divider utility ────────────────────────────────────── */
.detail-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 0.5rem 0;
  border: none;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile bottom sheet
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Disable backdrop-filter on the overlay — expensive on Android */
  .detail-backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .detail-drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 85vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1),
                visibility 300ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  .detail-drawer.is-open {
    transform: translateY(0);
  }

  .detail-drawer__inner {
    border-left: none;
    border-radius: 16px 16px 0 0;
  }

  .detail-drawer__inner::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0.75rem auto 0;
    flex-shrink: 0;
  }

  .detail-modal {
    padding: 1rem;
    align-items: flex-end;
  }

  .detail-modal__inner {
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }

  .detail-close {
    width: 44px;
    height: 44px;
  }

  .detail-header {
    padding: 1.25rem 1.25rem 1rem;
  }

  .detail-body {
    padding: 0 1.25rem 1.25rem;
  }

  .detail-cta {
    padding: 0.85rem 1.25rem;
  }

  .detail-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .detail-stats {
    grid-template-columns: 1fr;
  }

  .detail-header__title {
    font-size: 1.1rem;
  }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .detail-backdrop,
  .detail-drawer,
  .detail-modal,
  .detail-modal__inner {
    transition-duration: 0ms;
  }
}
