/* ==========================================================================
   TidyFactor Design System V4 — Home Page Stylesheet
   Architecture: Neo-Brutalist & Swiss Precision • 100% Logical RTL/LTR

   🏛️ NON-NEGOTIABLE ARCHITECTURAL INVARIANTS:
   1. ZERO-SCROLL HERO INVARIANT: The entire hero section (header copy,
      CTAs, 9 agent tags, and THE LOOP architecture simulation) MUST fit
      within the initial screen (<= 100svh) on desktop/laptop viewports
      (>= 1024px) so users NEVER have to scroll down to see all hero content.
   2. LIVE ANIMATED SIMULATION: THE LOOP features a continuous synchronized
      pipeline animation simulating the 5-stage AI agent execution loop:
      01 Prompt ➔ 02 Router ➔ 03 Skills ➔ 04 Gate ➔ 05 Ship.
   ========================================================================== */

/* --------------------------------------------------------------------------
   00. Universal Scaffolding & Container
   -------------------------------------------------------------------------- */
.tf-home-root {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-block: 8px 48px;
  position: relative;
  overflow-x: hidden;
}

.tf-container {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 16px;
  position: relative;
}

@media (min-width: 768px) {
  .tf-container {
    padding-inline: 24px;
  }
}

/* Generic Pill Badges */
.tf-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  box-shadow: 2px 2px 0px var(--border-color);
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-block-end: 0;
}

.tf-pill-idx {
  background: var(--accent-cyan);
  color: #090C13;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 0.62rem;
}

.tf-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
  display: inline-block;
  animation: tf-pulse 1.8s infinite ease-in-out;
}

@keyframes tf-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

/* --------------------------------------------------------------------------
   01. Hero Section (Zero-Scroll Precision Architecture)
   -------------------------------------------------------------------------- */
.tf-hero-section {
  position: relative;
  padding-block: 2px 8px;
  margin-block-end: 0;
}

.tf-hero-badge-wrap {
  display: flex;
  justify-content: flex-start;
  margin-block-end: 8px;
}

.tf-hero-header-grid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 24px;
  align-items: center;
  margin-block-end: 10px;
}

@media (max-width: 992px) {
  .tf-hero-header-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

.tf-hero-title-col {
  display: flex;
  flex-direction: column;
  text-align: start;
}

.tf-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.65rem, 2.2vw, 2.45rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  word-break: normal;
}

[dir="rtl"] .tf-hero-title {
  letter-spacing: 0;
  line-height: 1.22;
}

.tf-title-sticker {
  display: inline;
  color: var(--text-primary);
}

.tf-title-accent {
  display: inline;
  color: var(--accent-cyan);
}

.tf-title-badge-mcp {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 0.95vw, 0.88rem);
  font-weight: 900;
  background: var(--neo-yellow);
  color: #090C13;
  padding: 2px 8px;
  border: 1.5px solid var(--border-color);
  box-shadow: 2px 2px 0px var(--border-color);
  border-radius: 4px;
  vertical-align: middle;
  margin-inline-start: 8px;
}

.tf-title-badge-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  margin-inline-end: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

.tf-pill-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  margin-inline: 4px;
  animation: tf-sparkle-pulse 3s infinite ease-in-out;
}

@keyframes tf-sparkle-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(12deg); }
}

.tf-hero-desc-col {
  display: flex;
  flex-direction: column;
  text-align: start;
  gap: 8px;
}

.tf-hero-lead {
  font-size: 0.82rem;
  line-height: 1.52;
  color: var(--text-secondary);
  margin: 0;
}

.tf-hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
}

/* Neo-Brutalist Buttons (Compact Precision Scale) */
.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  border-radius: 4px;
  border: 1.5px solid var(--border-color);
  transition: transform 0.12s var(--t-ease), box-shadow 0.12s var(--t-ease);
  cursor: pointer;
}

.tf-btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-hard);
}

.tf-btn-primary:hover {
  transform: translate(-1.5px, -1.5px);
  box-shadow: var(--shadow-hard-lg);
}

.tf-btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  box-shadow: var(--shadow-hard);
}

.tf-btn-secondary:hover {
  transform: translate(-1.5px, -1.5px);
  box-shadow: var(--shadow-hard-lg);
}

