/* =========================================
   1. VARIABLES & THEME
   ========================================= */
:root {
    /* Brand */
    --accent: #ff570d;
    --accent-hover: #e04800;
    --accent-glass: rgba(255, 87, 13, 0.15);
    --accent-glow: rgba(255, 87, 13, 0.3);
    
    /* Light Mode */
    --bg-body: #fafafa;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #f4f4f5;
    --text-main: #18181b;
    --text-muted: #71717a;
    --border-color: rgba(0, 0, 0, 0.08);
    --code-bg: #f4f4f5;
    
    /* Navigation */
    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-border: rgba(0, 0, 0, 0.05);
    --nav-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --container-width: 64rem;
    --header-height: 4rem;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;

    /* Fonts */
    --font-title: "DM Serif Display", serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "SF Mono", "Fira Code", monospace;
}

html.dark {
    /* Dark Mode */
    --bg-body: #050505;
    --bg-surface: #121212;
    --bg-surface-secondary: #18181b;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --border-color: rgba(255, 255, 255, 0.1);
    --code-bg: #18181b;
    --nav-bg: rgba(18, 18, 18, 0.85);
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. RESET & LAYOUT UTILITIES
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;

}
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    background-color: var(--bg-body); color: var(--text-main); font-family: var(--font-body);
    line-height: 1.6; transition: background-color 0.3s ease, color 0.3s ease; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* Helpers */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.hidden { display: none !important; }
.text-accent { color: var(--accent); -webkit-text-fill-color: var(--accent);}
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.pt-32 {
    padding-top: 10rem;

}
.pb-12 {
    padding-bottom: 1rem;

}

/* Grids */
.grid {
    display: grid;
    gap: 1.25rem;

}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

/* Responsive */
.hidden-sm { display: none !important; }
.mobile-only { display: block; }

@media (min-width: 768px) {
    .hidden-sm { display: flex !important; }
    .mobile-only { display: none !important; }
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    
    }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================
   3. NAVIGATION & HEADER
   ========================================= */
.header-wrapper {
    position: fixed; top: 1.5rem; left: 0; right: 0;
    display: flex; justify-content: center; z-index: 100;
    pointer-events: none;
}

.nav-island {
    pointer-events: auto; display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem; border-radius: var(--radius-full);
    background-color: var(--nav-bg); border: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow); backdrop-filter: blur(12px) saturate(180%);
}

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
    padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500;
    color: var(--text-main); border-radius: var(--radius-full);
    transition: background 0.2s, color 0.2s;
}
.nav-link:hover { background-color: var(--bg-surface-secondary); color: var(--text-main); }

.nav-divider { width: 1px; height: 1.5rem; background-color: var(--border-color); margin: 0 0.5rem; }
.nav-actions { display: flex; align-items: center; gap: 0.25rem; }

.icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    color: var(--text-muted); transition: all 0.2s;
}
.icon-btn:hover { background-color: var(--bg-surface-secondary); color: var(--text-main); }

