/* ═══════════════════════════════════════
   VNTBLACK — Dark Science Theme
   ═══════════════════════════════════════ */

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

:root {
    --bg: #050505;
    --bg-card: #0c0c0c;
    --bg-card-hover: #111111;
    --border: #1a1a1a;
    --border-hover: #2a2a2a;
    --text: #e0e0e0;
    --text-dim: #777;
    --accent: #00d4ff;
    --accent-purple: #a855f7;
    --accent-amber: #f59e0b;
    --accent-green: #10b981;
    --glow: rgba(0, 212, 255, 0.15);
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

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

/* ═══ Navigation ═══ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(5, 5, 5, 0.8);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    font-size: 20px;
    color: var(--accent);
    filter: drop-shadow(0 0 6px var(--glow));
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: var(--mono);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: var(--accent);
}

/* ═══ Hero ═══ */
.hero {
    position: relative;
    z-index: 1;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 160px 24px 80px;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(transparent, var(--bg));
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
}

.hero-tag {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-title {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 24px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.4s;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-purple), var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease infinite;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-dim);
    max-width: 560px;
    margin: 0 auto 48px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-topics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 0.8s;
}

.hero-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid color-mix(in srgb, var(--badge-color) 30%, transparent);
    border-radius: 100px;
    background: color-mix(in srgb, var(--badge-color) 8%, transparent);
    color: var(--badge-color);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}

.hero-badge svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.hero-badge:hover {
    background: color-mix(in srgb, var(--badge-color) 16%, transparent);
    border-color: color-mix(in srgb, var(--badge-color) 50%, transparent);
    transform: translateY(-2px);
}

/* ═══ Sections ═══ */
.section {
    position: relative;
    z-index: 1;
    padding: 100px 0;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.section-sub {
    text-align: center;
    color: var(--text-dim);
    font-size: 16px;
    margin-bottom: 56px;
}

/* ═══ Topics Grid ═══ */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: all 0.3s ease;
    cursor: default;
}

.topic-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.topic-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    color: attr(data-color);
}

.topic-card:nth-child(1) .topic-icon { color: var(--accent); }
.topic-card:nth-child(2) .topic-icon { color: var(--accent-purple); }
.topic-card:nth-child(3) .topic-icon { color: var(--accent-amber); }
.topic-card:nth-child(4) .topic-icon { color: var(--accent-green); }

.topic-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.topic-card p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 16px;
}

.topic-tag {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
    opacity: 0.6;
}

/* ═══ News Grid ═══ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.news-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.news-card.featured {
    grid-column: 1 / -1;
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.news-img {
    background-size: cover;
    background-position: center;
    min-height: 250px;
}

.news-body {
    padding: 28px;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.news-category {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cat-color, var(--accent));
    background: color-mix(in srgb, var(--cat-color, var(--accent)) 12%, transparent);
    padding: 4px 10px;
    border-radius: 4px;
}

.news-meta time {
    font-size: 12px;
    color: var(--text-dim);
}

.news-card h3 {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
}

.news-card.featured h3 {
    font-size: 22px;
}

.news-card p {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 16px;
}

.news-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.news-link:hover {
    opacity: 0.7;
}

/* ═══ Resources ═══ */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.resource-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
}

.resource-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.resource-letter {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--mono);
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent);
    border-radius: 10px;
    flex-shrink: 0;
}

.resource-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.resource-card p {
    font-size: 13px;
    color: var(--text-dim);
}

.resource-arrow {
    margin-left: auto;
    font-size: 18px;
    color: var(--text-dim);
    transition: transform 0.2s, color 0.2s;
}

.resource-card:hover .resource-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

/* ═══ News source label ═══ */
.news-source {
    font-size: 11px;
    color: var(--text-dim);
    opacity: 0.55;
    font-family: var(--mono);
    letter-spacing: 0.5px;
}

/* ═══ News error ═══ */
.news-error {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    padding: 40px;
}

/* ═══ Skeleton loading ═══ */
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.skel-line {
    border-radius: 4px;
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s ease infinite;
    margin-bottom: 10px;
}

.skel-block {
    min-height: 250px;
    border-radius: 0;
    background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
    background-size: 600px 100%;
    animation: shimmer 1.4s ease infinite;
}

.skel-tag  { height: 20px; width: 70px; margin-bottom: 14px; }
.skel-h    { height: 18px; width: 100%; }
.skel-h.short { width: 75%; }
.skel-p    { height: 13px; width: 100%; }
.skel-p.short { width: 60%; }

.news-card.skeleton { pointer-events: none; }
.news-card.skeleton.visible { opacity: 1; transform: none; }

/* ═══ Footer ═══ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 48px 0;
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-text {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-copy {
    color: var(--text-dim);
    font-size: 12px;
    opacity: 0.5;
}

/* ═══ Animations ═══ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

/* Scroll reveal */
.topic-card,
.news-card,
.resource-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.topic-card.visible,
.news-card.visible,
.resource-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        padding: 100px 20px 60px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-desc {
        font-size: 16px;
    }

    .hero-topics {
        gap: 8px;
    }

    .hero-badge {
        font-size: 12px;
        padding: 8px 14px;
    }

    .section {
        padding: 60px 0;
    }

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

    .news-grid,
    .resources-grid {
        grid-template-columns: 1fr;
    }

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

    .resource-card:hover {
        transform: none;
    }
}

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

    .news-card h3 {
        font-size: 15px;
    }
}
