@font-face {
    font-family: 'Syne Mono';
    src: url('https://fonts.googleapis.com/css2?family=Syne+Mono&display=swap');
}

@font-face {
    font-family: 'Share Tech Mono';
    src: url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
}

@font-face {
    font-family: 'Space Mono';
    src: url('https://fonts.googleapis.com/css2?family=Space+Mono&display=swap');
}

/* ===================
   Global Variables
   =================== */
:root {
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-gray-dark: #111111;
    --color-gray-medium: #333333;
    --color-gray-light: #999999;
    --color-highlight: #ffffff;
    --font-heading: 'Syne Mono', monospace;
    --font-body: 'Share Tech Mono', monospace;
    --font-terminal: 'Space Mono', monospace;
    --glow-intensity: 5px;
}

/* ===================
   Reset & Base Styles
   =================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
    position: relative;
    min-height: 100vh;
}

/* Custom cursor */
body::after {
    content: '';
    position: fixed;
    width: 12px;
    height: 12px;
    border: 1px solid var(--color-text);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
    transition: all 80ms ease;
}

/* Links */
a {
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    text-shadow: 0 0 var(--glow-intensity) var(--color-highlight);
}

a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-text);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
    box-shadow: 0 0 var(--glow-intensity) var(--color-highlight);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: normal;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

p {
    margin-bottom: 1rem;
}

/* ===================
   Layout Components
   =================== */

/* Three.js Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* Scanlines Overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.15;
}

/* Particles Overlay */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(0, 0, 0, 0.7);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    position: relative;
}

.nav-logo::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 8px;
    height: 8px;
    background-color: var(--color-text);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 2rem;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 1px;
    margin: 5px auto;
    transition: all 0.3s ease;
    background-color: var(--color-text);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.hero-content {
    text-align: center;
    z-index: 3;
}

.hero h1 {
    font-size: 7vw;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.subtitle {
    font-size: 1.5rem;
    opacity: 0.7;
    max-width: 600px;
    margin: 0 auto;
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 var(--color-highlight);
    clip: rect(24px, 9999px, 90px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -1px 0 var(--color-highlight);
    clip: rect(85px, 9999px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(20px, 9999px, 50px, 0); }
    15% { clip: rect(28px, 9999px, 37px, 0); }
    30% { clip: rect(70px, 9999px, 92px, 0); }
    45% { clip: rect(15px, 9999px, 31px, 0); }
    60% { clip: rect(88px, 9999px, 122px, 0); }
    75% { clip: rect(41px, 9999px, 73px, 0); }
    100% { clip: rect(8px, 9999px, 81px, 0); }
}

/* Features Section */
.features {
    padding: 4rem 2rem;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.section-title {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--color-gray-medium);
    padding-bottom: 1rem;
    position: relative;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background-color: var(--color-gray-dark);
    border: 1px solid var(--color-gray-medium);
    overflow: hidden;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 var(--glow-intensity) var(--color-highlight);
}

.card-image {
    position: relative;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
    filter: grayscale(100%) contrast(1.2);
}

.feature-card:hover .card-image img {
    transform: scale(1.05);
    filter: grayscale(50%) contrast(1.3);
}

.card-content {
    padding: 1.5rem;
    position: relative;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card-summary {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.feature-card:hover .card-summary {
    height: auto;
    opacity: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 80px;
    right: 0;
    width: 300px;
    height: calc(100vh - 80px);
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-left: 1px solid var(--color-gray-medium);
    padding: 2rem;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

/* Date/Time Widget */
.datetime-widget {
    font-family: var(--font-terminal);
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--color-gray-medium);
    background-color: var(--color-gray-dark);
    display: flex;
    flex-direction: column;
}

.datetime-widget span {
    display: block;
    margin-bottom: 5px;
}

#current-time {
    font-size: 1.5rem;
    letter-spacing: 2px;
}

#current-date {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Transmissions Widget */
.transmissions-widget {
    border: 1px solid var(--color-gray-medium);
    background-color: var(--color-gray-dark);
    padding: 1rem;
}

.transmissions-widget h3 {
    border-bottom: 1px solid var(--color-gray-medium);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.transmission-list {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.transmission-item {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--color-gray-medium);
    position: relative;
}

.transmission-item:hover::before {
    content: attr(data-preview);
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 250px;
    background-color: var(--color-gray-dark);
    border: 1px solid var(--color-gray-medium);
    padding: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.9;
    z-index: 10;
    pointer-events: none;
}

/* Terminal Widget */
.terminal-widget {
    border: 1px solid var(--color-gray-medium);
    background-color: var(--color-gray-dark);
    font-family: var(--font-terminal);
    font-size: 0.8rem;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    background-color: var(--color-gray-medium);
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

.terminal-controls span {
    margin-left: 0.5rem;
    cursor: pointer;
}

.terminal-body {
    padding: 0.5rem;
    height: 150px;
    overflow-y: auto;
    color: var(--color-highlight);
}

.terminal-line {
    margin-bottom: 0.3rem;
}

#terminal-output {
    color: var(--color-text);
    opacity: 0.8;
}

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: var(--color-gray-dark);
    border-top: 1px solid var(--color-gray-medium);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 900;
}

.player-controls {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.player-controls button {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1rem;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.player-controls button:hover {
    text-shadow: 0 0 var(--glow-intensity) var(--color-highlight);
}

.track-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.track-name {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.track-progress {
    height: 2px;
    background-color: var(--color-gray-medium);
    width: 100%;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--color-text);
    transition: width 0.1s linear;
}

/* ===================
   Animation Classes
   =================== */
.fade-in {
    animation: fadeIn 0.7s forwards;
}

.slide-in-left {
    animation: slideInLeft 0.7s forwards;
}

.slide-in-right {
    animation: slideInRight 0.7s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* CRT Flicker */
.crt-flicker {
    animation: flicker 0.15s infinite alternate;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    10% { opacity: 0.9; }
    20% { opacity: 0.33; }
    30% { opacity: 0.9; }
    40% { opacity: 0.13; }
    50% { opacity: 0.78; }
    60% { opacity: 0.9; }
    70% { opacity: 0.33; }
    80% { opacity: 0.5; }
    90% { opacity: 0.89; }
}

/* ===================
   Responsive Styles
   =================== */
@media (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 640px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        background-color: var(--color-bg);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        padding-top: 80px;
        z-index: 1;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 2rem 0;
    }

    .hamburger {
        display: block;
        z-index: 2;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 10vw;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}