/* ============================================
   SupplyScout Homepage — Dark Scroll Showcase
   ============================================ */

/* ---- Design Tokens ---- */
:root {
    --home-bg: #0a0a0f;
    --home-text: #f0f0f5;
    --home-text-secondary: #9a9ab0;
    --home-accent: #7c6cf0;
    --home-gradient: linear-gradient(135deg, #667eea 0%, #7c6cf0 50%, #a855f7 100%);
    --home-card-bg: #1a1a24;
    --home-card-border: rgba(255, 255, 255, 0.08);
    --home-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --home-max-width: 1200px;
}

/* ---- Body Override ---- */
body.page-home {
    background: var(--home-bg);
    color: var(--home-text);
    font-family: var(--home-font);
    overflow-x: hidden;
}

/* ---- Header Override ---- */
body.page-home .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}

body.page-home .site-header.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.page-home .site-header__nav a {
    color: rgba(240, 240, 245, 0.8);
}

body.page-home .site-header__nav a:hover,
body.page-home .site-header__nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

body.page-home .nav-toggle span {
    background: #f0f0f5;
}

/* ---- Animated Elements ---- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Hero Section ---- */
.home-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem 4rem;
    overflow: hidden;
}

/* Animated gradient orbs */
.home-hero__orbs {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.home-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orb-drift 20s ease-in-out infinite alternate;
}

.home-hero__orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #7c6cf0, transparent 70%);
    top: -10%;
    left: -10%;
    animation-duration: 25s;
}

.home-hero__orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #a855f7, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-duration: 20s;
    animation-delay: -5s;
}

.home-hero__orb--3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #667eea, transparent 70%);
    top: 40%;
    left: 50%;
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes orb-drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
    100% { transform: translate(10px, -10px) scale(1.02); }
}

.home-hero__content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.home-hero__eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--home-accent);
    margin-bottom: 1.5rem;
}

.home-hero__title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--home-text);
}

