/* ========== GLOBAL VARIABLES & RESET (Shared with navigation) ========== */
:root {
    --bg: #0b0a0c;
    --card-bg: rgba(18, 16, 22, 0.7);
    --text: #1c1b1a;
    --text-light: #8c8fa8;
    --border: rgba(120, 100, 180, 0.25);
    --accent: #b44de0;
    --accent-hover: #c060f0;
    --nav-bg: rgba(10, 9, 12, 0.94);
    --shadow: 0 8px 28px rgba(0,0,0,0.5);
    --radius: 18px;
    --transition: 0.3s ease;
    --nav-text: #1c1b1a;
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f3f7;
        --card-bg: rgba(255, 255, 255, 0.8);
        --text: #2a2528;
        --text-light: #6b5e7a;
        --border: rgba(180, 160, 200, 0.3);
        --accent: #b44de0;
        --accent-hover: #8e3eb0;
        --nav-bg: rgba(245, 243, 247, 0.94);
        --shadow: 0 4px 16px rgba(0,0,0,0.05);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    font-family: 'Space Grotesk', 'Inter', 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
    padding: 0;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-image: 
        radial-gradient(ellipse at 30% 10%, #1a1030 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, #0f1a2c 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, #0a0a0f 0%, #050508 100%);
    background-attachment: fixed;
}

/* ========== NAVIGATION ========== */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    width: 100%;
    transition: box-shadow 0.3s;
}
.site-nav.scrolled {
    box-shadow: 0 2px 16px rgba(180, 77, 224, 0.2);
}
.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    gap: 1rem;
}
.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.75; }
.nav-logo .logo-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav-links a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.1px;
}
.nav-links a:hover,
.nav-links a.active {
    background: rgba(180, 77, 224, 0.15);
    color: var(--accent);
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    letter-spacing: 0.1px;
    user-select: none;
    color: var(--nav-text);
    background: none;
    border: none;
    font-family: inherit;
}
.nav-dropdown-toggle:hover {
    background: rgba(180, 77, 224, 0.15);
    color: var(--accent);
}
.nav-dropdown-toggle .arrow {
    font-size: 0.6rem;
    transition: transform 0.25s;
}
.nav-dropdown.open .nav-dropdown-toggle .arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #12101a;
    border: 1px solid rgba(120, 100, 180, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    padding: 0.5rem 0;
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 1001;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
@media (prefers-color-scheme: light) {
    .nav-dropdown-menu { background: #faf8fc; }
}
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 0;
    white-space: nowrap;
    color: #a098b8;
    text-decoration: none;
    transition: background 0.15s;
}
.nav-dropdown-menu a:hover {
    background: rgba(180, 77, 224, 0.15);
    color: var(--accent);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    flex-direction: column;
    gap: 5px;
    z-index: 1002;
}
.hamburger span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: var(--nav-text);
    border-radius: 2px;
    transition: all 0.3s;
}
.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); }

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999;
    padding: 1rem;
    overflow-y: auto;
    flex-direction: column;
    gap: 0.25rem;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    display: block;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: #a098b8;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s;
}
.mobile-menu a:hover,
.mobile-menu a.active {
    background: rgba(180, 77, 224, 0.15);
    color: var(--accent);
}
.mobile-menu .mobile-divider { height: 1px; background: var(--border); margin: 0.4rem 0; }
.mobile-menu .mobile-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #6a6f85;
    padding: 0.5rem 1rem 0.2rem;
}

/* ========== PAGE SPECIFIC STYLES (Neon Future) ========== */
.container {
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.8rem;
}

header {
    text-align: center;
    margin-bottom: 2.8rem;
}

.vol-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a0a8c0;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 0.4rem 1.5rem;
    border-radius: 30px;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}
.vol-chip span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

h1 {
    font-size: 2.8rem;
    font-weight: 580;
    letter-spacing: 1px;
    color: #f0ece4;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 12px rgba(180, 77, 224, 0.4);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 400;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
    padding-bottom: 0.55rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
    letter-spacing: 0.5px;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.9rem;
    margin-top: 0.2rem;
}

