/* ================================================================
   DevTips — Shared Stylesheet  (Indigo + Violet Theme)
   ================================================================ */

:root {
    --primary:     #6366f1;   /* indigo-500 */
    --primary-dark:#4f46e5;   /* indigo-600 */
    --primary-deep:#4338ca;   /* indigo-700 */
    --sky-light:   #e0e7ff;   /* indigo-100 */
    --sky-pale:    #eef2ff;   /* indigo-50  */
    --dark-text:   #0f172a;   /* slate-900  */
    --mid-text:    #1e293b;   /* slate-800  */
    --muted-text:  #64748b;   /* slate-500  */
    --border:      #c7d2fe;   /* indigo-200 */
    --surface:     #ffffff;
    --navbar-bg:   rgba(255, 255, 255, 0.97);
    --tint-bg:     rgba(99, 102, 241, 0.07);
    --chip-text:   var(--primary-deep);
    --section-py:  80px;
    color-scheme: light;

    /* Code syntax highlighting */
    --code-comment:  #64748b;  /* slate-500  */
    --code-keyword:  #4338ca;  /* indigo-700 */
    --code-string:   #047857;  /* emerald-700 */
    --code-number:   #b45309;  /* amber-700  */
    --code-function: #1d4ed8; /* blue-700   */
    --code-tag:      #be185d; /* pink-700   */
    --code-variable: #0f766e; /* teal-700   */
    --code-constant: #7c3aed; /* violet-600 */
    --code-deleted:  #b91c1c;
    --code-deleted-bg: #fee2e2;
    --code-inserted: #15803d;
    --code-inserted-bg: #dcfce7;
}

:root[data-theme="dark"] {
    --primary:     #818cf8;   /* indigo-400 */
    --primary-dark:#6366f1;   /* indigo-500 */
    --sky-light:   rgba(99, 102, 241, 0.16);
    --sky-pale:    #0b1020;
    --dark-text:   #f1f5f9;   /* slate-100  */
    --mid-text:    #cbd5e1;   /* slate-300  */
    --muted-text:  #8b98ac;
    --border:      rgba(129, 140, 248, 0.25);
    --surface:     #131a2e;
    --navbar-bg:   rgba(11, 16, 32, 0.85);
    --tint-bg:     rgba(99, 102, 241, 0.12);
    --chip-text:   #c7d2fe;
    color-scheme: dark;

    /* Code syntax highlighting */
    --code-comment:  #8b98ac;
    --code-keyword:  #a5b4fc;  /* indigo-300 */
    --code-string:   #6ee7b7;  /* emerald-300 */
    --code-number:   #fbbf24;  /* amber-400  */
    --code-function: #93c5fd; /* blue-300   */
    --code-tag:      #f9a8d4; /* pink-300   */
    --code-variable: #5eead4; /* teal-300   */
    --code-constant: #c4b5fd; /* violet-300 */
    --code-deleted:  #fca5a5;
    --code-deleted-bg: rgba(239, 68, 68, 0.15);
    --code-inserted: #86efac;
    --code-inserted-bg: rgba(34, 197, 94, 0.15);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--mid-text);
    background-color: var(--sky-pale);
    margin: 0;
    padding: 0;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ── Navbar ── */
.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.08);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary) !important;
}

.navbar-brand span { color: var(--primary-deep); }

.nav-link {
    font-weight: 500;
    color: var(--mid-text) !important;
    transition: color 0.2s;
    padding: 0.4rem 0.9rem !important;
}

.nav-link:hover,
.nav-link.active { color: var(--primary) !important; }

.navbar-toggler {
    border-color: rgba(99, 102, 241, 0.24);
    box-shadow: none !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.18);
}

.navbar-toggler-icon {
    width: 1.25em;
    height: 1.25em;
}

.navbar-collapse {
    flex-grow: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--sky-light);
    color: var(--primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Section Utilities ── */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0.75rem;
}

.section-sub {
    color: var(--muted-text);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.75;
}

.section-divider {
    width: 50px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), #a5b4fc);
    border-radius: 2px;
    margin: 1rem auto 0;
}

/* ── Hero (index.html only) ── */
#home-hero {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 50%, #818cf8 100%);
    display: flex;
    align-items: center;
    padding: 80px 0 40px;
    position: relative;
    overflow: hidden;
}

#home-hero::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    top: -80px;
    right: -80px;
    border-radius: 50%;
    pointer-events: none;
}

#home-hero::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, transparent 70%);
    bottom: -60px;
    left: -60px;
    border-radius: 50%;
    pointer-events: none;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    padding: 5px 16px;
    border-radius: 50px;
    font-size: 0.84rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    text-shadow: 0 2px 8px rgba(67, 56, 202, 0.35);
}

