:root {
    --primary: #8a2be2;
    --primary-hover: #b062f8;
    --text-main: #ffffff;
    --text-muted: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: #050510;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Fixed Background */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('back.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    /* Optional: subtle parallax or overlay */
    /* background-attachment: fixed; -- disabled: broken on iOS Safari mobile */
}

.background-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(5, 5, 16, 0.3) 0%, rgba(5, 5, 16, 0.8) 100%);
    z-index: 0;
}

/* Layout */
.container {
    width: 100%;
    min-height: 200vh;
    /* Make document scrollable */
    display: flex;
    flex-direction: column;
}

/* ------------- Hero Section ------------- */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
    gap: 2rem;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 4rem;
    max-width: 800px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    animation: floatIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    /* 'both' = applies start state before & end state after */
}

@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger: logo card appears first, content card slightly after */
.glass-card--logo {
    animation-delay: 0s;
}

.glass-card:not(.glass-card--logo) {
    animation-delay: 0.15s;
}

/* Safety net: if animations are disabled (prefers-reduced-motion), show cards immediately */
@media (prefers-reduced-motion: reduce) {
    .glass-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

.main-logo {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    margin-bottom: 0;
    /* Card padding handles spacing; no extra margin needed */
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.1));
}

/* Logo card: compact padding, semi-transparent white */
.glass-card--logo {
    background: rgba(255, 255, 255, 0.40);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.1), var(--glass-shadow);
    padding: 1.5rem 2rem;
}

.text-fill {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons / Links */
.nav-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    /* Mobile tap fixes */
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.15);
    touch-action: manipulation;
    position: relative;
    z-index: 10;
    display: inline-block;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-btn.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.nav-btn.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}

/* Scroll Prompt */
.scroll-prompt {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.7;
    animation: breathe 3s infinite ease-in-out;
}

.scroll-text {
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-mouse {
    width: 26px;
    height: 42px;
    border: 2px solid #fff;
    border-radius: 20px;
    position: relative;
    display: flex;
    justify-content: center;
}

.wheel {
    width: 4px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
    margin-top: 6px;
    animation: scrollWheel 2s infinite ease;
}

@keyframes scrollWheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(12px);
        opacity: 0;
    }
}

@keyframes breathe {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(5px);
    }
}

/* ------------- Agent Section Trigger ------------- */
.agent-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

.trigger-space {
    width: 100%;
    height: 50vh;
}

/* Fixed corner agent */
.agent-graphic {
    position: fixed;
    bottom: -50px;
    right: -50px;
    width: 30vw;
    max-width: 380px;
    min-width: 200px;
    height: auto;
    z-index: 5;
    /* Lower than buttons so it never blocks taps */
    pointer-events: none;
    /* Let clicks pass through */
    -webkit-user-select: none;
    user-select: none;

    /* Remove any frames */
    border: none;
    background: transparent;
    box-shadow: none;
    outline: none;
    /* Optional slight drop shadow for blending */
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.4));

    /* Animation initial states */
    opacity: 0;
    transform: translate(30px, 30px) scale(0.9);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Class added when scrolled into view */
.agent-graphic.revealed {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    bottom: 0px;
    /* Snug in the corner */
    right: 0px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        height: auto;
        min-height: 100vh;
        padding: 1.5rem 1rem 5rem;
        /* 5rem bottom = room for fixed footer */
        justify-content: flex-start;
        padding-top: 2rem;
    }

    .glass-card {
        padding: 1.5rem 1rem;
        margin: 0.5rem 0;
        position: relative;
        z-index: 20;
        /* Above the agent graphic */
    }

    .main-logo {
        max-height: 80px;
        margin-bottom: 0;
    }

    .main-title {
        font-size: 2.5rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
        padding: 1rem 2rem;
        /* Larger tap target on mobile */
    }

    /* Make agent graphic smaller so it doesn't cover buttons */
    .agent-graphic {
        width: 40vw;
        max-width: 160px;
        min-width: 80px;
    }
}

/* ------------- Footer ------------- */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(5, 5, 16, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 50;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
}

.footer-link:hover {
    color: rgba(255, 255, 255, 1);
}

@media (max-width: 768px) {
    .site-footer {
        gap: 1.2rem;
        padding: 0.65rem 1rem;
    }

    .footer-link {
        font-size: 0.8rem;
    }

    /* Push content up so footer doesn't cover buttons */
    .hero-section {
        padding-bottom: 4rem;
    }
}