/* ===========================
   CSS Variables
   =========================== */
:root {
    /* Colors */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0f;
    --text-primary: #ffffff;
    --text-secondary: #9a9aa5;
    --text-tertiary: #5a5a65;

    /* Gradients */
    --gradient-teal: linear-gradient(135deg, #00d9ff 0%, #00ffa3 100%);
    --gradient-text: linear-gradient(135deg, #00d9ff 0%, #00ffa3 50%, #00d9ff 100%);

    /* Category Colors */
    --color-science: #00ffa3;
    --color-technology: #00d9ff;
    --color-society: #a78bfa;

    /* Borders & Effects */
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-teal: rgba(0, 217, 255, 0.4);

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Space Grotesk', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 32px;
    --space-lg: 64px;
    --space-xl: 96px;
}

/* ===========================
   Reset & Base
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===========================
   Site Logo
   =========================== */
.site-logo {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    opacity: 0;
    animation: fadeIn 0.6s ease 0.4s forwards;
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.1);
}

.site-logo img {
    display: block;
    width: 40px;
    height: 40px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

/* ===========================
   Floating Stars Background
   =========================== */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}

.star:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.star:nth-child(2) { top: 40%; left: 30%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 60%; left: 70%; animation-delay: 1s; }
.star:nth-child(4) { top: 80%; left: 20%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 30%; left: 80%; animation-delay: 2s; }
.star:nth-child(6) { top: 50%; left: 50%; animation-delay: 2.5s; }
.star:nth-child(7) { top: 70%; left: 90%; animation-delay: 0.8s; }
.star:nth-child(8) { top: 15%; left: 60%; animation-delay: 1.8s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* ===========================
   Pill Navigation
   =========================== */
.nav-pill {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 6px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15) 0%, rgba(0, 255, 163, 0.15) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.2);
    z-index: 100;
    animation: fadeInDown 0.6s ease 0.2s backwards;
}

.pill-item {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-item:hover {
    background: rgba(0, 217, 255, 0.15);
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.3);
    transform: translateY(-1px);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
    position: relative;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

/* Overlay for readability */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: var(--space-md);
    text-transform: uppercase;
}

.gradient-text {
    background: var(--gradient-text);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

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

.hero-subtitle {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    letter-spacing: 0.02em;
}

/* ===========================
   Category Tags
   =========================== */
.category-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 14px;
}

.tag {
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

.tag.science { color: var(--color-science); }
.tag.technology { color: var(--color-technology); }
.tag.society { color: var(--color-society); }

.divider {
    color: var(--text-tertiary);
    opacity: 0.5;
}

/* ===========================
   Subscribe Form
   =========================== */
.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.email-input {
    width: 100%;
    padding: 18px 28px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(0, 217, 255, 0.4);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.email-input:focus {
    outline: none;
    border-color: rgba(0, 217, 255, 0.8);
    box-shadow: 0 0 20px var(--glow-teal);
}

.email-input::placeholder {
    color: rgba(0, 217, 255, 0.6);
}

.join-btn {
    width: 100%;
    padding: 20px 48px;
    background: var(--gradient-teal);
    background-size: 200% auto;
    color: var(--bg-primary);
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px var(--glow-teal);
}

.join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--glow-teal);
    animation: shimmer 2s linear infinite;
}

/* ===========================
   Sections
   =========================== */
.section {
    padding: var(--space-xl) var(--space-md);
    position: relative;
    z-index: 2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    text-align: center;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

/* ===========================
   Canvas Backgrounds
   =========================== */
.soundwave-canvas {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    height: 80px;
    opacity: 0.4;
    z-index: 1;
    pointer-events: none;
}

.dna-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.25;
    z-index: 1;
    pointer-events: none;
}

/* ===========================
   Podcasts Section
   =========================== */
.podcasts-section {
    background: var(--bg-secondary);
}

.episode-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.episode-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-technology);
    box-shadow: 0 12px 40px rgba(0, 217, 255, 0.2);
}

.episode-artwork {
    flex-shrink: 0;
}

.artwork-placeholder {
    width: 160px;
    height: 160px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-technology);
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.episode-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.episode-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.episode-description {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.episode-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

.play-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-teal);
    color: var(--bg-primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-body);
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px var(--glow-teal);
}

.meta-divider {
    opacity: 0.5;
}

/* ===========================
   Articles Section
   =========================== */
.articles-section {
    background: var(--bg-primary);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
}

.article-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-science);
    box-shadow: 0 12px 40px rgba(0, 255, 163, 0.2);
}

.article-image {
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 200px;
    background: rgba(0, 255, 163, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-science);
    border-bottom: 1px solid var(--border-color);
}

.article-content {
    padding: var(--space-md);
}

.article-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.article-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===========================
   Footer Links
   =========================== */
.footer-links {
    position: relative;
    z-index: 2;
    padding: var(--space-lg) var(--space-md);
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.footer-links a {
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-technology);
}

.footer-divider {
    opacity: 0.5;
}

.copyright {
    color: var(--text-tertiary);
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .nav-pill {
        top: 16px;
        gap: 6px;
    }

    .pill-item {
        padding: 6px 14px;
        font-size: 12px;
    }

    .hero {
        padding: var(--space-lg) var(--space-sm);
    }

    .subscribe-form {
        flex-direction: column;
    }

    .join-btn {
        width: 100%;
    }

    .episode-card {
        flex-direction: column;
    }

    .artwork-placeholder {
        width: 100%;
        height: 200px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .category-tags {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 40px;
    }

    .section-title {
        font-size: 28px;
    }
}

/* ===========================
   Accessibility
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-technology);
    outline-offset: 2px;
}