.tf-btn-large {
  padding: 12px 24px;
  font-size: 0.92rem;
}

.tf-btn-arrow {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 0.95rem;
  transition: transform 0.12s ease;
}

.tf-btn:hover .tf-btn-arrow {
  transform: translateX(3px);
}

[dir="rtl"] .tf-btn:hover .tf-btn-arrow {
  transform: translateX(-3px);
}

/* Compatible Agents Bar (9 IDE Matrix) */
.tf-compatible-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block-start: 6px;
  border-block-start: 1px dashed var(--border-color);
}

.tf-compat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.tf-compat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tf-tag-agent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1.2px solid var(--border-color);
  box-shadow: 1px 1px 0px var(--border-color);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tf-tag-agent:hover {
  transform: translateY(-1px);
  box-shadow: 2px 2px 0px var(--border-color);
}

.tf-agent-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0;
}

[data-theme="dark"] .tf-icon-invertible,
html[data-theme="dark"] .tf-icon-invertible {
  filter: invert(1) brightness(1.25);
}

/* --------------------------------------------------------------------------
   02. THE LOOP DIAGRAM (Live Animated Architecture Simulation)
   -------------------------------------------------------------------------- */
.tf-loop-canvas-wrapper {
  margin-block-start: 6px;
  position: relative;
}

.tf-loop-canvas {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-hard);
  border-radius: 6px;
  overflow: hidden;
}

.tf-loop-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: var(--bg-surface-elevated);
  border-block-end: 1.5px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

.tf-loop-top-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tf-loop-png-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  animation: tf-shen-breathe 4.5s infinite ease-in-out;
}

@keyframes tf-shen-breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px rgba(212, 175, 55, 0.4));
  }
  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(255, 230, 0, 0.8));
  }
}

.tf-loop-icon {
  color: var(--accent-amber);
  font-size: 0.85rem;
}

.tf-loop-name {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.tf-loop-telemetry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 7px;
  border-radius: 3px;
}

.tf-telemetry-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  display: inline-block;
  animation: tf-telemetry-blink 1.2s infinite ease-in-out;
}

@keyframes tf-telemetry-blink {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 6px var(--accent-emerald);
  }

  50% {
    opacity: 0.3;
    transform: scale(0.7);
    box-shadow: none;
  }
}

.tf-pipeline-track {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  padding: 10px 14px;
  gap: 8px;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(var(--grid-dot-color) 1px, transparent 1px);
  background-size: 14px 14px;
  position: relative;
}

@media (max-width: 1100px) {
  .tf-pipeline-track {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 12px;
  }
}

/* --------------------------------------------------------------------------
   5-Stage Nodes & Continuous Cycling Animation
   Cycle Duration: 6s (01: 0-20% -> 02: 20-40% -> 03: 40-60% -> 04: 60-80% -> 05: 80-100%)
   -------------------------------------------------------------------------- */
.tf-pipe-node {
  background: var(--bg-surface);
  border: 1.8px solid var(--border-color);
  box-shadow: 2px 2px 0px var(--border-color);
  border-radius: 7px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: start;
  min-height: 136px;
  height: 100%;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
  position: relative;
  z-index: 1;
}

.tf-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 3px;
}

