:root {
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --accent: #22d3ee;
    --accent-secondary: #f472b6;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --bg: #0f172a;
    --bg-alt: #1e293b;
    --border: #334155;
    --gradient-1: #6366f1;
    --gradient-2: #8b5cf6;
    --gradient-3: #06b6d4;
    --card-bg: rgba(30, 41, 59, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    overflow-x: hidden;
}

/* Animated background blobs */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: blobFloat 20s ease-in-out infinite;
}

.bg-blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.bg-blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.bg-blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f472b6 0%, #fb7185 100%);
    top: 40%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes blobFloat {

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

    25% {
        transform: translate(30px, -50px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(50px, 30px) scale(1.05);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navbar - Glassmorphism Dark */
.navbar {
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Buttons - Modern gradient style */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--gradient-2) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text);
    border: 1px solid rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 1);
    border-color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--gradient-2) 100%);
    color: white;
    border-color: transparent;
}

.btn-large {
    padding: 18px 36px;
    font-size: 1.1rem;
    border-radius: 16px;
}

/* Hero */
.hero {
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
    background: transparent;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-light);
    max-width: 650px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Sections */
.section {
    padding: 100px 0;
    position: relative;
}

.section-alt {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
}

.section h2 {
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cards - Glassmorphism Dark */
.problem-card,
.feature-card,
.tech-card,
.opportunity-card {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 36px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.problem-card:hover,
.feature-card:hover,
.tech-card:hover,
.opportunity-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.4);
}

.icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.problem-card h3,
.feature-card h3,
.tech-card h3,
.opportunity-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text);
}

.problem-card p,
.feature-card p,
.tech-card p,
.opportunity-card p {
    color: var(--text-light);
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.step {
    text-align: center;
    padding: 24px;
}

.step-number {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.step p {
    color: var(--text-light);
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--gradient-2) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: ctaGlow 10s linear infinite;
}

@keyframes ctaGlow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.cta-section h2 {
    color: white;
    margin-bottom: 16px;
    -webkit-text-fill-color: white;
    position: relative;
}

.cta-section p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 32px;
    position: relative;
}

.cta-section .btn-primary {
    background: white;
    color: var(--primary-dark);
    position: relative;
}

.cta-section .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    padding: 40px 0;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    color: var(--text-light);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Journey Section */
.journey-toggle {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 56px;
}

.journey-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 36px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: var(--text);
}

.journey-tab:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.journey-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--gradient-2) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.tab-icon {
    font-size: 1.3rem;
}

.journey-container {
    opacity: 1;
    transition: opacity 0.4s ease;
}

.journey-container.hidden {
    display: none;
    opacity: 0;
}

/* Journey Timeline */
.journey-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    margin-top: 40px;
}

.journey-copy {
    flex: 1;
    max-width: 380px;
}

.journey-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 4px;
}

.journey-heading {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.journey-tagline {
    color: var(--text-light);
    margin-bottom: 16px;
}

.journey-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-light);
}

.journey-benefits li strong {
    color: var(--text);
}

.journey-visuals {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.flow-caption {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    max-width: 520px;
    margin: 8px auto 0;
}

.journey-timeline {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    margin-bottom: 64px;
    flex-wrap: wrap;
}

.journey-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 140px;
    opacity: 0;
    animation: stepFadeIn 0.5s ease forwards;
}

.journey-step[data-step="1"] {
    animation-delay: 0.1s;
}

.journey-step[data-step="2"] {
    animation-delay: 0.3s;
}

.journey-step[data-step="3"] {
    animation-delay: 0.5s;
}

.journey-step[data-step="4"] {
    animation-delay: 0.7s;
}

.journey-step[data-step="5"] {
    animation-delay: 0.9s;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-icon-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.step-icon {
    width: 64px;
    height: 64px;
    background: var(--bg);
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    position: relative;
    z-index: 2;
}

.step-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    animation: pulse 2s infinite;
}

.journey-step:hover .step-pulse {
    animation: pulseHover 1s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }

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

@keyframes pulseHover {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

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

.step-content h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text);
}

.step-content p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Journey Connector */
.journey-connector {
    display: flex;
    align-items: center;
    padding-top: 32px;
    width: 40px;
}

.connector-line {
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    flex: 1;
    position: relative;
    animation: lineGrow 0.8s ease forwards;
    transform-origin: left;
    transform: scaleX(0);
}

