/* =========================================================
   FuelWise — Home page
========================================================= */

.home {
    --sky: #38bdf8;
    --sky-soft: #7dd3fc;
    --indigo: #818cf8;
    --violet: #a855f7;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, .14);
    --card: rgba(22, 32, 54, .62);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

.home section {
    position: relative;
}

/* ---------- Hero ---------- */
.home-hero {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    padding: 70px 0 110px;
    overflow: hidden;
}

.hero-roads {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    -webkit-mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 85%);
    mask-image: radial-gradient(ellipse at 60% 50%, #000 30%, transparent 85%);
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .5;
    pointer-events: none;
    animation: fw-float 11s ease-in-out infinite;
}

.hero-blob.b1 {
    width: 460px;
    height: 460px;
    top: -140px;
    right: 4%;
    background: #2563eb;
}

.hero-blob.b2 {
    width: 380px;
    height: 380px;
    bottom: -160px;
    right: 26%;
    background: #7c3aed;
    opacity: .34;
    animation-delay: -5s;
}

.hero-blob.b3 {
    width: 300px;
    height: 300px;
    top: 30%;
    left: -140px;
    background: #0ea5e9;
    opacity: .2;
    animation-delay: -8s;
}

@keyframes fw-float {
    50% { transform: translate(34px, -30px) scale(1.1); }
}

.home-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 480px);
    align-items: center;
    gap: clamp(48px, 7vw, 110px);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
    padding: 8px 16px 8px 12px;
    border: 1px solid rgba(56, 189, 248, .18);
    border-radius: 999px;
    background: rgba(30, 41, 59, .7);
    color: var(--sky);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    animation: fw-rise .8s var(--ease) both;
}

.hero-tag svg {
    width: 17px;
    height: 17px;
}

.home-hero h1 {
    margin-bottom: 26px;
    font-size: clamp(44px, 5.6vw, 78px);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -.035em;
}

.home-hero h1 .line {
    display: block;
    overflow: hidden;
    padding-bottom: .12em;
}

.home-hero h1 .line-inner {
    display: inline-block;
    transform: translateY(115%);
    animation: fw-line-up 1s var(--ease) .15s forwards;
}

.home-hero h1 .line:nth-child(2) .line-inner {
    animation-delay: .3s;
    background: linear-gradient(90deg, #38bdf8, #818cf8 45%, #38bdf8 90%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation:
        fw-line-up 1s var(--ease) .3s forwards,
        fw-sheen 7s linear 1.3s infinite;
}

@keyframes fw-line-up {
    to { transform: none; }
}

@keyframes fw-sheen {
    to { background-position: -220% 0; }
}

@keyframes fw-rise {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: none; }
}

.hero-lead {
    max-width: 560px;
    color: var(--muted);
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.75;
    animation: fw-rise .9s var(--ease) .55s both;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 38px;
    animation: fw-rise .9s var(--ease) .7s both;
}

.hero-actions .primary-btn {
    padding: 16px 30px;
    box-shadow: 0 14px 34px rgba(37, 99, 235, .35);
}

.hero-actions .secondary-btn {
    padding: 16px 30px;
}

.hero-actions svg {
    width: 18px;
    height: 18px;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 34px;
    color: #cbd5e1;
    font-size: 14px;
    animation: fw-rise .9s var(--ease) .85s both;
}

.hero-chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hero-chips svg {
    width: 16px;
    height: 16px;
    color: #34d399;
}

/* ---------- Live trip card ---------- */
.trip-live-wrap {
    perspective: 1200px;
    animation: fw-rise 1.1s var(--ease) .45s both;
}

.trip-live-bob {
    animation: fw-bob 6.5s ease-in-out infinite;
}

@keyframes fw-bob {
    50% { transform: translateY(-12px); }
}

