/* VMM Architecture Flowchart — Inside The Practice V3 */

.flowchart-page {
  background: #060d1a;
  color: #f8fafc;
  min-height: 100vh;
}

/* ─── Top bar ─────────────────────────────────────────── */
.fc-top {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(6, 13, 26, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.fc-top-back {
  color: rgba(248, 250, 252, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.fc-top-back:hover { color: #F5C400; }

.fc-top-divider { color: rgba(255, 255, 255, 0.2); }

.fc-top-sub { color: rgba(248, 250, 252, 0.5); }

/* ─── Intro ───────────────────────────────────────────── */
.flowchart-intro {
  padding: 72px 24px 48px;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.fc-intro-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #F5C400;
  margin-bottom: 20px;
}

.fc-intro-headline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.35;
  color: rgba(248, 250, 252, 0.95);
  margin-bottom: 20px;
}

.fc-intro-body {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 16px;
}

.fc-intro-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(148, 163, 184, 0.5);
  letter-spacing: 0.04em;
}

/* ─── Chart wrap ──────────────────────────────────────── */
.flowchart-wrap {
  padding: 0 16px 48px;
  max-width: 1480px;
  margin: 0 auto;
}

.flowchart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 8px;
}

.fc-intro-hint {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.55);
  margin-top: 8px;
}

/* ─── Route picker ────────────────────────────────────── */
.fc-routes-section {
  margin-bottom: 24px;
  padding: 0 8px;
}

.fc-routes-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.45);
  margin-bottom: 12px;
}

.fc-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.fc-route-card {
  --route-color: #F5C400;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 18px;
  min-width: 160px;
  flex: 1 1 160px;
  max-width: 220px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.25s, background 0.25s, transform 0.2s, box-shadow 0.25s;
}

.fc-route-card:hover {
  border-color: color-mix(in srgb, var(--route-color) 50%, transparent);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.fc-route-card.is-active {
  border-color: var(--route-color);
  background: color-mix(in srgb, var(--route-color) 12%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--route-color) 20%, transparent);
}

.fc-route-card--featured {
  border-color: color-mix(in srgb, var(--route-color) 35%, transparent);
  background: color-mix(in srgb, var(--route-color) 6%, transparent);
}

.fc-route-card-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.95);
  line-height: 1.3;
}

.fc-route-card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--route-color);
  opacity: 0.85;
  letter-spacing: 0.02em;
}

/* ─── Story panel + stage layout ──────────────────────── */
.flowchart-stage {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.fc-story {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.fc-story-inner {
  flex: 1;
  padding: 28px 24px;
  min-height: 280px;
}

.fc-story-inner.is-playing {
  animation: fcStoryIn 0.35s ease;
}

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

.fc-story-idle-label,
.fc-story-route-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.fc-story-idle-label { color: rgba(148, 163, 184, 0.45); }
.fc-story-route-tag { color: #F5C400; }

.fc-story-idle-title,
.fc-story-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(248, 250, 252, 0.95);
  margin: 0 0 14px;
}

.fc-story-idle-body,
.fc-story-body {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(148, 163, 184, 0.88);
  margin: 0 0 16px;
}

.fc-story-idle-tip {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.55);
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fc-story-idle-tip strong { color: rgba(248, 250, 252, 0.75); }

.fc-story-node {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 12px;
}

.fc-story-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}

.fc-story-node-label {
  flex: 1;
  color: rgba(248, 250, 252, 0.9);
  font-weight: 500;
}

.fc-story-node-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(148, 163, 184, 0.6);
}

.fc-story-controls {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

.fc-story-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-bottom: 10px;
  overflow: hidden;
}

.fc-story-progress-fill {
  height: 100%;
  background: #F5C400;
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0;
}

.fc-story-step-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(148, 163, 184, 0.5);
  display: block;
  margin-bottom: 12px;
}

.fc-story-nav {
  display: flex;
  gap: 8px;
}

.fc-story-btn {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: transparent;
  color: rgba(148, 163, 184, 0.8);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.fc-story-btn:hover:not(:disabled) {
  color: rgba(248, 250, 252, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.fc-story-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fc-story-btn--primary {
  background: rgba(245, 196, 0, 0.12);
  border-color: rgba(245, 196, 0, 0.35);
  color: #F5C400;
}

.fc-story-btn--primary:hover:not(:disabled) {
  background: rgba(245, 196, 0, 0.2);
  border-color: #F5C400;
}

.flowchart-stage .flowchart-canvas-wrap {
  flex: 1;
  min-width: 0;
}

.fc-view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
}

.fc-view-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(148, 163, 184, 0.7);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.fc-view-btn.is-active {
  background: rgba(245, 196, 0, 0.15);
  color: #F5C400;
}

.fc-view-btn:hover:not(.is-active) {
  color: rgba(248, 250, 252, 0.85);
}

.fc-toolbar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.7);
}

.fc-toolbar-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.fc-toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.fc-btn-sarah {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border: 1px solid rgba(245, 196, 0, 0.45);
  background: rgba(245, 196, 0, 0.1);
  color: #F5C400;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.fc-btn-sarah:hover {
  background: rgba(245, 196, 0, 0.18);
  border-color: #F5C400;
}

.fc-btn-reset {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.6);
  cursor: pointer;
  transition: color 0.2s;
}

.fc-btn-reset:hover { color: rgba(248, 250, 252, 0.8); }

.fc-gold-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(245, 196, 0, 0.65);
  letter-spacing: 0.03em;
}

.fc-gold-legend-line {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 2px dashed rgba(245, 196, 0, 0.7);
}

