body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #000000; /* Dark background */
    color: white;
    overflow: hidden; /* Prevent scrollbars due to canvas */
}

/* Themed Scrollbars - Global */
* {
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #00d4ff #1a1a1a;
}

/* Webkit browsers (Chrome, Safari, Edge) */
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #0099cc);
    border-radius: 4px;
    border: 1px solid #333;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #00ffff, #00d4ff);
}

*::-webkit-scrollbar-corner {
    background: #1a1a1a;
}
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: black;
    display: block;
}
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;             /* reduced from 64px */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: rgba(17,16,16,0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 1000;
    padding: 4px 12px;        /* reduced from 8px 12px */
}

.header .logo {
    position: absolute;
    left: 12px;
}

.logo {
    height: 36px;            /* increased from 28px */
    flex-shrink: 0;
}

.title {
    margin: 0;
    color: #c08459;
    font-size: 1.4rem;       /* increased from 1.1rem */
    font-weight: 600;
    letter-spacing: 0.2px;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 0 8px rgba(0,0,0,0.6);
}

/* Hero typography: match explainer title and body exactly */
.hero-title {
    margin: 0 0 10px 0;
    font-size: 1.8rem; /* desktop matches .replicant-content h2 */
    color: #c08459;
    text-align: center;
    font-weight: 600;
}

.hero-body {
    margin: 0;
    color: #d2d2d2; /* matches .replicant-content p */
    font-size: 1rem;
    line-height: 1.7;
    text-align: left;
}
.nav-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
        background-color: rgba(17, 16, 16, 0.65); /* More transparent */
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    position: fixed; /* Also fix this */
    top: 56px; /* Clear gap: 48px header + 8px separation */
    width: 100%;
    z-index: 998; /* Lower than header z-index: 1000 */
}

.nav-buttons button {
    background: linear-gradient(rgba(26,26,26,0.55), rgba(46,46,46,0.35));
    color: #ddd;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-grow: 1;
    text-align: center;
    font-size: 1rem;
}

.nav-buttons button:hover {
    background: linear-gradient(rgba(46,46,46,0.6), rgba(26,26,26,0.5));
}
.hero-section {
    text-align: center;
    /* Let child .hero-card define width to match .replicant-content */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: calc(20vh + 45px); /* buffer for nav button separation */
    margin-bottom: 0px;      /* no gap to explainer */
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center;     /* Center vertically */
    min-height: 12vh;        /* further reduced height */
}