/* Stage Index Box (Neo-brutalist solid block) */
.tf-node-stage-box {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-color);
  box-shadow: 1.2px 1.2px 0px var(--border-color);
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stage-purple  { background: var(--neo-purple); color: #090C13; }
.stage-cyan    { background: var(--neo-cyan); color: #090C13; }
.stage-yellow  { background: var(--neo-yellow); color: #090C13; }
.stage-emerald { background: var(--accent-emerald); color: #FFFFFF; }
.stage-lime    { background: #D8FF38; color: #090C13; }

/* Stage Tag Pill (Icon + Monospace Tag) */
.tf-node-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 6px;
  border-radius: 4px;
  border: 1.2px solid var(--border-color);
  box-shadow: 1px 1px 0px var(--border-color);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tag-purple  { background: rgba(167, 139, 250, 0.12); color: #7C3AED; border-color: rgba(167, 139, 250, 0.4); }
.tag-cyan    { background: rgba(0, 240, 255, 0.12); color: #0284C7; border-color: rgba(0, 240, 255, 0.4); }
.tag-yellow  { background: rgba(255, 230, 0, 0.15); color: #B45309; border-color: rgba(255, 230, 0, 0.45); }
.tag-emerald { background: rgba(16, 185, 129, 0.12); color: #059669; border-color: rgba(16, 185, 129, 0.4); }
.tag-lime    { background: rgba(216, 255, 56, 0.18); color: #4D7C0F; border-color: rgba(216, 255, 56, 0.45); }

[data-theme="dark"] .tag-purple  { background: rgba(167, 139, 250, 0.2); color: #C4B5FD; border-color: rgba(167, 139, 250, 0.5); }
[data-theme="dark"] .tag-cyan    { background: rgba(0, 240, 255, 0.2); color: #67E8F9; border-color: rgba(0, 240, 255, 0.5); }
[data-theme="dark"] .tag-yellow  { background: rgba(255, 230, 0, 0.2); color: #FDE047; border-color: rgba(255, 230, 0, 0.5); }
[data-theme="dark"] .tag-emerald { background: rgba(16, 185, 129, 0.2); color: #6EE7B7; border-color: rgba(16, 185, 129, 0.5); }
[data-theme="dark"] .tag-lime    { background: rgba(216, 255, 56, 0.2); color: #E4FF6E; border-color: rgba(216, 255, 56, 0.5); }

.tf-tag-png-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.tf-node-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-block: 4px 6px;
  text-align: start;
}

[dir="rtl"] .tf-node-body {
  text-align: right;
}

.tf-node-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.tf-node-sub {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.03em;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.tf-node-preview {
  margin-block-start: auto;
  background: var(--code-bg);
  border: 1.2px solid var(--border-color);
  border-radius: 4px;
  padding: 5px 7px;
  font-family: var(--font-mono);
  font-size: 0.60rem;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  height: 44px;
  max-height: 44px;
  box-sizing: border-box;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
  overflow: hidden;
}

.tf-stack-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.55rem;
  line-height: 1.2;
  white-space: nowrap;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

.tf-stack-row strong {
  color: #F8FAFC;
  font-weight: 800;
}

.tf-stack-row .text-muted {
  color: #94A3B8;
  font-size: 0.52rem;
  margin-inline-start: auto;
}

.tf-code-line {
  line-height: 1.35;
  word-break: break-all;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

.tf-cursor-blink {
  display: inline-block;
  color: var(--neo-yellow);
  font-weight: 900;
  animation: tf-cursor 0.8s infinite;
}

@keyframes tf-cursor {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.tf-c-yellow {
  color: var(--neo-yellow);
  font-weight: 800;
}

.tf-meter-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-block-end: 2px;
}

.tf-meter-fill {
  display: block;
  height: 100%;
  background: var(--neo-cyan);
  width: 95%;
  transition: width 0.3s ease;
}

.tf-spec-text {
  font-size: 0.58rem;
  font-weight: 700;
  color: #94A3B8;
}

/* Skills mini stack inside Stage 03 */
.tf-skills-stack-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-block-start: auto;
  min-height: 44px;
  justify-content: center;
  direction: ltr !important;
  text-align: left !important;
}

.tf-stack-item {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 1.5px 5px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  color: #F8FAFC;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

.tf-stack-item small {
  margin-inline-start: auto;
  color: #94A3B8;
  font-size: 0.5rem;
}

.tf-dot-lime {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #D8FF38;
}

.tf-dot-cyan {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--neo-cyan);
}

.tf-dot-purple {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--neo-purple);
}

.tf-dot-red {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-rose);
  display: inline-block;
}

.tf-dot-yellow {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--neo-yellow);
  display: inline-block;
}

.tf-dot-green {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-emerald);
  display: inline-block;
}

.tf-check-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--accent-emerald);
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

.tf-status-pill {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 800;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate;
}

.text-lime {
  color: #D8FF38 !important;
}

.text-cyan {
  color: var(--accent-cyan) !important;
}

.text-yellow {
  color: var(--neo-yellow) !important;
}

.text-emerald {
  color: var(--accent-emerald) !important;
}

.text-red {
  color: var(--accent-rose) !important;
}

/* Pipe Connectors & Traveling Energy Wave */
.tf-pipe-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text-muted);
  position: relative;
  min-width: 16px;
}

.tf-arrow-head {
  display: inline-block;
  transition: transform 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
  transform-origin: center center;
}

.tf-arrow-pulse {
  position: absolute;
  top: 50%;
  inset-inline-start: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

[dir="rtl"] .tf-pipe-arrow {
  transform: scaleX(-1);
}

@media (max-width: 1100px) {
  .tf-pipe-arrow {
    transform: rotate(90deg) !important;
  }
}

/* --------------------------------------------------------------------------
   LIVE SYNCHRONIZED 5-STAGE SIMULATION ANIMATION (6s Infinite Loop)
   -------------------------------------------------------------------------- */
.node-prompt {
  animation: tf-node-cycle-1 6s infinite ease-in-out;
}

.node-prompt .tf-node-stage-box {
  animation: tf-stage-cycle-1 6s infinite ease-in-out;
}

.node-router {
  animation: tf-node-cycle-2 6s infinite ease-in-out;
}

.node-router .tf-node-stage-box {
  animation: tf-stage-cycle-2 6s infinite ease-in-out;
}

.node-skills {
  animation: tf-node-cycle-3 6s infinite ease-in-out;
}

.node-skills .tf-node-stage-box {
  animation: tf-stage-cycle-3 6s infinite ease-in-out;
}

.node-gate {
  animation: tf-node-cycle-4 6s infinite ease-in-out;
}

.node-gate .tf-node-stage-box {
  animation: tf-stage-cycle-4 6s infinite ease-in-out;
}

.node-commit {
  animation: tf-node-cycle-5 6s infinite ease-in-out;
}

.node-commit .tf-node-stage-box {
  animation: tf-stage-cycle-5 6s infinite ease-in-out;
}

@keyframes tf-stage-cycle-1 {
  0%, 18% { transform: scale(1.12); box-shadow: 0 0 10px rgba(167, 139, 250, 0.75); }
  22%, 100% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
}

@keyframes tf-stage-cycle-2 {
  0%, 18% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
  20%, 38% { transform: scale(1.12); box-shadow: 0 0 10px rgba(0, 240, 255, 0.75); }
  42%, 100% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
}

@keyframes tf-stage-cycle-3 {
  0%, 38% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
  40%, 58% { transform: scale(1.12); box-shadow: 0 0 10px rgba(255, 230, 0, 0.75); }
  62%, 100% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
}

@keyframes tf-stage-cycle-4 {
  0%, 58% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
  60%, 78% { transform: scale(1.12); box-shadow: 0 0 10px rgba(16, 185, 129, 0.75); }
  82%, 100% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
}

@keyframes tf-stage-cycle-5 {
  0%, 78% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
  80%, 98% { transform: scale(1.12); box-shadow: 0 0 10px rgba(216, 255, 56, 0.85); }
  100% { transform: scale(1); box-shadow: 1.2px 1.2px 0 var(--border-color); }
}

/* Arrow Pulses & Traveling Packets */
[data-conn="1"] .tf-arrow-head {
  animation: tf-arrow-cycle-1 6s infinite ease-in-out;
}

[data-conn="1"] .tf-arrow-pulse {
  animation: tf-pulse-wave-1 6s infinite ease-out;
}

[data-conn="2"] .tf-arrow-head {
  animation: tf-arrow-cycle-2 6s infinite ease-in-out;
}

[data-conn="2"] .tf-arrow-pulse {
  animation: tf-pulse-wave-2 6s infinite ease-out;
}

[data-conn="3"] .tf-arrow-head {
  animation: tf-arrow-cycle-3 6s infinite ease-in-out;
}

[data-conn="3"] .tf-arrow-pulse {
  animation: tf-pulse-wave-3 6s infinite ease-out;
}

[data-conn="4"] .tf-arrow-head {
  animation: tf-arrow-cycle-4 6s infinite ease-in-out;
}

[data-conn="4"] .tf-arrow-pulse {
  animation: tf-pulse-wave-4 6s infinite ease-out;
}

/* Stage 01: Prompt Active (0s - 1.2s) */
@keyframes tf-node-cycle-1 {

  0%,
  18% {
    border-color: var(--neo-purple);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.55), 2px 2px 0 var(--border-color);
    transform: translateY(-2px);
  }

  22%,
  100% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }
}

/* Connector 1: Flow (1.0s - 1.6s) */
@keyframes tf-arrow-cycle-1 {

  14%,
  22% {
    color: var(--neo-purple);
    transform: scale(1.35);
    text-shadow: 0 0 8px var(--neo-purple);
  }

  0%,
  12%,
  24%,
  100% {
    color: var(--text-muted);
    transform: scale(1);
    text-shadow: none;
  }
}

@keyframes tf-pulse-wave-1 {
  14% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.5);
    background: var(--neo-purple);
    box-shadow: 0 0 8px var(--neo-purple);
  }

  22% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
    background: var(--neo-purple);
  }

  0%,
  12%,
  24%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

/* Stage 02: Router Active (1.2s - 2.4s) */
@keyframes tf-node-cycle-2 {

  0%,
  18% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }

  20%,
  38% {
    border-color: var(--neo-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.55), 2px 2px 0 var(--border-color);
    transform: translateY(-2px);
  }

  42%,
  100% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }
}

/* Meter Bar Animation inside Stage 02 */
.node-router .tf-meter-fill {
  animation: tf-meter-cycle 6s infinite ease-in-out;
}

@keyframes tf-meter-cycle {

  0%,
  18% {
    width: 10%;
    opacity: 0.5;
  }

  22%,
  36% {
    width: 95%;
    opacity: 1;
    box-shadow: 0 0 6px var(--neo-cyan);
  }

  40%,
  100% {
    width: 95%;
    opacity: 0.6;
  }
}

/* Connector 2: Flow (2.2s - 2.8s) */
@keyframes tf-arrow-cycle-2 {

  34%,
  42% {
    color: var(--neo-cyan);
    transform: scale(1.35);
    text-shadow: 0 0 8px var(--neo-cyan);
  }

  0%,
  32%,
  44%,
  100% {
    color: var(--text-muted);
    transform: scale(1);
    text-shadow: none;
  }
}

@keyframes tf-pulse-wave-2 {
  34% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.5);
    background: var(--neo-cyan);
    box-shadow: 0 0 8px var(--neo-cyan);
  }

  42% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
    background: var(--neo-cyan);
  }

  0%,
  32%,
  44%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

/* Stage 03: Skills Active (2.4s - 3.6s) */
@keyframes tf-node-cycle-3 {

  0%,
  38% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }

  40%,
  58% {
    border-color: var(--neo-yellow);
    box-shadow: 0 0 10px rgba(255, 230, 0, 0.55), 2px 2px 0 var(--border-color);
    transform: translateY(-2px);
  }

  62%,
  100% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }
}

