/* ===== CSS Variables ===== */
:root {
    --color-bg: #252538;
    --color-bg-dark: #1a1a2e;
    --color-surface: #2d2d44;
    --color-mint: #00D9A5;
    --color-lavender: #B794F4;
    --color-text: #ffffff;
    --color-text-muted: rgba(255, 255, 255, 0.7);
    --color-text-subtle: rgba(255, 255, 255, 0.5);

    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --max-width: 1200px;
    --border-radius: 16px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Utilities ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-mint), var(--color-lavender));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 48px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-mint), #00b894);
    color: var(--color-bg-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 217, 165, 0.3);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background: rgba(37, 37, 56, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon,
.logo svg.logo-icon {
    flex-shrink: 0;
    color: var(--color-mint);
}

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

.nav-links a {
    color: var(--color-text-muted);
    font-weight: 500;
}

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

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    max-width: 480px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, rgba(0, 217, 165, 0.15), transparent 50%),
        radial-gradient(circle at 30% 70%, rgba(183, 148, 244, 0.1), transparent 50%);
    z-index: -1;
}

/* Phone Mockup */
.hero-image {
    display: flex;
    justify-content: center;
}

.hero-phone-floating {
    max-width: 380px;
    filter: drop-shadow(0 50px 100px rgba(0, 0, 0, 0.5));
    animation: float 6s ease-in-out infinite;
    border-radius: 32px;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    border-radius: 32px;
    overflow: hidden;
}

.app-screen-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* or contain depending on image/device ratio, cover usually looks best for full screen */
}

.app-preview {
    padding: 24px 16px;
}

.app-header {
    margin-bottom: 24px;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.car-icon {
    font-size: 2rem;
}

.car-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-info strong {
    font-size: 0.95rem;
}

.car-info span {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.car-status {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.car-status.ok {
    background: rgba(0, 217, 165, 0.2);
    color: var(--color-mint);
}

.car-status.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* ===== Features Section ===== */
.features {
    padding: 120px 0;
    background: var(--color-bg-dark);
}

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

.feature-card {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 217, 165, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

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

.feature-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ===== Transfer Section ===== */
.transfer {
    padding: 120px 0;
    background: linear-gradient(135deg, var(--color-bg), var(--color-bg-dark));
    position: relative;
    overflow: hidden;
}

.transfer-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 64px;
}

.transfer-visual {
    position: relative;
    max-width: 1000px;
    /* Increased to fit side-by-side */
    margin: 0 auto;
    background: rgba(45, 45, 68, 0.5);
    border-radius: 24px;
    padding: 48px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.transfer-timeline-container {
    width: 100%;
}

.transfer-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 40px 0;
    width: 100%;
}

.transfer-mockup-container {
    display: flex;
    justify-content: center;
}

.transfer-mockup {
    max-width: 100%;
    max-height: 400px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Timeline Track */
.timeline-track {
    position: absolute;
    top: 50%;
    left: 80px;
    right: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%);
    border-radius: 4px;
    overflow: hidden;
}

.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--color-mint), transparent);
    animation: flow 2s linear infinite;
}

@keyframes flow {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* User Nodes */
.timeline-node {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 120px;
}

.node-icon {
    width: 80px;
    height: 80px;
    background: var(--color-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.node-icon svg {
    color: var(--color-text-muted);
}

.node-label {
    font-weight: 600;
    color: var(--color-text);
}

.node-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Active State for Seller (A) */
.timeline-node.seller .node-icon {
    border-color: var(--color-mint);
    box-shadow: 0 0 20px rgba(0, 217, 165, 0.2);
}

.timeline-node.seller svg {
    color: var(--color-mint);
}

/* Active State for Buyer (B) */
.timeline-node.buyer .node-icon {
    border-color: var(--color-lavender);
    box-shadow: 0 0 20px rgba(183, 148, 244, 0.2);
}

.timeline-node.buyer svg {
    color: var(--color-lavender);
}

/* Floating Packet Animation */
.data-packet {
    position: absolute;
    top: 50%;
    left: 80px;
    /* Start align with seller */
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--color-bg-dark);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-mint);
    box-shadow: 0 0 30px rgba(0, 217, 165, 0.4);
    z-index: 3;
    animation: transferMove 4s ease-in-out infinite;
}

.data-packet svg {
    color: var(--color-mint);
}

@keyframes transferMove {
    0% {
        left: 100px;
        opacity: 1;
        transform: translate(0, -50%) scale(1);
    }

    45% {
        transform: translate(0, -50%) scale(1.1);
    }

    90% {
        left: calc(100% - 100px);
        opacity: 1;
        transform: translate(-100%, -50%) scale(1);
    }

    100% {
        left: calc(100% - 100px);
        opacity: 0;
    }
}

/* Success Checkmark appearing at Buyer */
.check-success {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: var(--color-mint);
    border-radius: 50%;
    color: var(--color-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: checkPop 4s ease-in-out infinite;
}

@keyframes checkPop {

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

    90% {
        opacity: 1;
        transform: scale(1.2);
    }

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

@media (max-width: 768px) {
    .timeline-node {
        width: auto;
    }

    .node-label,
    .node-sub {
        font-size: 0.8rem;
    }

    .data-packet {
        width: 48px;
        height: 48px;
    }

    .node-icon {
        width: 60px;
        height: 60px;
    }

    .timeline-track {
        left: 60px;
        right: 60px;
    }

    @keyframes transferMove {
        0% {
            left: 70px;
        }

        90% {
            left: calc(100% - 70px);
        }

        100% {
            left: calc(100% - 70px);
            opacity: 0;
        }
    }
}

/* ===== Download Section ===== */
.download {
    padding: 120px 0;
    text-align: center;
}

.store-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.store-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-mint);
}

.store-btn svg {
    flex-shrink: 0;
}

.store-btn div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.store-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

.store-name {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===== Contact Section ===== */
.contact {
    padding: 120px 0;
    background: var(--color-bg-dark);
    text-align: center;
}

/* ===== Footer ===== */
.footer {
    padding: 64px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-brand p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links h4 {
    font-size: 0.9rem;
    margin-bottom: 16px;
    color: var(--color-text-muted);
}

.footer-links a {
    display: block;
    color: var(--color-text);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text-subtle);
    font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .phone-mockup {
        width: 220px;
        height: 460px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
    }

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

    .store-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}