.hero-section h1 {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #9e9e9e; /* Base text color */
    text-shadow:
        0 0 8px rgba(255, 255, 255, 0.3), /* Soft white glow */
        0 0 20px rgba(0, 0, 0, 0.1);     /* Subtle dark shadow for depth */
    background: linear-gradient(to right, #afafaf, #9c9c9c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent; /* Use gradient as text color */
}

/* Tablet and smaller screens */
@media (max-width: 1200px) {
    .hero-section {
    width: 100%;
    min-height: 15vh;      /* reduced for better spacing */
    margin-top: calc(15vh + 45px); /* viewport-based centering + nav space */
    }
    .title {
        font-size: 1.8rem;     /* slightly smaller for tablet */
    }
    .logo {
        height: 32px;          /* slightly smaller for tablet */
    }
    .buttons {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

.nav-buttons button {
        font-size: 1.2rem;      /* Larger text */
        padding: 0.8rem 1.2rem; /* More padding for finger taps */
    }

    .nav-buttons {
        align-items: center;     /* Center align */
    }
    
    .replicant-explainer {
        min-height: 35vh;
        margin-top: -8px;
    }
}

/* Mobile devices */
@media (max-width: 600px) {
    .hero-section {
    width: 100%;
    min-height: 12vh;      /* reduced for mobile */
    margin-top: calc(5vh + 40px); /* reduced from 16vh - much closer to top */
    }

    .hero-section h1 {
        font-size: 1rem; /* Adjust for mobile */
    }

    .title {
        font-size: 1.3rem;     /* increased from 1.5rem for better mobile visibility */
    }
    
    .logo {
        height: 30px;          /* good size for mobile */
    }

    .nav-buttons button {
        font-size: .8rem;      /* Larger text */
    }

    .nav-buttons {
        align-items: center;     /* Center align */
    }
    
    .replicant-explainer {
        min-height: 30vh;
        margin-top: -5px;
    }
}

/* ===== Replicant explainer section with neural network background ===== */
.replicant-explainer {
    position: relative;
    min-height: 60vh;      /* reduced to help center both frames */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;     /* minimal padding */
    margin-top: -10px;     /* small negative margin to close gap */
    overflow: hidden;
}

#neuralNetwork {
    position: fixed;      /* cover the entire viewport */
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;           /* above starfield, below header/nav/cards */
    cursor: default;      /* no drag cursor for canvas itself */
    pointer-events: none; /* make canvas non-interactive by default */
}

.hero-card,
.replicant-content {
    position: relative;
    z-index: 5;           /* put content frames above neural network */
    max-width: 1000px;
    width: min(90vw, 1100px); /* identical sizes for top and bottom frames */
    margin-left: auto;
    margin-right: auto;
        background: rgba(0, 0, 0, 0.6);      /* much more transparent */
        -webkit-backdrop-filter: blur(2px);  /* minimal blur */
        backdrop-filter: blur(2px);          /* minimal blur */
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.hero-card h1 {
    margin: 0;
    text-align: left;
    font-size: 1.3rem;
    color: #d6d6d6;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 0 8px rgba(0,0,0,0.6);
}

.replicant-content h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    color: #c08459;
    text-align: center;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 0 10px rgba(0,0,0,0.7);
}

/* Keep hero and explainer titles in perfect sync */
.hero-title { font-size: 1.8rem; }

.replicant-content p {
    margin: 0 0 8px 0;
    color: #d2d2d2;
    line-height: 1.7;
    text-shadow: 
        0 1px 3px rgba(0,0,0,0.8),
        0 0 6px rgba(0,0,0,0.5);
}

/* Improve legibility on the bottom card */
.replicant-content {
    background: rgba(0, 0, 0, 0.6);      /* much more transparent */
    -webkit-backdrop-filter: blur(2px);  /* minimal blur */
    backdrop-filter: blur(2px);          /* minimal blur */
}

.replicant-content .bullets {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.replicant-content .bullets li {
    color: #cfcfcf;
    text-shadow: 
        0 1px 2px rgba(0,0,0,0.8),
        0 0 4px rgba(0,0,0,0.5);
}

@media (max-width: 900px) {
    .replicant-explainer { min-height: 54vh; padding: 22px 14px; }
    .hero-card, .replicant-content { width: 94vw; padding: 18px; }
    .replicant-content h2, .hero-title { font-size: 1.4rem; }
}

@media (max-width: 600px) {
    .replicant-explainer { min-height: 40vh; padding: 60px 12px; } /* reduced height and padding */
    .hero-card, .replicant-content { width: 90vw; padding: 5px; }
    .replicant-content h2, .hero-title { font-size: 1.25rem; }
    .replicant-content p, .hero-body { font-size: 0.95rem; }
}

/* INDEX PAGE SPECIFIC STYLING - Improved headers and nav-buttons */
body.index-page .header {
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 28px);
    border: 1px solid rgba(148, 161, 196, 0.4);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background-color: rgba(0, 0, 0, 0.72); /* Black, slightly transparent */
}

body.index-page .nav-buttons {
    top: 55px; /* 48px header + 8px top margin + 8px gap */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2px);
    gap: 0;
}

body.index-page .nav-buttons button {
    background: linear-gradient(rgba(3, 3, 3, 0.5), rgba(2, 2, 2, 0.5));
    color: #ccc;
    border: 1px solid rgba(148, 161, 196, 0.4);
    border-top: none;
    height: 50px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.index-page .nav-buttons button:hover {
    background: linear-gradient(rgba(12, 12, 12, 0.6), rgba(14, 14, 14, 0.6));
}
