/* Pi Lab — Homelab Affiliate Site
   Minimal, fast, readability-first */

:root {
    --bg: #0a0e14;
    --bg-card: #111820;
    --bg-hover: #182030;
    --text: #c8d0dc;
    --text-muted: #7a8394;
    --accent: #58a6ff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;
    --border: #1e2a3a;
    --radius: 12px;
    --max-w: 960px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

/* Navigation */
.nav {
    border-bottom: 1px solid var(--border);
    background: rgba(10, 14, 20, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 24px;
    overflow-x: auto;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

/* Hero */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Sections */
section { margin-bottom: 60px; }

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text);
}

.section-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.section-note a { color: var(--accent); }

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: background 0.2s, transform 0.2s;
}

.card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.card-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
}

.card h3 a {
    color: var(--text);
    text-decoration: none;
}

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

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-meta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Product cards */
.card-product .card-category {
    color: var(--accent-orange);
    background: rgba(210, 153, 34, 0.1);
}

/* Article list */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.list-item:hover { background: var(--bg-card); }

.list-title {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

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

.list-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 16px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 60px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-brand strong { color: var(--accent); }

.footer-brand p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

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

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Article page */
.article-page { padding: 40px 0; }

.article-page article {
    max-width: 720px;
    margin: 0 auto;
}

.article-page h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 10px;
}

.article-page .article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.article-page h2 {
    font-size: 1.4rem;
    margin-top: 40px;
    margin-bottom: 16px;
}

.article-page h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 12px;
}

.article-page p {
    margin-bottom: 16px;
}

.article-page ul, .article-page ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-page li { margin-bottom: 8px; }

.article-page a { color: var(--accent); }

.article-page blockquote {
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--bg-card);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-muted);
}

.article-page code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
}

.article-page pre {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.article-page pre code {
    background: none;
    padding: 0;
}

.article-page .affiliate-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 24px 0;
    display: flex;
    gap: 16px;
    align-items: center;
}

.article-page .affiliate-box .btn {
    display: inline-block;
    background: var(--accent-green);
    color: #000;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.article-page .affiliate-box .btn:hover { opacity: 0.9; }

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 2rem; }
    .nav-links { gap: 14px; }
    .card-grid { grid-template-columns: 1fr; }
    .list-item { flex-direction: column; align-items: flex-start; gap: 4px; }
    .list-date { margin-left: 0; }
}
