/* --- Variables & Setup --- */
:root {
    --bg-main: #FAFAFA;
    --bg-darker: #F3F4F6;
    --bg-card: rgba(255, 255, 255, 0.7);
    --primary: #6D28D9;
    --primary-glow: rgba(109, 40, 217, 0.3);
    --secondary: #9333EA;
    --text-main: #0F172A;
    --text-muted: #475569;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-border: rgba(255, 255, 255, 0.5);
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --nav-bg: rgba(255, 255, 255, 0.6);
}

body.dark-mode {
    --bg-main: #030014;
    --bg-darker: #05051F;
    --bg-card: rgba(13, 17, 23, 0.5);
    --primary: #9D4EDD;
    --primary-glow: rgba(157, 78, 221, 0.4);
    --secondary: #C77DFF;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.05);
    --nav-bg: rgba(3, 0, 20, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 48px; }
.p-4 { padding: 24px; }
.p-5 { padding: 48px; }
.pb-0 { padding-bottom: 0 !important; }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-0 { border: none !important; }
.position-relative { position: relative; }
.z-10 { z-index: 10; }
.w-100 { width: 100%; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 900px) {
    .container { padding: 0 20px; }
}
.section { padding: 120px 0; }
.section[id] { scroll-margin-top: 100px; }
#extension { scroll-margin-top: 140px; }

.text-gradient {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Interactive Background Blob --- */
#blob {
    background-color: var(--primary);
    height: 400px;
    aspect-ratio: 1;
    position: fixed;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    border-radius: 50%;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    animation: rotate 20s infinite;
    opacity: 0.5;
    z-index: -3;
}

#blob-blur {
    height: 100vh;
    width: 100vw;
    position: fixed;
    z-index: -2;
    backdrop-filter: blur(150px);
    -webkit-backdrop-filter: blur(150px);
}

body:not(.dark-mode) #blob { opacity: 0.3; filter: brightness(1.2); }

@keyframes rotate {
    from { rotate: 0deg; }
    50% { scale: 1 1.5; }
    to { rotate: 360deg; }
}