/* Skills items sequential glow */
.stack-item-1 {
  animation: tf-stack-1 6s infinite ease-in-out;
}

.stack-item-2 {
  animation: tf-stack-2 6s infinite ease-in-out;
}

.stack-item-3 {
  animation: tf-stack-3 6s infinite ease-in-out;
}

@keyframes tf-stack-1 {

  40%,
  46% {
    background: rgba(216, 255, 56, 0.15);
    border-color: #D8FF38;
  }

  0%,
  38%,
  48%,
  100% {
    background: var(--code-bg);
    border-color: var(--border-color);
  }
}

@keyframes tf-stack-2 {

  46%,
  52% {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--neo-cyan);
  }

  0%,
  44%,
  54%,
  100% {
    background: var(--code-bg);
    border-color: var(--border-color);
  }
}

@keyframes tf-stack-3 {

  52%,
  58% {
    background: rgba(167, 139, 250, 0.15);
    border-color: var(--neo-purple);
  }

  0%,
  50%,
  60%,
  100% {
    background: var(--code-bg);
    border-color: var(--border-color);
  }
}

/* Connector 3: Flow (3.4s - 4.0s) */
@keyframes tf-arrow-cycle-3 {

  54%,
  62% {
    color: var(--neo-yellow);
    transform: scale(1.35);
    text-shadow: 0 0 8px var(--neo-yellow);
  }

  0%,
  52%,
  64%,
  100% {
    color: var(--text-muted);
    transform: scale(1);
    text-shadow: none;
  }
}