.palette-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow 0.4s ease, border-color 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    position: relative;
}
.palette-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(135deg, #b44de0, #3dccc7, #f2668c, #b44de0);
    background-size: 300% 300%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0;
    pointer-events: none;
}
.palette-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 0 1px rgba(180, 77, 224, 0.4), 0 12px 36px rgba(0,0,0,0.6);
    border-color: rgba(180, 77, 224, 0.4);
}
.palette-card:hover::after {
    opacity: 1;
    animation: borderGlow 3s linear infinite;
}
@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.color-strip {
    display: flex;
    width: 100%;
    height: 105px;
    cursor: pointer;
    position: relative;
    z-index: 1;
}
.color-swatch {
    flex: 1;
    position: relative;
    transition: filter 0.2s, transform 0.2s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 7px;
}
.color-swatch:hover {
    filter: brightness(1.15);
    transform: scaleY(1.05);
    z-index: 2;
    box-shadow: 0 0 18px rgba(255,255,255,0.2);
}
.swatch-hex {
    font-size: 0.6rem;
    font-weight: 550;
    color: rgba(255,255,255,0.95);
    background: rgba(10,10,15,0.6);
    padding: 3px 9px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
    border: 0.5px solid rgba(255,255,255,0.2);
}
.color-swatch:hover .swatch-hex { opacity: 1; }
.swatch-hex.light-text {
    color: rgba(20,20,25,0.9);
    background: rgba(255,255,255,0.75);
    border-color: rgba(0,0,0,0.1);
}

.palette-info {
    padding: 1.1rem 1.2rem 1rem 1.2rem;
    background: transparent;
    position: relative;
    z-index: 1;
}
.palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}
.palette-name {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
    color: #e8e2d2;
    text-shadow: 0 0 6px rgba(180, 77, 224, 0.3);
}
.copy-group-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 500;
    color: #c8c0d4;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.25s;
    letter-spacing: 0.3px;
    backdrop-filter: blur(5px);
}
.copy-group-btn:hover {
    background: rgba(180, 77, 224, 0.15);
    border-color: var(--accent);
    color: #f0e6ff;
    box-shadow: 0 0 14px rgba(180, 77, 224, 0.4);
}

.color-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    align-items: center;
    margin-top: 0.1rem;
}
.color-tag {
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.04);
    color: #c4bfd0;
    padding: 0.28rem 0.8rem;
    border-radius: 14px;
    font-weight: 420;
    letter-spacing: 0.2px;
    white-space: nowrap;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    backdrop-filter: blur(4px);
}
.color-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(180, 77, 224, 0.3);
    transform: translateY(-1px);
}
.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
    opacity: 0.95;
    box-shadow: 0 0 4px currentColor;
}

.footer-note {
    margin-top: 3.4rem;
    text-align: center;
    color: #6a6f85;
    font-size: 0.8rem;
    font-weight: 360;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.8rem;
    width: 100%;
    max-width: 620px;
    letter-spacing: 0.5px;
}

.toast-message {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 18, 28, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(180, 77, 224, 0.4);
    color: #f0e6ff;
    padding: 0.6rem 1.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 480;
    box-shadow: 0 0 20px rgba(180, 77, 224, 0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.4px;
}
.toast-message.show { opacity: 1; }

/* Light mode overrides for cards */
@media (prefers-color-scheme: light) {
    .palette-card {
        background: rgba(255,255,255,0.8);
        border: 1px solid rgba(180, 160, 200, 0.3);
        box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    }
    .palette-name { color: #2d2833; text-shadow: none; }
    .color-tag { background: rgba(0,0,0,0.03); color: #4a4250; border-color: rgba(0,0,0,0.08); }
    .color-tag:hover { background: rgba(180, 77, 224, 0.1); color: #2d1e3c; }
    .copy-group-btn { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #4a4250; }
    .copy-group-btn:hover { background: rgba(180, 77, 224, 0.1); color: #2d1e3c; }
    .subtitle { color: #6b5e7a; border-bottom-color: rgba(0,0,0,0.1); }
    .footer-note { color: #8c7f9e; }
    .toast-message { background: rgba(255,255,255,0.9); color: #2d1e3c; border-color: #b44de0; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .container { padding: 1.4rem 1rem; }
    h1 { font-size: 2rem; }
    .palette-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.3rem; }
}
@media (min-width: 769px) {
    .mobile-menu { display: none !important; }
}