#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding: 1rem;
    overflow: hidden;
}

#loading-screen::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.loading-logo-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.loading-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.3em;
    background: linear-gradient(to bottom, #ffffff 0%, #888888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

.loading-glitch {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.3em;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    color: rgba(255, 255, 255, 0.1);
    animation: glitch 3s infinite;
    text-align: center;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); opacity: 0; }
    92% { transform: translate(-2px, 2px); opacity: 0.8; }
    94% { transform: translate(2px, -2px); opacity: 0.8; }
    96% { transform: translate(-2px, -2px); opacity: 0.8; }
}

.loading-morse {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    letter-spacing: 0.4em;
    opacity: 0.6;
    margin-bottom: 3rem;
    text-align: center;
    animation: fade-in-out 2s ease-in-out infinite;
}

@keyframes fade-in-out {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.loading-bar-wrapper {
    width: 100%;
    margin-bottom: 2rem;
}

.loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff 0%, #888 50%, #fff 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: shimmer 1.5s infinite;
    position: relative;
    z-index: 2;
}

.loading-bar-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: scan-bar 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes scan-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
}

.loading-percentage {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-speed {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.1em;
}

.loading-text {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 2vw, 0.9rem);
    margin-bottom: 2rem;
    opacity: 0.7;
    letter-spacing: 0.15em;
    text-align: center;
    padding: 0 1rem;
    animation: text-cycle 3s infinite;
}

@keyframes text-cycle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.3;
    }
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Enhanced Responsive adjustments */
@media (max-width: 768px) {
    .loading-logo {
        font-size: clamp(2rem, 10vw, 4rem);
        letter-spacing: 0.2em;
    }

    .loading-glitch {
        font-size: clamp(2rem, 10vw, 4rem);
        letter-spacing: 0.2em;
    }

    .loading-morse {
        font-size: clamp(0.6rem, 2vw, 0.8rem);
        margin-bottom: 2rem;
    }

    .loading-bar-container {
        height: 3px;
    }

    .loading-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .loading-percentage {
        font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    }

    .loading-speed {
        font-size: clamp(0.6rem, 1.8vw, 0.8rem);
    }

    .loading-text {
        font-size: clamp(0.6rem, 1.8vw, 0.8rem);
        margin-bottom: 1.5rem;
    }

    .loading-dots span {
        width: 6px;
        height: 6px;
    }
}
.nav-link {
    position: relative;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    letter-spacing: 0.15em;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #fff;
    transition: width 0.3s ease;
}

.nav-link::before {
    content: '[ ';
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link:hover::after {
    width: 100%;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    margin-top: 1rem;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.dropdown-content.align-right {
    right: 0;
    left: auto;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
    display: block;
    color: #fff;
    text-decoration: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #fff;
    padding-left: 1.5rem;
}

.dropdown-arrow {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
    display: none;
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    display: block;
    max-height: 500px;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: #fff;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #fff;
    padding-left: 2rem;
}

.mobile-dropdown-items {
    padding-left: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-dropdown-items.active {
    max-height: 300px;
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .desktop-menu {
        display: none;
    }
}

/* ============================= */
/* Morse Code Background Wrapper */
/* ============================= */

.morse-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

/* ================= */
/* Morse Pulse Lines */
/* ================= */

/* Uncomment if you re-enable morse-line elements */
/*
.morse-line {
    position: absolute;
    height: 2px;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    animation: morse-pulse 2.5s infinite ease-in-out;
    z-index: 1;
}
*/

@keyframes morse-pulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.3; }
}

/* ================= */
/* Circuit Lines     */
/* ================= */

.circuit-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.215);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    z-index: 0;
}

.circuit-line.horizontal {
    height: 10px;
    width: 100%;
}

.circuit-line.vertical {
    width: 10px;
    height: 100%;
}

/* ================= */
/* Circuit Nodes     */
/* ================= */

.circuit-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.2;
    animation: pulse-node 3s infinite;
    z-index: 0;
}

@keyframes pulse-node {
    0%, 100% {
        opacity: 0.2;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.5);
    }
}

/* ================= */
/* Floating Tech UI  */
/* ================= */

.tech-element {
    position: absolute;
    width: 100px;
    height: 100px;
    opacity: 0.5;
    animation: float-diagonal 20s infinite;
    z-index: 1;
}

@keyframes float-diagonal {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(50px, -50px) rotate(90deg); }
    50% { transform: translate(100px, 0) rotate(180deg); }
    75% { transform: translate(50px, 50px) rotate(270deg); }
}

/* ================= */
/* Data Streams      */
/* ================= */

.data-stream {
    position: absolute;
    width: 100px;
    height: 200px;
    background: linear-gradient(to bottom, transparent, #fff, transparent);
    opacity: 0.15;
    animation: stream-flow 3s infinite linear;
    z-index: 0;
}

@keyframes stream-flow {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* ================= */
/* Morse Code Dots   */
/* ================= */

.morse-code {
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.2em;
    opacity: 0.4;
    font-size: 0.9rem;
}

.morse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    margin: 0 4px;
    animation: blink 2s infinite;
}

.morse-dash {
    display: inline-block;
    width: 24px;
    height: 8px;
    background: #fff;
    margin: 0 4px;
    animation: blink 2s infinite 0.5s;
}

@keyframes blink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ================= */
/* Grid Overlay (BG) */
/* ================= */

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

/* ================= */
/* Media Queries     */
/* ================= */

@media (max-width: 768px) {
    .morse-code {
        font-size: 0.65rem;
    }

    .morse-dot {
        width: 6px;
        height: 6px;
    }

    .morse-dash {
        width: 18px;
        height: 6px;
    }

    .grid-overlay {
        background-size: 30px 30px;
    }
}

@media (max-width: 480px) {
    .morse-code {
        font-size: 0.6rem;
    }
}

/* Allow fixed backgrounds to show */
.hero-section,
section {
    background-color: transparent !important;
}

  #music-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 28px;

    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;

    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;

    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
  }

  #music-toggle:hover {
    background: rgba(255, 255, 255, 0.85);
    color: #000;
    border-color: #000;
  }

  #music-toggle:active {
    transform: scale(0.96);
  }