/* LocalAI Guide — Design System */
/* Niche site for running LLMs locally — emerald/teal accent palette */

/* ─── CSS Variables ─── */
:root {
    --bg-primary: #050508;
    --bg-secondary: #080810;
    --bg-elevated: #0d0d18;
    --bg-card: rgba(13, 13, 24, 0.78);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.13);
    --text-primary: #f0f0f5;
    --text-secondary: #9494a8;
    --text-tertiary: #60607a;
    --accent: #10b981;
    --accent-light: #34d399;
    --accent-glow: rgba(16, 185, 129, 0.12);
    --accent-glow-strong: rgba(16, 185, 129, 0.25);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.12);
    --amber: #f59e0b;
    --amber-glow: rgba(245, 158, 11, 0.15);
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-text: linear-gradient(135deg, #34d399 0%, #06b6d4 50%, #34d399 100%);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
    --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.38), 0 0 0 1px var(--border-hover);
}

/* ─── Reset ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.mono { font-family: 'JetBrains Mono', monospace; }

/* ─── Layout ─── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}
.container-narrow {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 32px;
}

/* ─── Navigation ─── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 14px 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    background: rgba(5, 5, 8, 0.75);
    border-bottom: 1px solid transparent;
}
nav.scrolled {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 5, 8, 0.92);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
nav .container { display: flex; align-items: center; justify-content: space-between; }
.nav-left { display: flex; align-items: center; gap: 12px; }
.nav-logo {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-logo-icon {
    width: 30px; height: 30px;
    background: var(--gradient-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}
.nav-logo span { color: var(--accent-light); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--accent-light); }

/* ─── Typography ─── */
h1 {
    font-size: clamp(36px, 5.5vw, 64px);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.07;
}
h2 {
    font-size: clamp(26px, 3.5vw, 38px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
h3 {
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 700;
    letter-spacing: -0.02em;
}
h4 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
p { font-size: 16px; line-height: 1.7; }
.small { font-size: 14px; color: var(--text-secondary); }
.tiny { font-size: 12px; color: var(--text-tertiary); }

.gradient-text {
    background: var(--gradient-text);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
    filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.2));
}
@keyframes shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%; left: -60%;
    width: 30%; height: 200%;
    background: rgba(255,255,255,0.15);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
    pointer-events: none;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.4), 0 8px 32px rgba(16, 185, 129, 0.2);
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

/* ─── Cards ─── */
.card {
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: var(--card-shadow);
}
.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

/* ─── Section Helpers ─── */
.section-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-light);
    margin-bottom: 16px;
    padding: 5px 14px;
    background: var(--accent-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent-light);
    border: 1px solid rgba(16, 185, 129, 0.22);
    background: rgba(16, 185, 129, 0.08);
    padding: 8px 18px;
    border-radius: 100px;
    margin-bottom: 32px;
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.6s ease both;
}
.hero-badge .pulse {
    width: 6px; height: 6px;
    background: var(--accent-light);
    border-radius: 50%;
    animation: badgePulse 2s ease-in-out infinite;
}

/* ─── Hero Glow ─── */
.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px; height: 600px;
    background: radial-gradient(ellipse at center,
        rgba(16, 185, 129, 0.14) 0%,
        rgba(6, 182, 212, 0.05) 40%,
        transparent 70%);
    pointer-events: none;
    animation: pulseGlow 6s ease-in-out infinite;
}
@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
    50%       { opacity: 1;   transform: translateX(-50%) scale(1.1); }
}

/* ─── Blog Grid ─── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 80px;
}
.blog-post-card {
    padding: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.blog-post-card:hover {
    border-color: rgba(16, 185, 129, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1), 0 20px 50px rgba(0,0,0,0.3);
}
.blog-date {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-light);
    margin-bottom: 8px;
}
.blog-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cyan);
    background: var(--cyan-glow);
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.blog-post-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.blog-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 20px;
}
.blog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.blog-read-time {
    font-size: 12px;
    color: var(--text-tertiary);
    font-family: 'JetBrains Mono', monospace;
}
.blog-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}
.blog-link:hover { gap: 8px; }

/* ─── Featured Card ─── */
.blog-featured-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 36px;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 18px;
    backdrop-filter: blur(12px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.blog-featured-card:hover {
    border-color: rgba(16, 185, 129, 0.25);
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15), 0 24px 60px rgba(0,0,0,0.32);
}
.featured-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-light);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.featured-label::before {
    content: '';
    display: block;
    width: 16px; height: 2px;
    background: var(--accent);
    border-radius: 1px;
}
.featured-title {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.featured-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}
.featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-tertiary);
}
.featured-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-tertiary); }
.featured-visual {
    background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(6,182,212,0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: 14px;
    padding: 28px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.tv-line { margin-bottom: 4px; }
.tv-green { color: #34d399; }
.tv-cyan  { color: #22d3ee; }
.tv-amber { color: #f59e0b; }
.tv-dim   { color: var(--text-tertiary); }

/* ─── Article Reader ─── */
.article-hero {
    position: relative;
    padding: 160px 0 80px;
    text-align: center;
    overflow: hidden;
}
.article-category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-light);
    background: var(--accent-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
}
.article-hero h1 {
    font-size: clamp(26px, 4vw, 48px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 28px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}
.article-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-tertiary); }
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 200;
    transition: width 0.1s linear;
}
.article-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 32px 120px;
}
.article-divider {
    width: 56px; height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin: 44px auto;
    opacity: 0.6;
}
.article-body { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.8; color: var(--text-primary); }
.article-body h2 { font-size: clamp(22px, 2.8vw, 30px); font-weight: 800; margin: 52px 0 18px; letter-spacing: -0.025em; color: var(--text-primary); }
.article-body h3 { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; margin: 36px 0 14px; letter-spacing: -0.02em; color: var(--text-primary); }
.article-body p { margin-bottom: 22px; }
.article-body ul, .article-body ol { margin: 0 0 22px 28px; }
.article-body li { margin-bottom: 8px; line-height: 1.7; }
.article-body strong { font-weight: 700; color: var(--text-primary); }
.article-body em { font-style: italic; color: var(--text-secondary); }
.article-body a { color: var(--accent-light); text-decoration: underline; text-decoration-color: rgba(52, 211, 153, 0.4); transition: text-decoration-color 0.2s; }
.article-body a:hover { text-decoration-color: var(--accent-light); }
.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 14px 22px;
    margin: 28px 0;
    background: var(--accent-glow);
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: var(--text-secondary);
}
.article-body code {
    background: var(--bg-elevated);
    color: var(--accent-light);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
    border: 1px solid var(--border);
}
.article-body pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 24px;
    overflow-x: auto;
    margin: 28px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
}
.article-body pre code { background: none; border: none; padding: 0; color: var(--text-secondary); }

