/* ═══════════════════════════════════════════════════════════════
   QTSI — sections3.css
   Case Studies · LinkedIn · Gallery · Final CTA · Copilot
   Design by NEXORA (nexorayyc.io)
═══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════
   CASE STUDIES
══════════════════════════════════════════ */

.cases-blob-1 { width:500px; height:500px; top:-10%; left:-10%; opacity:.55; }
.cases-blob-2 { width:380px; height:380px; bottom:-8%; right:-8%; opacity:.45; }

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
  /* Equal height cards */
  align-items: stretch;
}

.case-card {
  padding: var(--sp-8) var(--sp-7);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  position: relative;
}

.case-number {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: rgba(255,255,255,.04);
  pointer-events: none;
  user-select: none;
}

.case-tag { align-self: flex-start; }

.case-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.case-industry {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-top: -var(--sp-2);
}

.case-outcome-highlight {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-5) var(--sp-5);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.case-outcome-metric {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.case-outcome-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.case-sections {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  flex: 1;
}

.case-block { display: flex; flex-direction: column; gap: var(--sp-2); }

.case-block-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-light);
}

.case-block:nth-child(3) .case-block-label { color: var(--green-light); }

.case-block-text {
  font-size: 0.85rem;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .cases-grid { grid-template-columns: 1fr; max-width: 680px; margin-inline: auto; }
}
@media (max-width: 640px) {
  .case-card { padding: var(--sp-6) var(--sp-5); }
  .case-outcome-metric { font-size: 1.2rem; }
}

/* ══════════════════════════════════════════
   LINKEDIN AUTHORITY
══════════════════════════════════════════ */

.li-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  max-width: 940px;
  margin-inline: auto;
}

.li-card {
  padding: var(--sp-8) var(--sp-7);
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.li-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
}

.li-avatar {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.li-avatar--company {
  background: rgba(0,112,243,.14);
  border: 1px solid rgba(0,112,243,.28);
  color: var(--blue-light);
}

.li-avatar--person {
  background: linear-gradient(135deg, rgba(0,112,243,.18) 0%, rgba(93,185,55,.15) 100%);
  border: 1px solid rgba(93,185,55,.25);
  color: var(--text-primary);
}

.li-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.li-card-sub { font-size: 0.82rem; margin-top: 3px; }

.li-card-desc { font-size: 0.875rem; line-height: 1.7; }

.li-content-pillars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.li-pillar {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(0,112,243,.08);
  border: 1px solid rgba(0,112,243,.18);
  color: var(--blue-light);
  white-space: nowrap;
}

.li-pillar--green {
  background: rgba(93,185,55,.07);
  border-color: rgba(93,185,55,.18);
  color: var(--green-light);
}

@media (max-width: 768px) {
  .li-grid { grid-template-columns: 1fr; max-width: 520px; }
}

/* ══════════════════════════════════════════
   POSTER GALLERY
══════════════════════════════════════════ */

/* Asymmetric mosaic: lg tile spans 2 rows, wide tile spans 2 cols */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
  gap: var(--sp-4);
}

.gallery-tile { border-radius: var(--r-xl); overflow: hidden; }
.gallery-tile--lg   { grid-row: span 2; }
.gallery-tile--wide { grid-column: span 2; }

.gallery-tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: inherit;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 250ms var(--ease-expo), box-shadow 250ms var(--ease-expo);
}

.gallery-tile--lg .gallery-tile-inner { min-height: 460px; }
.gallery-tile--wide .gallery-tile-inner { min-height: 220px; }

.gallery-tile-inner:hover {
  border-color: var(--border-blue);
  box-shadow: var(--shadow-lg), var(--shadow-blue);
}

/* Real image — add class .gallery-img to an <img> inside .gallery-tile-inner
   to activate it. The placeholder auto-hides. */
.gallery-tile-inner > img.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 400ms var(--ease-expo);
  border-radius: inherit;
}

.gallery-tile-inner > img.gallery-img[src]:not([src=""]) {
  opacity: 1;
}

.gallery-tile-inner > img.gallery-img[src]:not([src=""]) ~ .gallery-placeholder-content {
  display: none;
}

/* Slot div — invisible filler so tile has correct dimensions */
.gallery-img-slot { display: none; }

/* Placeholder content */
.gallery-placeholder-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  background: linear-gradient(135deg, rgba(0,112,243,.07) 0%, rgba(93,185,55,.06) 100%);
}

