/* ============================================
   VOIDWARE LABS — Deep Space Journal
   2025-2026
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;0,6..72,800;1,6..72,400;1,6..72,500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Deep space navy palette */
    --bg-primary: #080c14;
    --bg-secondary: #0c1220;
    --bg-tertiary: #111827;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(12, 18, 32, 0.85);

    /* Warm amber accent */
    --accent: #d4a574;
    --accent-light: #e8c9a0;
    --accent-dark: #b8864e;
    --accent-muted: rgba(212, 165, 116, 0.1);

    /* Text — tinted toward blue-gray */
    --text-primary: #e8e6e3;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
    --text-faint: #4b5563;

    /* Borders — tinted navy */
    --border: rgba(148, 163, 184, 0.08);
    --border-light: rgba(148, 163, 184, 0.15);

    /* Semantic */
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;

    /* System */
    --transition: 0.2s ease;
    --radius: 6px;
    --radius-lg: 10px;

    /* Typography */
    --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--bg-primary); }

/* Skip to content */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius);
    z-index: 9999;
    text-decoration: none;
}
.skip-link:focus { top: var(--space-md); }

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 var(--space-xl);
    height: 56px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease;
}

.navbar.scrolled { background: rgba(8, 12, 20, 0.95); }

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: var(--space-xl);
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
}

.logo-icon { width: 22px; height: 22px; }

.logo span:last-child {
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: -0.01em;
    font-family: var(--font-display);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.nav-link {
    padding: 0.5rem 0.875rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: color 0.15s ease;
    white-space: nowrap;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.search-input {
    width: 180px;
    padding: 0.5rem 0.875rem;
    min-height: 36px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: var(--font-body);
    transition: var(--transition);
}

.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { outline: none; border-color: var(--accent); width: 220px; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    color: var(--text-primary);
    margin-left: auto;
    align-items: center;
    justify-content: center;
}

.nav-toggle svg { display: block; width: 18px; height: 18px; }

/* ============================================
   HERO — Editorial, left-aligned
   ============================================ */

.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 0 var(--space-xl);
    padding-top: 56px;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    max-width: 700px;
    padding: var(--space-3xl) 0;
    padding-left: 2rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.95;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.accent { color: var(--accent); }

.tagline {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: var(--space-2xl);
    padding-left: 2px;
}

.hero-stats {
    display: flex;
    gap: var(--space-2xl);
}

.stat { padding: 0; background: none; border: none; }
.stat:hover { transform: none; }

.stat-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.2rem;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Vertical accent line */
.hero::before {
    content: '';
    position: absolute;
    left: var(--space-xl);
    top: calc(56px + var(--space-2xl));
    bottom: var(--space-2xl);
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    opacity: 0.3;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    padding: 8rem var(--space-xl) var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-sm);
}

.page-header p {
    color: var(--text-tertiary);
    font-size: 0.9375rem;
}

.page-header::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent);
    margin-top: var(--space-lg);
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl) var(--space-2xl);
}

/* ============================================
   FILTERS / TAGS
   ============================================ */