/* --- Spline Placeholders --- */
.spline-background {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* --- Glassmorphism --- */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}
body.dark-mode .glass-panel {
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- Typography --- */
h1 { 
    font-size: clamp(3rem, 7vw, 5rem); 
    line-height: 1.05; 
    margin-bottom: 24px; 
    font-weight: 800; 
    letter-spacing: -0.04em; 
}
h2 { 
    font-size: clamp(2.2rem, 5vw, 3.5rem); 
    line-height: 1.1;
    margin-bottom: 24px; 
    font-weight: 700;
    letter-spacing: -0.03em;
}
h3 { 
    font-size: 1.4rem; 
    margin-bottom: 12px; 
    font-weight: 600;
    letter-spacing: -0.01em;
}
p { 
    color: var(--text-muted); 
    font-size: 1.125rem; 
    line-height: 1.7;
    margin-bottom: 20px;
}

/* --- Navigation --- */
.navbar {
    position: fixed; top: 12px; left: 50%; transform: translateX(-50%); width: calc(100% - 48px); max-width: 1200px; z-index: 1000;
    border-radius: 100px;
    padding: 4px;
    transition: transform 0.3s ease, top 0.3s ease;
}
.nav-container {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 20px;
}
.nav-right { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.theme-toggle:hover { background: var(--bg-main); border-color: var(--primary); }
.sun-icon { display: none; }
.moon-icon { display: block; }
body.dark-mode .sun-icon { display: block; }
body.dark-mode .moon-icon { display: none; }

.logo { height: 34px; width: auto; max-width: 220px; transition: filter 0.3s; object-fit: contain; }
.footer-logo { height: 32px; width: auto; max-width: 200px; margin-bottom: 24px; object-fit: contain; }
.theme-asset { transition: filter 0.3s; }
body.dark-mode .theme-asset { filter: invert(100%); }

.nav-links { display: flex; gap: 32px; list-style: none; }
.nav-links a {
    color: var(--text-main); text-decoration: none; font-size: 0.95rem; font-weight: 500;
    transition: opacity 0.2s;
    padding: 8px 12px;
    border-radius: 20px;
}
.nav-links a:hover { background: rgba(0,0,0,0.05); }
body.dark-mode .nav-links a:hover { background: rgba(255,255,255,0.1); }

/* --- Buttons --- */
.btn {
    display: inline-block; padding: 14px 32px; border-radius: 100px;
    font-weight: 600; text-decoration: none; text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); cursor: pointer; border: none; font-size: 0.95rem;
    letter-spacing: -0.01em; position: relative; overflow: hidden;
    white-space: nowrap;
}

.btn-primary, .btn-glow {
    background: linear-gradient(110deg, var(--primary) 20%, var(--secondary) 40%, #A78BFA 50%, var(--secondary) 60%, var(--primary) 80%);
    background-size: 200% 100%;
    color: white;
    border: none;
    animation: shine 6s linear infinite;
    box-shadow: 0 4px 20px var(--primary-glow);
}

@keyframes shine { to { background-position: 200% center; } }

.btn-primary:hover, .btn-glow:hover {
    box-shadow: 0 15px 40px -5px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-outline {
    background: var(--bg-card); 
    color: var(--text-main); 
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}
.btn-outline:hover { background: var(--text-main); color: var(--bg-main); }

/* --- Hero Section --- */
.hero { padding: 180px 0 100px; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.hero-centered { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 40px; }
.hero-text { width: 100%; max-width: 800px; z-index: 2; }
.hero-visual { width: 100%; max-width: 900px; z-index: 1; perspective: 1000px; }
.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-main-display {
    width: 100%; border-radius: 20px; position: relative; overflow: hidden;
    transform: rotateX(5deg); transition: transform 0.5s ease;
}
.hero-main-display:hover { transform: rotateX(0deg) scale(1.02); }

.floating { animation: float 6s ease-in-out infinite; }
@keyframes float {
    0%, 100% { transform: translateY(0px) rotateX(5deg); }
    50% { transform: translateY(-15px) rotateX(8deg); }
}

/* --- Stats --- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 0 24px 80px; }
.stat-box { text-align: center; padding: 40px; border-radius: 24px; }
.stat-box h3 { font-size: clamp(2.5rem, 4vw, 3.5rem); margin-bottom: 4px; }
.stat-box p { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; margin: 0; }

/* --- Features Grid --- */
.section-title { text-align: center; margin-bottom: 64px; max-width: 700px; margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 32px; }
.card {
    padding: 48px 32px; border-radius: 32px;
    position: relative;
    transition: border-color 0.3s, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s;
    transform-style: preserve-3d;
}
.card:hover { border-color: var(--primary); }
.card-icon { width: 48px; height: 48px; margin-bottom: 24px; transform: translateZ(20px); }

/* --- Extension Section --- */
#extension .container { max-width: 1400px; width: 95%; }
.split-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 80px; align-items: center; }
.shifted-text { padding-left: 60px; }
#extension .image-content { border-radius: 20px; }
.mockup-window { border-radius: 24px; overflow: hidden; }
.mockup-header { padding: 16px; display: flex; gap: 8px; }
.mockup-header span { width: 12px; height: 12px; border-radius: 50%; background: var(--border-color); }
.mockup-header span:nth-child(1) { background: #ff5f56; }
.mockup-header span:nth-child(2) { background: #ffbd2e; }
.mockup-header span:nth-child(3) { background: #27c93f; }

/* --- FAQ & Contact --- */
.faq-grid { max-width: 800px; margin: 0 auto; display: grid; gap: 24px; }
.faq-item { padding-bottom: 24px; border-bottom: 1px solid var(--border-color); }

.contact-wrapper { padding: 80px; border-radius: 32px; }
.contact-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
}
.contact-title-inline { white-space: nowrap; }
.contact-card-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
    align-items: stretch;
}
.contact-card {
    min-height: 296px;
    padding: 36px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    border-radius: 28px;
}
.contact-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.contact-card-heading {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
}
.contact-card-copy {
    font-size: 0.95rem;
    margin-bottom: 0;
    max-width: 420px;
}
.contact-card-action {
    margin-top: auto;
}
.social-panel {
    border-radius: 28px;
}
.discord-action {
    display: flex;
    align-items: center;
    justify-content: center;
}
.discord-action-outline {
    background: transparent;
    color: #5865F2;
    border: 1px solid rgba(88, 101, 242, 0.45);
    box-shadow: none;
}
.discord-action-outline:hover {
    background: rgba(88, 101, 242, 0.08);
    color: #7b86ff;
    border-color: rgba(88, 101, 242, 0.75);
    box-shadow: 0 10px 24px rgba(88, 101, 242, 0.15);
}
.discord-action-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.discord-button-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
}
.social-links-large {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.social-links-cta {
    width: 100%;
    justify-content: center;
}
.social-icon-large {
    width: 68px;
    height: 68px;
}

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 500; }
.form-group input, .form-group textarea {
    width: 100%; padding: 16px; background: rgba(0,0,0,0.02); border: 1px solid var(--border-color);
    border-radius: 16px; color: var(--text-main); font-family: inherit; transition: 0.3s;
}
body.dark-mode .form-group input, body.dark-mode .form-group textarea { background: rgba(255,255,255,0.02); }

/* --- Footer --- */
.footer { padding: 80px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr; gap: 48px; margin-bottom: 64px; }
.footer-links ul { list-style: none; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: 0.2s; display: block; margin-bottom: 12px; font-size: 0.9375rem; }
.footer-links a:hover { color: var(--primary); }

.newsletter-input { display: flex; gap: 8px; }
.newsletter-input input { flex: 1; padding: 14px 20px; border-radius: 100px; border: 1px solid var(--border-color); background: transparent; color: var(--text-main); font-family: inherit; }

.footer-bottom { 
    text-align: center; color: var(--text-muted); font-size: 0.875rem; 
    border-top: 1px solid var(--border-color); padding-top: 32px;
}

.reveal-up { opacity: 0; transform: translateY(30px) scale(0.95); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-up.active { opacity: 1; transform: translateY(0) scale(1); }
.delay-1 { transition-delay: 0.1s; }

/* --- Social Icons --- */
.social-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.social-icon:hover {
    background: var(--primary); color: white; border-color: var(--primary);
    transform: translateY(-3px); box-shadow: 0 5px 15px var(--primary-glow);
}
.social-icon-large svg {
    width: 24px;
    height: 24px;
}

/* ==========================================
   RESPONSIVE OVERHAUL (Improved Unified System)
   ========================================== */

.hamburger {
    display: none; flex-direction: column; gap: 5px; cursor: pointer;
    z-index: 1101; padding: 0;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.hamburger span { width: 18px; height: 2px; background-color: var(--text-main); transition: 0.3s; border-radius: 2px; }

@media (max-width: 1200px) {
    .hamburger { display: flex; }

    .navbar {
        width: calc(100% - 24px);
        top: 10px;
    }

    .nav-container {
        padding: 8px 12px;
        gap: 10px;
    }
    
    .nav-links {
        position: fixed; top: 0; right: -100%; width: 85%; max-width: 320px; height: 100vh;
        background: var(--bg-darker); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
        flex-direction: column !important; justify-content: center; align-items: center; gap: 32px;
        transition: 0.45s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1000;
        box-shadow: -15px 0 45px rgba(0,0,0,0.5); border-left: 1px solid var(--border-color);
        display: flex;
    }
    .nav-links.active { right: 0; }
    .nav-right { margin-left: auto; gap: 12px; }
    .nav-right .nav-cta {
        display: none;
    }
    .navbar .nav-links li { width: 100%; text-align: center; }

    .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .split-layout {
        display: grid;
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 56px;
    }
    .mobile-reverse .image-content {
        order: 2;
    }
    .mobile-reverse .text-content {
        order: 1;
    }
    .image-content, .text-content { width: 100% !important; padding: 0 !important; min-height: auto !important; display: flex; flex-direction: column; align-items: center; }
    .shifted-text { padding-left: 0; }

    .hero {
        min-height: auto;
        padding: 140px 0 72px;
    }

    .hero-centered {
        padding-top: 12px;
    }

    .hero-text,
    .hero-visual {
        max-width: 100%;
    }

    .hero-main-display {
        max-width: 720px;
        margin: 0 auto;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    #canvas3d-extension-wrapper {
        transform: scale(0.28) translateX(-50%) translateY(60px) !important;
        width: 1000px !important; left: 50% !important; transform-origin: center !important; height: 520px !important;
    }
    .image-content { height: 420px !important; }

    #canvas3d-mobile-wrapper {
        transform: scale(0.32) translateX(-50%) translateY(120px) !important;
        width: 1000px !important; left: 50% !important; transform-origin: center !important;
    }
    .spline-placeholder-phones { height: 560px !important; }

    .contact-wrapper { padding: 40px 24px; }
    .contact-container { gap: 32px !important; text-align: center !important; }
    .contact-card-row { grid-template-columns: 1fr !important; gap: 32px !important; }
    .social-panel { width: 100% !important; }
    .contact-card {
        min-height: 0;
        padding: 32px 24px;
    }
    .newsletter-input { flex-direction: column; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 900px) {
    #blob,
    #blob-blur,
    .spline-background-wrapper {
        display: none;
    }

    .section { padding: 56px 0; }
    .navbar {
        left: 8px;
        right: 8px;
        width: auto;
        max-width: none;
        transform: none;
        border-radius: 28px;
        top: 8px;
    }
    .nav-container {
        padding: 12px 16px;
        position: relative;
        justify-content: space-between;
        min-height: 68px;
    }
    .logo { height: 28px; max-width: 180px; }

    .brand {
        display: flex;
        align-items: center;
        min-width: 0;
        flex: 0 1 auto;
    }
    
    .nav-right {
        display: none;
    }
    .nav-right .theme-toggle {
        display: none;
    }
    .hamburger {
        display: flex;
        position: static;
        transform: none;
        margin-left: auto;
        flex: 0 0 auto;
    }
    .theme-toggle { width: 40px; height: 40px; }
    .theme-toggle svg { width: 20px; height: 20px; }

    .hero {
        padding: 124px 0 56px;
    }

    .hero-main-display {
        max-width: 100%;
    }

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

    .card {
        padding: 36px 28px;
    }

    .section-title {
        margin-bottom: 40px;
    }

    .contact-wrapper {
        padding: 32px 20px;
    }

    .footer {
        padding: 56px 0 32px;
    }

    #extension {
        padding-top: 32px;
        padding-bottom: 24px;
    }

    #extension .image-content {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
    }

    #extension .split-layout {
        gap: 20px;
    }

    #extension .text-content {
        max-width: 100%;
    }

    #extension .text-content .btn {
        width: 100%;
        max-width: 320px;
    }

    #app {
        margin-top: 24px !important;
    }

    #app .image-content {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #app .split-layout {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .stats { grid-template-columns: 1fr; gap: 24px; }

    .app-buttons {
        width: 100%;
        justify-content: center;
    }

    .app-buttons .btn,
    .hero-actions .btn {
        width: 100%;
        max-width: 320px;
    }
}