.gallery-add-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px dashed var(--border-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: border-color 200ms, color 200ms;
}

.gallery-tile-inner:hover .gallery-add-icon {
  border-color: var(--border-blue);
  color: var(--blue-light);
}

.gallery-slot-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 200ms;
}

.gallery-tile-inner:hover .gallery-slot-label { color: var(--text-secondary); }

/* Overlay shown on hover (with real image) */
.gallery-tile-overlay {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(to top, rgba(7,7,12,.85) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 250ms var(--ease-expo), transform 250ms var(--ease-expo);
  pointer-events: none;
}

.gallery-tile-inner:hover .gallery-tile-overlay {
  opacity: 1;
  transform: none;
}

.gallery-tile-caption {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-tile--lg { grid-row: span 1; }
  .gallery-tile--wide { grid-column: span 2; }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-tile--wide { grid-column: span 1; }
}

/* ══════════════════════════════════════════
   FINAL CTA
══════════════════════════════════════════ */

.final-cta {
  background: var(--bg-void);
  position: relative;
  padding-block: clamp(96px, 14vw, 160px);
}

.final-cta-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 50%, rgba(0,112,243,.10) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 30% 80%, rgba(93,185,55,.09) 0%, transparent 55%);
  pointer-events: none;
}

.cta-blob-1 { width:700px; height:700px; top:-20%; left:-15%; opacity:.6; }
.cta-blob-2 { width:600px; height:600px; bottom:-20%; right:-15%; opacity:.5; }

.final-cta-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}

.final-cta-container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.final-cta-content {
  text-align: center;
  max-width: 760px;
}

.final-cta-eyebrow { margin-bottom: var(--sp-5); }

.final-cta-headline {
  margin-bottom: var(--sp-6);
  color: var(--text-primary);
}

.final-cta-sub {
  max-width: 580px;
  margin-inline: auto;
  margin-bottom: var(--sp-10);
}

.final-cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
}

.final-cta-btn-primary {
  padding: 16px 40px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

/* Stat row between sub and CTA */
.final-cta-stats {
  display: flex;
  justify-content: center;
  gap: clamp(32px, 6vw, 80px);
  margin-bottom: var(--sp-10);
  padding-block: var(--sp-8);
  border-block: 1px solid var(--border);
}

.final-cta-stat-item {
  text-align: center;
}

.final-cta-stat-value {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.final-cta-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .final-cta-stats { gap: var(--sp-8); flex-wrap: wrap; }
}

/* Trust signals row */
.final-cta-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-6);
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border);
}

.final-cta-trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.825rem;
  color: var(--text-secondary);
}

.final-cta-trust-item svg { color: var(--green-light); flex-shrink: 0; }

/* Direct contact row */
.final-cta-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.final-cta-contact-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 200ms;
}
.final-cta-contact-link:hover { color: var(--blue-light); }
.final-cta-contact-sep { color: var(--border-hi); }

@media (max-width: 640px) {
  .final-cta-actions { flex-direction: column; align-items: center; }
  .final-cta-trust   { gap: var(--sp-4); }
  .final-cta-contact { flex-direction: column; gap: var(--sp-2); }
  .final-cta-contact-sep { display: none; }
}

/* ══════════════════════════════════════════
   QTSI COPILOT
══════════════════════════════════════════ */

/* FAB wrapper — holds button + tooltip */
.copilot-fab-wrapper {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: var(--z-copilot);
  display: flex;
  align-items: center;
  gap: 12px;
  /* Tooltip sits to the left of the FAB */
  flex-direction: row-reverse;
}

/* Tooltip label — desktop only */
.copilot-fab-label {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 200ms var(--ease-expo), transform 200ms var(--ease-expo);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.copilot-fab-wrapper:hover .copilot-fab-label {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .copilot-fab-label { display: none; }
  .copilot-fab-wrapper { bottom: 20px; right: 20px; }
}

/* FAB */
.copilot-fab {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  box-shadow:
    0 0 0 0 rgba(0,112,243,.4),
    0 8px 28px rgba(0,112,243,.45),
    0 2px 8px rgba(0,0,0,.6);
  transition:
    transform    200ms cubic-bezier(0.34,1.56,0.64,1),
    box-shadow   250ms var(--ease-expo);
  outline: none;
  flex-shrink: 0;
}

.copilot-fab:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 0 8px rgba(0,112,243,.12),
    0 12px 36px rgba(0,112,243,.55),
    0 2px 8px rgba(0,0,0,.6);
}