.sponsor-heart { color: #ef4444; transition-duration: .5s; }
.sponsor-heart:hover { background-color: rgba(238, 68, 68, 0.95); color: #fff; }

/* Logo */
.logo-btn { display: flex; align-items: center; justify-content: center; padding-right: 0.5rem; }
.logo-circle {
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    background-color: var(--accent); color: white;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-weight: 700; font-size: 1.4rem;
    letter-spacing: -2px; transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 10px var(--accent-glow);
}
.logo-btn:hover .logo-circle { transform: scale(1.1); background-color: var(--text-main); color: var(--bg-body); }
.mgks-logo {
    fill: var(--bg-body);

}

/* Theme Toggle */
.theme-btn {
    display: flex; align-items: center; justify-content: center;
    width: 2.5rem; height: 2.5rem; border-radius: 50%;
    color: var(--text-muted); transition: all 0.2s;
}
.theme-btn:hover { background-color: var(--bg-surface-secondary); color: var(--text-main); }
html.dark .sun-icon { display: none; }
html.dark .moon-icon { display: block; }
html:not(.dark) .sun-icon { display: block; }
html:not(.dark) .moon-icon { display: none; }

/* Mobile Menu */
.mobile-drawer {
    pointer-events: auto; position: fixed; top: 5.5rem; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 300px; background-color: var(--nav-bg);
    border: 1px solid var(--nav-border); border-radius: var(--radius-lg);
    backdrop-filter: blur(12px) saturate(180%); box-shadow: var(--nav-shadow);
    padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 99;
}
.mobile-link {
    text-align: center; padding: 0.75rem; font-weight: 500;
    border-radius: 0.5rem; color: var(--text-main); transition: background 0.2s;
}
.mobile-link:hover { background-color: var(--bg-surface-secondary); }
.mobile-sm { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; border-top: 1px solid var(--border-color); padding-top: 1rem; }

/* =========================================
   4. HOMEPAGE & HERO
   ========================================= */
.hero {
    min-height: 80vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    padding-top: 8rem; position: relative;
}

.mascot-wrapper {
    position: relative;
    margin-bottom: 2.5rem;
    cursor: pointer;

}
.mascot-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12rem;
    height: 12rem;
    opacity: 0.1;
    background: var(--accent);
    border-radius: 50%;
    transition: opacity 0.5s;
    pointer-events: none;

}
.mascot-wrapper:hover .mascot-glow {
    opacity: .5;

}
.mascot-img {
    width: 9rem; position: relative; z-index: 2;
    transition: filter 0.5s, transform 0.5s;
}
.dark .mascot-img {
    filter: invert(1);

}
.mascot-wrapper:hover .mascot-img {
    transform: translateY(-20px);

}

@media (min-width: 768px) { .mascot-img { width: 11rem; } }

.hero-title {
    font-family: var(--font-title); font-size: 3.5rem; line-height: 1;
    margin-bottom: 1.5rem; font-weight: 700; color: var(--text-main);
}
.hero-subtitle {
    background: linear-gradient(90deg, #9ca3af, #4b5563);
    background-clip: text;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
html.dark .hero-subtitle { background: linear-gradient(90deg, #9ca3af, #d1d5db); background-clip: text;-webkit-background-clip: text; }
@media (min-width: 768px) { .hero-title { font-size: 5.5rem; } }

.hero-desc {
    font-size: 1.25rem; color: var(--text-muted);
    max-width: 42rem; margin: 0 auto 3rem auto;
}
.hero-desc strong { color: var(--text-main); font-weight: 600; }

/* Tech Stack */
.tech-stack {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem;
    opacity: 0.6; transition: opacity 0.3s; filter: grayscale(100%);
}
.tech-stack:hover { opacity: 1; filter: grayscale(0%); }
.tech-icon { width: 2.5rem; height: 2.5rem; color: var(--text-muted); transition: transform 0.2s; }
.tech-icon:hover { transform: scale(1.1); }

/* Highlight Card */
.highlight-section { padding: 5rem 0; position: relative; }
.highlight-glow {
    position: absolute; inset: 0; background: var(--accent); opacity: 0.1;
    filter: blur(80px); border-radius: 50%; pointer-events: none;
}
.highlight-card {
    position: relative; background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-radius: 2rem; padding: 3rem; display: flex; flex-direction: column; gap: 2rem;
    transition: border-color 0.3s;
}
html.dark .highlight-card { background-color: rgba(18, 18, 18, 0.5); }
.highlight-card:hover { border-color: var(--accent-glow); }
@media (min-width: 768px) { .highlight-card { flex-direction: row; align-items: center; } }

.highlight-content { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.highlight-content .hero-desc { margin: 0; font-size: 1.1rem; max-width: none; }
.highlight-label {
    font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--accent); display: flex; align-items: center; gap: 0.5rem;
}
.pulse-dot { width: 0.5rem; height: 0.5rem; background-color: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
.highlight-title { font-family: var(--font-title); font-size: 2.5rem; line-height: 1.1; margin: 0.5rem 0; }
.highlight-link {
    font-weight: 700; font-size: 0.9rem; border-bottom: 2px solid var(--accent);
    padding-bottom: 0.2rem; align-self: flex-start; margin-top: 1rem;
}
.highlight-image-wrap { flex: 1; max-width: 400px; }
.highlight-image {
    border-radius: 1rem; box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
    transform: rotate(2deg); transition: transform 0.5s ease; border: 1px solid var(--border-color);
}
.highlight-card:hover .highlight-image { transform: rotate(0deg) scale(1.02); }

@keyframes pulse {
    0% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 87, 13, 0.4); }
    70% { opacity: 0.7; box-shadow: 0 0 0 10px rgba(255, 87, 13, 0); }
    100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 87, 13, 0); }
}

/* =========================================
   5. BLOG & CARDS
   ========================================= */
.section-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 2rem; border-bottom: 1px solid var(--border-color); padding-bottom: 1rem;
}
.section-title { font-family: var(--font-title); font-size: 2.5rem; }
.section-link { font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); }