.home-hero__title-accent {
    background: var(--home-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-hero__subtitle {
    font-size: 1.2rem;
    color: var(--home-text-secondary);
    max-width: 540px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.home-hero__badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.home-hero__badges .store-badge img {
    height: 48px;
}

/* Scroll hint */
.home-hero__scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--home-text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: scroll-bounce 2s ease-in-out infinite;
}

.home-hero__scroll-hint svg {
    width: 20px;
    height: 20px;
    stroke: var(--home-text-secondary);
}

@keyframes scroll-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ---- Phone Reveal Section ---- */
.phone-reveal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.phone-reveal__device {
    transform: scale(0.6);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.phone-reveal__device.is-visible {
    transform: scale(1);
    opacity: 1;
}

.phone-reveal__caption {
    margin-top: 2rem;
    font-size: 1.1rem;
    color: var(--home-text-secondary);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.phone-reveal__device.is-visible ~ .phone-reveal__caption {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Phone Mockup (real frame PNG) ---- */
.phone-mockup {
    width: 280px;
    position: relative;
    /* Aspect ratio matches phone-frame.png: 1500 x 2942 */
    aspect-ratio: 1500 / 2942;
}

.phone-mockup__frame {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.phone-mockup__frame img {
    display: block;
    width: 100%;
    height: 100%;
}

.phone-mockup__screen {
    position: absolute;
    /* Inset to align with the transparent screen area of the frame */
    top: 2.2%;
    left: 5.5%;
    right: 5.5%;
    bottom: 2.2%;
    border-radius: 28px;
    overflow: hidden;
    z-index: 1;
    background: #16161e;
}

/* Screen images and placeholders */
.phone-screen-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    transition: opacity 0.6s ease;
}

.phone-screen-placeholder img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.phone-screen-placeholder--map,
.phone-screen-placeholder--community,
.phone-screen-placeholder--alerts,
.phone-screen-placeholder--smartscan,
.phone-screen-placeholder--default {
    background: #16161e;
}

/* ---- Sticky Phone Showcase ---- */
.showcase {
    position: relative;
    max-width: var(--home-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.showcase__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.showcase__phone-col {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase__phone-wrapper {
    position: relative;
}

.showcase__phone-wrapper .phone-screen-placeholder {
    opacity: 0;
}

.showcase__phone-wrapper .phone-screen-placeholder.active {
    opacity: 1;
}

.showcase__text-col {
    padding: 10vh 0;
}

.showcase__panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 0;
}

.showcase__panel-number {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--home-accent);
    margin-bottom: 1rem;
}

.showcase__panel-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.showcase__panel-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--home-text-secondary);
    max-width: 480px;
}

/* ---- Stats Bar ---- */
.stats-bar {
    padding: 6rem 2rem;
    text-align: center;
}

.stats-bar__inner {
    max-width: var(--home-max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    gap: 4rem;
    flex-wrap: wrap;
}

.stats-bar__item {
    flex: 1;
    min-width: 200px;
}

.stats-bar__number {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    background: var(--home-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stats-bar__label {
    font-size: 0.95rem;
    color: var(--home-text-secondary);
}

/* Staggered animation */
.stats-bar__item:nth-child(1) { transition-delay: 0s; }
.stats-bar__item:nth-child(2) { transition-delay: 0.15s; }
.stats-bar__item:nth-child(3) { transition-delay: 0.3s; }

/* ---- Why SupplyScout ---- */
.why-section {
    padding: 6rem 2rem;
}

.why-section__inner {
    max-width: var(--home-max-width);
    margin: 0 auto;
}

.why-section__title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
}

.why-section__subtitle {
    text-align: center;
    color: var(--home-text-secondary);
    margin-bottom: 3rem;
}

.why-section__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.why-card {
    background: var(--home-card-bg);
    border: 1px solid var(--home-card-border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: box-shadow 0.4s, border-color 0.4s;
}

.why-card:hover {
    border-color: rgba(124, 108, 240, 0.3);
    box-shadow: 0 8px 40px rgba(124, 108, 240, 0.12);
}

.why-card__icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
}

.why-card__title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--home-text);
}

.why-card__text {
    font-size: 0.95rem;
    color: var(--home-text-secondary);
    line-height: 1.7;
}

/* ---- Download CTA ---- */
.download-cta {
    position: relative;
    padding: 6rem 2rem;
    text-align: center;
    overflow: hidden;
}

.download-cta__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(124, 108, 240, 0.15) 0%, transparent 70%);
    z-index: 0;
}

.download-cta__content {
    position: relative;
    z-index: 1;
}

.download-cta__title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.download-cta__text {
    font-size: 1.1rem;
    color: var(--home-text-secondary);
    margin-bottom: 2.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.download-cta__badges {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.download-cta__badges .store-badge img {
    height: 48px;
}

/* ---- Footer Override ---- */
body.page-home .site-footer {
    background: #08080d;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ---- Mobile Showcase Phone (inline, no sticky) ---- */
.showcase__inline-phone {
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .home-hero {
        min-height: 90vh;
        padding: 5rem 1.5rem 3rem;
    }

    .home-hero__orb--1 { width: 300px; height: 300px; }
    .home-hero__orb--2 { width: 250px; height: 250px; }
    .home-hero__orb--3 { width: 200px; height: 200px; }

    .home-hero__badges .store-badge img {
        height: 40px;
    }

    .phone-reveal {
        min-height: auto;
        padding: 4rem 1.5rem;
    }

    .phone-mockup {
        width: 220px;
    }

    .phone-mockup__screen {
        border-radius: 22px;
    }

    /* Showcase: stack vertically */
    .showcase {
        padding: 0 1.5rem;
    }

    .showcase__grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .showcase__phone-col {
        display: none;
    }

    .showcase__inline-phone {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .showcase__panel {
        min-height: auto;
        padding: 4rem 0 2rem;
    }

    .showcase__panel-text {
        max-width: 100%;
    }

    /* Stats */
    .stats-bar {
        padding: 4rem 1.5rem;
    }

    .stats-bar__inner {
        flex-direction: column;
        gap: 2rem;
    }

    /* Why */
    .why-section {
        padding: 4rem 1.5rem;
    }

    .why-section__grid {
        grid-template-columns: 1fr;
    }

    /* CTA */
    .download-cta {
        padding: 4rem 1.5rem;
    }

    /* Mobile nav - dark override */
    body.page-home .site-header__nav {
        background: rgba(10, 10, 15, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    body.page-home .site-header__nav a {
        color: rgba(240, 240, 245, 0.8);
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .home-hero__orb {
        animation: none;
    }

    .home-hero__scroll-hint {
        animation: none;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .phone-reveal__device {
        opacity: 1;
        transform: scale(1);
        transition: none;
    }

    .phone-reveal__caption {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .phone-screen-placeholder {
        transition: none;
    }
}

/* ---- No-JS Fallback ---- */
.no-js [data-animate] {
    opacity: 1;
    transform: none;
}

.no-js .phone-reveal__device {
    opacity: 1;
    transform: scale(1);
}

.no-js .phone-reveal__caption {
    opacity: 1;
    transform: none;
}

.no-js .phone-screen-placeholder--map {
    opacity: 1;
}