.journey-connector:nth-of-type(2) .connector-line {
    animation-delay: 0.2s;
}

.journey-connector:nth-of-type(4) .connector-line {
    animation-delay: 0.4s;
}

.journey-connector:nth-of-type(6) .connector-line {
    animation-delay: 0.6s;
}

.journey-connector:nth-of-type(8) .connector-line {
    animation-delay: 0.8s;
}

@keyframes lineGrow {
    to {
        transform: scaleX(1);
    }
}

.connector-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: dotPop 0.3s ease forwards;
    opacity: 0;
    transform: scale(0);
}

.journey-connector:nth-of-type(2) .connector-dot {
    animation-delay: 0.4s;
}

.journey-connector:nth-of-type(4) .connector-dot {
    animation-delay: 0.6s;
}

.journey-connector:nth-of-type(6) .connector-dot {
    animation-delay: 0.8s;
}

.journey-connector:nth-of-type(8) .connector-dot {
    animation-delay: 1s;
}

@keyframes dotPop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section h2 {
        font-size: 2rem;
    }

    .footer .container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

.section h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* Problem Grid */
.problem-grid,
.features-grid,
.tech-grid,
.opportunity-grid {
    display: grid;
    gap: 24px;
    margin-top: 48px;
}

.problem-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.tech-grid,
.opportunity-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}




/* Flow Animation */
.flow-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, rgba(0, 184, 148, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.flow-entity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    position: relative;
}

.flow-step-label {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.entity-avatar {
    width: 72px;
    height: 72px;
    background: var(--bg);
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.flow-entity:hover .entity-avatar {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.25);
}

.flow-entity span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.flow-arrow {
    display: flex;
    align-items: center;
    width: 120px;
    height: 60px;
    position: relative;
}

.arrow-line {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    position: relative;
}

.arrow-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    border: 8px solid transparent;
    border-left: 12px solid var(--accent);
}

.flow-arrow.reverse .arrow-line {
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.flow-arrow.reverse .arrow-line::after {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 12px solid var(--primary);
}

.flow-packet {
    position: absolute;
    font-size: 1.5rem;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    animation: flowRight 2s infinite ease-in-out;
}

.flow-arrow.reverse .flow-packet {
    animation: flowLeft 2s infinite ease-in-out;
}

@keyframes flowRight {
    0% {
        left: 0;
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    100% {
        left: calc(100% - 24px);
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
}

@keyframes flowLeft {
    0% {
        left: calc(100% - 24px);
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    100% {
        left: 0;
        opacity: 0;
        transform: translateY(-50%) scale(0.5);
    }
}

/* Stagger animations so the flow reads as a clear sequence */
/* nth-of-type counts ALL divs, so: entities at 1,3,5,7 and arrows at 2,4,6,8 */
.borrower-flow>div:nth-child(2) .flow-packet {
    animation-delay: 0s;
}

/* invoice arrow */
.borrower-flow>div:nth-child(4) .flow-packet {
    animation-delay: 2.2s;
}

/* money arrow */

.lender-flow>div:nth-child(2) .flow-packet {
    animation-delay: 0s;
}

/* capital in */
.lender-flow>div:nth-child(4) .flow-packet {
    animation-delay: 2.2s;
}

/* token out */
.lender-flow>div:nth-child(6) .flow-packet {
    animation-delay: 4.4s;
}

/* yield back */

/* Yield arrow (the reverse arrow returning to investor) - make it visually distinct */
.lender-flow .yield-arrow {
    position: relative;
}

.lender-flow .yield-arrow .arrow-line {
    background: linear-gradient(90deg, #4caf50, #81c784);
}

.lender-flow .yield-arrow .arrow-line::after {
    border-right-color: #4caf50;
}

/* ========================================
   STEP-THROUGH FLOW (NEXT button style)
   ======================================== */

.step-flow {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05) 0%, rgba(0, 184, 148, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 32px 24px;
    position: relative;
}

/* Controls at top right of panel */
.step-flow-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.step-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--primary);
}

.step-btn-next {
    background: var(--primary);
    color: white;
}

.step-btn-next:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.step-btn-reset {
    background: transparent;
    color: var(--primary);
    padding: 6px 10px;
}

.step-btn-reset:hover:not(:disabled) {
    background: rgba(0, 102, 204, 0.1);
}

.step-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.step-flow-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-bottom: 16px;
    padding-top: 20px;
}

/* Flow nodes (entities) */
.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
    transition: opacity 0.4s ease;
    position: relative;
}

/* Inactive nodes fade out */
.step-flow[data-step]:not([data-step="0"]) .flow-node:not(.active):not(.completed) {
    opacity: 0.35;
}

.node-circle {
    width: 72px;
    height: 72px;
    background: rgba(30, 41, 59, 0.9);
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Active node styling - animation handled by GSAP */
.flow-node.active .node-circle {
    border-color: var(--primary);
}

.flow-node.completed .node-circle {
    border-color: var(--accent);
    background: rgba(0, 184, 148, 0.15);
}

.flow-node span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    transition: opacity 0.4s ease;
}

.flow-node.active span {
    font-weight: 700;
    color: var(--primary);
}

/* Connectors between nodes */
.flow-connector {
    width: 100px;
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
}

.connector-track {
    height: 4px;
    width: 100%;
    background: var(--border);
    border-radius: 2px;
    position: relative;
    transition: background 0.4s ease;
}

.connector-track::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left: 10px solid var(--border);
    transition: border-color 0.4s ease;
}