.blog-card {
    display: block; border-radius: var(--radius-lg); overflow: hidden;
    background-color: var(--bg-surface); border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--nav-shadow); border-color: var(--accent-glow); }

.card-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background-color: var(--bg-surface-secondary); }
.card-cover img {
    width: 100%; height: 100%; object-fit: cover;
    filter: grayscale(100%); transition: filter 0.3s, transform 0.5s;
}
.blog-card:hover .card-cover img { filter: grayscale(0%); transform: scale(1.05); }

.date-badge {
    position: absolute; top: 1rem; left: 1rem;
    background: var(--nav-bg); padding: 0.25rem 0.75rem; border-radius: 99px;
    font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
    backdrop-filter: blur(4px); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card-title { font-family: var(--font-title); font-size: 1.5rem; line-height: 1.2; transition: color 0.2s; }
.blog-card:hover .card-title { color: var(--accent); }
.card-desc {
    font-size: 0.95rem; color: var(--text-muted); line-height: 1.5;
    display: -webkit-box;line-clamp: 2; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Archive List */
/* Archive List */
.archive-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }

.archive-item {
    display: flex;
    flex-direction: column; /* Mobile Default: Stacked */
    gap: 0.5rem;            /* Smaller gap on mobile */
    padding: 1.25rem;       /* Slightly larger touch target */
    border-radius: var(--radius-md);
    transition: 0.2s;
    border-bottom: 1px solid var(--border-color); /* Separator for mobile readability */
}

/* Remove border from last item */
.archive-item:last-child { border-bottom: none; }

.archive-item:hover { background-color: var(--bg-surface-secondary); border-color: transparent; }

.archive-date {
    font-family: var(--font-mono);
    font-size: 0.75rem; /* Smaller date on mobile */
    color: var(--text-muted);
    opacity: 0.8;
}

.archive-content h3 {
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.2s;
    line-height: 1.3;
}

.archive-item:hover h3 { color: var(--accent); }

/* Desktop Overrides */
@media (min-width: 768px) {
    .archive-item {
        flex-direction: row; /* Switch to side-by-side */
        align-items: baseline;
        gap: 2rem;
        padding: 1rem;
        border-bottom: none; /* No separators needed on desktop hover style */
    }

    .archive-date {
        font-size: 0.85rem;
        min-width: 8rem; /* Fixed width column for date */
        text-align: right; /* Clean alignment */
    }
}

/* =========================================
   6. PROJECTS PAGE
   ========================================= */
.filter-bar {
    /* position: sticky; */
    top: 5rem;
    z-index: 40;
    padding: 1rem 0;
    background-color: var(--bg-body);
    /* border-bottom: 1px solid var(--border-color); */
    margin-bottom: 4rem;

}
.filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.filter-btn {
    padding: 0.5rem 1.25rem; border-radius: 99px; font-family: var(--font-mono); font-size: 0.8rem;
    border: 1px solid var(--border-color); color: var(--text-muted);
    transition: all 0.2s; background: var(--bg-surface);
}
.filter-btn:hover, .filter-btn.active { border-color: var(--accent); background-color: var(--accent); color: white; }

.project-section { padding-bottom: 4rem; }
.project-section-title {
    font-family: var(--font-mono); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--text-muted); border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem; margin-bottom: 3rem;
}

