/* =============================================================================
   Frontpage-only styles — loaded via <link> in index.rst
   ============================================================================= */

/* ===== BASE LAYOUT ===== */
.bd-sidebar-secondary {
    display: none;
}

.wy-nav-content-wrap {
    margin-left: 0;
}

.frontpage-equation {
    margin-top: 1.9em;
    margin-bottom: 1.6em;
}

.bd-main .bd-content .bd-article-container {
    max-width: 80rem;
}

.code-example-text {
    max-width: 60rem;
    margin: 0 auto;
}

article.bd-article section {
    padding: 3rem 0 7rem;
}

h1:not(.sd-d-none) {
    font-weight: 800;
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0d1b3e;
    letter-spacing: -0.02em;
}

h3:not(#hero h3) {
    font-weight: bold;
    text-align: center;
}

.sd-row {
    justify-content: center;
}

/* ===== HERO — DARK GRADIENT ===== */
#hero {
    background: linear-gradient(135deg, #070d1f 0%, #0d1b3e 35%, #122a5e 65%, #0f2347 100%);
    border-radius: 20px;
    padding: 3.5rem 3rem;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    box-shadow: 0 20px 60px rgba(10, 22, 50, 0.3);
}

/* Graph network canvas overlay */
#hero-graph-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Accent glow — top right */
#hero::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 140, 255, 0.12) 0%, rgba(0, 60, 180, 0.04) 50%, transparent 70%);
    top: -150px;
    right: -80px;
    border-radius: 50%;
    pointer-events: none;
    animation: orbPulse 6s ease-in-out infinite;
}

@keyframes orbPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

/* Secondary glow — bottom left */
.hero-orb-secondary {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    bottom: -140px;
    left: -100px;
    border-radius: 50%;
    pointer-events: none;
    animation: orbPulse 8s ease-in-out infinite reverse;
    z-index: 0;
}

/* ===== HERO LEFT ===== */
#hero-left {
    position: relative;
    z-index: 2;
}

#hero-left .scaled-image {
    filter: brightness(0) invert(1);
    opacity: 1;
}

#hero-left h2 {
    background: linear-gradient(135deg, #ffffff 0%, #a8d4ff 50%, #ffffff 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 68px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

#hero-left h3 {
    color: rgba(168, 212, 255, 0.9) !important;
    font-weight: 600 !important;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

#hero-left p {
    color: rgba(200, 220, 255, 0.7);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ===== HERO RIGHT — FLOATING CARDS ===== */
#hero-right {
    position: relative;
    z-index: 2;
}

#hero-right .sd-card {
    background: rgba(255, 255, 255, 0.97) !important;
    border: 1px solid rgba(100, 180, 255, 0.15) !important;
    border-radius: 14px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#hero-right .sd-card:hover {
    border-color: rgba(0, 120, 255, 0.4) !important;
    transform: translateY(-5px);
    box-shadow: 0 14px 44px rgba(0, 80, 200, 0.25);
}

#hero-right .example-img-plot-overlay,
#hero-right .example-img-plot-overlay p.sd-card-text {
    border-radius: 14px;
    background: rgb(0 14 72) !important;
    color: #ffffff !important;
}

#hero-right .example-img-plot-overlay {
    opacity: 0;
    transition: .2s ease;
}

#hero-right .sd-card:hover .example-img-plot-overlay {
    opacity: 0.9;
}

/* ===== BUTTONS ===== */
.homepage-button {
    min-width: 150px;
    padding: 0.65em 1.4em;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
}

.primary-button {
    background: linear-gradient(135deg, #0088ff, #0055cc) !important;
    border: 1px solid transparent !important;
    color: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 100, 255, 0.35);
}

.primary-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(0, 100, 255, 0.5) !important;
    background: linear-gradient(135deg, #0099ff, #0066dd) !important;
    color: #ffffff !important;
}

.secondary-button {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

.secondary-button:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.homepage-button-link {
    color: rgba(168, 212, 255, 0.8) !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.homepage-button-link:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

/* ===== STATS STRIP ===== */
.stats-strip {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 3.5rem 2rem;
    margin: 0 auto;
    max-width: 80rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem 2.5rem;
    background: linear-gradient(135deg, #f0f6ff 0%, #e8eef8 100%);
    border-radius: 14px;
    border: 1px solid rgba(1, 89, 153, 0.06);
    transition: all 0.3s ease;
    flex: 1;
    min-width: 180px;
    max-width: 250px;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(1, 89, 153, 0.08);
    border-color: rgba(1, 89, 153, 0.12);
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: #015999;
    display: block;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.82rem;
    color: #5a6a85;
    margin-top: 0.3rem;
    display: block;
    font-weight: 500;
}

/* ===== SECTION DECORATIONS ===== */
.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #015999, #0099ff);
    border-radius: 2px;
    margin: 0 auto 1rem;
    border: none;
}

.section-subtitle {
    text-align: center;
    color: #5a6a85;
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

/* ===== FEATURE CARDS ===== */
#key-features .sd-card {
    border-radius: 16px !important;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(1, 89, 153, 0.05) !important;
    background: #ffffff !important;
}

#key-features .sd-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(1, 89, 153, 0.08);
    border-color: rgba(1, 89, 153, 0.1) !important;
}

#key-features .sd-card img {
    transition: transform 0.3s ease;
}

#key-features .sd-card:hover img {
    transform: scale(1.05);
}

/* ===== CODE COMPARISON SECTION ===== */
#dive-into-qrisp-code {
    background: linear-gradient(180deg, #f8fafc 0%, #f0f4f8 100%);
    border-radius: 20px;
    padding: 3rem 2rem !important;
}

/* ===== PARTNER LOGOS ===== */
#who-is-behind-qrisp .sd-card {
    transition: all 0.3s ease;
    border-radius: 12px !important;
}

#who-is-behind-qrisp .sd-card:hover {
    transform: translateY(-3px);
}

#who-is-behind-qrisp .sd-card img {
    filter: grayscale(20%);
    opacity: 0.85;
    transition: all 0.3s ease;
}

#who-is-behind-qrisp .sd-card:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* ===== ENTRANCE ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

#hero-left {
    animation: fadeInUp 0.8s ease-out;
}

#hero-right {
    animation: fadeInUp 0.8s ease-out 0.15s both;
}

.stats-strip {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* ===== SCROLL REVEAL ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== CARD TILT GLOW OVERLAY ===== */
.tilt-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.sd-card:hover > .tilt-glow {
    opacity: 1;
}

/* ===== CODE TYPING CURSOR ===== */
.typing-cursor-line {
    animation: cursorBlink 0.75s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    #hero {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }

    #hero-left,
    #hero-right {
        width: 100%;
    }

    #hero-left h2 {
        font-size: 48px !important;
    }

    #hero-left p {
        margin-right: 0 !important;
    }

    #hero-left .scaled-image,
    #hero-left img[src$="logo_white.png"] {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    #hero-right {
        min-width: unset !important;
    }

    .homepage-button-container {
        margin-top: 1rem;
    }

    img {
        max-width: 76%;
    }

    .stats-strip {
        padding: 2rem 1rem;
    }

    .stat-item {
        padding: 1rem 1.5rem;
        min-width: 140px;
    }

    #dive-into-qrisp-code {
        border-radius: 12px;
        padding: 2rem 1rem !important;
    }
}
