/* ============================================================
   Prefontaine.design — Horizontal-scroll Services showcase
   Pinned section; cards pan in from the right as you scroll.
   ============================================================ */

.showcase {
  position: relative;
  background: var(--teal-deep);
}
.showcase__pin {
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.showcase__track {
  display: flex;
  align-items: center;
  gap: 4vw;
  padding-left: max(32px, calc((100vw - var(--max-content)) / 2));
  padding-right: 10vw;
  will-change: transform;
}
.sc-panel { flex: 0 0 auto; }

/* intro panel */
.sc-intro { width: min(460px, 78vw); }
.sc-intro .eyebrow { margin-bottom: 22px; }
.sc-intro h2 { font-size: clamp(38px, 5vw, 64px); margin-bottom: 24px; }
.sc-intro p { color: var(--silver); font-size: 18px; max-width: 30ch; }
.sc-intro__hint {
  margin-top: 36px;
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver);
}
.sc-intro__hint svg { color: var(--gold); }

/* card shell */
.sc-card {
  width: min(860px, 88vw);
  height: 58vh;
  max-height: 540px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.82fr 1fr;
}
.sc-card__body {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
}
.sc-card__tag {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--emerald-bright); margin-bottom: 20px;
}
.sc-card__body h3 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 18px; }
.sc-card__body > p { color: var(--silver); font-size: 17px; max-width: 34ch; }
.sc-chips {
  list-style: none; margin: auto 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 9px;
}
.sc-chips li {
  font-size: 12.5px; color: var(--off-white);
  padding: 7px 14px; border-radius: 100px;
  border: 1px solid rgba(16,185,129,0.22);
  background: rgba(16,185,129,0.06);
  white-space: nowrap;
}
.sc-card__visual {
  position: relative;
  overflow: hidden;
  border-left: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(16,185,129,0.10), transparent 60%),
    rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

/* ---------- Visual A: self-building website ---------- */
.demo-build {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 3.1;
  border-radius: 12px;
  background: #0b1411;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 50px rgba(0,0,0,0.45);
  overflow: hidden;
}
.demo-build__chrome {
  height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: rgba(255,255,255,0.03); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.demo-build__chrome i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.demo-build__screen { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.db-el { opacity: 1; }
.db-nav { display: flex; justify-content: space-between; align-items: center; }
.db-nav .logo { width: 42px; height: 7px; border-radius: 3px; background: var(--emerald-bright); }
.db-nav .links { display: flex; gap: 6px; }
.db-nav .links span { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.18); }
.db-hero { height: 76px; border-radius: 8px; background: linear-gradient(120deg, rgba(16,185,129,0.28), rgba(13,92,74,0.5)); }
.db-h1 { height: 11px; width: 78%; border-radius: 3px; background: rgba(255,255,255,0.5); }
.db-h2 { height: 11px; width: 56%; border-radius: 3px; background: rgba(255,255,255,0.28); }
.db-cta { height: 22px; width: 96px; border-radius: 100px; background: var(--gold); margin-top: 2px; }

.showcase.playing .demo-build .db-el { animation: dbReveal 6s var(--ease-settle) 1 backwards; }
.showcase.playing .db-nav  { animation-delay: 0.2s !important; }
.showcase.playing .db-hero { animation-delay: 0.8s !important; }
.showcase.playing .db-h1   { animation-delay: 1.4s !important; }
.showcase.playing .db-h2   { animation-delay: 1.7s !important; }
.showcase.playing .db-cta  { animation-delay: 2.1s !important; }
@keyframes dbReveal {
  0%      { opacity: 0; transform: translateY(10px); }
  6%      { opacity: 1; transform: translateY(0); }
  78%,100% { opacity: 1; transform: translateY(0); }
}
.showcase.playing .db-cta { animation: dbReveal 6s var(--ease-settle) 1 backwards, dbPulse 6s ease-in-out infinite; }
@keyframes dbPulse {
  0%,34% { transform: scale(1); }
  37%    { transform: scale(1.06); }
  40%,100%{ transform: scale(1); }
}

/* ---------- Visual B: maintenance / health monitor ---------- */
.demo-health {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 14px;
}
.health-rows {
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25); overflow: hidden;
}
.health-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.health-row:last-child { border-bottom: none; }
.health-row .label { font-size: 13px; color: var(--off-white); flex: 1; }
.health-row .status { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--emerald-bright); }
.health-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 0 0 rgba(16,185,129,0.5);
}
.showcase.playing .health-dot { animation: healthPulse 2.4s ease-out infinite; }
.showcase.playing .health-row:nth-child(2) .health-dot { animation-delay: 0.4s; }
.showcase.playing .health-row:nth-child(3) .health-dot { animation-delay: 0.8s; }
@keyframes healthPulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.45); }
  70%,100% { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
}
.health-chat {
  border-radius: 12px; border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25); padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.chat-bubble { font-size: 12.5px; line-height: 1.5; padding: 9px 13px; border-radius: 12px; max-width: 84%; }
