:root {
    --space-dark: #0a0a1a;
    --space-deep: #0d0d25;
    --space-card: #121230;
    --space-border: #1a1a45;
    --nebulous-purple: #8b5cf6;
    --nebulous-blue: #3b82f6;
    --nebulous-pink: #ec4899;
    --nebulous-cyan: #06b6d4;
    --star-white: #ffffff;
    --star-muted: #a0a0c0;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--space-dark);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 350px 60px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 420px 200px, rgba(255,255,255,0.8), transparent);
    background-repeat: repeat;
    background-size: 500px 250px;
    animation: twinkle 8s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -2;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(180deg, rgba(10, 10, 26, 0.98) 0%, rgba(10, 10, 26, 0.85) 100%);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--nebulous-purple) 0%, var(--nebulous-blue) 50%, var(--nebulous-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 3px;
    position: relative;
}

.logo::after {
    content: '✦';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nebulous-cyan);
    animation: pulse-star 2s ease-in-out infinite;
}

@keyframes pulse-star {
    0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.2); }
}

nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--nebulous-purple);
    background: rgba(139, 92, 246, 0.1);
}

nav a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5px;
    width: 4px;
    height: 4px;
    background: var(--nebulous-cyan);
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.3s ease;
}

nav a:hover::before {
    transform: translateY(-50%) scale(1);
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(18, 18, 48, 0.8);
    border-radius: 10px;
    padding: 8px 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    outline: none;
    width: 180px;
    font-size: 0.95rem;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-box button {
    background: linear-gradient(135deg, var(--nebulous-purple) 0%, var(--nebulous-blue) 100%);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.hero {
    padding: 100px 20px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-tag {
    display: inline-block;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: var(--nebulous-cyan);
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 25px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    letter-spacing: 2px;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 900;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--star-white) 0%, var(--nebulous-purple) 40%, var(--nebulous-blue) 70%, var(--nebulous-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    animation: cosmic-glow 4s ease-in-out infinite;
}

@keyframes cosmic-glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3)); }
    50% { filter: drop-shadow(0 0 35px rgba(139, 92, 246, 0.5)); }
}

.hero p {
    font-size: 1.3rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.8;
}

.hero-orb {
    position: absolute;
    top: 20%;
    right: 10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: float-orb 8s ease-in-out infinite;
}

.hero-orb::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
    border-radius: 50%;
}

@keyframes float-orb {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.hero-orb-2 {
    position: absolute;
    bottom: 20%;
    left: 5%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    animation: float-orb 6s ease-in-out infinite reverse;
}

main {
    padding: 50px 0;
}

.section-title {
    font-size: 2.3rem;
    margin-bottom: 35px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 30px;
    background: linear-gradient(180deg, var(--nebulous-purple) 0%, var(--nebulous-blue) 100%);
    border-radius: 2px;
}

.section-title::after {
    content: '◈';
    color: var(--nebulous-pink);
    font-size: 1.2rem;
    animation: spin-icon 10s linear infinite;
}

@keyframes spin-icon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
    margin-bottom: 60px;
}

.article-card {
    background: var(--space-card);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--space-border);
    transition: all 0.4s ease;
    position: relative;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--nebulous-purple) 0%, var(--nebulous-blue) 50%, var(--nebulous-cyan) 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card:hover {
    border-color: var(--nebulous-purple);
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(139, 92, 246, 0.15),
        0 0 0 1px rgba(139, 92, 246, 0.2);
}

.article-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(0deg, var(--space-card) 0%, transparent 100%);
}

.article-header {
    padding: 25px;
    position: relative;
}

.article-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.15);
    color: var(--nebulous-purple);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.featured-tag {
    background: rgba(236, 72, 153, 0.15);
    color: var(--nebulous-pink);
    border-color: rgba(236, 72, 153, 0.3);
}

.article-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 12px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.article-title:hover {
    color: var(--nebulous-cyan);
}