.flow-connector.reverse .connector-track::after {
    right: auto;
    left: -6px;
    border-left: none;
    border-right: 10px solid var(--border);
}

/* Active connector - shows the packet moving */
.flow-connector.animating .connector-track {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.flow-connector.animating .connector-track::after {
    border-left-color: var(--accent);
}

.flow-connector.reverse.animating .connector-track::after {
    border-right-color: var(--primary);
}

.flow-connector.completed .connector-track {
    background: var(--accent);
}

.flow-connector.completed .connector-track::after {
    border-left-color: var(--accent);
}

.flow-connector.reverse.completed .connector-track::after {
    border-right-color: var(--accent);
}

/* Packet (emoji) that moves along connector */
.connector-packet {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    z-index: 10;
}

/* Animations handled by GSAP */
.flow-connector.animating .connector-packet,
.flow-connector.completed .connector-packet {
    opacity: 1;
}

/* Caption area - grows below animation */
.step-flow-caption {
    display: block;
    padding: 16px 20px;
    margin-top: 8px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    transition: background 0.3s ease;
}

.step-flow[data-step="0"] .step-flow-caption {
    background: rgba(51, 65, 85, 0.3);
    border-left-color: var(--border);
}

/* Step list container */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual step item */
.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0.5;
}

.step-item.current {
    opacity: 1;
}

.step-number-badge {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-flow[data-step="0"] .step-number-badge {
    background: var(--border);
}

.step-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    line-height: 1.6;
}

.step-flow[data-step="0"] .step-text {
    font-weight: 400;
    color: var(--text-light);
    font-style: italic;
}

/* Step history - show previous steps as faded list below current step */
.step-history {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.step-history:empty {
    display: none;
}

.step-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.6;
    margin-bottom: 4px;
}

