/* ===== CSS Variables ===== */
:root {
    --bg: #0A0A0B;
    --bg-elevated: #18181B;
    --bg-card: #1C1C1F;
    --bg-hover: #27272A;
    --text: #FAFAFA;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --border: #27272A;
    --primary: #6366F1;
    --primary-hover: #818CF8;
    --primary-dark: #4F46E5;
    --success: #22C55E;
    --warning: #EAB308;
    --danger: #EF4444;
    --gradient-1: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-2: linear-gradient(135deg, #EC4899 0%, #F59E0B 100%);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

img { max-width: 100%; display: block; }

button { cursor: pointer; border: none; background: none; font: inherit; }

input, textarea { font: inherit; }

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

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

.header.scrolled {
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.nav { display: flex; align-items: center; gap: 0.5rem; }

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover { color: var(--text); background: var(--bg-hover); }

.nav-link.active { color: var(--text); }

.btn-nav {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.btn-nav:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 0.5rem;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 0 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 4rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-elevated);
    border-color: var(--text-muted);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.stat-item { text-align: center; }

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-muted), transparent);
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* ===== Sections ===== */
section { padding: 6rem 0; }

.section-header {
    margin-bottom: 3rem;
}

.section-tag {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
}

/* ===== Featured ===== */
.featured-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: var(--transition);
}

.featured-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}

.featured-img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
    width: fit-content;
}

.featured-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.featured-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.dot { opacity: 0.5; }

.featured-link {
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.featured-link:hover { color: var(--primary-hover); }

/* ===== Articles Grid ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.article-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.article-image {
    aspect-ratio: 16/10;
    background: var(--bg-card);
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.article-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
}

.article-content { padding: 1.5rem; }

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.article-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Skeleton ===== */
.skeleton-card { background: var(--bg-elevated); border-radius: var(--radius-lg); overflow: hidden; }

.skeleton-image {
    aspect-ratio: 16/10;
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content { padding: 1.5rem; }

.skeleton-line {
    height: 14px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    animation: shimmer 1.5s infinite;
}

.skeleton-line.short { width: 60%; }

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

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.6rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Categories ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.category-card {
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.category-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Newsletter ===== */
.newsletter-card {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.newsletter-icon { font-size: 3rem; margin-bottom: 1rem; }

.newsletter-card h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }

.newsletter-card p { color: var(--text-secondary); margin-bottom: 2rem; }

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 0.9rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.newsletter-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* ===== Products ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.product-card {
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.product-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-card);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.product-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-link {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== About ===== */
.about-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

.about-avatar {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.about-info h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

.about-info p { color: var(--text-secondary); margin-bottom: 1rem; }

.about-social { display: flex; gap: 0.75rem; }

.about-social a {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.about-social a:hover { background: var(--primary); }

/* ===== Footer ===== */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand p { color: var(--text-muted); margin-top: 0.75rem; }

.footer-links h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; color: var(--text-secondary); }

.footer-links a {
    display: block;
    color: var(--text-muted);
    padding: 0.4rem 0;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .articles-grid, .categories-grid, .products-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .featured-card { grid-template-columns: 1fr; }
    .featured-image { max-height: 300px; }
}

@media (max-width: 768px) {
    .nav { display: none; }
    .mobile-toggle { display: flex; }
    .nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-elevated);
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .hero-stats { gap: 2rem; }
    .stat-number { font-size: 1.5rem; }
    .articles-grid, .categories-grid, .products-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-card { flex-direction: column; text-align: center; }
    .newsletter-form { flex-direction: column; }
    .hero-actions { flex-direction: column; }
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
