:root {
    --primary: #CC0000;
    --primary-hover: #b30000;
    --accent: #FFD700;
    --bg-body: #fdfdfd;
    --bg-surface: #ffffff;
    --bg-offset: #f3f4f6;
    --text-main: #111827;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --border-light: #e5e7eb;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --max-w: 1240px;
    --header-height: 80px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1)
}

[data-theme="dark"] {
    --bg-body: #0a0b10;
    --bg-surface: #12141c;
    --bg-offset: #1a1d26;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    --border-light: #2d3139;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4)
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    scroll-behavior: smooth;
    transition: background-color 0.5s ease, color 0.5s ease
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1)
}

.reveal.active {
    opacity: 1;
    transform: translateY(0)
}

.theme-switch {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2001;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 8px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition)
}

.theme-switch:hover {
    transform: scale(1.1);
    border-color: var(--primary)
}

.theme-switch i {
    font-size: 1.2rem;
    color: var(--text-main)
}

.theme-switch .indicator {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem
}

.copy-success-tip {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 4000;
    box-shadow: 0 10px 30px rgba(204, 0, 0, 0.4)
}

.copy-success-tip.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0)
}

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    z-index: 2000;
    transition: width 0.1s ease
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--text-main);
    color: var(--bg-body);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    border: none
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0)
}

#back-to-top:hover {
    background: var(--primary);
    transform: scale(1.1)
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition)
}

ul {
    list-style: none
}

img {
    max-width: 100%;
    height: auto;
    display: block
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    margin-bottom: 0.75em
}

.cosmos-container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px
}

.galaxy-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) 1fr;
    gap: 64px;
    margin-bottom: 80px;
    align-items: start
}

.nova-header {
    padding: 40px 0 24px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto
}

.stardust-trail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 16px;
    letter-spacing: 0.5px
}

.supernova-title {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--text-main)
}

.nebula-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 32px
}

.nebula-meta span {
    display: flex;
    align-items: center;
    gap: 8px
}

.nebula-meta i {
    color: var(--primary)
}

.warp-portal {
    position: relative;
    width: 100%;
    margin-bottom: 64px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16/9;
    background: var(--bg-offset)
}

.portal-view {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s ease
}

.warp-portal:hover .portal-view {
    transform: scale(1.03)
}

.transmission-body {
    font-size: 1.15rem;
    color: var(--text-main)
}

.transmission-body p {
    margin-bottom: 1.8em;
    line-height: 1.85
}

.transmission-body p:first-of-type::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: 0.65;
    padding-right: 12px;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--primary)
}

.hologram-frame {
    margin: 40px 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: zoom-in;
    position: relative;
    transition: var(--transition)
}

.hologram-frame:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg)
}

.hologram-frame img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover
}

.signal-transmitter {
    margin: 56px 0;
    padding: 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    text-align: center
}

.emit-signal-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 40px;
    background: var(--text-main);
    color: var(--bg-body);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2)
}

.emit-signal-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(204, 0, 0, 0.3)
}

.constellation-link {
    margin-top: 64px;
    border-top: 1px solid var(--border-light);
    padding-top: 48px
}

.sector-designation {
    font-size: 1.25rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px
}

.sector-designation::before {
    content: '';
    width: 6px;
    height: 24px;
    background: var(--primary);
    border-radius: 4px
}

.cluster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px
}

.asteroid-card {
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid var(--border-light)
}

.asteroid-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg)
}

.asteroid-card img {
    width: 100%;
    height: 180px;
    object-fit: cover
}

.surface-data {
    padding: 20px
}

.data-signature {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.orbital-sidebar {
    display: flex;
    flex-direction: column;
    gap: 48px;
    position: sticky;
    top: 24px
}

.satellite-unit {
    background: var(--bg-surface);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: var(--transition)
}

.satellite-unit:hover {
    box-shadow: var(--shadow-lg)
}

.newsletter-box {
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    color: white
}

.newsletter-box h3 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 10px
}

.newsletter-box p {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 20px
}

.newsletter-box .input-group {
    display: flex;
    gap: 0;
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2)
}

.newsletter-box .email-input {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-family: var(--font-body);
    outline: none
}

.newsletter-box .action-button {
    padding: 0 20px;
    background: var(--primary);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--transition)
}

.newsletter-box .action-button:hover {
    background: white;
    color: var(--primary)
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    place-items: center;
    padding: 40px;
    opacity: 0;
    transition: opacity 0.3s
}

.lightbox-modal.active {
    display: grid;
    opacity: 1
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1);
    transform: scale(0.9);
    transition: transform 0.3s
}

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

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition)
}

.lightbox-close:hover {
    color: var(--primary);
    transform: rotate(90deg)
}

.rotation-deck {
    position: relative;
    min-height: 340px
}

.deck-header {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main)
}

.deck-header i {
    color: var(--primary)
}

.scan-window {
    position: relative;
    overflow: hidden;
    height: 280px
}

.parallax-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1)
}