@keyframes tf-pulse-wave-3 {
  54% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.5);
    background: var(--neo-yellow);
    box-shadow: 0 0 8px var(--neo-yellow);
  }

  62% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
    background: var(--neo-yellow);
  }

  0%,
  52%,
  64%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

/* Stage 04: Gate Active (3.6s - 4.8s) */
@keyframes tf-node-cycle-4 {

  0%,
  58% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }

  60%,
  78% {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.55), 2px 2px 0 var(--border-color);
    transform: translateY(-2px);
  }

  82%,
  100% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }
}

.node-gate .tf-check-badge {
  animation: tf-gate-badge 6s infinite ease-in-out;
}

@keyframes tf-gate-badge {

  60%,
  78% {
    color: #55D79C;
    text-shadow: 0 0 6px #55D79C;
  }

  0%,
  58%,
  80%,
  100% {
    color: var(--accent-emerald);
    text-shadow: none;
  }
}

/* Connector 4: Flow (4.6s - 5.2s) */
@keyframes tf-arrow-cycle-4 {

  74%,
  82% {
    color: var(--accent-emerald);
    transform: scale(1.35);
    text-shadow: 0 0 8px var(--accent-emerald);
  }

  0%,
  72%,
  84%,
  100% {
    color: var(--text-muted);
    transform: scale(1);
    text-shadow: none;
  }
}

