/* ==========================
    Imports & Base Styles
========================== */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;900&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'Lexend', Arial, sans-serif;
    background: #09073f;
    color: #fff;
    position: relative;
    line-height: 1;
    scroll-behavior: smooth;
}

/* ======================
    Navbar & Overlay
====================== */
.navbar {
    width: 100%;
    position: absolute;
    z-index: 3000;
    background: transparent;
    box-shadow: none;
    padding-top: 50px;
    padding-bottom: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s, box-shadow 0.3s, opacity 0.4s;
    opacity: 1;
}

.navbar-logo {
    display: flex;
    align-items: center;
    position: absolute;
    left: 32px;
    top: 32px;
    height: 38px;
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer;
}
.navbar-logo.fade-out,
.navbar-logo.active {
    opacity: 0;
    pointer-events: none;
}

.navbar-links {
    list-style: none;
    display: flex;
    gap: 12px;
    margin: 0 auto;
    padding: 0;
    align-items: center;
    justify-content: center;
}

.navbar-links li {
    display: inline-block;
}

.navbar-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.04em;
    padding: 6px 12px;
    border-radius: 10px;
    transition: color 0.2s, background 0.2s;
}
.navbar-links a:hover {
    background: #5865f2;
    text-decoration: none;
}

.navbar.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Shared Hamburger/Close Base */
.navbar-hamburger,
.navbar-close {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    position: absolute;
    top: 33px;
    right: 32px;
    cursor: pointer;
    transition: background 0.6s;
    z-index: 3200;
}

/* Hamburger */
.navbar-hamburger {
    background: rgba(0,0,0,0.3);
    z-index: 100;
}
.navbar-hamburger span {
    width: 20px;
    height: 2px;
    background: #fff;
    margin: 2.5px 0;
}
.navbar-hamburger span:last-child {
    width: 12px;
    margin-left: 6px;
    align-self: flex-start;
}
.navbar-hamburger:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Close (X) */
.navbar-close {
    background: rgba(168, 230, 255, 0.3);
}
.navbar-close span {
    position: absolute;
    width: 24px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
}
.navbar-close span:first-child { transform: rotate(45deg); }
.navbar-close span:last-child { transform: rotate(-45deg); }
.navbar-close:hover { background: rgba(255,255,255,0.3); }

/* Blur Overlay */
#nav-blur-overlay {
    display: none;
}

@media (max-width: 1100px) {
    .navbar-links.active .navbar-close { display: flex; }

    #nav-blur-overlay {
        position: fixed;
        top: 0; left: 0;
        width: 100vw; height: 100vh;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(32px);
        z-index: 1999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }
    
    #nav-blur-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Mobile Logo */
.navbar-links .mobile-logo {
    display: none;
    position: fixed;
    top: 42px;
    left: 32px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 2100;
}

/* ============
    Header
============ */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 100px;
}

.header-main-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;      /* vertically center children */
    width: 100%;
    background: radial-gradient(ellipse at center, #2b2794 0%, transparent 70%);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0 0 60px;
}

.header-content h1 {
    font-size: 65px;
    font-weight: 800;
    line-height: 0.8;
    margin-bottom: 25px;
}

.sub-heading {
    font-size: 18px;
    max-width: 525px;
    margin: 0;
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 0 10px 100px;
    width: 100%;
    max-width: 100vw;
}

.rounded-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 10px;
    padding: 20px 30px;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: 'Lexend', Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(31,27,134,0.10);
    transition: background 0.3s, box-shadow 0.5s;
    text-align: center;
}
.rounded-btn:hover {
    background: #dbdbdb;
    box-shadow: 0 12px 32px -4px rgba(0,0,0,0.55);
}

/* Second Button Effect */
.header-buttons .rounded-btn:nth-child(2) {
    position: relative;
    background: #5865f2;
    color: #fff;
    overflow: hidden;
}
.header-buttons .rounded-btn:nth-child(2)::after {
    content: "";
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 80%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 1;
}
.header-buttons .rounded-btn:nth-child(2):hover::after {
    opacity: 1;
}

/* 3D Canvas */
#three-canvas {
    width: 45vw;
    aspect-ratio: 1 / 1;
    min-width: 0;
    max-width: 790px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ======================
    Discord Embed
====================== */
.discord-embed-wrapper {
    display: flex;
    justify-content: center;
    padding: 10px; /* top and bottom 50px, sides 10px */
}