.stellar-object {
    min-width: 100%;
    height: 100%;
    padding: 0;
    text-decoration: none;
    position: relative
}

.stellar-object img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.object-telemetry {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white
}

.telemetry-header {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3
}

.nav-beacons {
    position: absolute;
    bottom: 15px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10
}

.beacon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition)
}

.beacon.active {
    background: white;
    transform: scale(1.2)
}

.eclipse-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    place-items: center;
    opacity: 0;
    transition: opacity 0.3s
}

.eclipse-overlay.phase-locked {
    display: grid;
    opacity: 1
}

.eclipse-core {
    background: var(--bg-body);
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    color: var(--text-main)
}

.eclipse-overlay.phase-locked .eclipse-core {
    transform: translateY(0)
}

.mission-abort {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-offset);
    display: grid;
    place-items: center;
    transition: var(--transition);
    color: var(--text-main)
}

.mission-abort:hover {
    background: #e5e7eb
}

.comms-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px
}

.freq-channel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden
}

.freq-channel:hover {
    transform: translateY(-8px) scale(1.05);
    filter: brightness(1.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2)
}

.freq-channel i {
    font-size: 1.5rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275)
}

.freq-channel:hover i {
    transform: scale(1.2) rotate(8deg)
}

.freq-channel::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg) translateY(100%);
    transition: transform 0.6s
}

.freq-channel:hover::after {
    transform: rotate(45deg) translateY(-100%)
}

@media (max-width:1024px) {
    .galaxy-grid {
        grid-template-columns: 1fr;
        gap: 48px
    }

    .orbital-sidebar {
        position: static
    }

    .satellite-unit {
        max-width: none;
        margin: 0
    }

    .warp-portal {
        aspect-ratio: 16/10
    }
}

@media (max-width:768px) {
    .cosmos-container {
        padding: 0 20px
    }

    .nova-header {
        padding: 30px 0 16px
    }

    .supernova-title {
        font-size: 2.25rem;
        margin-bottom: 20px
    }

    .nebula-meta {
        flex-wrap: wrap;
        gap: 12px 20px;
        font-size: 0.85rem;
        margin-bottom: 24px
    }

    .warp-portal {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        border-radius: 0;
        margin-bottom: 32px
    }

    .transmission-body {
        font-size: 1.05rem
    }

    .transmission-body p:first-of-type::first-letter {
        font-size: 3em
    }

    .comms-matrix {
        grid-template-columns: repeat(2, 1fr)
    }

    .signal-transmitter {
        padding: 24px 16px;
        margin: 40px 0
    }

    .cluster-grid {
        grid-template-columns: 1fr;
        gap: 20px
    }

    .constellation-link {
        max-width: none;
        margin: 48px 0 0
    }

    .theme-switch {
        display: none
    }

    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px
    }
}

@media (max-width:480px) {
    .supernova-title {
        font-size: 1.85rem
    }

    .comms-matrix {
        grid-template-columns: 1fr
    }

    .galaxy-grid {
        gap: 40px
    }
}

.voidFooterRealm {
    width: 100%;
    background-color: #0d0d0d;
    color: #fff;
    padding: 60px 20px 40px;
    border-top: 5px solid var(--primary)
}

.nebulaFooterCore {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2.2fr 1.2fr;
    gap: 48px
}

@media (max-width:900px) {
    .nebulaFooterCore {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px
    }

    .lunarLogoHub,
    .lunarLogoHub p {
        max-width: none;
        margin: 0 auto
    }

    .astroNavCluster {
        justify-content: center
    }

    .cosmicSocialSphere {
        display: flex;
        flex-direction: column;
        align-items: center
    }
}

@media (max-width:600px) {
    .astroNavCluster {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px 20px;
        text-align: left
    }
}

.lunarLogoHub img {
    width: 140px;
    margin-bottom: 16px;
    filter: brightness(0) invert(1)
}

.lunarLogoHub p {
    opacity: 0.6;
    font-size: 0.9rem;
    max-width: 250px
}

.astroNavCluster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px
}

.astroNavCluster a {
    color: #a3a3a3;
    font-weight: 500;
    transition: 0.2s
}

.astroNavCluster a:hover {
    color: white;
    transform: translateX(5px);
    display: inline-block
}

.cosmicSocialSphere h3 {
    margin-bottom: 20px
}

.stellarSocialIcons {
    display: flex;
    gap: 12px
}

.stellarSocialIcons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: white
}

.stellarSocialIcons a:hover {
    background: var(--primary);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(204, 0, 0, 0.3)
}

.stellarSocialIcons a i {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275)
}

.stellarSocialIcons a:hover i {
    transform: scale(1.2)
}

@media (max-width:768px) {
    .nebulaFooterCore {
        grid-template-columns: 1fr;
        text-align: center
    }

    .lunarLogoHub,
    .lunarLogoHub p {
        margin: 0 auto
    }

    .stellarSocialIcons {
        justify-content: center
    }
}