.trip-live {
    position: relative;
    border: 1px solid rgba(56, 189, 248, .26);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(22, 32, 54, .86), rgba(11, 18, 36, .92));
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    box-shadow:
        0 34px 80px rgba(0, 0, 0, .5),
        0 0 80px rgba(37, 99, 235, .22),
        inset 0 1px 0 rgba(255, 255, 255, .06);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform .25s ease-out;
    overflow: hidden;
}

.trip-live-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(56, 189, 248, .12);
    color: var(--muted);
    font-size: 13px;
}

.trip-live-bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(56, 189, 248, .45);
}

.trip-live-bar span {
    margin-left: 8px;
}

.trip-live-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto !important;
    color: #6ee7b7;
    font-weight: 600;
}

.trip-live-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
    animation: fw-ping 1.8s ease-out infinite;
}

@keyframes fw-ping {
    to { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
}

.trip-map {
    display: block;
    width: 100%;
    height: auto;
    background:
        radial-gradient(circle at 70% 20%, rgba(56, 189, 248, .1), transparent 55%),
        rgba(8, 13, 28, .55);
    transition: opacity .45s ease;
}

.trip-map .grid line {
    stroke: rgba(148, 163, 184, .08);
    stroke-width: 1;
}

.trip-map .ghost {
    fill: none;
    stroke: rgba(148, 163, 184, .1);
    stroke-width: 6;
    stroke-linecap: round;
}

.trip-map .route-base {
    fill: none;
    stroke: rgba(56, 189, 248, .14);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 2 11;
}

.trip-map .route {
    fill: none;
    stroke: url(#fw-route-gradient);
    stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, .65));
}

.trip-map .pin {
    fill: #0b1224;
    stroke: var(--sky);
    stroke-width: 3;
}

.trip-map .pin.end {
    stroke: #a78bfa;
}

.trip-map .pin-pulse {
    fill: none;
    stroke: var(--sky);
    stroke-width: 2;
    transform-box: fill-box;
    transform-origin: center;
    animation: fw-pin 2.2s ease-out infinite;
}

.trip-map .pin-pulse.end {
    stroke: #a78bfa;
    animation-delay: 1.1s;
}

@keyframes fw-pin {
    from { transform: scale(.6); opacity: .9; }
    to { transform: scale(2.4); opacity: 0; }
}

.trip-map .car {
    fill: #fff;
    filter: drop-shadow(0 0 8px #38bdf8) drop-shadow(0 0 16px #38bdf8);
}

.trip-live-body {
    padding: 20px 22px 24px;
    transition: opacity .45s ease;
}

.trip-live.is-switching .trip-map,
.trip-live.is-switching .trip-live-body {
    opacity: .15;
}

.trip-cities {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
}

.trip-cities small {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.trip-cities strong {
    font-size: 22px;
    letter-spacing: -.02em;
}

.trip-cities > div:last-child {
    text-align: right;
}

.trip-cities svg {
    width: 22px;
    height: 22px;
    color: var(--sky);
}

.trip-progress {
    height: 4px;
    margin: 18px 0 20px;
    border-radius: 4px;
    background: rgba(148, 163, 184, .14);
    overflow: hidden;
}

.trip-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transform: scaleX(var(--p, 0));
    transform-origin: left;
}

.trip-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.trip-stat {
    padding: 14px 14px 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, .6);
}

.trip-stat span {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12.5px;
}

.trip-stat svg {
    width: 15px;
    height: 15px;
    color: var(--sky);
}