/* ======================
    Responsive Layout
====================== */
@media (max-width: 1100px) {
    header {
        padding-top: 10px;
    }

    .header-main-wrapper {
        flex-direction: column-reverse;
        padding: 0 10px;
        margin-top: 50px;
        box-sizing: border-box;
    }

    #three-canvas {
        min-width: 0;
        width: 100vw;
        max-width: 500px;
    }

    .header-content {
        display: flex;
        flex-direction: column;
        align-items: center;     /* Horizontally center children */
        justify-content: center; /* Vertically center children if needed */
        text-align: center;
        padding: 0px 20px 35px; /* Balanced horizontal padding */
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .header-content h1 {
        font-size: 36px;
    }

    .discord-embed-wrapper {
        margin-top: 16px;
    }

    .navbar {
        position: fixed;
    }

    .navbar.scrolled {
        background: #5865f2;
        box-shadow: 0 2px 16px rgba(0,0,0,0.18);
        opacity: 1;
    }

    .navbar-links {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        box-sizing: border-box;
        position: fixed;
        top: 0;
        right: -100%;
        height: 100%;
        width: 50.5%;
        background: #5865f2;
        box-shadow: -2px 0 16px rgba(0,0,0,0.18);
        padding: 132px 32px 32px;
        border-radius: 40px 0 0 40px;
        transform: translateX(100%);
        pointer-events: none;
        visibility: hidden;
        z-index: 3100;
        transition: transform 0.4s, opacity 0.4s, visibility 0s linear 0.4s;
    }

    .navbar-links.active {
        transform: translateX(0);
        right: 0;
        pointer-events: auto;
        visibility: visible;
        transition: transform 0.4s, opacity 0.4s, visibility 0s;
    }

    .navbar-links.closing {
        transform: translateX(100%);
        pointer-events: none;
        visibility: hidden;
        transition: transform 0.4s, opacity 0.4s, visibility 0s linear 0.4s;
    }

    #nav-blur-overlay {
        display: flex;
        transition: opacity 0.4s cubic-bezier(0.4,0,0.2,1);
    }

    .navbar-links li {
        width: 100%;
        padding: 21px 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .navbar-links a {
        display: block;
        width: 100%;
        padding: 4px 0;
        text-align: left;
        border-radius: 6px;
    }

    .navbar-hamburger,
    .navbar-links .mobile-logo {
        display: flex;
    }
}

@media (max-width: 615px) {
html, body {
    overflow-x: hidden;
}
    .header-buttons {
        flex-direction: column;
        gap: 15px;
        padding-bottom: 40px;
        align-items: center;
    }

    .rounded-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* =========================
    Utilities & Animation
========================= */
.rounded-btn .bounce-arrow {
    display: inline-block;
    transition: transform 0.2s;
}
.rounded-btn:hover .bounce-arrow {
    animation: bounce-arrow 1.2s infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-8px); }
    40% { transform: translateY(0); }
    60% { transform: translateY(-4px); }
    80% { transform: translateY(0); }
}

/* ==============
    Footer
============== */
footer {
    width: 100%;
    background: linear-gradient(180deg, #3d478e 0%, #5865f2 100%);
    color: #fff;
    margin-top: 200px;
    padding: 80px 0 0 0; /* Remove bottom padding to reduce whitespace */
    text-align: center;
    font-size: 1rem;
    position: relative;
    z-index: 100;
    max-width: 100vw;
    overflow: hidden;

    .footer-container {
        max-width: 1600px;
        margin: 0 auto;
        width: 100%;
    }

    .footer-row {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        width: 100%;
        position: relative;
        z-index: 3;
    }

    .footer-logo {
        height: 64px;
        margin-bottom: 25px;
        cursor: pointer;
        flex-shrink: 0;
        position: static;
        margin-right: 64px;
        padding-left: 30px;
    }

    .footer-nav-columns {
        display: flex;
        flex-direction: row;
        gap: 5vw;
        margin-bottom: 32px;
        justify-content: flex-end;
        align-items: flex-start;
    }

    .footer-nav-column {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-right: 35px;
    }

    .footer-nav-title {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.5);
        margin-bottom: 18px;
        letter-spacing: 0.04em;
    }

    .footer-nav-link {
        color: #fff;
        text-decoration: none;
        font-size: 1rem;
        margin-bottom: 12px;
        transition: color 0.2s;
    }
    .footer-nav-link:hover {
        text-decoration: underline;
    }

    .footer-bg-logo {
        position: relative;
        left: 0;
        bottom: 0;
        width: 100%;
        padding: 25px;
        max-height: 600px;
        height: 44vw;
        pointer-events: none;
        z-index: 1;
        object-fit: cover;
        margin: 0 auto;
        display: block;
    }
}

