/* ═══════════════════════════════════════
   BLOC STORY — comment c'est fait + tabs
   ═══════════════════════════════════════ */

/* Tab bar */
.story-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
}

.story-tab {
  background: none;
  border: none;
  color: var(--cream3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}

.story-tab:hover {
  color: var(--cream2);
}

.story-tab.active {
  background: rgba(94, 207, 160, 0.12);
  color: var(--teal);
  box-shadow: 0 0 10px rgba(94, 207, 160, 0.08);
}

.story-tab .tab-badge {
  display: inline-block;
  background: rgba(212, 160, 74, 0.15);
  color: var(--amber);
  font-size: 0.46rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  letter-spacing: 0.06em;
  vertical-align: middle;
  animation: badgePulse 2.5s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Inactive demo tab gets subtle glow to draw eye */
.story-tab:not(.active):has(.tab-badge) {
  color: var(--cream2);
}

/* CTA at bottom of story pane */
.story-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.3rem 1.5rem;
  background: linear-gradient(135deg, rgba(94, 207, 160, 0.08), rgba(59, 168, 122, 0.04));
  border: 1px solid rgba(94, 207, 160, 0.18);
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  animation: ctaPulse 3s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 207, 160, 0); }
  50% { box-shadow: 0 0 20px rgba(94, 207, 160, 0.1); }
}

.story-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(94, 207, 160, 0.012) 3px, rgba(94, 207, 160, 0.012) 4px);
  pointer-events: none;
}

.story-cta:hover {
  background: linear-gradient(135deg, rgba(94, 207, 160, 0.12), rgba(59, 168, 122, 0.07));
  border-color: rgba(94, 207, 160, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(94, 207, 160, 0.12);
}

.story-cta-text {
  flex: 1;
}

.story-cta-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.25rem;
}

.story-cta-desc {
  font-size: 0.72rem;
  color: var(--cream2);
  line-height: 1.55;
}

.story-cta-arrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--teal);
  background: rgba(94, 207, 160, 0.1);
  border: 1px solid rgba(94, 207, 160, 0.2);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.25s;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.story-cta:hover .story-cta-arrow {
  background: rgba(94, 207, 160, 0.18);
  border-color: rgba(94, 207, 160, 0.4);
  transform: translateX(2px);
  box-shadow: 0 0 12px rgba(94, 207, 160, 0.15);
}

/* Pane transition */
.story-pane {
  animation: paneIn 0.35s ease-out;
}

@keyframes paneIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.story-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.story-narrative {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.story-title {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.15;
  color: var(--cream);
  letter-spacing: -0.02em;
}

.story-title em {
  font-style: normal;
  color: var(--teal);
}

.story-lead {
  font-size: 0.88rem;
  color: var(--cream2);
  line-height: 1.75;
  font-weight: 300;
}

.story-lead strong {
  color: var(--cream);
  font-weight: 500;
}

.story-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.story-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(94, 207, 160, 0.15);
  background: rgba(94, 207, 160, 0.04);
}

/* Workflow steps */
.story-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.story-step {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  position: relative;
  padding: 0.8rem 0;
}

.story-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 2.2rem;
  bottom: -0.2rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--teal-dim), transparent);
}

.story-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  border: 2px solid var(--teal-dim);
  background: var(--bg);
  position: relative;
  z-index: 1;
}

.story-step:first-child .story-dot {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 8px rgba(94, 207, 160, 0.3);
}

.story-step-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal-dim);
  margin-bottom: 0.15rem;
}

.story-step-text {
  font-size: 0.78rem;
  color: var(--cream2);
  line-height: 1.55;
}

.story-step-text code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--teal);
  background: rgba(94, 207, 160, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(94, 207, 160, 0.08);
}

/* Right column — terminal preview */
.story-terminal {
  background: var(--code);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.story-term-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: rgba(240, 230, 211, 0.015);
}

.story-term-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.story-term-dot:nth-child(1) { background: #ff5f56; }
.story-term-dot:nth-child(2) { background: #ffbd2e; }
.story-term-dot:nth-child(3) { background: #27c93f; }

.story-term-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--cream3);
  margin-left: 0.3rem;
  letter-spacing: 0.05em;
}

.story-term-body {
  padding: 1rem 1.1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  line-height: 1.9;
  color: var(--cream2);
  flex: 1;
}

.story-prompt {
  color: var(--amber);
}

.story-cmd {
  color: var(--cream3);
}

.story-result {
  color: var(--teal);
}

.story-comment {
  color: var(--cream3);
  opacity: 0.45;
}

/* Bottom note */
.story-footnote {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  color: var(--cream3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.6rem;
  opacity: 0.6;
}

.story-footnote a {
  color: var(--teal-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 207, 160, 0.15);
}

.story-footnote a:hover {
  color: var(--teal);
  border-color: var(--teal);
}

/* Responsive */
@media (max-width: 768px) {
  .story-wrap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .story-title {
    font-size: 1.3rem;
  }
}