/* App Cards */
.app-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;

}
.app-card:hover { border-color: var(--accent-hover); transform: translateY(-5px); box-shadow: var(--nav-shadow); }
.app-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; }
.app-logo-box {
    width: 4rem; height: 4rem; border-radius: 1rem;
    background-color: var(--bg-surface-secondary); border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
    color: var(--accent); transition: transform 0.3s;
}
.app-card:hover .app-logo-box { transform: scale(1.05); }
.app-logo-box img { width: 100%; height: 100%; object-fit: cover; }
.app-logo-box svg { width: 2rem; height: 2rem; }
.app-title { font-family: var(--font-title); font-size: 1.75rem; margin-bottom: 0.75rem; line-height: 1.2; }
.app-desc { color: var(--text-muted); margin-bottom: 2rem; flex: 1; font-size: 1rem; line-height: 1.6; }
.dark .app-logo-box svg, .dark .lib-icon svg{fill:#ffffff}

/* Library Cards */
.lib-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all 0.2s ease;
    height: 100%;

}
.lib-card:hover { border-color: var(--accent); background-color: var(--bg-surface-secondary); transform: translateY(-3px); }
.lib-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.lib-icon {
    flex-shrink: 0; width: 2.5rem; height: 2.5rem; display: flex; align-items: center; justify-content: center;
    background-color: var(--bg-surface-secondary); border-radius: 0.5rem; color: var(--text-main);
}
.lib-card:hover .lib-icon { background-color: var(--bg-surface); color: var(--accent); }
.lib-title { font-family: var(--font-title); font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.lib-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; flex: 1; }

.tag-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; }
.tag-pill {
    font-family: var(--font-mono); font-size: 0.7rem; padding: 0.25rem 0.6rem;
    border: 1px solid var(--border-color); border-radius: 0.5rem; color: var(--text-muted);
}
.project-card.hidden { display: none; }

/* =========================================
   7. ARTICLE PROSE & UTILS
   ========================================= */
.article-header {
    min-height: 50vh; display: flex; flex-direction: column; justify-content: flex-end;
    position: relative; padding-bottom: 4rem; overflow: hidden; text-align: center;
}
.article-container {
    margin-top: 7rem;
}
.article-cover-box {
    width: 100%;
}

.article-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 25px;
}

.article-container .article-container-header {
    margin: 1.5em;
    text-align: center;
}
.article-container .article-container-header .font-title{
    font-size: 3rem;
    line-height: 1.25;
    margin: 1rem 0;
    color: var(--text-main);

}

/* Feature Hero Text Padding Fix */
.hero-content-box {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(18, 18, 18, 0.99), rgba(7, 7, 7, 0.81) 36.97%, rgba(51, 51, 51, 0.18) 68.91%);
    color: #ffffff;
    padding: 2.5rem; /* Consistent padding */
    display: flex; flex-direction: column; justify-content: flex-end;
}

/* Related Posts Card (Sub-feature style) */
.related-card {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 1.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    transition: all 0.2s ease;
}
.related-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.4; z-index: -1; }
.header-overlay {
    position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-body) 0%, transparent 100%); z-index: 0;
}
.header-content { position: relative; z-index: 1; max-width: 50rem; margin: 0 auto; }
.article-title { font-family: var(--font-title); font-size: 3rem; line-height: 1.1; margin: 1rem 0; }
.article-meta { font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }

.prose { max-width: 42rem; margin: 0 auto; padding: 2rem 0; font-size: 1.125rem; word-break: break-word; }
.prose h1, .prose h2, .prose h3 {
    font-family: var(--font-title); color: var(--text-main); margin-top: 2.5rem; margin-bottom: 1rem;
}
.prose h2 { font-size: 2rem; } .prose h3 { font-size: 1.5rem; }
.prose p { margin-bottom: 1.5rem; color: var(--text-main); line-height: 1.7; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.5rem; }
.prose blockquote {
    border-left: 4px solid var(--accent); padding-left: 1.5rem; margin: 2rem 0; font-style: italic; color: var(--text-muted);
}
.prose img { border-radius: 1rem; margin: 2rem 0; box-shadow: var(--nav-shadow); }
.prose pre {
    background-color: var(--code-bg); padding: 1.5rem; border-radius: 1rem;
    overflow-x: auto; margin: 2rem 0; border: 1px solid var(--border-color); position: relative;
}
.prose code {
    font-family: var(--font-mono); font-size: 0.9em; background-color: var(--code-bg); padding: 0.2em 0.4em; border-radius: 0.3em;
}
.prose pre code { background: none; padding: 0; color: inherit; }

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    z-index: 20;
    cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