/* =====================
    Embeds & Markdown
===================== */
.discord-embed {
    display: grid;
    grid-template-columns: auto 80px;
    grid-template-areas:
        "author      thumbnail"
        "title       thumbnail"
        "description thumbnail"
        "fields      thumbnail"
        "maskedlinks thumbnail"
        "markdown    thumbnail"
        "image       image"
        "footer      footer";
    gap: 0;
    position: relative;
    background: #2b2d31;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    color: #fff;
    max-width: 800px;
    padding: 18px 22px 16px 18px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-size: 15px;
    line-height: 1.2;
    overflow: hidden;

    h1 { color: #fff; font-size: 2.2em; font-weight: 800; margin-top: 1rem; margin-bottom: 0.5rem; }
    h2 { color: #fff; font-size: 1.5em; font-weight: 700; margin-top: 1rem; margin-bottom: 0.5rem; }
    h3 { color: #fff; font-size: 1.15em; font-weight: 600; margin-top: 1rem; margin-bottom: 0.5rem; }
    blockquote { margin: 0.25rem 0; padding: 0 0.75rem; border-radius: 4px; color: #b5bac1; border-left: 4px solid #4e5058; white-space: pre-wrap; line-height: 1.4; }
    ul, ol { margin-left: 1.1em; color: #b5bac1; padding-left: 0; margin-bottom: 0; }
    li { padding: 0; margin: 0; }
    code { background-color: #27282c; font-family: monospace; font-size: 0.85em; padding: 2px 4px; border-radius: 4px; }
    pre { background-color: #27282c; padding: 10px; border-radius: 4px; overflow-x: auto; margin: 0.5rem 0; font-family: monospace; font-size: 1em; color: #b5bac1; }
    a { color: #00b0f4; text-decoration: none; padding: 0; margin: 0; }
    a:hover { text-decoration: underline; }
    .spoiler { background: #1a1a1a; color: transparent; border-radius: 4px; cursor: pointer; transition: color 0.2s, background 0.2s; padding: 0; user-select: none; position: relative; }
    .spoiler.revealed { color: #b5bac1; background: #23272a; }
    small.subtext { color: #999; font-size: 0.8em; }
    .discord-mention { color: #bcd1dbff; background: #1c3f819c; font-weight: 600; text-decoration: none; cursor: pointer; }
    .discord-mention:hover { text-decoration: underline; }
    .discord-channel { color: #bcd1dbff; background: #1c3f819c; font-weight: 600; text-decoration: none; cursor: pointer; }
    .discord-channel:hover { text-decoration: underline; }
}

.discord-embed::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 6px; height: 100%;
    background: #5865f2;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    z-index: 1;
}

.discord-embed > * { position: relative; z-index: 2; }
.embed-author {
    grid-area: author;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    word-break: break-word;
    gap: 8px;
}

.embed-author-image img {
    width: 32px; height: 32px;
    border-radius: 50%; background: #23272a;
    object-fit: cover; display: block;
}

.embed-title {
    grid-area: title;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
}

.embed-description {
    grid-area: description;
    font-size: 15px;
    color: #b5bac1;
}

.embed-field-grid {
    grid-area: fields;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

.embed-field { min-width: 0; }
.embed-field[inline="False"] { grid-column: auto; }
.embed-field-title {
    word-break: break-word;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.embed-field-value {
    font-size: 15px;
    color: #b5bac1;
    margin-bottom: 8px;
}

.embed-thumbnail {
    width: 80px; height: 80px;
    grid-area: thumbnail;
    align-self: start;
    justify-self: end;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    padding: 0; margin: 0;
}

.embed-image {
    grid-area: image;
    width: 100%; max-width: 100%; min-height: 120px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    overflow: hidden;
    margin: 18px 0 0 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.embed-image img {
    width: 100%; height: auto;
    border-radius: inherit;
    display: block;
    max-width: 100%;
}

.embed-thumbnail img {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.embed-footer {
    grid-area: footer;
    font-size: 12px;
    color: #b5bac1;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.embed-footer-image img {
    width: 24px; height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.embed-field-placeholder {
    visibility: hidden;
    height: 0;
}