/* ============================================================
   Hero Animation — 3 variants of an email sequence
   Variant A: Inbox timeline — emails land in an inbox one by one
   Variant B: Automation flow — Klaviyo-like node diagram
   Variant C: Stacked cards — paper plane flies between cards
   ============================================================ */

/* shared */
.seq-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 6;
  background: var(--beige-soft);
  border: 3px solid var(--bleu-nuit);
  box-shadow: 14px 14px 0 var(--bleu-electrique);
  padding: 20px;
  overflow: hidden;
}
.seq-stage-inner { position: relative; width: 100%; height: 100%; }

.seq-label {
  position: absolute;
  top: -3px; left: 20px;
  background: var(--bleu-nuit);
  color: var(--beige);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 10;
}
.seq-meter {
  position: absolute;
  top: 8px; right: 20px;
  display: flex;
  gap: 6px;
  z-index: 10;
}
.seq-meter span {
  width: 10px; height: 10px;
  background: var(--beige);
  border: 2px solid var(--bleu-nuit);
  transition: all 200ms var(--ease-snap);
}
.seq-meter span.on { background: var(--bleu-electrique); }

/* ============================================================
   Variant A: INBOX TIMELINE
   ============================================================ */
.seq-inbox {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: 44px;
  gap: 10px;
}
.seq-inbox-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bleu-nuit);
  color: var(--beige);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 -4px;
  border: 2px solid var(--bleu-nuit);
}
.seq-inbox-header .dots { display: inline-flex; gap: 4px; }
.seq-inbox-header .dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--beige); opacity: 0.4;
}
.seq-inbox-header .title {
  flex: 1; text-transform: uppercase; font-size: 11px; letter-spacing: 0.12em;
}
.seq-inbox-header .counter {
  background: var(--bleu-electrique);
  padding: 3px 8px;
  font-weight: 700;
}

.seq-inbox-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding-top: 4px;
}
.email-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  background: var(--beige);
  border: 2px solid var(--bleu-nuit);
  align-items: center;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 500ms var(--ease-snap), transform 500ms var(--ease-snap),
              box-shadow 300ms var(--ease-snap), background 300ms var(--ease-snap);
  position: relative;
}
.email-row.in {
  opacity: 1;
  transform: translateX(0);
  box-shadow: 4px 4px 0 var(--bleu-nuit);
}
.email-row.active {
  background: var(--bleu-electrique);
  color: var(--beige);
  box-shadow: 6px 6px 0 var(--bleu-nuit);
}
.email-row.active .email-meta,
.email-row.active .email-time { color: var(--beige); opacity: 0.85; }
.email-row.active .email-avatar { background: var(--beige); color: var(--bleu-electrique); border-color: var(--beige); }

