/* Phillips Wall Demo - Sentiment Index (hero replacement) */
.phillips-demo-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  background: #000;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.phillips-demo-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: 0;
  pointer-events: none;
}

/* Subtle purple glow to match portfolio branding */
.phillips-demo-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 40%, rgba(110,7,243,0.12) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

.phillips-demo-hero .navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 50;
  background: transparent;
}

.phillips-demo-header {
  position: absolute;
  top: 104px;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  padding: 0 2rem;
  pointer-events: none;
  /* Hidden until the demo is activated — fades in with the wall. */
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.phillips-demo-hero.demo-live .phillips-demo-header {
  opacity: 1;
  transform: none;
}

.phillips-demo-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.4rem;
}

.phillips-demo-header p {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
}

.sentiment-grid {
  position: absolute;
  top: 200px;
  left: 130px;
  right: 130px;
  bottom: 96px;
  z-index: 1;
  /* Soft/faded until the demo is activated. */
  opacity: 0.35;
  filter: saturate(0.7) brightness(0.85);
  transition: opacity 0.9s ease, filter 0.9s ease;
}

.phillips-demo-hero.demo-live .sentiment-grid {
  opacity: 1;
  filter: none;
}

.axis-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.axis-lines::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 48px;
  bottom: 48px;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.22);
}

.axis-lines::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 80px;
  right: 80px;
  height: 1px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.22);
}

.axis-label {
  position: absolute;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  z-index: 2;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  white-space: nowrap;
}

.axis-label--top { top: -8px; left: 50%; transform: translateX(-50%); }
.axis-label--bottom { bottom: 12px; left: 50%; transform: translateX(-50%); }
.axis-label--left { left: -6px; top: 50%; transform: translateY(-50%) rotate(-90deg); width: auto; }
.axis-label--right { right: -6px; top: 50%; transform: translateY(-50%) rotate(90deg); width: auto; }

.quadrant-label {
  position: absolute;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.22);
  pointer-events: none;
  z-index: 2;
}

.quadrant-label--tl { top: 16px; left: 20px; }
.quadrant-label--tr { top: 16px; right: 20px; }
.quadrant-label--bl { bottom: 16px; left: 20px; }
.quadrant-label--br { bottom: 16px; right: 20px; }

.answer-bubble {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 20px rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.35);
  animation: float 12s ease-in-out infinite;
}

.answer-bubble:hover {
  transform: translate(-50%, -50%) scale(1.2);
  z-index: 2000 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 28px rgba(255,255,255,0.15);
}

@keyframes float {
  0% { transform: translate(-50%, -50%) translate(0px, 0px) scale(1); }
  25% { transform: translate(-50%, -50%) translate(-1px, -3px) scale(1.08); }
  50% { transform: translate(-50%, -50%) translate(0px, -4px) scale(1); }
  75% { transform: translate(-50%, -50%) translate(1px, -3px) scale(0.92); }
  100% { transform: translate(-50%, -50%) translate(0px, 0px) scale(1); }
}

.cluster-group { position: absolute; width: 0; height: 0; z-index: 5; cursor: pointer; }

/* Match the other project entrances without changing the wall composition.
   Animate the zero-size anchor, not the bubble's centring/hover transform.
   A single soft overshoot gives the circles a little spring, then releases
   all animation styles so the demo behaves exactly as before. */
@media (prefers-reduced-motion: no-preference) {
  html.js body:not(.loaded) .phillips-demo-hero .cluster-group {
    opacity: 0;
    transform: translateY(34px) scale(0.78);
  }

  body.loaded .phillips-demo-hero .cluster-group {
    animation: wall-cluster-enter 0.85s cubic-bezier(0.22, 0.7, 0.3, 1)
      var(--cluster-enter-delay, 0.05s) backwards;
  }

  /* Early activation should never leave someone waiting for a click target. */
  body.loaded .phillips-demo-hero.demo-live .cluster-group {
    animation: none;
  }
}