.hero-title .accent { color: #c7d2fe; }

.hero-sub {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 520px;
    margin-bottom: 2.5rem;
    line-height: 1.75;
}

.hero-sub:last-of-type {
    margin-bottom: 0;
}

.hero-code {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 2rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.92rem;
    color: #ffffff;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(67, 56, 202, 0.25);
}

.code-line    { margin: 4px 0; }
.code-comment { color: rgba(255, 255, 255, 0.5); }
.code-keyword { color: #c7d2fe; }
.code-string  { color: #a5f3fc; }
.code-func    { color: #fde047; }

/* ── Hero Visual Panel ── */
.hero-visual {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(67, 56, 202, 0.3);
    overflow: hidden;
}

.hv-header {
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hv-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hv-red    { background: #ff5f57; }
.hv-yellow { background: #febc2e; }
.hv-green  { background: #28c840; }

.hv-title-bar {
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-family: 'Consolas', monospace;
}

.hv-body { padding: 1.4rem; }

.hv-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.2rem;
}
.hv-stat-label { color: rgba(255, 255, 255, 0.6); font-size: 0.75rem; margin-bottom: 4px; }
.hv-stat-value { color: #ffffff; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.5px; }

.hv-tasks { margin-bottom: 1.25rem; }

.hv-task {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.45);
    opacity: 0;
    animation: hvSlideIn 0.45s ease forwards;
}
.hv-task i { font-size: 0.88rem; flex-shrink: 0; }
.hv-done   { color: rgba(255, 255, 255, 0.9); }
.hv-done i { color: #4ade80; }

.hv-a1 { animation-delay: 0.4s; }
.hv-a2 { animation-delay: 0.85s; }
.hv-a3 { animation-delay: 1.3s; }
.hv-a4 { animation-delay: 1.75s; }
.hv-a5 { animation-delay: 2.2s; }

@keyframes hvSlideIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.hv-footer {}
.hv-prog-label { color: rgba(255, 255, 255, 0.65); font-size: 0.75rem; margin-bottom: 6px; }
.hv-prog-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    height: 7px;
    overflow: hidden;
    margin-bottom: 5px;
}
.hv-prog-fill {
    height: 100%;
    background: linear-gradient(to right, #a5b4fc, #4ade80);
    border-radius: 50px;
    width: 0;
    animation: hvGrowBar 1.2s 2.5s ease-out forwards;
}
@keyframes hvGrowBar { to { width: 72%; } }

.hv-prog-pct { color: #a5b4fc; font-size: 0.8rem; font-weight: 600; text-align: right; }

/* ── Category Cards (index.html only) ── */
.category-section {
    padding: var(--section-py) 0;
    background: var(--surface);
}

.cat-card {
    background: var(--sky-pale);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s, background 0.25s;
    height: 100%;
}

.cat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(99, 102, 241, 0.18);
    border-color: var(--primary);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

.cat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1.25rem;
}

.cat-icon.vs  { background: #ede9fe; color: #7c3aed; }
.cat-icon.cmd { background: #fef3c7; color: #d97706; }
.cat-icon.gen { background: #dcfce7; color: #16a34a; }

.cat-card h5 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.cat-card p {
    font-size: 0.875rem;
    color: var(--muted-text);
    margin-bottom: 0;
    line-height: 1.65;
}

/* ── Page Header (inner pages) ── */
.page-header {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 60%, #818cf8 100%);
    padding: 100px 0 60px;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    top: -100px;
    right: -80px;
    border-radius: 50%;
    pointer-events: none;
}

.page-header .ph-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
}

.page-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
}

.page-header p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    max-width: 520px;
    line-height: 1.75;
    margin-bottom: 0;
}

/* ── Tip Cards ── */
.tips-section {
    padding: var(--section-py) 0;
    background: var(--surface);
}

.tip-card {
    background: var(--sky-pale);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    height: 100%;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s, background 0.25s;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.16);
    border-color: var(--primary);
    background: var(--surface);
}

.tip-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.tip-icon.vs  { background: #ede9fe; color: #7c3aed; }
.tip-icon.cmd { background: #fef3c7; color: #d97706; }
.tip-icon.gen { background: #dcfce7; color: #16a34a; }

.tip-card h5 {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.tip-card p {
    font-size: 0.875rem;
    color: var(--muted-text);
    line-height: 1.65;
    margin-bottom: 0;
}

.tip-shortcut {
    background: var(--sky-light);
    color: var(--chip-text);
    border: 1px solid var(--border);
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
    padding: 2px 9px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.75rem;
}

/* ── About Section ── */
.about-section {
    padding: var(--section-py) 0;
    background: var(--sky-pale);
}

.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.10);
}

.about-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-deep), #a5b4fc);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
    color: #fff;
    font-weight: 700;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.about-name {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--dark-text);
}

.about-role {
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.about-bio {
    color: var(--muted-text);
    line-height: 1.8;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.skill-badge {
    background: var(--sky-light);
    border: 1px solid var(--border);
    color: var(--chip-text);
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Contact Section ── */
.contact-section {
    padding: var(--section-py) 0;
    background: var(--sky-pale);
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.25rem 1.75rem;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.18);
    border-color: var(--primary);
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.contact-icon.email    { background: var(--sky-light); color: var(--primary-dark); }
.contact-icon.github   { background: #f0fdf4;  color: #16a34a; }
.contact-icon.linkedin { background: #eff6ff;  color: #0a66c2; }

.contact-card h5 { font-weight: 600; color: var(--dark-text); margin-bottom: 0.3rem; }
.contact-card p  { color: var(--muted-text); font-size: 0.88rem; margin-bottom: 0.5rem; }
.contact-card a  { color: var(--primary); text-decoration: none; font-size: 0.9rem; }
.contact-card a:hover { text-decoration: underline; }

/* ── Footer ── */
footer {
    background: var(--primary-deep);
    color: rgba(255, 255, 255, 0.7);
    padding: 1.5rem 0;
    font-size: 0.86rem;
    text-align: center;
}

footer a { color: #bae6fd; text-decoration: none; }
footer a:hover { color: #ffffff; }

/* ================================================================
   My Work — Project Cards
   ================================================================ */

/* ── Intro Section ── */
.projects-intro-section {
    padding: var(--section-py) 0 50px;
    background: var(--sky-pale);
}

.btn-github-profile {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--dark-text);
    color: #ffffff !important;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.btn-github-profile:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

/* ── Projects Section ── */
.projects-section {
    padding: var(--section-py) 0;
    background: var(--surface);
}

.projects-section-alt {
    background: var(--sky-pale);
}

/* ── Section Header with Icon ── */
.project-section-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.project-section-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.windows-app-icon { background: #dbeafe; color: #1d4ed8; }
.vs-icon          { background: #ede9fe; color: #7c3aed; }

/* ── Project Card (shared) ── */
.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.16);
    border-color: var(--primary);
}

/* ── Featured card (AltTab) ── */
.project-card-featured {
    flex-direction: column;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.10);
}

.project-card-featured .project-card-body {
    padding: 2rem 2.25rem;
}

/* ── Accent bar at top ── */
.project-card-accent {
    height: 5px;
    width: 100%;
    flex-shrink: 0;
}

.project-card-accent.cpp    { background: linear-gradient(to right, #1d4ed8, #60a5fa); }
.project-card-accent.csharp { background: linear-gradient(to right, #7c3aed, #a78bfa); }

/* ── Card body ── */
.project-card-body {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ── Sidebar (featured card only) ── */
.project-card-sidebar {
    background: linear-gradient(160deg, #f8faff 0%, #eef2ff 100%);
    border-left: 1px solid var(--border);
    display: flex;
    align-items: stretch;
}

.project-sidebar-inner {
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

/* ── Mock AltTab switcher graphic ── */
.project-sidebar-graphic {
    width: 100%;
}

.mock-switcher {
    background: #1e1b4b;
    border-radius: 10px;
    padding: 0.75rem;
    box-shadow: 0 8px 24px rgba(30, 27, 75, 0.35);
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
}

.mock-switcher-search {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px;
    color: #c7d2fe;
    font-family: 'Consolas', monospace;
    font-size: 0.82rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.mock-typing {
    border-right: 2px solid #c7d2fe;
    padding-right: 2px;
    animation: blink-cursor 1s step-end infinite;
}

@keyframes blink-cursor {
    50% { border-right-color: transparent; }
}

.mock-switcher-item {
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: rgba(199, 210, 254, 0.75);
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    transition: background 0.15s;
}

.mock-switcher-item.active {
    background: rgba(99, 102, 241, 0.55);
    color: #ffffff;
    font-weight: 600;
}

.mock-kbd-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 1rem;
}

.mock-kbd {
    background: #312e81;
    border: 1px solid #4338ca;
    border-bottom: 3px solid #1e1b4b;
    border-radius: 6px;
    color: #c7d2fe;
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 10px;
}

.mock-kbd-plus {
    color: #818cf8;
    font-weight: 700;
    font-size: 0.9rem;
}

/* ── Sidebar link buttons ── */
.project-sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}

/* ── Type badges ── */
.project-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 13px;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}

.project-type-badge.windows-app  { background: #dbeafe; color: #1d4ed8; }
.project-type-badge.vs-extension { background: #ede9fe; color: #7c3aed; }

/* ── Title ── */
.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0.75rem;
}

/* ── Description ── */
.project-description {
    font-size: 0.9rem;
    color: var(--muted-text);
    line-height: 1.8;
    margin-bottom: 1rem;
    flex: 1;
}

/* ── Feature bullets ── */
.project-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.project-features li {
    font-size: 0.855rem;
    color: var(--mid-text);
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    line-height: 1.6;
}

.project-features li::before {
    content: '';
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 7px;
}

/* ── Tech tags ── */
.project-tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 1.1rem;
}

.tech-tag {
    background: var(--sky-light);
    border: 1px solid var(--border);
    color: var(--chip-text);
    padding: 3px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
}

/* ── Stats row ── */
.project-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.1rem;
    font-size: 0.84rem;
    color: var(--muted-text);
    margin-bottom: 0;
}

.project-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Card footer ── */
.project-card-footer {
    padding: 1rem 1.75rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--sky-pale);
    margin-top: auto;
}

/* ── GitHub buttons ── */
.btn-github {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--dark-text);
    color: #ffffff !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-github:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-project-site {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--primary) !important;
    border: 1.5px solid var(--primary);
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s, transform 0.15s;
}

.btn-project-site:hover {
    background: var(--primary);
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* ── Call-to-Action Banner ── */
.projects-cta-section {
    padding: 60px 0;
    background: var(--surface);
}

.projects-cta-card {
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #818cf8 100%);
    border-radius: 20px;
    padding: 2.75rem 3rem;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
    position: relative;
    overflow: hidden;
}

.projects-cta-card::before {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
    top: -100px;
    right: -50px;
    border-radius: 50%;
    pointer-events: none;
}

.btn-github-cta {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.55);
    color: #ffffff !important;
    padding: 12px 26px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
    backdrop-filter: blur(8px);
}

.btn-github-cta:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
}

/* ================================================================
   Visual Studio Page — Extensions, Shortcuts, Others
   ================================================================ */

/* ── Section alternating background ── */
.tips-section-alt {
    padding: var(--section-py) 0;
    background: var(--sky-pale);
}

/* ── Extension Cards ── */
.ext-card {
    background: var(--sky-pale);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s, background 0.25s;
}

.ext-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.16);
    border-color: var(--primary);
    background: var(--surface);
}

.ext-card h5 {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.ext-card h5 a {
    color: var(--dark-text);
    text-decoration: none;
}

.ext-card h5 a:hover { color: var(--primary); }

.ext-card p {
    font-size: 0.875rem;
    color: var(--muted-text);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 0;
}

.ext-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--sky-light);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    align-self: flex-start;
}

.ext-link:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* ── Keyboard Shortcuts Section ── */
.shortcuts-section {
    padding: var(--section-py) 0;
    background: var(--sky-pale);
}

.shortcut-accordion .accordion-item {
    border: 1px solid var(--border);
    border-radius: 10px !important;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.shortcut-accordion .accordion-button {
    font-weight: 600;
    color: var(--dark-text);
    background: var(--surface);
    font-size: 0.95rem;
    border-radius: 10px !important;
}

.shortcut-accordion .accordion-button:not(.collapsed) {
    background: var(--sky-light);
    color: var(--chip-text);
    box-shadow: none;
}

.shortcut-accordion .accordion-body {
    background: var(--surface);
    padding: 0;
}

.shortcut-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcut-table tr {
    border-bottom: 1px solid var(--sky-pale);
}

.shortcut-table tr:last-child {
    border-bottom: none;
}

.shortcut-table td {
    padding: 10px 1.25rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

.shortcut-table td:first-child { width: 40%; }

.shortcut-table td:last-child {
    color: var(--muted-text);
    line-height: 1.6;
}

.shortcut-table tr:hover td { background: var(--sky-pale); }

.shortcut-table .tip-shortcut { margin-top: 0; }

/* ================================================================
   CMD Prompt Page — Cmder, Clink, Oh My Posh
   ================================================================ */

/* ── Tool Overview Cards ── */
.tool-overview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.25rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.tool-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 4px;
}

/* ── Feature List ── */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 0.875rem;
    color: var(--mid-text);
    line-height: 1.65;
    border-bottom: 1px solid var(--sky-pale);
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li > i {
    color: var(--primary);
    font-size: 0.75rem;
    margin-top: 5px;
    flex-shrink: 0;
}

/* ── Oh My Posh Terminal Mockup ── */
.omp-terminal {
    background: #1e1b4b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(30, 27, 75, 0.4);
}

.omp-terminal-body {
    padding: 1.25rem 1.5rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.84rem;
    line-height: 1.6;
}

.omp-plain-prompt { color: #94a3b8; margin: 4px 0 0; }

.omp-comment {
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
    font-size: 0.8rem;
}

.omp-prompt-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 3px 0;
}

.omp-seg {
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

.omp-path   { background: #4f46e5; color: #ffffff; border-radius: 4px 0 0 4px; }
.omp-branch { background: #059669; color: #ffffff; }
.omp-clean  { background: #16a34a; color: #ffffff; border-radius: 0 4px 4px 0; padding-right: 12px; }
.omp-dirty  { background: #d97706; color: #ffffff; border-radius: 0 4px 4px 0; padding-right: 12px; }
.omp-staged { background: #7c3aed; color: #ffffff; border-radius: 0 4px 4px 0; padding-right: 12px; }
.omp-arrow  { color: #a5b4fc; padding: 0 6px; font-size: 1rem; }

/* ── Setup Step Numbers ── */
.omp-step-num {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

/* ── Multi-line Command Code Block ── */
.cmd-code-block {
    background: var(--tint-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--chip-text);
    margin-top: 0.75rem;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.75;
    display: block;
}

.cmd-code-block .cmt { color: var(--muted-text); font-style: italic; }

/* ── Inline Command Code Block ── */
.cmd-code {
    background: var(--tint-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--chip-text);
    margin-top: 0.6rem;
    overflow-x: auto;
    display: block;
    word-break: break-all;
}

/* ================================================================
   Topic Teaser Cards & Detail Pages
   ================================================================ */

a.ext-card,
a.project-card,
a.project-card-featured {
    text-decoration: none;
    color: inherit;
}

a.tool-overview-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ext-card .ext-link-hint {
    margin-top: auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-text);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover { color: var(--primary); }

/* ================================================================
   Blog
   ================================================================ */

.blog-post-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2.25rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.blog-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.14);
    border-color: var(--primary);
    color: inherit;
}

.blog-post-card-date {
    font-size: 0.8rem;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
}

.blog-post-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0.6rem;
}

.blog-post-card-excerpt {
    color: var(--muted-text);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.blog-post-section {
    padding: 130px 0 var(--section-py);
}

.blog-post {
    max-width: 720px;
    margin: 0 auto;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.blog-post-date {
    font-size: 0.85rem;
    color: var(--muted-text);
}

.blog-post-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blog-post-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--dark-text);
    line-height: 1.25;
    margin-bottom: 2rem;
}

.blog-post-content {
    color: var(--mid-text);
    font-size: 1.05rem;
    line-height: 1.85;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    color: var(--dark-text);
    font-weight: 700;
    line-height: 1.3;
}

.blog-post-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.blog-post-content h3 { font-size: 1.2rem; margin: 1.75rem 0 0.85rem; }
.blog-post-content h4 { font-size: 1.05rem; margin: 1.5rem 0 0.75rem; }

.blog-post-content p { margin-bottom: 1.25rem; }

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.blog-post-content li { margin-bottom: 0.5rem; }

.blog-post-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--border);
}

.blog-post-content a:hover { text-decoration-color: var(--primary); }

.blog-post-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: var(--muted-text);
    font-style: italic;
}

.blog-post-content code {
    background: var(--tint-bg);
    color: var(--chip-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
}

.blog-post-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.blog-post-content pre code {
    background: none;
    padding: 0;
    color: var(--mid-text);
}

/* ── Syntax highlighting ──
   Rouge (server-rendered posts, classes like .k/.s/.nf) and highlight.js
   (client-rendered admin preview, classes like .hljs-keyword) tokenize
   differently, so the rules below target both class schemes against the
   same --code-* palette — not byte-identical highlighting, but the same
   colors for the same kind of token in both places. */

.blog-post-content .highlight .c,
.blog-post-content .highlight .c1,
.blog-post-content .highlight .cm,
.blog-post-content .highlight .cs,
.blog-post-content .highlight .cp,
.blog-post-content .highlight .go,
.blog-post-content .highlight .gp,
.blog-post-content .hljs-comment,
.blog-post-content .hljs-quote {
    color: var(--code-comment);
    font-style: italic;
}

.blog-post-content .highlight .k,
.blog-post-content .highlight .kc,
.blog-post-content .highlight .kd,
.blog-post-content .highlight .kn,
.blog-post-content .highlight .kp,
.blog-post-content .highlight .kr,
.blog-post-content .highlight .kt,
.blog-post-content .highlight .ow,
.blog-post-content .hljs-keyword,
.blog-post-content .hljs-literal,
.blog-post-content .hljs-selector-tag {
    color: var(--code-keyword);
    font-weight: 600;
}

.blog-post-content .highlight .s,
.blog-post-content .highlight .s1,
.blog-post-content .highlight .s2,
.blog-post-content .highlight .sb,
.blog-post-content .highlight .sc,
.blog-post-content .highlight .sd,
.blog-post-content .highlight .se,
.blog-post-content .highlight .sh,
.blog-post-content .highlight .si,
.blog-post-content .highlight .sx,
.blog-post-content .highlight .sr,
.blog-post-content .highlight .ss,
.blog-post-content .highlight .dl,
.blog-post-content .hljs-string,
.blog-post-content .hljs-template-string,
.blog-post-content .hljs-regexp {
    color: var(--code-string);
}

.blog-post-content .highlight .m,
.blog-post-content .highlight .mf,
.blog-post-content .highlight .mh,
.blog-post-content .highlight .mi,
.blog-post-content .highlight .mo,
.blog-post-content .highlight .mb,
.blog-post-content .highlight .mx,
.blog-post-content .highlight .il,
.blog-post-content .hljs-number {
    color: var(--code-number);
}

.blog-post-content .highlight .nf,
.blog-post-content .highlight .nc,
.blog-post-content .highlight .nd,
.blog-post-content .highlight .ne,
.blog-post-content .highlight .nb,
.blog-post-content .hljs-title,
.blog-post-content .hljs-built_in,
.blog-post-content .hljs-section {
    color: var(--code-function);
}

.blog-post-content .highlight .nt,
.blog-post-content .highlight .na,
.blog-post-content .highlight .ni,
.blog-post-content .hljs-tag,
.blog-post-content .hljs-name,
.blog-post-content .hljs-attr,
.blog-post-content .hljs-attribute,
.blog-post-content .hljs-selector-id,
.blog-post-content .hljs-selector-class {
    color: var(--code-tag);
}

.blog-post-content .highlight .nv,
.blog-post-content .highlight .vc,
.blog-post-content .highlight .vg,
.blog-post-content .highlight .vi,
.blog-post-content .highlight .bp,
.blog-post-content .highlight .py,
.blog-post-content .highlight .nl,
.blog-post-content .hljs-variable,
.blog-post-content .hljs-params {
    color: var(--code-variable);
}

.blog-post-content .highlight .no,
.blog-post-content .highlight .nn,
.blog-post-content .hljs-symbol,
.blog-post-content .hljs-meta,
.blog-post-content .hljs-bullet {
    color: var(--code-constant);
}

.blog-post-content .highlight .err {
    color: var(--code-deleted);
    font-weight: 600;
}

.blog-post-content .highlight .gd,
.blog-post-content .hljs-deletion {
    color: var(--code-deleted);
    background: var(--code-deleted-bg);
}

.blog-post-content .highlight .gi,
.blog-post-content .hljs-addition {
    color: var(--code-inserted);
    background: var(--code-inserted-bg);
}

.blog-post-content .highlight .gh,
.blog-post-content .highlight .gu {
    color: var(--dark-text);
    font-weight: 700;
}

.blog-post-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.blog-post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ================================================================
   Comments (giscus)
   ================================================================ */

.comments-section {
    padding: var(--section-py) 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

/* ================================================================
   Bootstrap Form Controls — theme-aware
   ================================================================ */

.form-control,
.form-select {
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--mid-text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    color: var(--mid-text);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.form-control::placeholder { color: var(--muted-text); opacity: 0.8; }

.form-label {
    color: var(--dark-text);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-text { color: var(--muted-text); }

/* ================================================================
   Admin — New Post
   ================================================================ */

.admin-panel {
    max-width: 820px;
    margin: 0 auto;
}

.admin-auth-card {
    background: var(--sky-pale);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
}

.admin-auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-user-chip { display: flex; align-items: center; gap: 0.65rem; }

.admin-user-chip img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

.admin-user-chip span { font-weight: 600; color: var(--dark-text); font-size: 0.92rem; }

.admin-link-btn {
    color: var(--muted-text);
    font-size: 0.85rem;
    text-decoration: underline;
    text-decoration-color: var(--border);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.admin-link-btn:hover { color: var(--primary); text-decoration-color: var(--primary); }

.admin-status {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

.admin-status-success { color: #16a34a; }
.admin-status-error { color: #dc2626; }
.admin-status-info { color: var(--muted-text); }

/* ── GitHub-style Write / Preview editor ── */

.md-editor {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
}

.md-editor-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--sky-pale);
    border-bottom: 1px solid var(--border);
    padding: 0 0.5rem;
}

.md-editor-tablist { display: flex; }

.md-editor-tab {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted-text);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.md-editor-tab.active { color: var(--dark-text); border-bottom-color: var(--primary); }

.md-editor-hint {
    font-size: 0.8rem;
    color: var(--muted-text);
    text-decoration: none;
    padding: 0 0.25rem;
}

.md-editor-hint:hover { color: var(--primary); }

button.md-editor-hint {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

button.md-editor-hint:disabled {
    opacity: 0.6;
    cursor: default;
}

.md-editor-body textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 380px;
    border: none;
    border-radius: 0;
    resize: vertical;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.92rem;
    background: var(--surface);
    color: var(--mid-text);
    padding: 0.9rem 1rem;
}

.md-editor-body textarea:focus { outline: none; box-shadow: none; }

.md-editor-preview {
    box-sizing: border-box;
    height: 380px;
    overflow-y: auto;
    padding: 0.9rem 1rem;
    color: var(--mid-text);
}

.md-editor-preview.is-empty { color: var(--muted-text); font-style: italic; }
.md-editor-preview :first-child { margin-top: 0; }

/* ================================================================
   Navbar Search Box (site-wide, live dropdown)
   ================================================================ */

.nav-search-wrap {
    position: relative;
}

.nav-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--sky-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    transition: border-color 0.2s, background 0.2s;
}

.nav-search-box:focus-within {
    border-color: var(--primary);
    background: var(--surface);
}

.nav-search-icon {
    color: var(--muted-text);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.nav-search-input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--mid-text);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    width: 180px;
    min-width: 0;
}

@media (min-width: 1200px) {
    .nav-search-input {
        width: 260px;
    }
}

.nav-search-input::placeholder { color: var(--muted-text); }

.nav-search-clear {
    background: none;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.nav-search-clear.is-hidden { visibility: hidden; }

.nav-search-kbd {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--muted-text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
    line-height: 1.5;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Hidden while focused/typing, but stays in the layout (visibility, not
   display) so the search box doesn't change width when it disappears. */
.nav-search-kbd.is-hidden { visibility: hidden; }

.nav-search-clear:hover { color: var(--dark-text); }

.nav-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    z-index: 1050;
    padding: 8px;
}

.nav-search-dropdown.show { display: block; }

.nav-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.nav-search-result:hover,
.nav-search-result:focus,
.nav-search-result.active {
    background: var(--sky-light);
    color: inherit;
}

.nav-search-seeall.active {
    background: var(--sky-light);
}

.nav-search-result-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: var(--sky-light);
    color: var(--primary);
}

.nav-search-result-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-search-result-section {
    font-size: 0.72rem;
    color: var(--muted-text);
}

.nav-search-empty {
    padding: 16px;
    text-align: center;
    color: var(--muted-text);
    font-size: 0.85rem;
}

.nav-search-seeall {
    display: block;
    text-align: center;
    padding: 8px 10px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
}

.nav-search-seeall:hover { text-decoration: underline; }

/* ================================================================
   Search Page
   ================================================================ */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box-icon {
    position: absolute;
    left: 1.1rem;
    color: var(--muted-text);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3rem;
    font-size: 1.05rem;
    border: 2px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--dark-text);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.search-clear {
    position: absolute;
    right: 0.9rem;
    background: none;
    border: none;
    color: var(--muted-text);
    cursor: pointer;
    padding: 0.3rem;
    font-size: 0.9rem;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.15s;
}

.search-clear:hover { color: var(--dark-text); }

.filter-btn {
    padding: 5px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--sky-pale);
    color: var(--mid-text);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.search-result-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.4rem;
    margin-bottom: 0.6rem;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.13);
    border-color: var(--primary);
    color: inherit;
}

.search-result-title {
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--dark-text);
}

.search-result-content {
    font-size: 0.875rem;
    color: var(--muted-text);
    margin: 0.3rem 0 0.5rem;
    line-height: 1.6;
}

.search-result-tag {
    font-size: 0.72rem;
    background: var(--sky-pale);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 7px;
    color: var(--muted-text);
}

.search-cat-card {
    background: var(--sky-pale);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
}

.search-cat-card:hover {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.13);
    transform: translateY(-4px);
}

.search-cat-count {
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 6px;
}

mark {
    background: rgba(99, 102, 241, 0.15);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

/* ── Anchor target: offset for fixed navbar + highlight animation ── */
[id] { scroll-margin-top: 84px; }

@keyframes anchor-card-glow {
    0%, 8%  { box-shadow: 0 0 0 3px var(--primary), 0 8px 32px rgba(99, 102, 241, 0.2); }
    75%     { box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25); }
    100%    { box-shadow: none; }
}
@keyframes anchor-section-flash {
    0%, 8%  { outline: 3px solid rgba(99, 102, 241, 0.55); outline-offset: -2px; }
    100%    { outline: 3px solid transparent; outline-offset: -2px; }
}

.tip-card:target,
.ext-card:target,
.tool-overview-card:target {
    animation: anchor-card-glow 2.5s ease-out forwards;
}
section:target {
    animation: anchor-section-flash 2.5s ease-out forwards;
}

/* ── Responsive Breakpoints ── */
@media (max-width: 991.98px) {
    :root {
        --section-py: 64px;
    }

    #home-hero {
        min-height: auto;
        padding: 96px 0 72px;
    }

    .hero-title {
        font-size: clamp(2rem, 5.4vw, 3rem);
    }

    .hero-sub,
    .page-header p,
    .section-sub {
        max-width: none;
    }

    .blog-post-section {
        padding: 112px 0 var(--section-py);
    }

    .hero-visual {
        max-width: 420px;
        margin: 2rem auto 0;
    }

    .page-header {
        padding: 84px 0 52px;
    }

    .project-section-header {
        align-items: flex-start;
    }

    .project-card-featured {
        flex-direction: column;
    }

    .project-card-sidebar {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .project-sidebar-inner {
        padding: 1.5rem;
    }

    .about-card {
        padding: 2rem;
    }

    .contact-card,
    .tip-card,
    .cat-card,
    .search-cat-card,
    .search-result-card {
        height: auto;
    }
}

@media (max-width: 767.98px) {
    :root {
        --section-py: 52px;
    }

    body {
        overflow-x: hidden;
    }

    .blog-post-section {
        padding: 96px 0 var(--section-py);
    }

    .blog-post-card {
        padding: 1.5rem;
    }

    .navbar-brand {
        font-size: 1.05rem;
    }

    .nav-link {
        padding: 0.55rem 0 !important;
    }

    .navbar .container {
        align-items: center;
    }

    .navbar-collapse {
        background: var(--navbar-bg);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 16px 36px rgba(99, 102, 241, 0.14);
        margin-top: 0.75rem;
        padding: 0.75rem 1rem;
        width: 100%;
    }

    .navbar-nav {
        gap: 0.2rem;
    }

    .nav-search-wrap {
        order: -1;
        margin-bottom: 0.5rem;
    }

    .nav-search-box {
        width: 100%;
    }

    .nav-search-input {
        width: 100%;
    }

    .nav-search-kbd {
        display: none;
    }

    .nav-search-dropdown {
        width: 100%;
        left: 0;
        right: 0;
    }

    #home-hero {
        padding: 88px 0 56px;
    }

    .hero-badge {
        margin-bottom: 1rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 9vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .hero-sub {
        font-size: 1rem;
        margin-bottom: 1.75rem;
    }

    .hero-code,
    .about-card,
    .tip-card,
    .contact-card,
    .project-card-body,
    .project-sidebar-inner,
    .search-result-card,
    .search-cat-card {
        padding: 1.25rem;
    }

    .hero-code,
    .mock-switcher {
        width: 100%;
        max-width: 100%;
    }

    .page-header {
        padding: 72px 0 44px;
    }

    .page-header h1 {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
    }

    .section-title {
        font-size: 1.7rem;
    }

    .project-section-header {
        flex-direction: column;
        gap: 0.85rem;
        margin-bottom: 1.75rem;
    }

    .project-section-icon {
        width: 50px;
        height: 50px;
    }

    .about-avatar {
        width: 84px;
        height: 84px;
        font-size: 2rem;
    }

    .about-name {
        font-size: 1.45rem;
    }

    .contact-icon {
        width: 52px;
        height: 52px;
    }

    .search-box {
        align-items: stretch;
    }

    .search-input {
        font-size: 1rem;
        padding: 0.9rem 3rem 0.9rem 2.8rem;
    }

    .search-box-icon {
        left: 0.95rem;
    }

    .search-clear {
        right: 0.75rem;
    }

    .shortcut-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .shortcut-table td:first-child {
        width: auto;
    }

    [id] {
        scroll-margin-top: 72px;
    }
}

@media (max-width: 575.98px) {
    :root {
        --section-py: 44px;
    }

    .container,
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-sub,
    .page-header p,
    .about-bio,
    .tip-card p,
    .cat-card p,
    .search-result-content,
    .contact-card p {
        font-size: 0.92rem;
    }

    .hero-code {
        padding: 1rem;
        font-size: 0.8rem;
    }

    .hv-body {
        padding: 1rem;
    }

    .page-header {
        padding: 64px 0 40px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .cat-card,
    .tip-card,
    .contact-card,
    .project-card-body,
    .project-sidebar-inner,
    .about-card,
    .search-result-card,
    .search-cat-card {
        padding: 1rem;
    }

    .cat-icon,
    .tip-icon {
        width: 54px;
        height: 54px;
        font-size: 1.3rem;
    }

    .project-card-featured .project-card-body {
        padding: 1.25rem;
    }

    .mock-switcher {
        padding: 0.6rem;
    }

    .mock-switcher-search {
        font-size: 0.75rem;
    }

    .tip-shortcut,
    .search-result-tag,
    .skill-badge {
        font-size: 0.75rem;
    }

    footer {
        padding: 1.25rem 0;
        font-size: 0.8rem;
    }
}
