/* ========== GLOBAL VARIABLES & RESET (Shared with navigation) ========== */
:root {
    --bg: #03050a;
    --card-bg: rgba(8, 12, 24, 0.8);
    --text: #d0d8e8;
    --text-light: #8aa8cc;
    --border: rgba(70, 130, 200, 0.3);
    --accent: #4a90e0;
    --accent-hover: #7ec8f8;
    --nav-bg: rgba(3, 5, 10, 0.94);
    --shadow: 0 8px 24px rgba(0,0,0,0.6);
    --radius: 8px;
    --transition: 0.3s ease;
    --nav-text: #d0d8e8;
}

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

body {
    background: var(--bg);
    font-family: 'Orbitron', 'Segoe UI', 'Roboto', system-ui, sans-serif;
    padding: 0;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-image: 
        radial-gradient(2px 2px at 15% 25%, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 45% 10%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 75% 35%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 85% 55%, rgba(255,255,255,0.5), transparent),
        radial-gradient(3px 3px at 55% 80%, rgba(180,200,255,0.4), transparent),
        radial-gradient(ellipse at 40% 60%, rgba(20, 40, 80, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(30, 10, 50, 0.6) 0%, transparent 50%),
        linear-gradient(180deg, #020510 0%, #0a0e1a 40%, #03060f 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 rgba(74, 144, 224, 0.3);
    padding: 0 1.5rem;
    width: 100%;
    transition: box-shadow 0.3s;
}
.site-nav.scrolled {
    box-shadow: 0 2px 16px rgba(74, 144, 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: #ffffff;
    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(74, 144, 224, 0.15);
    color: var(--accent-hover);
}

/* 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(74, 144, 224, 0.15);
    color: var(--accent-hover);
}
.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: #0a0e1a;
    border: 1px solid rgba(74, 144, 224, 0.4);
    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;
}
.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: #a0b8d8;
    text-decoration: none;
    transition: background 0.15s;
}
.nav-dropdown-menu a:hover {
    background: rgba(74, 144, 224, 0.15);
    color: var(--accent-hover);
}

/* 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: #ffffff;
    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: #a0b8d8;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s;
}
.mobile-menu a:hover,
.mobile-menu a.active {
    background: rgba(74, 144, 224, 0.15);
    color: var(--accent-hover);
}
.mobile-menu .mobile-divider { height: 1px; background: rgba(74, 144, 224, 0.2); margin: 0.4rem 0; }
.mobile-menu .mobile-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #7a8eb0;
    padding: 0.5rem 1rem 0.2rem;
}

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

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

.mission-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #7ec8f8;
    border: 1px solid #4a80b0;
    padding: 0.4rem 2rem;
    border-radius: 2px;
    background: rgba(10, 20, 40, 0.7);
    backdrop-filter: blur(8px);
    margin-bottom: 1rem;
}

.mission-badge span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #f0d060;
    border-radius: 50%;
    box-shadow: 0 0 6px #f0d060;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #ffffff;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(100, 180, 255, 0.6);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 400;
    border-bottom: 1px solid rgba(100, 160, 220, 0.4);
    display: inline-block;
    padding-bottom: 0.5rem;
    padding-left: 1.2rem;
    padding-right: 1.2rem;
    letter-spacing: 0.6px;
    font-family: 'Segoe UI', sans-serif;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    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(70, 130, 200, 0.3), var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow 0.4s;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.palette-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #4a90e0, #7ec8f8, #4a90e0);
    z-index: 2;
    opacity: 0.7;
}

.palette-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 0 1px #7ec8f8, 0 12px 32px rgba(70, 130, 200, 0.4);
}

.color-strip {
    display: flex;
    width: 100%;
    height: 112px;
    cursor: pointer;
    margin-top: 4px;
}

.color-swatch {
    flex: 1;
    position: relative;
    transition: filter 0.18s, transform 0.2s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
}

.color-swatch:hover {
    filter: brightness(1.1);
    transform: scaleY(1.05);
    z-index: 3;
    box-shadow: 0 6px 16px rgba(100, 180, 255, 0.5);
}

.swatch-hex {
    font-size: 0.6rem;
    font-weight: 600;
    color: #ffffff;
    background: rgba(5, 8, 18, 0.65);
    padding: 3px 9px;
    border-radius: 2px;
    letter-spacing: 0.6px;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.color-swatch:hover .swatch-hex {
    opacity: 1;
}

.swatch-hex.light-text {
    color: #03050a;
    background: rgba(255, 255, 255, 0.85);
}

.palette-info {
    padding: 1rem 1.2rem 0.9rem 1.2rem;
    background: transparent;
}

.palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.palette-name {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.8px;
    color: #e0ecff;
    text-transform: uppercase;
    border-bottom: 2px solid #4a90e0;
    padding-bottom: 3px;
}

.copy-group-btn {
    background: rgba(70, 130, 200, 0.15);
    border: 1px solid #4a90e0;
    padding: 0.4rem 0.95rem;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #7ec8f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.25s;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.copy-group-btn:hover {
    background: #4a90e0;
    color: #03050a;
    box-shadow: 0 0 12px rgba(74, 144, 224, 0.7);
}

.color-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
    margin-top: 0.2rem;
}

.color-tag {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.04);
    color: #c0d0f0;
    padding: 0.26rem 0.8rem;
    border-radius: 2px;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    border: 0.5px solid rgba(74, 144, 224, 0.3);
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
}

.color-tag:hover {
    background: rgba(74, 144, 224, 0.25);
    border-color: #4a90e0;
    color: #ffffff;
    transform: translateY(-1px);
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-right: 7px;
    opacity: 0.95;
}

.footer-note {
    margin-top: 3.5rem;
    text-align: center;
    color: #7a8eb0;
    font-size: 0.82rem;
    font-weight: 400;
    border-top: 1px solid rgba(74, 144, 224, 0.3);
    padding-top: 1.7rem;
    width: 100%;
    max-width: 640px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.toast-message {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #4a90e0;
    color: #03050a;
    padding: 0.65rem 1.8rem;
    border-radius: 2px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 0 24px rgba(74, 144, 224, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
    white-space: nowrap;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}
.toast-message.show { opacity: 1; }

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