@keyframes wall-cluster-enter {
  0% { opacity: 0; transform: translateY(34px) scale(0.78); }
  65% { opacity: 1; transform: translateY(-4px) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.cluster-group .answer-bubble { position: absolute; animation: none; transform: translate(-50%, -50%); transition: transform 0.3s ease, box-shadow 0.3s ease; }

.cluster-group:hover .answer-bubble { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25); }

.stack-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.stack-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.expanded-stack {
  position: fixed;
  inset: 0;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expanded-stack.active {
  opacity: 1;
  pointer-events: auto;
}

.demo-close-btn {
  position: absolute;
  top: clamp(1rem, 3vh, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  z-index: 1001;
  cursor: pointer;
  font-family: inherit;
}

.demo-close-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.demo-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* ============================================================
   EXPANDED CARD STACK — new structured card design
   - Rounded-2xl cards with lavender (single/focused) or
     ice-blue (multi fanned) color mapping
   - Question inside card (upper) + answer (lower)
   - "YOU" pill badge + top-center dot indicator
   - Footer counter pill
   ============================================================ */

.active-question {
  display: none; /* question now lives on each card */
}

.card-stack {
  position: absolute;
  bottom: 2%;
  left: 0;
  right: 0;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card base — portrait card shape, rounded-2xl. Background color is set
   inline by JS from the cluster's pastel color; this is the fallback. */
.answer-card {
  position: absolute;
  width: 360px;
  height: 480px;
  border-radius: 1.5rem;
  background: #BFE3FF;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom center;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  top: 50%;
  left: 50%;
  margin-top: -240px;
  margin-left: -180px;
  z-index: 1;
}

/* Soft inner glow for depth */
.answer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.35) 0%, transparent 60%);
  pointer-events: none;
  border-radius: 1.5rem;
  z-index: 1;
}

/* Focused card — elevated shadow, no size jump, keeps cluster color */
.answer-card.focused {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  width: 360px;
  height: 480px;
  margin-top: -240px;
  margin-left: -180px;
  z-index: 100;
}

.answer-card.hovered {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

/* ===== Card internal structure ===== */

/* Top-center hole indicator — visible inset ring so the card reads as
   punched through at the top */
.answer-card__dot {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
   width: 18px;
   height: 18px;
   border-radius: 50%;
   background: rgba(0, 0, 0, 0.18);
   box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7),
               0 1px 3px rgba(0, 0, 0, 0.15);
  z-index: 3;
  pointer-events: none;
}

/* "YOU" pill badge — top-right, dark pill style */
.answer-card__badge {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1e1b4b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25),
              inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  z-index: 3;
  pointer-events: none;
}

/* Question — upper third, centered, semibold, gray-900 */
.answer-card__question {
  position: relative;
  z-index: 2;
  color: #1e1b4b;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  padding: 4rem 1.5rem 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* Answer — fluid middle, centered, gray-700, relaxed */
.answer-card__answer {
  position: relative;
  z-index: 2;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 400;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  padding: 0 1.5rem 1.5rem;
  line-height: 1.6;
  flex: 1;
  overflow-y: auto;
}

/* ===== Footer counter pill ===== */
.card-footer-counter {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 6px 16px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.card-footer-counter.active {
  opacity: 1;
}

/* ===== Flip-card variant (phillipswall-demo-fix.js) ===== */
.expanded-card {
  position: relative;
  width: 360px;
  max-width: 90vw;
  border-radius: 1.5rem;
  background: #D8B4FE;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.expanded-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.35) 0%, transparent 60%);
  pointer-events: none;
  border-radius: 1.5rem;
  z-index: 1;
}

.expanded-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  background: rgba(0, 0, 0, 0.15);
  color: #3B0764;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: background 0.2s ease;
}

.expanded-card__close svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.expanded-card__close:hover {
  background: rgba(0, 0, 0, 0.25);
}

.expanded-card__dot {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6),
              0 1px 2px rgba(0, 0, 0, 0.12);
  z-index: 3;
  pointer-events: none;
}

.expanded-card__badge {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #000;
  z-index: 3;
  pointer-events: none;
}

.expanded-card__question {
  position: relative;
  z-index: 2;
  color: #1e1b4b;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  padding: 2.5rem 1.5rem 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.expanded-card__text {
  position: relative;
  z-index: 2;
  color: #5b21b6;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  font-weight: 400;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  padding: 0 1.5rem 1.5rem;
  line-height: 1.6;
}

.expanded-card__nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.8rem 1.5rem 1.2rem;
  border-top: 1px solid rgba(59, 7, 96, 0.12);
}

.expanded-card__nav button {
  background: none;
  border: none;
  color: #3B0764;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.expanded-card__nav button:hover {
  background: rgba(59, 7, 96, 0.08);
}