@keyframes tf-pulse-wave-4 {
  74% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.5);
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
  }

  82% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(2.2);
    background: var(--accent-emerald);
  }

  0%,
  72%,
  84%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
}

/* Stage 05: Ship Active (4.8s - 6.0s) */
@keyframes tf-node-cycle-5 {

  0%,
  78% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }

  80%,
  98% {
    border-color: #D8FF38;
    box-shadow: 0 0 12px rgba(216, 255, 56, 0.65), 2px 2px 0 var(--border-color);
    transform: translateY(-2px);
  }

  100% {
    border-color: var(--border-color);
    box-shadow: 1.5px 1.5px 0 var(--border-color);
    transform: translateY(0);
  }
}

.node-commit .tf-status-pill {
  animation: tf-ship-pill 6s infinite ease-in-out;
}

@keyframes tf-ship-pill {

  80%,
  98% {
    color: #D8FF38;
    text-shadow: 0 0 8px #D8FF38;
  }

  0%,
  78%,
  100% {
    color: #A3E635;
    text-shadow: none;
  }
}


/* --------------------------------------------------------------------------
   03. Proof Strip: Architectural Metrics
   -------------------------------------------------------------------------- */
.tf-proof-section {
  background: var(--bg-surface);
  border-block: 2px solid var(--border-color);
  padding-block: 36px;
}

.tf-proof-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .tf-proof-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .tf-proof-grid {
    grid-template-columns: 1fr;
  }
}

.tf-proof-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: start;
  padding-inline-start: 16px;
  border-inline-start: 3px solid var(--border-color);
}

.tf-proof-val-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 6px;
}

.tf-proof-val {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.tf-proof-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-color);
  box-shadow: 1.5px 1.5px 0px var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 5px;
  box-sizing: border-box;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tf-proof-png-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.tf-proof-lbl {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.tf-proof-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   04. Comparison Section (Before vs After)
   -------------------------------------------------------------------------- */
.tf-problem-section {
  position: relative;
}

.tf-section-head-center {
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
  margin-block-end: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tf-section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text-primary);
  margin-block: 10px 16px;
}

.tf-highlight-lime {
  background: var(--neo-yellow);
  color: #090C13;
  padding-inline: 8px;
  display: inline-block;
}

.tf-section-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.tf-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 850px) {
  .tf-compare-grid {
    grid-template-columns: 1fr;
  }
}

.tf-compare-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-hard-lg);
  border-radius: 8px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: start;
}

.card-before {
  border-inline-start: 6px solid var(--accent-rose);
}

.card-after {
  border-inline-start: 6px solid var(--accent-emerald);
}

.tf-card-top-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
}