.copilot-fab:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 4px;
}

.copilot-fab-inner { animation: copilotBob 3.2s ease-in-out infinite; }

/* Notification dot */
.copilot-fab-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-base);
  box-shadow: 0 0 8px rgba(93,185,55,.7);
}

/* Panel */
.copilot-panel {
  position: fixed;
  bottom: 108px;
  right: 28px;
  z-index: var(--z-copilot);
  width: 388px;
  max-height: 620px;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: rgba(10,10,18,.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(0,112,243,.22);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06),
    0 24px 64px rgba(0,0,0,.75),
    0 0 80px rgba(0,112,243,.14),
    0 0 160px rgba(93,185,55,.08);
  transform-origin: bottom right;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 350ms cubic-bezier(0.34,1.56,0.64,1),
    opacity   280ms var(--ease-expo);
}

.copilot-panel.is-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Glow strip at top of panel */
.copilot-panel-glow {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%);
  z-index: 1;
}

/* Header */
.copilot-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.copilot-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,112,243,.4) 0%, rgba(93,185,55,.3) 100%);
  border: 1px solid rgba(0,112,243,.4);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--blue-light);
  box-shadow: 0 0 16px rgba(0,112,243,.25);
}

.copilot-header-info { flex: 1; min-width: 0; }

.copilot-header-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.copilot-header-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.copilot-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(93,185,55,.7);
  flex-shrink: 0;
}

.copilot-close {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  flex-shrink: 0;
}
.copilot-close:hover { background: var(--bg-surface-md); color: var(--text-primary); }

/* Messages */
.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  scroll-behavior: smooth;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}

.copilot-messages::-webkit-scrollbar { width: 4px; }
.copilot-messages::-webkit-scrollbar-track { background: transparent; }
.copilot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* Message bubbles */
.copilot-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 88%;
  animation: fadeUp 0.3s var(--ease-expo) both;
}

.copilot-msg--bot { align-self: flex-start; }
.copilot-msg--user { align-self: flex-end; }

.copilot-bubble {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.855rem;
  line-height: 1.6;
}

.copilot-msg--bot .copilot-bubble {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--text-primary);
  border-radius: 4px 16px 16px 16px;
}

.copilot-msg--user .copilot-bubble {
  background: rgba(0,112,243,.22);
  border: 1px solid rgba(0,112,243,.30);
  color: var(--text-primary);
  border-radius: 16px 4px 16px 16px;
}

/* Typing indicator */
.copilot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 4px 16px 16px 16px;
  width: fit-content;
  animation: fadeIn 0.2s var(--ease-expo) both;
}

.copilot-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* "QTSI Copilot is thinking…" label beside the animated dots */
.copilot-thinking-label {
  margin-left: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-secondary, #9aa3b2);
  white-space: nowrap;
}

/* Suggested prompts */
.copilot-suggestions {
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.copilot-suggestion-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.copilot-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.copilot-chip-btn {
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
  text-align: left;
  min-height: 32px;
}

.copilot-chip-btn:hover {
  background: rgba(0,112,243,.14);
  border-color: rgba(0,112,243,.30);
  color: var(--blue-light);
}

/* Input area */
.copilot-input-area {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.copilot-input {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.855rem;
  color: var(--text-primary);
  resize: none;
  outline: none;
  min-height: 42px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 200ms, background 200ms;
  scrollbar-width: thin;
}

.copilot-input::placeholder { color: var(--text-muted); }

.copilot-input:focus {
  border-color: rgba(0,112,243,.40);
  background: rgba(255,255,255,.08);
}

.copilot-send {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--blue);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 150ms, transform 150ms cubic-bezier(0.34,1.56,0.64,1);
}
.copilot-send:hover  { background: var(--blue-light); transform: scale(1.06); }
.copilot-send:active { transform: scale(0.94); }
.copilot-send:disabled { background: var(--bg-surface-md); color: var(--text-muted); cursor: not-allowed; transform: none; }

/* Mobile: full screen panel */
@media (max-width: 480px) {
  .copilot-panel {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    max-height: 90dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform-origin: bottom center;
  }
}
