/* 
   MacTechBuds Design System
   Theme: Deep Mint & Obsidian (Dark) / Clean Emerald (Light)
   Status: Stable & Compact
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* DARK MODE (Default) */
    --primary-accent: #00ffa3;
    /* Neon Mint */
    --primary-accent-rgb: 0, 255, 163;

    --bg-main: #02040a;
    /* Obsidian */
    --bg-gradient: radial-gradient(circle at 60% 0%, #1e293b 0%, #02040a 70%);

    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(2, 4, 10, 0.9);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Layout */
    --radius-lg: 12px;
    /* Reduced radius for compact feel */
    --header-height: 60px;
    /* More compact header */
    --glass-blur: 16px;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    /* LIGHT MODE (High Contrast) */
    --primary-accent: #008a5e;
    /* Deep Emerald (Darker for readability) */
    --primary-accent-rgb: 0, 138, 94;

    --bg-main: #f5f5f7;
    /* Soft Off-White/Grey */
    --bg-gradient: linear-gradient(180deg, #eef2f6 0%, #f5f5f7 100%);

    --glass-bg: #ffffff;
    /* Solid/High opacity for clean look */
    --glass-border: #d1d5db;
    /* Slate 300 - Slightly darker border for contrast */
    --header-bg: rgba(245, 245, 247, 0.95);

    --text-primary: #0f172a;
    /* Slate 900 - Very Dark */
    --text-secondary: #334155;
    /* Slate 700 */
    --text-muted: #64748b;

    --glass-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-main);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

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

.logo img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 24px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    /* Dark in light mode */
}

/* Header Buttons */
.header-actions {
    display: flex;
    gap: 8px;
}

/* Dedicated Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(125, 125, 125, 0.1);
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}

/* --- Mobile Nav Fix --- */
@media (max-width: 900px) {
    .nav-menu {
        display: none;
    }
}

/* --- Hero --- */
.hero {
    padding-top: calc(var(--header-height) + 40px);
    padding-bottom: 40px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    /* Smaller, cleaner */
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

[data-theme="dark"] .hero h1 {
    background: linear-gradient(135deg, #fff 30%, var(--primary-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* --- Compact Cards / Tiles --- */
.glass-panel,
.download-item,
.glass-element {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    /* Reduced padding for 'small tile' feel */
    margin-bottom: 16px;
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    will-change: transform;
}

.glass-panel:hover,
.download-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-accent);
}

.card-title,
.download-title {
    font-size: 1.1rem;
    /* Smaller headers */
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-desc,
.download-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.card-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(var(--primary-accent-rgb), 0.1);
    color: var(--primary-accent);
    display: inline-block;
    margin-bottom: 10px;
}

/* --- Grids (Compact) --- */
.grid-2,
.grid-cols-2 {
    display: grid;
    /* Allow smaller columns -> more tiles per row */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.grid-3,
.grid-cols-3,
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* Very compact */
    gap: 16px;
}

@media (max-width: 600px) {

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

/* --- Buttons --- */
.btn,
.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background: rgba(0, 255, 163, 0.15);
    /* Tinted glass */
    color: var(--primary-accent);
    border: 1px solid rgba(0, 255, 163, 0.3);
}

.btn-primary:hover {
    background: rgba(0, 255, 163, 0.25);
    box-shadow: 0 0 20px rgba(0, 255, 163, 0.2);
    transform: translateY(-2px);
}

.btn-glass,
.download-button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-glass:hover,
.download-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* Light Mode Overrides */
[data-theme="light"] .btn-glass,
[data-theme="light"] .download-button {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-glass:hover {
    background: rgba(0, 0, 0, 0.06);
    border-color: var(--text-primary);
}

/* --- Hyperlinks --- */
a {
    color: inherit;
    text-decoration: none;
}

p a,
.article-content a {
    color: var(--primary-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

p a:hover {
    color: var(--text-primary);
}


/* macOS Version List Styles */
.download-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.download-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    padding: 2px 6px;
    background: rgba(125, 125, 125, 0.1);
    border-radius: 4px;
    color: var(--text-secondary);
}

.download-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.download-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

/* Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 16px;
    padding: 0 4px;
}

.section-header span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-toggle:hover {
    background: rgba(var(--primary-accent-rgb), 0.1);
    color: var(--primary-accent);
}

.section-content {
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.section-content.collapsed {
    display: none;
}

/* Small Box Grid for Downloads */
.small-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.small-tile {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    /* Slightly rounder for icon-box feel */
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    aspect-ratio: 1 / 1;
    /* Make them square-ish */
    justify-content: center;
}

.small-tile:hover {
    transform: translateY(-4px);
    border-color: var(--primary-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: var(--bg-card);
}

.small-tile i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--primary-accent);
}

.small-tile .tile-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.small-tile .tile-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(125, 125, 125, 0.1);
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-links a {
    margin: 0 10px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

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

/* --- Terminal Loader Overlay --- */
#terminal-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #02040a;
    z-index: 9999;
    padding: 40px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: #f8fafc;
    overflow: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

#terminal-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.terminal-line {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 4px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.terminal-line.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.term-cyan {
    color: #00d4ff;
}

.term-green {
    color: #4af626;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2rem;
    background: var(--primary-accent);
    margin-left: 4px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    #terminal-loader {
        padding: 20px;
    }

    .terminal-line {
        font-size: 0.85rem;
    }
}
/* Revert complete: layout logic restored */
/* Revert complete: layout logic restored */