.expanded-card__counter {
  color: #6B21A8;
  font-size: 0.8rem;
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', sans-serif;
  min-width: 40px;
  text-align: center;
}

.expanded-card__tag {
  display: none; /* replaced by structured question/answer layout */
}


/* "Try the demo" pill — centered over the faded wall */
.demo-activate {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  appearance: none;
  border: 1px solid rgba(255,255,255,0.16);
  cursor: pointer;
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(110,7,243,0.92);
  padding: 1rem 2.8rem;
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(110,7,243,0.55);
  transition: opacity 0.6s ease, background 0.2s ease, visibility 0.6s ease;
  white-space: nowrap;
}

.demo-activate:hover {
  background: #9a53ff;
}

.phillips-demo-hero.demo-live .demo-activate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hide the bottom case-study nav bar while cards are open */
body.demo-locked .case-study-nav {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* Scroll cue: "Scroll for case study" + bouncing chevron.
   Slim + subtle — sits at the bottom of the hero, in view. */
.demo-scroll-cue {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  text-decoration: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.demo-scroll-cue__text {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.demo-scroll-cue__arrow {
  color: #6E07F3;
  font-size: 1.7rem;
  line-height: 1;
  display: flex;
  animation: demoCueBounce 2s ease-in-out infinite;
}

.demo-scroll-cue:hover .demo-scroll-cue__text {
  color: #fff;
}

.demo-scroll-cue:hover .demo-scroll-cue__arrow {
  color: #9a53ff;
}

@keyframes demoCueBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(7px); opacity: 1; }
}

/* Hide the cue while cards are open (page scroll is locked anyway). */
body.demo-locked .demo-scroll-cue {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Hide mini-axis labels until demo is activated */
.phillips-demo-hero .mini-axis {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phillips-demo-hero.demo-live .mini-axis {
  opacity: 1;
  visibility: visible;
}

/* Hide axis lines, axis labels, and quadrant labels until demo is activated */
.phillips-demo-hero .axis-lines,
.phillips-demo-hero .axis-label,
.phillips-demo-hero .quadrant-label {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.phillips-demo-hero.demo-live .axis-lines,
.phillips-demo-hero.demo-live .axis-label,
.phillips-demo-hero.demo-live .quadrant-label {
  opacity: 1;
  visibility: visible;
}


@media (max-width: 768px) {
  .phillips-demo-hero { height: 100svh; min-height: 620px; }
  .phillips-demo-header { top: 92px; }
  .phillips-demo-header h2 { font-size: 1.5rem; }
  .sentiment-grid { top: 180px; left: 40px; right: 40px; bottom: 88px; }
  .active-question { display: none; }
  .answer-card { width: 220px; height: 310px; margin-top: -155px; margin-left: -110px; padding: 0; }
  .answer-card.focused { width: 360px; height: 380px; margin-top: -190px; margin-left: -180px; }
  .answer-card__question { font-size: 0.85rem; padding: 2rem 1rem 0.3rem; }
  .answer-card__answer { font-size: 0.8rem; padding: 0.3rem 1rem 1.2rem; }
  .answer-card__badge { font-size: 0.55rem; padding: 2px 8px; top: 8px; right: 8px; }
  .answer-card__dot { width: 10px; height: 10px; top: 14px; }
  .card-footer-counter { bottom: 20px; font-size: 0.65rem; padding: 4px 12px; }
}

@media (max-width: 480px) {
  .sentiment-grid { top: 170px; left: 26px; right: 26px; bottom: 80px; }
  .answer-card { width: 190px; height: 270px; margin-top: -135px; margin-left: -95px; }
  .answer-card.focused { width: 300px; height: 330px; margin-top: -165px; margin-left: -150px; }
  .answer-card__question { font-size: 0.78rem; padding: 1.6rem 0.8rem 0.2rem; }
  .answer-card__answer { font-size: 0.72rem; padding: 0.2rem 0.8rem 1rem; }
  .answer-card__badge { font-size: 0.5rem; padding: 2px 6px; top: 6px; right: 6px; }
  .answer-card__dot { width: 8px; height: 8px; top: 12px; }
  .card-footer-counter { bottom: 16px; font-size: 0.6rem; padding: 3px 10px; }
}

.cluster-group:hover .answer-bubble { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25); }