.step-history-item .mini-badge {
    width: 18px;
    height: 18px;
    min-width: 18px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Control buttons - already positioned at top right via earlier rules */
.step-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ========================================
   LENDER LAYOUT (linear with return arrow below)
   ======================================== */

.lender-layout {
    flex-direction: column;
    gap: 16px;
}

/* Lender Layout (SVG Refactor) */
.lender-main-row {
    display: block;
    position: relative;
    height: 240px;
    width: 600px;
    margin: 0 auto;
}

.lender-main-row .flow-node {
    position: absolute;
    width: 100px;
    /* Assuming 100px width for centering */
    top: 70px;
    /* Center Y=120, minus 50 offset */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 5;
}

/* Specific Positions (Center xCoords: 80, 300, 520) */
/* Modified X to match index.html trim: Investor 130->80 center? No. 
   SVG line starts at 130. Arrow is 10px. 
   Let's check index.html: 
   Inv Node used to be far left.
   In index.html: line x1=130. Node radius=50. Center=130-50=80? No clearance.
   Let's align nodes to centers of: 80, 300, 520.
   radius=50.
   Clearance for 80 -> line start 130? 80+50=130. PERFECT.
   Clearance for 300 -> line end 250? 300-50=250. PERFECT.
*/

.lender-main-row .node-investor {
    left: 30px;
    /* 80 - 50 */
}

.lender-main-row .node-vault {
    left: 250px;
    /* 300 - 50 */
}

.lender-main-row .node-borrower {
    left: 470px;
    /* 520 - 50 */
}

/* Cleanup obsolete connector styles */
.exchange-connector,
.token-burn-row,
.lender-return-lanes {
    display: none !important;
}



/* Journey mobile responsive */
@media (max-width: 900px) {
    .journey-layout {
        flex-direction: column;
    }

    .journey-copy {
        max-width: 100%;
    }

    .journey-timeline {
        flex-direction: column;
        align-items: center;
    }

    .journey-connector {
        transform: rotate(90deg);
        padding-top: 0;
        height: 40px;
        width: auto;
    }

    .flow-animation {
        flex-direction: column;
        gap: 16px;
    }

    .flow-arrow {
        transform: rotate(90deg);
        width: 80px;
        height: 40px;
    }

    .flow-arrow.reverse {
        transform: rotate(-90deg);
    }
}

@media (max-width: 600px) {
    .journey-toggle {
        flex-direction: column;
        align-items: center;
    }

    .journey-tab {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}


/* Journey Step Interaction */
.journey-step {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.journey-step:hover {
    transform: translateY(-4px);
}

.journey-step.highlighted .step-icon {
    background: var(--primary);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 102, 204, 0.4);
}

.journey-step .step-icon {
    transition: all 0.3s ease;
}

/* ========================================
   BORROWER TRIANGLE LAYOUT
   ======================================== */

.borrower-triangle-layout {
    position: relative;
    height: 320px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 16px;
    display: block;
    /* Override flex from previous layout */
}

/* Triangle Nodes */
.borrower-triangle-layout .flow-node {
    position: absolute;
    width: 100px;
    /* specific width for alignment */
}

/* Top Center */
.borrower-triangle-layout .node-platform {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* Position label above the icon for the Platform node */
.borrower-triangle-layout .node-platform span {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 12px;
    width: max-content;
}

/* Bottom Left */
.borrower-triangle-layout .node-business {
    bottom: 20px;
    left: 20px;
}

/* Bottom Right */
.borrower-triangle-layout .node-vault {
    bottom: 20px;
    right: 20px;
}

/* SVG Layer */
.flow-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Behind nodes (nodes are z-index 5) */
    pointer-events: none;
}

.connector-track {
    stroke: #64748b;
    /* var(--text-muted) */
    stroke-width: 2;
    stroke-dasharray: 4 2;
    transition: margin 0.3s;
}

/* Packets are styled inline or via JS, but helpful to center text */
.connector-packet-group text {
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Ensure node circles stay on top of lines */
.borrower-triangle-layout .node-circle {
    z-index: 5;
    background: var(--bg);
    /* Ensure lines don't show through */
}

/* Responsive Triangle */
@media (max-width: 500px) {
    .borrower-triangle-layout {
        height: 280px;
        transform: scale(0.9);
    }

    .borrower-triangle-layout .node-business {
        left: 0;
    }

    .borrower-triangle-layout .node-vault {
        right: 0;
    }

    .borrower-triangle-layout .conn-invoice {
        left: 15%;
        width: 140px;
    }

    .borrower-triangle-layout .conn-token {
        left: 55%;
        width: 140px;
    }

    .borrower-triangle-layout .conn-cash {
        width: 50%;
        right: 25%;
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Platform entity special styling */
.flow-entity.platform .entity-avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    color: white;
}

.flow-entity.vault .entity-avatar {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    border: none;
}

.flow-entity.invoices .entity-avatar {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    border: none;
}

/* Improve packet visibility */
.flow-packet {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.money-packet {
    animation-duration: 1.8s !important;
}

.invoice-packet {
    animation-duration: 2.2s !important;
}

.yield-packet {
    animation-duration: 2.5s !important;
}

/* ========================================
   WHY XRPL COMPARISON TABLE
   ======================================== */

.comparison-table-wrapper {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-table thead tr {
    background: rgba(99, 102, 241, 0.1);
}

.comparison-table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comparison-table th.xrpl-col {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

.comparison-table td.feature-col {
    color: var(--text-light);
    font-weight: 500;
}

.comparison-table td.eth-col {
    color: rgba(255, 255, 255, 0.6);
}

.comparison-table td.xrpl-col {
    background: rgba(99, 102, 241, 0.08);
}

.comparison-table td.xrpl-col.highlight {
    color: var(--primary-light);
}

.comparison-table td.xrpl-col.highlight strong {
    color: var(--accent);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

@media (max-width: 768px) {

    .comparison-table th,
    .comparison-table td {
        padding: 12px;
        font-size: 0.85rem;
    }
}