:root {
    /* Color Palette - Cyber/Fantasy Aesthetic */
    --bg-hue: 240;
    --bg-sat: 10%;
    --bg-light: 8%;

    --surface-hue: 240;
    --surface-sat: 15%;
    --surface-light: 12%;

    --primary-hue: 260;
    /* Deep Purple */
    --primary-sat: 80%;
    --primary-light: 65%;

    --accent-hue: 45;
    /* Golden/Amber */
    --accent-sat: 90%;
    --accent-light: 55%;

    /* Generated Colors */
    --color-bg: hsl(var(--bg-hue), var(--bg-sat), var(--bg-light));
    --color-surface: hsl(var(--surface-hue), var(--surface-sat), var(--surface-light));
    --color-surface-trans: hsla(var(--surface-hue), var(--surface-sat), var(--surface-light), 0.7);
    --color-surface-hover: hsl(var(--surface-hue), var(--surface-sat), 20%);

    --color-primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
    --color-primary-glow: hsla(var(--primary-hue), var(--primary-sat), var(--primary-light), 0.4);

    --color-accent: hsl(var(--accent-hue), var(--accent-sat), var(--accent-light));

    --color-text-main: #ffffff;
    --color-text-muted: hsla(0, 0%, 100%, 0.6);

    --border-color: hsla(0, 0%, 100%, 0.1);

    /* Spacing & Layout */
    --header-height: 70px;
    --nav-height: 80px;
    --container-width: 1200px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    /* Effects */
    --glass-bg: rgba(30, 30, 35, 0.6);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --blur-strength: 20px;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(circle at 10% 20%, hsla(var(--primary-hue), 50%, 20%, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, hsla(var(--accent-hue), 50%, 20%, 0.15) 0%, transparent 40%);
    background-attachment: fixed;
    color: var(--color-text-main);
    font-family: 'Outfit', 'Roboto', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    /* Mobile: Fixed elements, simplified flow */
    display: flex;
    flex-direction: column;
}

/* === TYPOGRAPHY === */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.1rem;
}

p {
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* === HEADER === */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    border-bottom: var(--glass-border);
    z-index: 50;
    transition: all 0.3s ease;
}

#main-header.collapsed {
    background: rgba(20, 20, 25, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    height: 60px;
    /* Optional slight shrink */
}

.header-content {
    display: flex;
    flex-direction: column;
}

#page-title {
    font-size: 1.25rem;
    margin: 0;
    background: linear-gradient(90deg, var(--color-text-main), #ccc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#page-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    font-weight: 600;
}

/* === MAIN CONTENT === */
main {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    /* Padding to account for fixed header/nav on mobile */
    padding-top: var(--header-height);
    padding-bottom: var(--nav-height);
}

#scroll-container {
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 100px;
    scroll-behavior: smooth;
}

#scroll-container::-webkit-scrollbar {
    width: 6px;
}

#scroll-container::-webkit-scrollbar-thumb {
    background: var(--color-surface-hover);
    border-radius: 3px;
}

/* === CARDS === */
.card-group {
    background: var(--color-surface-trans);
    border-radius: var(--radius-lg);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-group:hover {
    box-shadow: var(--shadow-soft);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.card-header h3 {
    margin: 0;
    color: var(--color-text-main);
}

.chevron {
    color: var(--color-primary);
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.card-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease, padding 0.3s ease;
    padding: 0 24px;
}

.card-content.open {
    grid-template-rows: 1fr;
    padding-bottom: 24px;
    border-top: var(--glass-border);
    padding-top: 16px;
}

.card-content>div {
    overflow: hidden;
}

/* === NAV === */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-strength));
    border-top: var(--glass-border);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    z-index: 50;
    padding: 0 16px;
}

.nav-scroller {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    width: 100%;
    padding: 4px;
    scrollbar-width: none;
}

.nav-scroller::-webkit-scrollbar {
    display: none;
}

.nav-pill {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    padding: 10px 20px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.nav-pill:hover {
    color: var(--color-text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-pill.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--color-primary-glow);
    font-weight: 600;
}

/* === FAB === */
#fab-menu {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #000;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 214, 10, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 60;
}

#fab-menu:hover {
    transform: scale(1.1) rotate(90deg);
}

/* === DRAWER / SHEET === */
#bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#bottom-sheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

#bottom-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 450px;
    background: rgba(20, 20, 24, 0.95);
    border-left: var(--glass-border);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0;
}

#bottom-sheet.open {
    transform: translateX(0);
}

.sheet-header {
    padding: 24px;
    border-bottom: var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sheet-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* === DESKTOP / TABLET RESPONSIVE === */
@media (min-width: 768px) {
    body {
        display: grid;
        grid-template-columns: 280px 1fr;
        grid-template-rows: 100vh;
        grid-template-areas: "nav content";
        overflow: hidden;
    }

    #main-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: transparent;
        border-bottom: none;
        padding: 40px;
        pointer-events: none;
        justify-content: flex-start;
        z-index: 40;
    }

    #main-header .header-content {
        margin-left: 280px;
    }

    #bottom-nav {
        grid-area: nav;
        position: relative;
        flex-direction: column;
        height: 100%;
        /* Fill grid cell */
        width: 100%;
        border-right: var(--glass-border);
        border-top: none;
        padding: 40px 20px;
        align-items: flex-start;
        background: rgba(20, 20, 25, 0.5);
        /* Slightly more transparent */
    }

    .desktop-logo {
        display: block !important;
    }

    .nav-scroller {
        flex-direction: column;
        overflow: visible;
        gap: 16px;
    }

    .nav-pill {
        width: 100%;
        text-align: left;
        padding: 12px 24px;
        border-radius: 12px;
    }

    main {
        grid-area: content;
        padding: 0;
        /* Reset mobile padding */
        height: 100%;
    }

    #scroll-container {
        padding: 120px 40px 40px;
        /* Intentionally push content down */
    }

    /* Sheet becomes a side modal */
    #bottom-sheet {
        top: 20px;
        bottom: 20px;
        right: 20px;
        height: auto;
        border-radius: var(--radius-lg);
        border: var(--glass-border);
        box-shadow: var(--shadow-soft);
    }

    /* FAB moves to top right or stays bottom right */
    #fab-menu {
        bottom: 40px;
        right: 40px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeIn 0.4s ease forwards;
}