.filters { margin-bottom: var(--space-lg); }

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.tag {
    padding: 0.4rem 0.75rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tag:hover { border-color: var(--border-light); color: var(--text-secondary); }
.tag.active { background: var(--accent); border-color: var(--accent); color: var(--bg-primary); }

/* ============================================
   CONTENT GRID — Bento with 1px gaps
   ============================================ */

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.content-grid .card:first-child { grid-column: span 2; }
.content-grid .card:nth-child(5n) { grid-column: span 2; }

/* ============================================
   CARDS
   ============================================ */

.card {
    position: relative;
    background: var(--bg-primary);
    border: none;
    border-radius: 0;
    padding: var(--space-lg);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease;
    overflow: hidden;
    min-height: 160px;
}

.card::before { display: none; }
.card:hover { background: var(--bg-tertiary); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.card-category {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.6875rem;
    padding: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.08em;
    background: none;
    border: none;
}

.card-category::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Category colors — warm-shifted for navy bg */
.card-category.blog { color: #7db4f5; }
.card-category.blog::before { background: #7db4f5; }
.card-category.wiki { color: #b49bfa; }
.card-category.wiki::before { background: #b49bfa; }
.card-category.research { color: var(--accent-light); }
.card-category.research::before { background: var(--accent-light); }
.card-category.projects { color: #fbbf24; }
.card-category.projects::before { background: #fbbf24; }
.card-category.designs { color: #f9a8d4; }
.card-category.designs::before { background: #f9a8d4; }
.card-category.code { color: #fca5a5; }
.card-category.code::before { background: #fca5a5; }

.card-priority {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.card-priority.priority-high { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.card-priority.priority-medium { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.card-priority.priority-low { background: rgba(255, 255, 255, 0.04); color: var(--text-tertiary); }

.card-title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    transition: color 0.15s ease;
}

.card:hover .card-title { color: var(--accent); }

.card-excerpt {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    line-height: 1.5;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.card-info { display: flex; align-items: center; gap: var(--space-sm); }
.card-tags { display: flex; gap: 0.3rem; }

.card-tag {
    padding: 0.15rem 0.5rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: var(--transition);
}

.card-tag:hover { color: var(--accent); border-color: var(--accent); }

.card-images-count {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.card-images-count::before { content: ''; display: none; }

.card-language {
    padding: 0.15rem 0.5rem;
    background: var(--accent-muted);
    border: none;
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
}

/* ============================================
   ARTICLE VIEW
   ============================================ */

.article-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 7rem 2rem var(--space-2xl);
}

.article-header {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.article-meta {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-lg);
}

.article-date { color: var(--text-tertiary); font-size: 0.875rem; }

.article-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: var(--space-lg);
}

.article-tags { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

/* Article content — the editorial heart */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: rgba(232, 230, 227, 0.88);
}

.article-content h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: var(--space-2xl) 0 var(--space-md);
    letter-spacing: -0.02em;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.article-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin: var(--space-xl) 0 0.75rem;
    color: var(--text-primary);
}

.article-content p { margin-bottom: 1.25rem; }

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(212, 165, 116, 0.3);
    transition: var(--transition);
}

.article-content a:hover { text-decoration-color: var(--accent); }

.article-content code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.article-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    margin: var(--space-lg) 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    font-size: 0.8125rem;
}

.article-content blockquote {
    border-left: 2px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: var(--space-lg) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content ul, .article-content ol { margin: 0.75rem 0 1.25rem 1.25rem; }
.article-content li { margin-bottom: 0.35rem; }

.article-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: var(--space-lg) 0;
    border: 1px solid var(--border);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-lg) 0;
    font-size: 0.875rem;
}

.article-content th, .article-content td {
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.article-content th { background: rgba(255, 255, 255, 0.03); font-weight: 600; }
.article-content hr { border: none; height: 1px; background: var(--border); margin: var(--space-xl) 0; }

/* ============================================
   COMMENTS
   ============================================ */

.comments-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.comments-section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: var(--space-lg);
}

.comment-form input,
.comment-form textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 0.875rem;
    min-height: 44px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder { color: var(--text-faint); }

.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--accent); }

.comment-form textarea { min-height: 100px; resize: vertical; }

.comment-form button {
    align-self: flex-start;
    background: var(--accent);
    border: none;
    padding: 0.65rem 1.5rem;
    min-height: 44px;
    border-radius: var(--radius);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form button:hover { background: var(--accent-light); }
.comment-form button:disabled { opacity: 0.4; cursor: not-allowed; }

.comments-list { display: flex; flex-direction: column; gap: 0.75rem; }

.comment {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.comment-author { font-weight: 600; color: var(--accent); font-size: 0.9375rem; }
.comment-date { font-size: 0.8125rem; color: var(--text-tertiary); }
.comment-body { color: var(--text-secondary); line-height: 1.5; font-size: 0.9375rem; white-space: pre-wrap; }
.no-comments, .comments-loading { text-align: center; padding: var(--space-lg); color: var(--text-tertiary); font-size: 0.875rem; }

/* ============================================
   FOOTER
   ============================================ */

footer {
    border-top: 1px solid var(--border);
    padding: var(--space-xl);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-brand img { width: 18px; height: 18px; opacity: 0.4; }
.footer-brand span { font-size: 0.8125rem; color: var(--text-tertiary); }

.footer-links { display: flex; gap: var(--space-lg); }

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

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

footer p { text-align: center; color: var(--text-tertiary); font-size: 0.8125rem; }

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
    color: var(--text-tertiary);
    grid-column: 1 / -1;
}

.empty-state-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.2; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.125rem; color: var(--text-secondary); margin-bottom: var(--space-xs); }

/* ============================================
   BACK BUTTON
   ============================================ */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    min-height: 44px;
    color: var(--text-tertiary);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    transition: var(--transition);
}

.btn-back:hover { color: var(--text-primary); border-color: var(--border-light); }

/* ============================================
   RESEARCH PAGE
   ============================================ */

.research-stats {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.research-stat-item { padding: 0; background: none; border: none; }

.research-stat-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.research-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.research-list { display: flex; flex-direction: column; gap: 0; }

.research-paper {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem 0;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.research-paper:first-child { border-top: 1px solid var(--border); }
.research-paper:hover { padding-left: 0.75rem; }

.research-paper-number {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.research-paper-content { flex-grow: 1; min-width: 0; }

.research-paper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.research-paper-date { font-size: 0.75rem; color: var(--text-tertiary); }
.research-paper-fields { display: flex; gap: 0.3rem; }

.research-field {
    padding: 0.2rem 0.5rem;
    color: var(--accent);
    border: 1px solid rgba(212, 165, 116, 0.2);
    border-radius: 3px;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.research-paper-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    transition: color 0.15s ease;
}

.research-paper:hover .research-paper-title { color: var(--accent); }

.research-paper-abstract {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.research-paper-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
}

.research-paper-authors { font-size: 0.75rem; color: var(--text-tertiary); }
.research-paper-link { color: var(--accent); font-size: 0.8125rem; font-weight: 600; }
.research-empty { text-align: center; padding: var(--space-xl); color: var(--text-tertiary); }
.research-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.2; }

/* ============================================
   PROJECTS PAGE
   ============================================ */

.projects-hero { margin-bottom: var(--space-lg); }

.featured-project {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.featured-project::before {
    content: 'FEATURED';
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.featured-project:hover { border-color: var(--accent); }

.featured-project h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.featured-project p { color: var(--text-tertiary); font-size: 0.9375rem; line-height: 1.6; max-width: 550px; }

.project-stats { display: flex; gap: var(--space-lg); margin-top: 1.25rem; }

.project-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-family: var(--font-mono);
}

.project-stat-icon { color: var(--accent); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.project-card {
    background: var(--bg-primary);
    padding: var(--space-lg);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: background 0.2s ease;
}

.project-card:hover { background: var(--bg-tertiary); }

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.project-icon { font-size: 1.5rem; }

.project-status {
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active { background: rgba(52, 211, 153, 0.12); color: var(--success); }
.status-development { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.status-planned { background: rgba(255, 255, 255, 0.04); color: var(--text-tertiary); }

.project-card h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    transition: color 0.15s ease;
}

.project-card:hover h3 { color: var(--accent); }
.project-card p { color: var(--text-tertiary); font-size: 0.875rem; line-height: 1.5; flex-grow: 1; }

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-md);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.project-tags { display: flex; gap: 0.3rem; }

.project-tag {
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.project-link { color: var(--accent); font-size: 0.8125rem; font-weight: 600; }
.no-projects { grid-column: 1 / -1; text-align: center; padding: var(--space-xl); color: var(--text-tertiary); }

/* ============================================
   WIKI PAGE
   ============================================ */

.wiki-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-lg);
    align-items: start;
}

.wiki-sidebar {
    border-right: 1px solid var(--border);
    padding-right: var(--space-lg);
    position: sticky;
    top: 80px;
}

.wiki-sidebar h3 {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.wiki-categories { list-style: none; margin-bottom: var(--space-lg); }
.wiki-categories li { margin-bottom: 0.15rem; }

.wiki-categories a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 0.4rem 0.5rem;
    min-height: 36px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}

.wiki-categories a:hover { color: var(--text-primary); }
.wiki-categories a.active { color: var(--accent); }
.wiki-categories .count { margin-left: auto; font-size: 0.6875rem; color: var(--text-tertiary); font-family: var(--font-mono); }

.alphabet-nav { display: flex; flex-wrap: wrap; gap: 1px; }

.alphabet-nav a {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.alphabet-nav a:hover { color: var(--text-primary); }
.alphabet-nav a.has-content { color: var(--accent); }

.wiki-content { min-height: 400px; }
.wiki-section { margin-bottom: var(--space-lg); }

.wiki-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
}

.wiki-section-letter {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--accent);
}

.wiki-section-title { font-size: 0.8125rem; color: var(--text-tertiary); }
.wiki-articles { display: flex; flex-direction: column; }

.wiki-article {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-bottom: 1px solid rgba(148, 163, 184, 0.04);
}

.wiki-article:hover { padding-left: 0.5rem; }
.wiki-article-icon { display: none; }
.wiki-article-content { flex-grow: 1; min-width: 0; }

.wiki-article-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: color 0.15s ease;
}

.wiki-article:hover .wiki-article-title { color: var(--accent); }

.wiki-article-desc {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wiki-article-arrow { color: var(--text-tertiary); font-size: 0.8125rem; transition: var(--transition); }
.wiki-article:hover .wiki-article-arrow { color: var(--accent); }
.wiki-empty { text-align: center; padding: var(--space-xl); color: var(--text-tertiary); }
.wiki-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.2; }

/* ============================================
   BLOG PAGE
   ============================================ */

.blog-featured { margin-bottom: var(--space-xl); }

.blog-featured-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: var(--transition);
    overflow: hidden;
}

.blog-featured-card:hover { border-color: var(--accent); }

.blog-featured-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.2rem 0.6rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 0 0 var(--radius) 0;
}

.blog-featured-content { flex-grow: 1; padding: var(--space-lg); }

.blog-featured-meta {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.blog-featured-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    transition: color 0.15s ease;
    letter-spacing: -0.02em;
}

.blog-featured-card:hover .blog-featured-title { color: var(--accent); }

.blog-featured-excerpt {
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.blog-featured-tags { display: flex; gap: 0.3rem; }

.blog-tag {
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.blog-featured-arrow {
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    border-left: 1px solid var(--border);
    color: var(--text-tertiary);
    font-size: 1.25rem;
    transition: var(--transition);
}

.blog-featured-card:hover .blog-featured-arrow { color: var(--accent); }

.blog-timeline {
    position: relative;
    padding-left: var(--space-lg);
    border-left: 1px solid var(--border);
}

.blog-timeline::before { display: none; }
.blog-timeline-section { margin-bottom: var(--space-lg); }

.blog-timeline-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.blog-timeline-dot {
    position: absolute;
    left: calc(-1.5rem - 3px);
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
}

.blog-timeline-period {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-tertiary);
}

.blog-timeline-posts { display: flex; flex-direction: column; }

.blog-post-card {
    display: flex;
    gap: var(--space-md);
    padding: 0.75rem 0;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-bottom: 1px solid rgba(148, 163, 184, 0.04);
}

.blog-post-card:hover { padding-left: 0.5rem; }

.blog-post-date {
    min-width: 28px;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

.blog-post-content { flex-grow: 1; min-width: 0; }

.blog-post-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    transition: color 0.15s ease;
}

.blog-post-card:hover .blog-post-title { color: var(--accent); }

.blog-post-excerpt {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.blog-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.blog-post-tags { display: flex; gap: 0.2rem; }

.blog-tag-sm {
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.625rem;
}

.blog-empty { text-align: center; padding: var(--space-xl); color: var(--text-tertiary); }
.blog-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.2; }

/* ============================================
   DESIGNS PAGE
   ============================================ */

.design-filters { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: var(--space-lg); }

.design-filter {
    padding: 0.4rem 0.75rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.design-filter:hover { border-color: var(--border-light); color: var(--text-secondary); }
.design-filter.active { background: var(--accent); border-color: var(--accent); color: var(--bg-primary); }

.design-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.design-card {
    background: var(--bg-primary);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.design-card:hover { background: var(--bg-tertiary); }

.design-card-preview {
    position: relative;
    height: 160px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.design-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.design-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.15;
}

.design-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 20, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.design-card:hover .design-card-overlay { opacity: 1; }

.design-card-view { color: var(--accent); font-size: 0.8125rem; font-weight: 600; }

.design-card-info { padding: var(--space-md); }

.design-card-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    transition: color 0.15s ease;
}

.design-card:hover .design-card-title { color: var(--accent); }

.design-card-desc {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.design-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
}

.design-card-count { color: var(--accent); }
.design-empty { grid-column: 1 / -1; text-align: center; padding: var(--space-xl); color: var(--text-tertiary); }
.design-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.2; }

/* ============================================
   CODE PAGE
   ============================================ */

.code-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.code-stat-total { display: flex; align-items: baseline; gap: var(--space-sm); }

.code-stat-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.code-stat-label { font-size: 0.8125rem; color: var(--text-tertiary); }
.code-stat-langs { display: flex; gap: var(--space-md); flex-wrap: wrap; }

.code-lang-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.code-lang-dot { width: 7px; height: 7px; border-radius: 50%; }
.code-lang-count { opacity: 0.4; }
.code-list { display: flex; flex-direction: column; }

.code-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 0.875rem 0;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.code-item:first-child { border-top: 1px solid var(--border); }
.code-item:hover { padding-left: 0.5rem; }

.code-item-icon { font-size: 1.25rem; }
.code-file-icon { display: block; }
.code-item-content { flex-grow: 1; min-width: 0; }
.code-item-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 0.15rem; }

.code-item-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.code-item:hover .code-item-title { color: var(--accent); }

.code-item-lang {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--border);
    font-family: var(--font-mono);
}

.code-item-desc {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.code-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.code-item-tags { display: flex; gap: 0.2rem; }

.code-tag {
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    font-size: 0.625rem;
    font-family: var(--font-mono);
}

.code-item-arrow { color: var(--text-tertiary); font-size: 0.875rem; transition: var(--transition); }
.code-item:hover .code-item-arrow { color: var(--accent); }
.code-empty { text-align: center; padding: var(--space-xl); color: var(--text-tertiary); }
.code-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.2; }

/* ============================================
   ABOUT PAGE
   ============================================ */

.about-content { max-width: 700px; }

.about-section { margin-bottom: var(--space-xl); }

.about-section h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.about-section h2::before { display: none; }
.about-section p { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.7; }

/* ============================================
   MODS BANNER
   ============================================ */

.mods-banner {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem var(--space-lg);
    margin-bottom: var(--space-lg);
}

.mods-banner-content { display: flex; align-items: center; gap: var(--space-md); }
.mods-banner-icon { font-size: 1.5rem; }
.mods-banner-text p { color: var(--text-tertiary); font-size: 0.875rem; margin-bottom: 0.15rem; }

.mods-banner-link {
    color: var(--accent);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.mods-banner-link:hover { text-decoration: underline; }

/* ============================================
   TEAM PAGE
   ============================================ */

.team-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    text-align: center;
    transition: var(--transition);
}

.team-card:hover { border-color: var(--accent); }
.team-card::before { display: none; }

.team-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-display);
}

.team-name { font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; margin-bottom: 0.15rem; }

.team-role { color: var(--text-tertiary); font-size: 0.8125rem; margin-bottom: var(--space-md); }

.team-links { display: flex; gap: 0.4rem; justify-content: center; }

.team-link {
    padding: 0.4rem 0.75rem;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: var(--transition);
}

.team-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================
   ANALYTICS PAGE
   ============================================ */

.analytics-controls { margin-bottom: var(--space-lg); }

.period-selector {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.2rem;
    width: fit-content;
}

.period-btn {
    padding: 0.5rem 1rem;
    min-height: 36px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.period-btn:hover { color: var(--text-secondary); }
.period-btn.active { background: var(--accent); color: var(--bg-primary); }

.analytics-stats {
    display: flex;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.analytics-stat-card {
    flex: 1;
    background: var(--bg-primary);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.analytics-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.analytics-stat-num {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.analytics-card {
    background: var(--bg-primary);
    padding: var(--space-lg);
    transition: opacity 0.2s ease;
}

.analytics-card.loading { opacity: 0.4; }

.analytics-card h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.analytics-card-body { display: flex; flex-direction: column; gap: var(--space-sm); }

.analytics-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.analytics-row-label {
    min-width: 120px;
    max-width: 180px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-row-bar-wrap {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.analytics-row-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.analytics-row-bar.referrer { background: #7db4f5; }
.analytics-row-bar.country { background: #b49bfa; }

.analytics-row-value {
    min-width: 40px;
    text-align: right;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
}

.analytics-empty {
    text-align: center;
    padding: var(--space-lg);
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.1s; }
.reveal-delay-3 { transition-delay: 0.15s; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .navbar { padding: 0 var(--space-lg); }
    .hero { padding-left: var(--space-lg); padding-right: var(--space-lg); }
    .hero::before { left: var(--space-lg); }
    .page-header { padding-left: var(--space-lg); padding-right: var(--space-lg); }
    .container { padding-left: var(--space-lg); padding-right: var(--space-lg); }
    .content-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid .card:first-child,
    .content-grid .card:nth-child(5n) { grid-column: span 2; }
    .wiki-layout { grid-template-columns: 1fr; }
    .wiki-sidebar { position: static; border-right: none; padding-right: 0; border-bottom: 1px solid var(--border); padding-bottom: var(--space-lg); }
    footer { padding-left: var(--space-lg); padding-right: var(--space-lg); }
}

@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; gap: var(--space-sm); height: auto; padding: 0.75rem var(--space-md); }
    .nav-toggle { display: flex; }
    .nav-links { display: none; width: 100%; flex-wrap: wrap; order: 3; gap: 0.15rem; }
    .nav-links.open { display: flex; }
    .nav-actions { order: 2; }
    .search-input { width: 120px; }
    .search-input:focus { width: 150px; }

    .hero { min-height: 60vh; padding: 6rem var(--space-md) var(--space-lg); }
    .hero::before { left: var(--space-md); }
    .hero-content { padding-left: var(--space-lg); }
    .hero h1 { font-size: 2.5rem; }
    .hero-stats { gap: var(--space-lg); }
    .stat-num { font-size: 1.75rem; }

    .page-header { padding: 7rem var(--space-md) var(--space-lg); }
    .page-header h1 { font-size: 2rem; }
    .container { padding: 0 var(--space-md) var(--space-xl); }

    .content-grid { grid-template-columns: 1fr; }
    .content-grid .card:first-child,
    .content-grid .card:nth-child(5n) { grid-column: span 1; }

    .blog-featured-card { flex-direction: column; }
    .blog-featured-arrow { display: none; }
    .research-stats { gap: var(--space-lg); }
    .projects-grid, .design-gallery { grid-template-columns: 1fr; }
    .code-stats { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
    .footer-content { flex-direction: column; gap: var(--space-md); }
    .analytics-stats { flex-direction: column; }
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-row-label { min-width: 80px; max-width: 120px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .page-header h1 { font-size: 1.5rem; }
    .hero-stats { flex-direction: column; gap: var(--space-md); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
    .reveal { opacity: 1; transform: none; }
    html { scroll-behavior: auto; }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.2); }

/* ============================================
   LOADING SKELETON
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

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

.skeleton-card {
    background: var(--bg-primary);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.skeleton-line { height: 14px; border-radius: 3px; }
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long { width: 100%; }
.skeleton-title { height: 20px; width: 80%; border-radius: 3px; }

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success { border-color: rgba(52, 211, 153, 0.3); }
.toast-error { border-color: rgba(248, 113, 113, 0.3); color: var(--error); }

/* ============================================
   CHARACTER COUNTER
   ============================================ */

.char-counter {
    font-size: 0.75rem;
    color: var(--text-faint);
    text-align: right;
    display: block;
    margin-top: -0.5rem;
}

.char-counter.near-limit { color: var(--warning); }
.char-counter.at-limit { color: var(--error); }

/* ============================================
   READING TIME
   ============================================ */

.article-read-time {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.article-read-time::before {
    content: '·';
    margin: 0 0.5rem;
}

/* ============================================
   BACK TO TOP
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, color 0.15s ease, border-color 0.15s ease;
    z-index: 100;
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ============================================
   LIGHT THEME
   ============================================ */

[data-theme="light"] {
    --bg-primary: #f8f7f4;
    --bg-secondary: #efede8;
    --bg-tertiary: #e8e5df;
    --bg-card: rgba(0, 0, 0, 0.02);
    --bg-card-hover: rgba(0, 0, 0, 0.04);
    --bg-glass: rgba(248, 247, 244, 0.9);
    --accent: #9a6b3a;
    --accent-light: #b8864e;
    --accent-dark: #7a5229;
    --accent-muted: rgba(154, 107, 58, 0.1);
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-tertiary: #777777;
    --text-faint: #999999;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .card-category.blog { color: #2563eb; }
[data-theme="light"] .card-category.blog::before { background: #2563eb; }
[data-theme="light"] .card-category.wiki { color: #7c3aed; }
[data-theme="light"] .card-category.wiki::before { background: #7c3aed; }
[data-theme="light"] .card-category.research { color: var(--accent); }
[data-theme="light"] .card-category.research::before { background: var(--accent); }
[data-theme="light"] .card-category.projects { color: #b45309; }
[data-theme="light"] .card-category.projects::before { background: #b45309; }
[data-theme="light"] .card-category.designs { color: #db2777; }
[data-theme="light"] .card-category.designs::before { background: #db2777; }
[data-theme="light"] .card-category.code { color: #dc2626; }
[data-theme="light"] .card-category.code::before { background: #dc2626; }

[data-theme="light"] .analytics-row-bar.referrer { background: #2563eb; }
[data-theme="light"] .analytics-row-bar.country { background: #7c3aed; }

/* Light mode — code blocks & syntax highlighting */
[data-theme="light"] .article-content code {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

[data-theme="light"] .article-content pre {
    background: #f0ede8;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .article-content pre code {
    color: #1a1a1a;
}

/* Override highlight.js github-dark for light mode */
[data-theme="light"] .hljs {
    background: #f0ede8 !important;
    color: #24292e !important;
}

[data-theme="light"] .hljs-keyword,
[data-theme="light"] .hljs-selector-tag,
[data-theme="light"] .hljs-literal,
[data-theme="light"] .hljs-section,
[data-theme="light"] .hljs-link { color: #d73a49 !important; }

[data-theme="light"] .hljs-string,
[data-theme="light"] .hljs-title,
[data-theme="light"] .hljs-name,
[data-theme="light"] .hljs-type,
[data-theme="light"] .hljs-attribute,
[data-theme="light"] .hljs-symbol,
[data-theme="light"] .hljs-bullet,
[data-theme="light"] .hljs-addition,
[data-theme="light"] .hljs-variable,
[data-theme="light"] .hljs-template-tag,
[data-theme="light"] .hljs-template-variable { color: #032f62 !important; }

[data-theme="light"] .hljs-comment,
[data-theme="light"] .hljs-quote,
[data-theme="light"] .hljs-deletion,
[data-theme="light"] .hljs-meta { color: #6a737d !important; }

[data-theme="light"] .hljs-number,
[data-theme="light"] .hljs-regexp,
[data-theme="light"] .hljs-literal,
[data-theme="light"] .hljs-built_in,
[data-theme="light"] .hljs-params { color: #005cc5 !important; }

[data-theme="light"] .hljs-function { color: #6f42c1 !important; }

/* Light mode — form inputs */
[data-theme="light"] .search-input,
[data-theme="light"] .comment-form input,
[data-theme="light"] .comment-form textarea {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

/* Light mode — table headers */
[data-theme="light"] .article-content th {
    background: rgba(0, 0, 0, 0.04);
}

/* Light mode — blockquote */
[data-theme="light"] .article-content blockquote {
    border-left-color: var(--accent);
    background: rgba(0, 0, 0, 0.02);
}

/* Light mode — priority badges */
[data-theme="light"] .card-priority.priority-high { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
[data-theme="light"] .card-priority.priority-medium { background: rgba(217, 119, 6, 0.1); color: #b45309; }
[data-theme="light"] .card-priority.priority-low { background: rgba(0, 0, 0, 0.04); color: var(--text-tertiary); }

/* Light mode — status badges */
[data-theme="light"] .status-active { background: rgba(5, 150, 105, 0.1); color: #059669; }
[data-theme="light"] .status-development { background: rgba(217, 119, 6, 0.1); color: #b45309; }
[data-theme="light"] .status-planned { background: rgba(0, 0, 0, 0.04); }

/* Light mode — period selector & analytics */
[data-theme="light"] .period-selector { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .analytics-row-bar-wrap { background: rgba(0, 0, 0, 0.06); }

/* Light mode — card language badge */
[data-theme="light"] .card-language { background: rgba(154, 107, 58, 0.1); }

/* Light mode — research field badge */
[data-theme="light"] .research-field { border-color: rgba(154, 107, 58, 0.25); }

/* Light mode — selection */
[data-theme="light"] ::selection { background: var(--accent); color: #fff; }

/* Light mode — scrollbar */
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.2); }

/* Light mode — skeleton loading */
[data-theme="light"] .skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
}

/* Light mode — toast */
[data-theme="light"] .toast { background: #fff; border-color: var(--border-light); }
[data-theme="light"] .toast-error { color: #dc2626; }

/* Light mode — search highlight */
[data-theme="light"] mark.search-highlight { background: rgba(154, 107, 58, 0.15); color: #7a5229; }

/* Light mode — article content text */
[data-theme="light"] .article-content { color: rgba(26, 26, 26, 0.88); }
[data-theme="light"] .article-content h2,
[data-theme="light"] .article-content h3 { color: #1a1a1a; }

/* Light mode — navbar glass */
[data-theme="light"] .navbar { background: rgba(248, 247, 244, 0.9); }
[data-theme="light"] .navbar.scrolled { background: rgba(248, 247, 244, 0.97); }

/* Light mode — design card overlay */
[data-theme="light"] .design-card-overlay { background: rgba(248, 247, 244, 0.8); }

/* Light mode — back-to-top & buttons */
[data-theme="light"] .back-to-top { background: #fff; }
[data-theme="light"] .comment-form button { color: #fff; }
[data-theme="light"] .period-btn.active { color: #fff; }
[data-theme="light"] .tag.active { color: #fff; }
[data-theme="light"] .design-filter.active { color: #fff; }
[data-theme="light"] .featured-project::before { color: #fff; }
[data-theme="light"] .blog-featured-badge { color: #fff; }
[data-theme="light"] .skip-link { color: #fff; }

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.4rem;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.15s ease, border-color 0.15s ease;
    margin-left: var(--space-sm);
    font-size: 1rem;
    line-height: 1;
}

.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================
   PAGE TRANSITION
   ============================================ */

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

main, .article-container {
    animation: page-fade-in 0.4s ease both;
}

@media (prefers-reduced-motion: reduce) {
    main, .article-container { animation: none; }
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */

.toc {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: var(--space-md);
    border-left: 1px solid var(--border);
    padding-left: var(--space-md);
}

.toc-title {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    display: block;
    padding: 0.3rem 0;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.8125rem;
    line-height: 1.4;
    transition: color 0.15s ease;
    border-left: 2px solid transparent;
    padding-left: var(--space-sm);
    margin-left: -1px;
}

.toc-link:hover { color: var(--text-primary); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); }
.toc-link[data-level="3"] { padding-left: var(--space-lg); font-size: 0.75rem; }

/* Article layout with TOC */
.article-with-toc {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: var(--space-xl);
    max-width: 960px;
    margin: 0 auto;
    padding: 7rem 2rem var(--space-2xl);
    align-items: start;
}

.article-with-toc .article-main { min-width: 0; }

@media (max-width: 900px) {
    .article-with-toc { grid-template-columns: 1fr; }
    .toc { display: none; }
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent);
    z-index: 1001;
    transition: width 0.1s linear;
}

/* ============================================
   SHARE BUTTONS
   ============================================ */

.share-buttons {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}

.share-label {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-right: var(--space-xs);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: none;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.share-btn:hover { color: var(--accent); border-color: var(--accent); }

/* ============================================
   SEARCH HIGHLIGHT
   ============================================ */

mark.search-highlight {
    background: var(--accent-muted);
    color: var(--accent);
    padding: 0.05em 0.15em;
    border-radius: 2px;
}

/* ============================================
   KEYBOARD SHORTCUT HINT
   ============================================ */

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-hint {
    position: absolute;
    right: 0.5rem;
    font-size: 0.625rem;
    color: var(--text-faint);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    pointer-events: none;
    font-family: var(--font-mono);
    line-height: 1.4;
}

.search-input:focus ~ .search-hint { display: none; }