.flowchart-canvas-wrap {
  background: #0a1528;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  min-height: 480px;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.flowchart-canvas-wrap.is-route-focus {
  border-color: rgba(245, 196, 0, 0.28);
  box-shadow:
    0 0 0 1px rgba(245, 196, 0, 0.08),
    0 12px 48px rgba(0, 0, 0, 0.55),
    inset 0 0 80px rgba(0, 0, 0, 0.25);
}

svg#vmm-flowchart.fc-map {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.fc-load-error {
  padding: 48px 24px;
  text-align: center;
  color: rgba(248, 250, 252, 0.7);
  font-size: 14px;
}

.fc-hover-labels text {
  pointer-events: none;
}

.fc-label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* ─── Tooltip ─────────────────────────────────────────── */
#fc-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  max-width: 280px;
  width: 280px;
  padding: 18px 20px;
  background: rgba(10, 18, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#fc-tooltip.is-visible { opacity: 1; }

.fc-tip-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #F5C400;
  display: block;
  margin-bottom: 4px;
}

.fc-tip-group {
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(148, 163, 184, 0.6);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fc-tip-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #f8fafc;
  margin: 0 0 8px;
  line-height: 1.3;
}

.fc-tip-desc {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: rgba(148, 163, 184, 0.9);
  margin: 0 0 10px;
}

.fc-tip-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(148, 163, 184, 0.5);
}

/* ─── Legend ──────────────────────────────────────────── */
.flowchart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  padding: 0 8px;
}

.fc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.75);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 6px 12px;
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}

.fc-legend-item:hover { border-color: rgba(255, 255, 255, 0.18); }

.fc-legend-item.is-off { opacity: 0.35; }

.fc-legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── CTA ─────────────────────────────────────────────── */
.flowchart-cta {
  padding: 80px 24px 100px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fc-cta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #F5C400;
  margin-bottom: 16px;
}

.fc-cta-headline {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.5vw, 28px);
  font-weight: 600;
  margin-bottom: 14px;
}

.fc-cta-body {
  font-size: 15px;
  color: rgba(148, 163, 184, 0.85);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.fc-cta-btn {
  display: inline-block;
  padding: 16px 32px;
  background: #F5C400;
  color: #060d1a;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, transform 0.2s;
}

.fc-cta-btn:hover {
  background: #ffcf1f;
  transform: translateY(-1px);
}

.fc-cta-note {
  display: block;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.5);
}

/* ─── Mobile timeline ─────────────────────────────────── */
.flowchart-mobile {
  padding: 0 20px 48px;
  max-width: 520px;
  margin: 0 auto;
}

.fc-mobile-stages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

.fc-mobile-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 24px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fc-mobile-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fc-mobile-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #F5C400;
  display: block;
  margin-bottom: 8px;
}

.fc-mobile-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
}

.fc-mobile-title {
  font-family: var(--font-display);
  font-size: 20px;
  margin-bottom: 8px;
}

.fc-mobile-desc {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(148, 163, 184, 0.85);
}

.fc-mobile-sarah {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fc-mobile-sarah-title {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 16px;
  color: #F5C400;
}

.fc-sarah-steps {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.fc-sarah-step {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: rgba(245, 196, 0, 0.06);
  border: 1px solid rgba(245, 196, 0, 0.2);
  border-radius: 10px;
  padding: 16px;
}

.fc-sarah-step-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #F5C400;
  display: block;
  margin-bottom: 6px;
}

.fc-sarah-step-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.85);
}

/* ─── Full Stack embed preview ────────────────────────── */
.fs-map-preview {
  background: #060d1a;
  padding: 80px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.fs-map-preview-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.fs-map-preview-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #F5C400;
  margin-bottom: 16px;
}

.fs-map-preview h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  margin-bottom: 12px;
}

.fs-map-preview p {
  font-size: 16px;
  color: var(--fs-muted, rgba(148, 163, 184, 0.85));
  line-height: 1.65;
  margin-bottom: 32px;
}

.fs-map-preview-visual {
  position: relative;
  margin-bottom: 32px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(ellipse at center, rgba(245, 196, 0, 0.04) 0%, transparent 70%);
  padding: 48px 24px;
}

.fs-map-preview-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  opacity: 0.5;
  filter: blur(0.5px);
}

.fs-map-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.fs-map-dot--gold { background: rgba(245, 196, 0, 0.5); }
.fs-map-dot--purple { background: rgba(155, 127, 232, 0.4); }
.fs-map-dot--green { background: rgba(46, 204, 113, 0.4); }

.fs-map-preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 13, 26, 0.3);
}

.fs-map-preview-stat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(248, 250, 252, 0.6);
  letter-spacing: 0.06em;
}

.fs-map-cta-btn {
  display: inline-block;
  padding: 16px 28px;
  background: rgba(245, 196, 0, 0.12);
  border: 1px solid rgba(245, 196, 0, 0.4);
  color: #F5C400;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.fs-map-cta-btn:hover {
  background: rgba(245, 196, 0, 0.2);
  border-color: #F5C400;
}

@media (max-width: 1100px) {
  .flowchart-stage { flex-direction: column; }
  .fc-story { flex: none; min-height: auto; }
  .fc-story-inner { min-height: 180px; }
}

@media (max-width: 767px) {
  .flowchart-toolbar { flex-direction: column; align-items: stretch; }
  .fc-toolbar-actions { justify-content: center; }
  .flowchart-intro { padding-top: 48px; }
  .fc-route-card { max-width: none; flex: 1 1 100%; }
  .fc-routes-section { margin-bottom: 20px; }
}