.chat-bubble.you { align-self: flex-end; background: rgba(255,255,255,0.06); color: var(--off-white); border-bottom-right-radius: 4px; }
.chat-bubble.them { align-self: flex-start; background: rgba(16,185,129,0.14); color: #d6f5e8; border-bottom-left-radius: 4px; }
.chat-bubble.them b { color: var(--emerald-bright); font-weight: 500; }
.showcase.playing .chat-bubble { animation: chatIn 6s var(--ease-settle) 1 backwards; }
.showcase.playing .chat-bubble.them { animation-delay: 1.2s; }

/* Visual C triggers (showcase) */
.showcase.playing .demo-data .dd-bars i { animation: ddGrow 6s var(--ease-settle) 1 backwards; }
.showcase.playing .demo-data .dd-bars i:nth-child(1) { animation-delay: 0.10s; }
.showcase.playing .demo-data .dd-bars i:nth-child(2) { animation-delay: 0.18s; }
.showcase.playing .demo-data .dd-bars i:nth-child(3) { animation-delay: 0.26s; }
.showcase.playing .demo-data .dd-bars i:nth-child(4) { animation-delay: 0.34s; }
.showcase.playing .demo-data .dd-bars i:nth-child(5) { animation-delay: 0.42s; }
.showcase.playing .demo-data .dd-bars i:nth-child(6) { animation-delay: 0.50s; }
.showcase.playing .demo-data .dd-bars i:nth-child(7) { animation-delay: 0.58s; }
.showcase.playing .demo-data .dd-spark path.line { animation: ddDraw 6s var(--ease-settle) 1 backwards; }
.showcase.playing .demo-data .dd-insight { animation: ddInsight 6s var(--ease-settle) 1 backwards; }
@keyframes chatIn {
  0%,4% { opacity: 0; transform: translateY(8px); }
  10%,100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Visual C: data / analytics + AI insight ---------- */
.demo-data {
  width: 100%; max-width: 400px;
  border-radius: 12px;
  background: #0b1411;
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 24px 50px rgba(0,0,0,0.45);
  overflow: hidden;
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 14px;
}
.dd-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dd-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(205,238,224,0.5); }
.dd-kpi { font-size: 26px; font-weight: 700; color: #eafaf3; margin-top: 4px; letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 8px; }
.dd-trend { font-size: 11px; font-weight: 500; color: var(--emerald-bright); }
.dd-spark { width: 88px; height: 36px; flex: 0 0 auto; }
.dd-spark path.line { fill: none; stroke: var(--emerald-bright); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 120; stroke-dashoffset: 0; }
.dd-bars {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 6px; height: 84px; padding: 0 2px;
}
.dd-bars i {
  flex: 1; border-radius: 3px 3px 0 0;
  background: linear-gradient(to top, rgba(16,185,129,0.25), var(--emerald-bright));
  transform: scaleY(1); transform-origin: bottom;
}
.dd-bars i:nth-child(1) { height: 38%; }
.dd-bars i:nth-child(2) { height: 60%; }
.dd-bars i:nth-child(3) { height: 46%; }
.dd-bars i:nth-child(4) { height: 78%; }
.dd-bars i:nth-child(5) { height: 56%; }
.dd-bars i:nth-child(6) { height: 92%; }
.dd-bars i:nth-child(7) { height: 70%; }
/* the bar where the lift happens gets the gold highlight */
.dd-bars i:nth-child(6) { background: linear-gradient(to top, rgba(201,168,76,0.3), var(--gold)); }
.dd-insight {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 13px; border-radius: 10px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.22);
  opacity: 1;
}
.dd-insight svg { flex: 0 0 auto; color: var(--gold); margin-top: 1px; }
.dd-insight p { font-size: 12px; line-height: 1.45; color: #e9e2cf; }
.dd-insight p b { color: var(--gold); font-weight: 500; }

@keyframes ddGrow {
  0% { transform: scaleY(0); }
  16% { transform: scaleY(1); }
  82%,100% { transform: scaleY(1); }
}
@keyframes ddDraw {
  0%,8% { stroke-dashoffset: 120; }
  34% { stroke-dashoffset: 0; }
  82%,100% { stroke-dashoffset: 0; }
}
@keyframes ddInsight {
  0%,40% { opacity: 0; transform: translateY(8px); }
  52%,100% { opacity: 1; transform: translateY(0); }
}

/* reusable trigger for the demo visuals outside the showcase (e.g. services page) */
.demo-play .demo-build .db-el { animation: dbReveal 6s var(--ease-settle) 1 backwards; }
.demo-play .db-nav { animation-delay: 0.2s !important; }
.demo-play .db-hero { animation-delay: 0.8s !important; }
.demo-play .db-h1 { animation-delay: 1.4s !important; }
.demo-play .db-h2 { animation-delay: 1.7s !important; }
.demo-play .db-cta { animation: dbReveal 6s var(--ease-settle) 1 backwards, dbPulse 6s ease-in-out infinite; animation-delay: 2.1s !important; }
.demo-play .health-dot { animation: healthPulse 2.4s ease-out infinite; }
.demo-play .health-row:nth-child(2) .health-dot { animation-delay: 0.4s; }
.demo-play .health-row:nth-child(3) .health-dot { animation-delay: 0.8s; }
.demo-play .chat-bubble { animation: chatIn 6s var(--ease-settle) 1 backwards; }
.demo-play .chat-bubble.them { animation-delay: 1.2s; }
.demo-play .demo-data .dd-bars i { animation: ddGrow 6s var(--ease-settle) 1 backwards; }
.demo-play .demo-data .dd-bars i:nth-child(1) { animation-delay: 0.10s; }
.demo-play .demo-data .dd-bars i:nth-child(2) { animation-delay: 0.18s; }
.demo-play .demo-data .dd-bars i:nth-child(3) { animation-delay: 0.26s; }
.demo-play .demo-data .dd-bars i:nth-child(4) { animation-delay: 0.34s; }
.demo-play .demo-data .dd-bars i:nth-child(5) { animation-delay: 0.42s; }
.demo-play .demo-data .dd-bars i:nth-child(6) { animation-delay: 0.50s; }
.demo-play .demo-data .dd-bars i:nth-child(7) { animation-delay: 0.58s; }
.demo-play .demo-data .dd-spark path.line { animation: ddDraw 6s var(--ease-settle) 1 backwards; }
.demo-play .demo-data .dd-insight { animation: ddInsight 6s var(--ease-settle) 1 backwards; }

/* responsive: stack the showcase as a normal vertical section on small screens */
@media (max-width: 860px) {
  .showcase__pin { height: auto; display: block; padding: 56px 0; }
  .showcase__track { flex-direction: column; align-items: stretch; gap: 20px; padding: 0 24px; transform: none !important; }
  .sc-intro, .sc-card { width: 100%; }
  /* stack body over visual; drop the 540px cap so the full demo (and its
     animation) is visible instead of being clipped by overflow:hidden */
  .sc-card { height: auto; max-height: none; grid-template-columns: 1fr; }
  /* roomy band so each demo renders at full size and animates in view */
  .sc-card__visual { border-left: none; border-top: 1px solid rgba(255,255,255,0.06); min-height: 300px; padding: 24px; }
  .sc-card__body { padding: 28px 24px; }
  .sc-chips { margin-top: 20px; }
  .sc-intro__hint { display: none; } /* misleading on mobile — section stacks vertically */
}
