/* 
 * DESIGN SYSTEM: Minimalist Tech / Terminal Style
 * Target: High Readability, Fast Load, Bing Friendly
 */

:root {
    /* Colors - Dark Mode (Default) */
    --bg: #050505;
    --bg-card: #0a0a0a;
    --bg-hover: #111111;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --accent: #ff7a00;
    --accent-dim: rgba(255, 122, 0, 0.1);
    --border: #222222;
    --border-hover: #333333;
    --error: #ff4444;
    --header-bg: rgba(5, 5, 5, 0.9);
    
    /* Typography */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    
    /* Spacing */
    --container-width: 1100px;
    --header-height: 70px;
    --radius: 4px;
}

/* Light Theme */
[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-card: #ffffff;
    --bg-hover: #eeeeee;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --accent: #cc6200;
    --accent-dim: rgba(204, 98, 0, 0.1);
    --border: #dddddd;
    --border-hover: #bbbbbb;
    --error: #cc0000;
    --header-bg: rgba(245, 245, 245, 0.95);
}

/* Top Bar for Links */
.top-bar {
    background: #000000;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
.top-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.top-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: 0.2s;
}
.top-link:hover {
    color: #ffffff;
    text-decoration: underline;
}
.separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .top-bar-inner {
        gap: 10px;
        font-size: 0.8rem;
    }
}

/* Featured Link Block */
.featured-link-box {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.featured-link-box a {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: block;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}
.featured-link-box a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
h1 { font-size: 2.5rem; line-height: 1.1; }
h2 { font-size: 1.8rem; margin-top: 2rem; border-left: 3px solid var(--accent); padding-left: 1rem; }
h3 { font-size: 1.4rem; color: var(--accent); }
p { margin-bottom: 1.2rem; color: #cccccc; }
a { color: var(--accent); text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: underline; opacity: 0.9; }

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

/* Theme Toggle & Search */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
}
.theme-toggle, .search-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius);
    transition: 0.2s;
    line-height: 1;
}
.theme-toggle:hover, .search-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}
[data-theme="light"] .theme-toggle .dark-icon { display: none; }
[data-theme="light"] .theme-toggle .light-icon { display: inline; }
[data-theme="dark"] .theme-toggle .dark-icon { display: inline; }
[data-theme="dark"] .theme-toggle .light-icon { display: none; }

/* Search Bar */
.search-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
}
.search-overlay.open { display: flex; }
.search-overlay .search-box {
    width: 100%;
    max-width: 600px;
    margin: 0 20px;
}
.search-overlay input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-size: 1.3rem;
    font-family: var(--font-mono);
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--text-main);
    border-radius: var(--radius);
    outline: none;
}
.search-overlay input::placeholder { color: var(--text-muted); }
.search-overlay .search-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}
.search-overlay .search-close:hover { color: var(--accent); }
.search-overlay .search-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo {
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 0.05em;
}
.logo span { color: var(--accent); }

/* Navigation */
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); text-decoration: none; }

/* Mobile Menu */
.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* Cards & Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin: 3rem 0; }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius);
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}
.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 122, 0, 0.05);
}
.card-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}
.card h3 { margin-top: 0; font-size: 1.2rem; }

/* Terminal Elements */
.terminal-box {
    background: #000;
    border: 1px solid var(--border);
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent);
    margin: 2rem 0;
    border-radius: var(--radius);
}
.terminal-box::before { content: "$ "; opacity: 0.5; }


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

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: var(--header-height); left: 0; width: 100%; background: var(--bg); flex-direction: column; padding: 2rem; border-bottom: 1px solid var(--border); }
    .nav-links.open { display: flex; }
    .menu-toggle { display: block; }
    h1 { font-size: 2rem; }
}