.trip-stat strong {
    font-size: clamp(17px, 1.6vw, 21px);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.trip-stat.is-cost {
    border-color: rgba(56, 189, 248, .3);
    background: linear-gradient(160deg, rgba(37, 99, 235, .24), rgba(15, 23, 42, .6));
}

.trip-stat.is-cost strong {
    color: var(--sky-soft);
}

/* ---------- Marquee ---------- */
.home-marquee {
    padding: 18px 0;
    border-block: 1px solid var(--line);
    background: linear-gradient(90deg, rgba(37, 99, 235, .16), rgba(124, 58, 237, .14), rgba(37, 99, 235, .16));
    overflow: hidden;
    white-space: nowrap;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
    display: inline-flex;
    animation: fw-marquee 36s linear infinite;
}

.home-marquee:hover .marquee-track {
    animation-play-state: paused;
}

.marquee-group {
    display: inline-flex;
    align-items: center;
}

.marquee-group span {
    display: inline-flex;
    align-items: center;
    color: #dbeafe;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.marquee-group span::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: 0 30px;
    border-radius: 2px;
    background: var(--sky);
    opacity: .7;
    transform: rotate(45deg);
}

@keyframes fw-marquee {
    to { transform: translateX(-50%); }
}

/* ---------- Shared section spacing ---------- */
.home .features-section,
.home-steps,
.home-prices {
    padding: 120px 0;
}

.home .section-heading h2 span {
    display: block;
}

/* ---------- Feature cards ---------- */
.home .features-grid {
    margin-top: 0;
}

.home .feature-card {
    background:
        radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), rgba(56, 189, 248, .14), transparent 45%),
        rgba(30, 41, 59, .6);
    transition:
        transform .35s var(--ease),
        border-color .35s ease,
        box-shadow .35s ease;
}

.home .feature-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--ease);
}

.home .feature-card:hover::after {
    transform: scaleX(1);
}

.home .feature-icon {
    background: linear-gradient(145deg, #1e3a8a, #172554);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: transform .4s var(--ease), box-shadow .4s ease;
}

.home .feature-card:hover .feature-icon {
    transform: rotate(-8deg) scale(1.1);
    box-shadow: 0 10px 26px rgba(56, 189, 248, .28), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.feature-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 22px;
    color: var(--sky);
    font-size: 14px;
    font-weight: 600;
}

.feature-link svg {
    width: 16px;
    height: 16px;
    transition: transform .3s ease;
}

.feature-card:hover .feature-link svg {
    transform: translateX(5px);
}

/* Whole card is clickable through the link */
.feature-link::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ---------- How it works ---------- */
.home-steps {
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, .55) 18%, rgba(15, 23, 42, .55) 82%, transparent);
}

.steps-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    counter-reset: step;
}

.steps-line {
    position: absolute;
    top: 33px;
    left: 16.66%;
    right: 16.66%;
    height: 2px;
    background: rgba(148, 163, 184, .16);
    overflow: hidden;
}

.steps-line i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #a855f7);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.8s var(--ease) .3s;
}

.steps-grid.is-in .steps-line i {
    transform: scaleX(1);
}

.step-card {
    position: relative;
    text-align: center;
    padding: 0 12px;
}

.step-number {
    position: relative;
    z-index: 1;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 28px;
    border: 1px solid rgba(56, 189, 248, .35);
    border-radius: 50%;
    background: #0f172a;
    color: var(--sky);
    box-shadow: 0 0 0 8px rgba(15, 23, 42, .9), 0 0 34px rgba(56, 189, 248, .22);
    transition: transform .4s var(--ease), box-shadow .4s ease;
}

.step-number svg {
    width: 26px;
    height: 26px;
}

.step-card:hover .step-number {
    transform: translateY(-6px) scale(1.06);
    box-shadow: 0 0 0 8px rgba(15, 23, 42, .9), 0 0 46px rgba(56, 189, 248, .45);
}

.step-card small {
    display: block;
    margin-bottom: 10px;
    color: var(--indigo);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .16em;
}

.step-card h3 {
    margin-bottom: 12px;
    font-size: 23px;
    letter-spacing: -.02em;
}

.step-card p {
    max-width: 330px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.75;
}

