* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-dark: #0a0a0a;
    --bg-card: #111111;
    --bg-input: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --border: #27272a;
    --accent: #3b82f6;
    --danger: #ef4444;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background-color: var(--bg-dark);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Bottom gradient transition */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, transparent 0%, rgba(10, 10, 10, 0.7) 50%, var(--bg-dark) 100%);
    z-index: 5;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 24px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 1;
}

.nav {
    position: relative;
    z-index: 10;
    padding: 24px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    user-select: none;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.title-line {
    font-size: clamp(48px, 10vw, 120px);
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1s ease-out;
}

.title-sub {
    font-size: clamp(20px, 4vw, 48px);
    font-weight: 300;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-desc {
    margin-top: 24px;
    font-size: 18px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 4px;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.scroll-hint {
    position: absolute;
    bottom: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    letter-spacing: 2px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) rotate(45deg);
    }
    40% {
        transform: translateY(-10px) rotate(45deg);
    }
    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

/* ===== BLOG SECTION ===== */
.blog {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

.blog-header {
    text-align: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.blog-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.blog-header h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

.blog-header p {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ===== CATEGORY FILTER ===== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    opacity: 0;
    transform: translateY(10px);
}

.category-tag.revealed {
    opacity: 1;
    transform: translateY(0);
}

.category-tag:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.category-tag.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.category-tag .tag-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
}

.category-tag.active .tag-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== LOADING STATE ===== */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== POSTS ===== */
.posts {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Posts Grid (3x2 layout on main page) */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: opacity 0.3s ease;
}

.posts-grid.switching {
    opacity: 0;
}

.posts-grid .post {
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 420px;
}

.posts-grid .post .post-image {
    margin: 0;
    height: 180px;
    flex-shrink: 0;
    overflow: hidden;
}

.posts-grid .post .post-image img {
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.posts-grid .post:hover .post-image img {
    transform: scale(1.05);
}

.posts-grid .post .post-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.posts-grid .post .post-content {
    flex: 1;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.posts-grid .post .post-title {
    margin-bottom: 6px;
    font-size: 16px;
}

.posts-grid .post .post-title a {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.posts-grid .post .post-actions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.posts-grid .post .view-all-btn {
    margin-bottom: 0;
    margin-top: auto;
}

.posts-grid .post .post-file {
    margin-bottom: 8px;
}

.posts-grid .post .comments-section {
    display: none !important;
}

/* View More Button */
.view-more-wrap {
    text-align: center;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.view-more-wrap.visible {
    opacity: 1;
    transform: translateY(0);
}

.view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    text-decoration: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.view-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.view-more-btn svg {
    transition: transform 0.3s ease;
}

.view-more-btn:hover svg {
    transform: translateX(4px);
}

.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* Staggered scroll reveal */
.post-scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.post-scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    font-size: 15px;
}

.post-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.post-category {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 10px;
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle;
}

/* Post Title */
.post-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.post-title a:hover {
    color: var(--accent);
}

.post-content {
    font-size: 15px;
    line-height: 1.7;
    word-break: break-word;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
    display: block;
}

.post-content.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.view-all-btn {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 4px;
    margin-bottom: 16px;
    text-decoration: none;
    transition: color 0.2s;
}

.view-all-btn:hover {
    color: #60a5fa;
}

.post-image {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.post-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.post-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.post-file:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.download-badge {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

.post-file:hover .download-badge {
    background: #60a5fa;
}

/* ===== POST ACTIONS ===== */
.post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.like-btn, .comment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.like-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.like-btn.liked {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.like-btn .heart {
    font-size: 16px;
    transition: transform 0.2s;
}

.like-btn:active .heart {
    transform: scale(1.3);
}

.comment-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.action-count {
    font-weight: 500;
}

/* ===== COMMENTS SECTION ===== */
.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: none;
}

.comments-section.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.comments-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-form-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.comment-form-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-name-input {
    width: 200px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.comment-name-input:focus {
    border-color: var(--primary);
}

.comment-input-wrapper {
    display: flex;
    gap: 10px;
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    transition: border-color 0.2s;
}

.comment-input:focus {
    border-color: var(--primary);
}

.comment-submit {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.comment-submit:hover {
    background: var(--primary-hover);
}

.comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Comment List */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-size: 14px;
    font-weight: 600;
}

.comment-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d8;
    word-break: break-word;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 15px;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.lightbox.show {
    display: flex;
    animation: fadeIn 0.25s ease-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-body {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.lightbox-body:active {
    cursor: grabbing;
}

.lightbox-body img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.2s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-controls {
    position: absolute;
    bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 100px;
    backdrop-filter: blur(10px);
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.lightbox-zoom-level {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    min-width: 50px;
    text-align: center;
}

/* Clickable image cursor */
.clickable-image {
    cursor: pointer;
    transition: opacity 0.2s;
}

.clickable-image:hover {
    opacity: 0.9;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav {
        padding: 16px 24px;
    }

    .logo {
        font-size: 22px;
    }

    .hero {
        background-attachment: scroll;
    }

    .blog {
        padding: 48px 16px 80px;
    }

    .post {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .post-actions {
        flex-wrap: wrap;
    }

    .like-btn, .comment-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-form-avatar {
        display: none;
    }

    .comment-input-wrapper {
        flex-direction: column;
    }

    .comment-name-input {
        width: 100%;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}