.article-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.article-body {
    padding: 0 25px 25px;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--nebulous-blue);
    padding: 12px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.article-link:hover {
    background: linear-gradient(135deg, var(--nebulous-purple) 0%, var(--nebulous-blue) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.article-link::after {
    content: '→';
    transition: transform 0.3s ease;
}

.article-link:hover::after {
    transform: translateX(5px);
}

.featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.featured-card {
    border-color: rgba(236, 72, 153, 0.2);
}

.featured-card:hover {
    border-color: var(--nebulous-pink);
    box-shadow: 
        0 25px 50px rgba(236, 72, 153, 0.15),
        0 0 0 1px rgba(236, 72, 153, 0.2);
}

.featured-image {
    height: 260px;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(18, 18, 48, 0.3) 0%, rgba(18, 18, 48, 0.9) 100%);
}

.featured-link {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--nebulous-pink);
    border-color: rgba(236, 72, 153, 0.3);
}

.featured-link:hover {
    background: linear-gradient(135deg, var(--nebulous-pink) 0%, var(--nebulous-purple) 100%);
}

footer {
    background: linear-gradient(180deg, var(--space-card) 0%, var(--space-dark) 100%);
    padding: 60px 20px;
    margin-top: 50px;
    border-top: 1px solid var(--space-border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    color: var(--text-primary);
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--nebulous-purple);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h3::before {
    content: '✧';
    color: var(--nebulous-cyan);
}

.footer-section p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.7;
}

.footer-section a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    padding: 5px 0;
}

.footer-section a:hover {
    color: var(--nebulous-cyan);
    padding-left: 8px;
}

.footer-section a::before {
    content: '›';
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-section a:hover::before {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--space-border);
    position: relative;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer-constellation {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
}

.footer-constellation span {
    width: 6px;
    height: 6px;
    background: var(--nebulous-cyan);
    border-radius: 50%;
    animation: twinkle-individual 3s ease-in-out infinite;
}

.footer-constellation span:nth-child(2) { animation-delay: 0.5s; }
.footer-constellation span:nth-child(3) { animation-delay: 1s; }
.footer-constellation span:nth-child(4) { animation-delay: 1.5s; }

@keyframes twinkle-individual {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

.article-detail {
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--nebulous-blue);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-link:hover {
    gap: 15px;
}

.article-detail-container {
    background: var(--space-card);
    border-radius: 25px;
    padding: 40px;
    border: 1px solid var(--space-border);
}

.article-detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.article-detail-meta {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--space-border);
}

.article-detail-meta p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.8;
}

.article-detail-image {
    margin-bottom: 35px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.article-detail-image img {
    width: 100%;
    height: 450px;
    object-fit: cover;
}

.article-detail-content {
    color: var(--text-primary);
    font-size: 1.15rem;
    line-height: 1.9;
}

.article-detail-content p {
    margin-bottom: 25px;
}

.article-detail-content p:first-child::first-letter {
    font-size: 3rem;
    font-weight: 800;
    color: var(--nebulous-purple);
    float: left;
    margin-right: 15px;
    margin-top: 5px;
    line-height: 1;
}

.related-articles-section {
    margin-top: 50px;
}

.search-results {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.search-header {
    margin-bottom: 45px;
}

.search-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.search-header strong {
    color: var(--nebulous-purple);
}

.search-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    background: var(--space-card);
    border-radius: 25px;
    border: 1px solid var(--space-border);
}

.no-results h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.no-results a {
    display: inline-block;
    background: linear-gradient(135deg, var(--nebulous-purple) 0%, var(--nebulous-blue) 100%);
    color: white;
    padding: 14px 35px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
    transition: transform 0.3s ease;
}

.no-results a:hover {
    transform: translateY(-3px);
}

.page-content {
    max-width: 900px;
    margin: 50px auto;
    padding: 0 20px;
}

.page-content h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 25px;
}

.page-content h2 {
    font-size: 1.6rem;
    color: var(--nebulous-purple);
    margin: 35px 0 18px;
    padding-top: 20px;
    border-top: 1px solid var(--space-border);
}

.page-content h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin: 25px 0 12px;
}

.page-content p {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 20px;
}

.page-content ul {
    margin-left: 30px;
    margin-bottom: 20px;
}

.page-content li {
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .articles-grid, .featured-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .article-detail-title {
        font-size: 2rem;
    }

    .article-detail-image img {
        height: 300px;
    }

    nav {
        gap: 10px;
    }

    .search-box input {
        width: 140px;
    }

    .article-detail-container {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        margin-bottom: 15px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .article-detail-title {
        font-size: 1.7rem;
    }

    .article-detail-image img {
        height: 250px;
    }
}