.tf-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.tf-fragile-chain,
.tf-solid-chain {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #F8FAFC;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tf-fragile-chain i,
.tf-solid-chain i {
  font-style: normal;
  color: var(--text-muted);
}

.tf-solid-chain b {
  color: var(--accent-emerald);
}

.tf-points-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  margin: 0;
}

.tf-points-list li {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
  position: relative;
  padding-inline-start: 16px;
}

.tf-points-list li::before {
  content: '▪';
  position: absolute;
  inset-inline-start: 0;
  color: var(--text-muted);
}

.tf-points-list strong {
  color: var(--text-primary);
}

.tf-card-verdict {
  margin-block-start: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px dashed var(--border-color);
  background: var(--bg-surface-elevated);
}

/* --------------------------------------------------------------------------
   05. The 3 Integrated Core Pillars
   -------------------------------------------------------------------------- */
.tf-pillars-section {
  position: relative;
}

.tf-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-block-end: 40px;
  flex-wrap: wrap;
  text-align: start;
}

.tf-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 992px) {
  .tf-pillars-grid {
    grid-template-columns: 1fr;
  }
}

.tf-pillar-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-hard-lg);
  border-radius: 8px;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: start;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tf-pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: 6px 6px 0px var(--border-color);
}

.tf-pillar-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.05em;
}

.tf-pillar-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.tf-pillar-desc {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.tf-pillar-link {
  margin-block-start: auto;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--border-color);
}

.tf-pillar-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   06. Multi-Platform Install Terminal
   -------------------------------------------------------------------------- */
.tf-terminal-section {
  position: relative;
}

.tf-terminal-box {
  background: var(--code-bg);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-hard-lg);
  border-radius: 8px;
  overflow: hidden;
  max-width: 960px;
  margin-inline: auto;
}

.tf-terminal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #0B0F19;
  border-block-end: 1.5px solid var(--border-color);
  flex-wrap: wrap;
  gap: 12px;
}

.tf-terminal-dots {
  display: flex;
  gap: 6px;
}

.tf-terminal-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tf-term-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #94A3B8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tf-term-tab.active,
.tf-term-tab:hover {
  background: #182234;
  color: #FFFFFF;
  border-color: #2E3E58;
}

.tf-terminal-body {
  padding: 24px;
}

.tf-term-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid #273449;
  border-radius: 6px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #F8FAFC;
  flex-wrap: wrap;
}

.tf-term-prompt {
  color: var(--neo-yellow);
  font-weight: 900;
}

.tf-term-cmd {
  flex: 1;
  word-break: break-all;
}

.tf-copy-btn {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.tf-copy-btn:hover {
  background: var(--neo-yellow);
  color: #090C13;
}

.tf-terminal-footer {
  padding: 10px 18px;
  background: #0B0F19;
  border-block-start: 1px solid #1E293B;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #64748B;
  text-align: start;
}

/* --------------------------------------------------------------------------
   07. Featured Skills Grid
   -------------------------------------------------------------------------- */
.tf-skills-section {
  position: relative;
}

.tf-skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 992px) {
  .tf-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .tf-skills-grid {
    grid-template-columns: 1fr;
  }
}

.tf-skill-card-item {
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-hard);
  border-radius: 8px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  text-align: start;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tf-skill-card-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hard-lg);
  border-color: var(--border-color);
}

.tf-skill-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tf-skill-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--text-muted);
}

.tf-skill-tier-badge {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.tf-skill-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
}

.tf-skill-card-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.tf-skill-card-foot {
  margin-block-start: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--border-color);
  gap: 10px;
}

.tf-skill-install-cmd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tf-skill-arrow {
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   08. Bottom High-Conversion CTA
   -------------------------------------------------------------------------- */
.tf-cta-section {
  position: relative;
}

.tf-cta-box {
  background: var(--bg-surface);
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-hard-lg);
  border-radius: 8px;
  padding: 48px 36px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
  text-align: start;
}

@media (max-width: 850px) {
  .tf-cta-box {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 28px;
  }
}

.tf-cta-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 2.8vw, 2.4rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text-primary);
  margin-block: 10px 14px;
}

.tf-cta-lead {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.tf-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}