/* ==========================================================================
   REHEARSE — Live Interactive Demos + Scenario Tabs
   Loaded after /styles.css and /rehearse/rehearse.css.
   Everything here is namespaced (.demo-*, .scn-*) so it cannot collide with
   the shared stylesheet or the existing core-tab / try-card rules.
   Brand: Innovation Blue #23B6FF · Tail End Purple #AF23FF · Wednesday Pink #FE2285
          Deep Purple #2B1E8F · Navy #031956
   ========================================================================== */

:root {
  --demo-blue: #23B6FF;
  --demo-purple: #AF23FF;
  --demo-pink: #FE2285;
  --demo-deep: #2B1E8F;
  --demo-navy: #031956;
  --demo-grad: linear-gradient(90deg, var(--demo-blue) 0%, var(--demo-purple) 50%, var(--demo-pink) 100%);
}

/* --------------------------------------------------------------------------
   Shared gradient launch button (used by cards and scenario tabs)
   -------------------------------------------------------------------------- */
.demo-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: .01em;
  color: #fff !important;
  text-decoration: none !important;
  background-image: var(--demo-grad);
  background-size: 200% 100%;
  background-position: 0% 50%;
  box-shadow: 0 8px 22px rgba(175, 35, 255, .28);
  transition: background-position .5s ease, transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.demo-launch:hover,
.demo-launch:focus-visible {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(254, 34, 133, .32);
}
.demo-launch:focus-visible {
  outline: 3px solid var(--demo-blue);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Section 1: Live Interactive Demos — 4 cards
   -------------------------------------------------------------------------- */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin-top: 40px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .demo-grid { grid-template-columns: 1fr; gap: 18px; }
}

.demo-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: #fff;
  border: 1px solid rgba(43, 30, 143, .10);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(3, 25, 86, .06);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.demo-card:hover,
.demo-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(43, 30, 143, .16);
  border-color: rgba(175, 35, 255, .35);
}

.demo-card-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--demo-navy);
}
.demo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.demo-card:hover .demo-card-img img { transform: scale(1.04); }
.demo-card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 25, 86, 0) 55%, rgba(3, 25, 86, .35) 100%);
  pointer-events: none;
}

.demo-card-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 20px 20px 22px;
  gap: 10px;
}
.demo-card-cat {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--demo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.demo-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  color: var(--demo-navy);
}
.demo-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: #3C3960;
  flex: 1 1 auto;
}
.demo-card-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #6B6890;
  flex: 0 0 auto;
}
.demo-card .demo-launch {
  margin-top: 8px;
  align-self: flex-start;
}

.demo-footnote {
  margin: 28px auto 0;
  max-width: 760px;
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
  color: #6B6890;
}

/* --------------------------------------------------------------------------
   Section 2: Scenario tabs (dark band)
   -------------------------------------------------------------------------- */
.scn-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 36px 0 28px;
}
.scn-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.scn-tab:hover { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.scn-tab:focus-visible { outline: 3px solid var(--demo-blue); outline-offset: 2px; }
.scn-tab.is-active {
  background: var(--demo-grad);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(175, 35, 255, .35);
}

.scn-panel {
  display: none;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  padding: 26px;
  backdrop-filter: blur(6px);
}
.scn-panel.is-active {
  display: grid;
  animation: scnFade .35s ease both;
}
@keyframes scnFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 900px) {
  .scn-panel { grid-template-columns: 1fr; gap: 22px; padding: 18px; }
}

.scn-shot {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: var(--demo-navy);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}
.scn-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

.scn-copy { color: #fff; min-width: 0; }
.scn-copy .scn-cat {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--demo-blue);
  margin-bottom: 8px;
}
.scn-copy h3 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.15;
  color: #fff;
}
.scn-copy p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .86);
}
.scn-caps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.scn-caps li {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
}
.scn-caps li::before {
  content: "✓";
  margin-right: 6px;
  color: var(--demo-blue);
  font-weight: 800;
}

.scn-close {
  text-align: center;
  margin-top: 40px;
}
.scn-close .scn-tagline {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 18px;
  letter-spacing: .01em;
}
.scn-close .scn-tagline span {
  background: var(--demo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .demo-launch, .demo-card, .demo-card-img img, .scn-tab { transition: none; }
  .demo-card:hover, .demo-launch:hover { transform: none; }
  .demo-card:hover .demo-card-img img { transform: none; }
  .scn-panel.is-active { animation: none; }
}