/* ---------- Stats ---------- */
.home-stats {
    padding: 30px 0 110px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.stat-item {
    padding: 8px 0 8px 24px;
    border-left: 2px solid rgba(56, 189, 248, .4);
}

.stat-item strong {
    display: block;
    font-size: clamp(44px, 5vw, 68px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(120deg, #7dd3fc, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-item span {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    font-size: 15px;
}

/* ---------- Live prices ---------- */
.home-prices {
    padding-top: 0;
}

.home-prices[hidden] {
    display: none;
}

.prices-panel {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr);
    align-items: center;
    gap: clamp(30px, 5vw, 70px);
    padding: clamp(28px, 4vw, 52px);
    border: 1px solid var(--line);
    border-radius: 30px;
    background:
        radial-gradient(600px circle at 0% 0%, rgba(37, 99, 235, .2), transparent 60%),
        rgba(15, 23, 42, .6);
}

.prices-panel .section-heading {
    max-width: none;
    margin: 0;
    text-align: left;
}

.prices-panel .section-heading h2 {
    font-size: clamp(32px, 3.4vw, 46px);
}

.prices-panel .feature-link {
    position: static;
}

.prices-panel .feature-link::before {
    content: none;
}

.prices-panel .feature-link:hover svg {
    transform: translateX(5px);
}

.prices-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.price-tile {
    padding: 24px 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(30, 41, 59, .55);
    transition: transform .35s var(--ease), border-color .35s ease;
}

.price-tile:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, .35);
}

.price-tile > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-weight: 600;
}

.price-tile svg {
    width: 18px;
    height: 18px;
    color: var(--sky);
}

.price-tile strong {
    display: block;
    margin: 16px 0 6px;
    font-size: clamp(26px, 2.6vw, 36px);
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.price-tile small {
    color: var(--muted);
    font-size: 13px;
}

/* ---------- CTA ---------- */
.home-cta {
    padding: 0 0 130px;
}

.cta-panel {
    position: relative;
    padding: clamp(48px, 7vw, 92px) clamp(24px, 6vw, 80px) clamp(76px, 9vw, 120px);
    border: 1px solid rgba(56, 189, 248, .22);
    border-radius: 34px;
    background:
        radial-gradient(700px circle at 85% -10%, rgba(124, 58, 237, .38), transparent 60%),
        radial-gradient(700px circle at 10% 110%, rgba(37, 99, 235, .45), transparent 60%),
        #0b1224;
    text-align: center;
    overflow: hidden;
}

.cta-panel h2 {
    max-width: 760px;
    margin: 0 auto 18px;
    font-size: clamp(34px, 4.4vw, 58px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.cta-panel p {
    max-width: 560px;
    margin: 0 auto 36px;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.cta-actions svg {
    width: 18px;
    height: 18px;
}

.cta-road {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 34px;
    width: 100%;
    height: 14px;
    pointer-events: none;
}

.cta-road line {
    stroke: rgba(226, 232, 240, .34);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 34 30;
    animation: fw-road 1.3s linear infinite;
}

@keyframes fw-road {
    to { stroke-dashoffset: -64; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .home-hero-grid {
        grid-template-columns: 1fr;
    }

    .trip-live-wrap {
        width: min(100%, 540px);
    }

    .prices-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .steps-line {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 34px 22px;
    }
}

@media (max-width: 650px) {
    .home-hero {
        min-height: auto;
        padding: 40px 0 80px;
    }

    .home .features-section,
    .home-steps {
        padding: 84px 0;
    }

    .home-prices {
        padding-bottom: 84px;
    }

    .home-stats {
        padding-bottom: 84px;
    }

    .hero-actions > * {
        flex: 1 1 100%;
    }

    .trip-cities strong {
        font-size: 19px;
    }

    .trip-stats {
        gap: 8px;
    }

    .trip-stat {
        padding: 12px 10px;
    }

    .trip-stat strong {
        font-size: 15px;
    }

    .prices-cards {
        grid-template-columns: 1fr;
    }

    .home-cta {
        padding-bottom: 90px;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .home *,
    .home *::before,
    .home *::after {
        animation: none !important;
        transition: none !important;
    }

    .home-hero h1 .line-inner {
        transform: none;
    }
}