@media (max-width: 600px) {
    .container { padding: 0 16px; }
    h1 { font-size: 2.25rem !important; line-height: 1.02; }
    h2 { font-size: 1.9rem !important; }
    p { font-size: 1rem; }
    .navbar {
        left: 6px;
        right: 6px;
        width: auto;
        border-radius: 24px;
    }
    .nav-container {
        padding: 10px 12px;
        min-height: 60px;
    }
    .logo {
        height: 26px;
        max-width: 170px;
    }
    .nav-links {
        width: min(82vw, 280px);
    }
    .hamburger {
        width: 40px;
        height: 40px;
    }
    .hero-actions {
        gap: 12px;
    }
    .hero-main-display {
        border-radius: 16px;
    }
    .mockup-header {
        padding: 12px;
    }
    #extension .container {
        width: 100%;
    }
    #extension {
        scroll-margin-top: 90px;
    }
    .image-content {
        height: auto !important;
    }
    #app .spline-placeholder-phones,
    #app #canvas3d-mobile-wrapper {
        display: none !important;
    }
    #canvas3d-extension-wrapper {
        transform: scale(0.2) translateX(-50%) translateY(10px) !important;
        height: 360px !important;
    }
    #canvas3d-mobile-wrapper {
        transform: scale(0.22) translateX(-50%) translateY(40px) !important;
    }
    .spline-placeholder-phones {
        height: 360px !important;
    }
    .contact-title-inline { white-space: normal; }
    .contact-card { padding: 28px 24px; }
    .social-icon-large {
        width: 60px;
        height: 60px;
    }
    .card,
    .contact-card,
    .modal-content {
        border-radius: 24px;
    }
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .extension-subtext { max-width: 100% !important; margin: 0 0 16px 0 !important; }
}

.extension-subtext { max-width: 500px; margin-bottom: 24px; }
@media (max-width: 1200px) {
    .extension-subtext { margin: 0 auto 24px; text-align: center; }
}

/* --- Modal System --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 60px 40px 40px;
    border-radius: 32px;
    position: relative;
    transform: scale(0.9);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-main);
}

@media (max-width: 600px) {
    .modal-content {
        padding: 50px 24px 32px;
    }
    .app-buttons {
        justify-content: center;
    }
}