﻿/* ── Smooth theme transition ─────────────────────────────────── */
html { scroll-behavior: smooth; }
*, *::before, *::after {
    transition: background-color 0.2s ease, color 0.15s ease, border-color 0.2s ease;
}
/* Disable transitions on page load to prevent flash */
.no-transition * { transition: none !important; }

/* ── Hero background ─────────────────────────────────────────── */
.hero-bg {
    background: linear-gradient(135deg, #ddeeff 0%, #c8e4ff 60%, #b8d4f0 100%);
}
.dark .hero-bg {
    background: linear-gradient(135deg, #0a0f1a 0%, #0d1f35 55%, #0a1628 100%);
}

/* ── Alternate section (light blue panel in home) ────────────── */
.section-alt { background: #f0f7ff; }
.dark .section-alt { background: #111827; }

/* Wave SVG fill adapts to section-alt */
.wave-to-alt   { fill: #f0f7ff; }
.wave-from-alt { fill: #f0f7ff; }
.dark .wave-to-alt   { fill: #111827; }
.dark .wave-from-alt { fill: #111827; }

/* ── Tag pills ───────────────────────────────────────────────── */
.tag-pill {
    display: inline-block;
    background: #e0edff;
    color: #1a6eb5;
    font-size: 0.72rem;
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    font-weight: 500;
    line-height: 1.6;
    text-decoration: none;
    transition: opacity 0.15s ease;
}
.tag-pill:hover { opacity: 0.8; }
.dark .tag-pill {
    background: #193452;
    color: #7eb8f7;
}

/* ── Tile entrance animation (home hero) ─────────────────────── */
.tile {
    opacity: 0;
    animation: tile-in 0.5s ease forwards;
}
.tile:nth-child(1) { animation-delay: 0.00s; }
.tile:nth-child(2) { animation-delay: 0.08s; }
.tile:nth-child(3) { animation-delay: 0.16s; }
.tile:nth-child(4) { animation-delay: 0.24s; }
.tile:nth-child(5) { animation-delay: 0.32s; }
.tile:nth-child(6) { animation-delay: 0.40s; }
.tile:nth-child(7) { animation-delay: 0.48s; }
.tile:nth-child(8) { animation-delay: 0.56s; }
@keyframes tile-in {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Blog post body typography ───────────────────────────────── */
.post-body { font-size: 1.05rem; }
.post-body h2 { font-size: 1.35rem; font-weight: 700; margin: 2.5rem 0 0.75rem; padding-top: 1.75rem; border-top: 1px solid #e5e7eb; color: #0d2a4a; }
.post-body h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.post-body h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.6rem; color: #0d2a4a; }
.post-body p  { margin-bottom: 1rem; color: #374151; line-height: 1.8; }
.post-body ul { margin-left: 1.5rem; margin-bottom: 1rem; color: #374151; list-style-type: disc; }
.post-body ol { margin-left: 1.5rem; margin-bottom: 1rem; color: #374151; list-style-type: decimal; }
.post-body li { margin-bottom: 0.4rem; }
.post-body blockquote { border-left: 4px solid #1a6eb5; background: #f0f7ff; padding: 0.75rem 1rem; border-radius: 0 6px 6px 0; margin: 1.25rem 0; color: #374151; }
.post-body a  { color: #1a6eb5; text-decoration: underline; }
.post-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-family: 'Cascadia Code', 'JetBrains Mono', monospace; font-size: 0.88em; }
.post-body pre { background: #282c34; border-radius: 10px; overflow-x: auto; margin-bottom: 1.25rem; padding: 0; }
.post-body pre code { background: none; padding: 1.25rem !important; border-radius: 10px; font-size: 0.88em; }
.post-body pre code.hljs { border-radius: 10px; }
.post-body .mermaid { margin: 1.5rem 0; text-align: center; }
.post-body .mermaid svg { max-width: 100%; height: auto; }

/* post-body dark mode */
.dark .post-body h2, .dark .post-body h3 { color: #f1f5f9; }
.dark .post-body h2 { border-top-color: #1f2937; }
.dark .post-body p  { color: #d1d5db; }
.dark .post-body ul, .dark .post-body ol { color: #d1d5db; }
.dark .post-body blockquote { background: #172033; border-left-color: #7eb8f7; color: #d1d5db; }
.dark .post-body code { background: #1e293b; color: #e2e8f0; }
.dark .post-body a  { color: #7eb8f7; }

/* ── Info card (About page) ─────────────────────────────────── */
.info-card {
    background: #ddeeff;
    border: 1px solid #c0daf7;
    border-radius: 1rem;
    padding: 2rem;
}
.dark .info-card {
    background: #172033;
    border-color: #2a3f5a;
}

/* ── Blog filter pills ───────────────────────────────────────── */
.filter-pill {
    cursor: pointer;
    border: none;
    outline: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.filter-pill-active  { background: #1a6eb5; color: #fff; }
.filter-pill-inactive { background: #e0edff; color: #1a6eb5; }
.dark .filter-pill-inactive { background: #193452; color: #7eb8f7; }
.dark .filter-pill-active   { background: #1a6eb5; color: #fff; }

/* ── Search result cards ─────────────────────────────────────── */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.result-card {
    animation: fade-up 0.18s ease both;
}

/* ── Copy code button ────────────────────────────────────────── */
.copy-btn {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    padding: 0.25rem 0.45rem;
    background: #2d3f55;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease;
}
.copy-btn:hover { background: #3b5268; color: #e2e8f0; }
.copy-btn.copied { color: #4ade80; }

/* ── Table of Contents sidebar ───────────────────────────────── */
@media (max-width: 1279px) { #toc-sidebar { display: none !important; } }
.toc-link {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 0.2rem 0 0.2rem 0.65rem;
    border-left: 2px solid transparent;
    font-size: 0.82rem;
    line-height: 1.55;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.toc-link.toc-h3 { padding-left: 1.3rem; font-size: 0.77rem; }
.toc-link:hover { color: #1a6eb5; }
.toc-link.toc-active { color: #1a6eb5; border-left-color: #1a6eb5; }
.dark .toc-link { color: #64748b; }
.dark .toc-link:hover, .dark .toc-link.toc-active { color: #7eb8f7; border-left-color: #7eb8f7; }

/* ── Skill badges ────────────────────────────────────────────── */
.skill-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
}

/* ── Timeline ────────────────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0.35rem;
    top: 0.4rem;
    bottom: 0;
    width: 2px;
    background: #c8dff7;
}
.dark .timeline::before { background: #1e3a5f; }
.timeline-item { position: relative; padding-bottom: 1.6rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute;
    left: -1.24rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1a6eb5;
    border: 2px solid #fff;
}
.dark .timeline-dot { border-color: #030712; }
.timeline-year {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1a6eb5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}
.dark .timeline-year { color: #7eb8f7; }