.email-avatar {
  width: 40px; height: 40px;
  background: var(--bleu-nuit);
  color: var(--beige);
  border: 2px solid var(--bleu-nuit);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.email-body { min-width: 0; }
.email-subject {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-meta {
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.email-time {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.seq-inbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bleu-nuit);
  color: var(--beige);
  border: 2px solid var(--bleu-nuit);
  font-size: 12px;
  margin: 0 -4px -4px;
}
.seq-inbox-footer .conv {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.seq-inbox-footer .conv b { color: #7dd394; }

/* ============================================================
   Variant B: AUTOMATION FLOW
   8 nodes + 7 connectors must fit in seq-stage (aspect-ratio 5/6).
   Sizing is tight on purpose — adjust gap/ico/padding together.
   ============================================================ */
.seq-flow {
  padding-top: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-node {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 8px 12px;
  background: var(--beige);
  border: 2px solid var(--bleu-nuit);
  align-items: center;
  opacity: 0.35;
  transform: scale(0.97);
  transition: all 400ms var(--ease-snap);
  position: relative;
}
.flow-node.in { opacity: 1; transform: scale(1); }
.flow-node.active {
  background: var(--bleu-electrique);
  color: var(--beige);
  box-shadow: 4px 4px 0 var(--bleu-nuit);
  transform: scale(1) translate(-2px, -2px);
}
.flow-node.active .flow-sub { color: var(--beige); opacity: 0.85; }
.flow-node.active .flow-ico { background: var(--beige); color: var(--bleu-electrique); }

.flow-ico {
  width: 36px; height: 36px;
  background: var(--bleu-nuit);
  color: var(--beige);
  border: 2px solid var(--bleu-nuit);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 200ms var(--ease-snap);
}
.flow-title { font-size: 13px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.flow-sub { font-size: 11px; color: var(--fg-muted); margin-top: 1px; line-height: 1.2; }

.flow-connector {
  width: 2px;
  height: 8px;
  background: var(--bleu-nuit);
  margin-left: 17px;
  position: relative;
  opacity: 0.3;
  transition: opacity 300ms;
}
.flow-connector.in { opacity: 1; }
.flow-connector::after {
  content: '';
  position: absolute;
  bottom: -4px; left: -3px;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--bleu-nuit);
}
.flow-connector.pulse::before {
  content: '';
  position: absolute;
  left: -1px; top: 0;
  width: 4px; height: 100%;
  background: var(--bleu-electrique);
  transform-origin: top;
  animation: flowPulse calc(2s / var(--hero-seq-speed, 1)) ease-out;
}
@keyframes flowPulse {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

.flow-trigger { background: var(--bleu-nuit); color: var(--beige); }
.flow-trigger .flow-sub { color: var(--beige); opacity: 0.7; }
.flow-trigger .flow-ico { background: var(--beige); color: var(--bleu-nuit); }
.flow-delay {
  background: repeating-linear-gradient(45deg, var(--beige) 0 6px, var(--beige-deep) 6px 12px);
}

/* ============================================================
   Variant C: PAPER PLANE CARDS
   ============================================================ */
.seq-cards {
  padding-top: 44px;
  height: 100%;
  position: relative;
}
.seq-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  height: 100%;
}
.plane-card {
  background: var(--beige);
  border: 2px solid var(--bleu-nuit);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 300ms var(--ease-snap);
  opacity: 0.5;
  transform: scale(0.95);
}
.plane-card.in { opacity: 1; transform: scale(1); box-shadow: 3px 3px 0 var(--bleu-nuit); }
.plane-card.active {
  background: var(--bleu-electrique);
  color: var(--beige);
  box-shadow: 6px 6px 0 var(--bleu-nuit);
  transform: scale(1) translate(-2px, -2px);
}
.plane-card.active .plane-day,
.plane-card.active .plane-preview { color: var(--beige); opacity: 0.85; }
.plane-day {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bleu-electrique);
}
.plane-subject {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 6px 0;
}
.plane-preview {
  font-size: 11px;
  line-height: 1.3;
  color: var(--fg-muted);
}
.plane-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 6px;
  background: var(--bleu-nuit);
  color: var(--beige);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: flex-start;
}
.plane-card.active .plane-tag { background: var(--beige); color: var(--bleu-electrique); }

.plane {
  position: absolute;
  width: 40px; height: 40px;
  z-index: 5;
  pointer-events: none;
  transition: transform calc(1.2s / var(--hero-seq-speed, 1)) var(--ease-snap);
  top: 80px; left: 50px;
}
.plane svg { width: 100%; height: 100%; }

/* ============================================================
   Playback controls
   ============================================================ */
.seq-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 12px;
  font-size: 12px;
}
.seq-tabs {
  display: flex;
  gap: 0;
  border: 2px solid var(--bleu-nuit);
}
.seq-tab {
  padding: 6px 12px;
  background: var(--beige);
  border: none;
  border-right: 2px solid var(--bleu-nuit);
  font-family: inherit;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--bleu-nuit);
  transition: all 150ms;
}
.seq-tab:last-child { border-right: none; }
.seq-tab.on { background: var(--bleu-nuit); color: var(--beige); }
.seq-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--fg-muted);
}
.seq-status .live-dot {
  width: 8px; height: 8px;
  background: #2fb964;
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