/* ─── Back Link ─── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 48px;
    transition: color 0.2s;
}
.back-link:hover { color: var(--accent-light); }

/* ─── Footer ─── */
footer {
    padding: 52px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-logo {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.footer-logo-icon {
    width: 26px; height: 26px;
    background: var(--gradient-primary);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.footer-text { font-size: 13px; color: var(--text-tertiary); }
.footer-links { display: flex; gap: 22px; }
.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-primary); }

/* ─── Scroll Reveal ─── */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(2) { transition-delay: 0.07s; }
.reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal:nth-child(4) { transition-delay: 0.21s; }
.reveal:nth-child(5) { transition-delay: 0.28s; }
.reveal:nth-child(6) { transition-delay: 0.35s; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .gradient-text { animation: none; }
}

/* ─── Misc ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(16, 185, 129, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(16, 185, 129, 0.5); }
::selection { background: rgba(16, 185, 129, 0.25); color: var(--text-primary); }

.gradient-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(16,185,129,0.3) 25%, rgba(6,182,212,0.2) 50%, rgba(16,185,129,0.3) 75%, transparent 100%);
}
.glow-line {
    width: 72px; height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin: 0 auto;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

/* ─── Keyframes ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ─── Responsive ─── */
/* Mobile-first: Images responsive by default */
img { max-width: 100%; height: auto; display: block; }
video { max-width: 100%; height: auto; }

/* Touch-friendly tap targets (min 44x44px) */
button, a.btn, input[type="button"], input[type="submit"],
.pill, .share-btn, .topic-card {
    min-height: 44px;
    min-width: 44px;
}

/* Form elements mobile-friendly */
input[type="email"], input[type="text"], input[type="password"],
textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 44px;
    padding: 12px 14px;
}

/* Responsive grid layouts */
@media (max-width: 1024px) {
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .container, .container-narrow { padding: 0 20px; }

    /* Navigation */
    .nav-links { display: none; }
    nav .container { flex-direction: column; gap: 12px; }

    /* Typography mobile adjustments */
    h1 { font-size: clamp(28px, 5vw, 48px); }
    h2 { font-size: clamp(22px, 4vw, 32px); }
    h3 { font-size: clamp(18px, 3vw, 24px); }

    /* Grid layouts to single column */
    .topics-grid { grid-template-columns: 1fr; }
    .blog-grid { grid-template-columns: 1fr; }
    .blog-featured-card { grid-template-columns: 1fr; }

    /* Footer responsive */
    .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
    .footer-links { flex-wrap: wrap; justify-content: center; }

    /* Featured visual hide on tablet */
    .featured-visual { display: none; }

    /* Sections padding reduction */
    section { padding: 48px 0 !important; }

    /* Forms responsive */
    .capture-input-row { flex-direction: column !important; }
    input[type="email"], input[type="text"] { width: 100%; }
}

@media (max-width: 640px) {
    .container, .container-narrow { padding: 0 16px; }

    /* Aggressive text sizing for small phones */
    h1 { font-size: clamp(24px, 6vw, 36px); }
    h2 { font-size: clamp(18px, 5vw, 28px); }
    h3 { font-size: clamp(16px, 4vw, 22px); }
    p, body { font-size: 16px; line-height: 1.6; }

    /* Article container padding */
    .article-container { padding: 0 16px 80px; }
    article { padding: 24px 0; }

    /* Button and link sizing for touch */
    .btn, button, a.btn {
        width: 100%;
        padding: 16px 20px;
        font-size: 16px;
    }

    /* Flex direction changes */
    .capture-input-row { flex-direction: column; gap: 12px; }
    .capture-submit-btn { width: 100%; }
}

@media (max-width: 480px) {
    .container, .container-narrow { padding: 0 14px; }

    h1 { font-size: 24px; line-height: 1.2; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }

    /* Minimal padding for very small screens */
    section { padding: 32px 0 !important; }

    /* Form inputs full width */
    input, textarea, select { width: 100%; box-sizing: border-box; }

    /* Article spacing */
    .article-container { padding: 0 14px 60px; }
}