.pagination {
    display: flex; justify-content: space-between; align-items: center;
    padding: 2rem 0; border-top: 1px solid var(--border-color); margin-top: 4rem;
}
.page-btn {
    padding: 0.75rem 1.5rem; border: 1px solid var(--border-color); border-radius: 99px;
    font-family: var(--font-mono); font-size: 0.9rem; transition: all 0.2s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }

.about-avatar { text-align: center; margin-bottom: 2rem; }
.about-avatar img {
    width: 15rem; height: 15rem; border-radius: 50%; object-fit: cover;
    margin: 2rem auto; border: 5px solid var(--bg-surface); box-shadow: var(--nav-shadow);
}

/* FEATURED GRID LAYOUT (Left Hero, Right Stack) */
.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Feature Hero Card (Left Side) */
.feat-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 400px;
    border: 1px solid var(--border-color);
    background-color: #121212;
}

/* Feature Sub Cards (Right Side) */
.feat-sub {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    padding: 1.5rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}
.feat-sub:hover {
    border-color: var(--accent);
    transform: translateX(5px);
}

@media (min-width: 1024px) {
    .featured-grid {
        grid-template-columns: 1.6fr 1fr; /* Left is wider */
        grid-template-rows: 1fr 1fr;      /* Two rows of equal height */
        height: 600px;                    /* Fixed height container for alignment */
    }
    .feat-hero {
        grid-row: 1 / 3; /* Spans both rows */
        height: 100%;
    }
}

/* Consistent Page Headers */
.page-hero {
    padding-top: 8rem;
    padding-bottom: 4rem;
    text-align: center;
}
.page-hero h1 { font-size: 4rem; margin-bottom: 1rem; color: var(--text-main); }
.page-hero p { font-size: 1.2rem; color: var(--text-muted); max-width: 30rem; margin: 0 auto; }

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    margin-top: 6rem; padding: 3rem 0; border-top: 1px solid var(--border-color);
    text-align: center; color: var(--text-muted); font-size: 0.9rem;
}
.footer-links { margin-top: 1rem; display: flex; justify-content: center; gap: 1rem; }
.footer-links a:hover { color: var(--accent); }
hr {
    border: 1px solid var(--border-color);
    border-top: 0;

}

/* UTILITY: Hidden Tags Animation */
#hidden-tags {
    transition: opacity 0.3s ease;
}
#hidden-tags.hidden {
    display: none;
}

/* =========================================
   TAG TOGGLE BUTTON (Custom Style)
   ========================================= */
.tag-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    border: 1px solid var(--border-color); /* Match default border */
    color: var(--accent); /* Text is accent */
    background-color: transparent;
    transition: all 0.2s;
    cursor: pointer;
    min-width: 4rem; /* Prevent layout shift when text changes */
}

.tag-toggle-btn:hover {
    background-color: var(--bg-surface-secondary);
    border-color: var(--accent);
}

/* =========================================
   TABLE STYLING (Breakout & Scroll)
   ========================================= */
.prose table {
    display: block;
    width: 100%;
    margin: 3rem 0; /* More vertical space */
    border-collapse: separate; /* Allows border-radius */
    border-spacing: 0;
    overflow-x: auto;
    white-space: nowrap;
    
    /* Visuals */
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--nav-shadow); /* Highlight effect */
}

.prose thead {
    background-color: var(--bg-surface-secondary);
}

.prose th {
    text-align: left;
    font-weight: 700;
    color: var(--text-main);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-title);
    letter-spacing: 0.02em;
}

.prose td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.prose tr:last-child td { border-bottom: none; }
.prose tr:hover td { background-color: var(--bg-surface-secondary); color: var(--text-main); }

@media (min-width: 1024px) {
    .prose table {
        width: fit-content;
        max-width: var(--container-width);
        margin-left: 50%;
        transform: translateX(-50%);
    }
}