/* =====================================================
   Personal Blog / Portfolio — Global Stylesheet
   Design language: Apple HIG-inspired (clarity, depth, deference)
   ===================================================== */

:root {
    --font-body: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --bg: #f5f5f7;
    --bg-elevated: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.8);
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-rgb: 0, 113, 227;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --bg-header: rgba(28, 28, 30, 0.75);
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #8d8d92;
    --accent: #2997ff;
    --accent-hover: #4dabff;
    --accent-rgb: 41, 151, 255;
    --border: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }

.skip-link {
    position: absolute; left: -9999px; top: 0;
}
.skip-link:focus { left: 12px; top: 12px; background: var(--bg-elevated); padding: 8px 16px; border-radius: var(--radius-sm); z-index: 999; }

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-header);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.brand-mark {
    width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #66c2ff);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.main-nav { display: flex; gap: 28px; }
.main-nav a {
    color: var(--text-secondary); font-size: 14.5px; font-weight: 500;
    padding: 6px 2px; position: relative; transition: color var(--transition);
}
.main-nav a::after {
    content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
    background: var(--accent); transition: width var(--transition);
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-elevated);
    color: var(--text); display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform var(--transition), background var(--transition);
}
.icon-btn:hover { transform: scale(1.06); }
.icon-sun, .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
:root:not([data-theme="dark"]) .icon-moon { display: block; }
.nav-toggle { display: none; }

.visitor-chip {
    display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; font-size: 13px;
}
.visitor-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px; border-radius: 999px; font-size: 15px; font-weight: 500;
    border: 1px solid transparent; cursor: pointer; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-oauth { width: 100%; justify-content: center; background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-oauth:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero {
    display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: center;
    padding: 72px 24px 48px;
}
.hero-photo img {
    width: 240px; height: 240px; border-radius: var(--radius-lg);
    object-fit: cover; box-shadow: var(--shadow-lg);
}
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0 0 6px; letter-spacing: .02em; }
.hero-text h1 { font-size: 44px; margin: 0 0 6px; letter-spacing: -0.02em; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0deg); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 30% { transform: rotate(14deg); } 40% { transform: rotate(-4deg); } }
.hero-subtitle { font-size: 17px; font-weight: 600; color: var(--text); margin: 0 0 12px; }
.typed-tagline { font-size: 20px; color: var(--text-secondary); min-height: 30px; margin: 0 0 18px; font-weight: 500; }
.typed-cursor { display: inline-block; width: 2px; height: 20px; background: var(--accent); margin-left: 2px; vertical-align: middle; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-bio { color: var(--text-secondary); max-width: 560px; margin: 0 0 20px; }
.role-badge {
    display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px;
    box-shadow: var(--shadow-sm); margin-bottom: 28px;
}
.role-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; flex-shrink: 0; box-shadow: 0 0 0 3px #34c75926; }
.role-badge div { display: flex; flex-direction: column; line-height: 1.3; }
.role-badge strong { font-size: 13.5px; color: var(--text); }
.role-badge span { font-size: 12px; color: var(--text-muted); }
.hero-actions { display: flex; gap: 14px; }

/* ---------- Sections / reveal animation ---------- */
.section { padding: 56px 24px; }
.page-heading { margin-bottom: 32px; }
.page-heading h1 { font-size: 36px; margin: 0 0 8px; letter-spacing: -0.02em; }
.page-heading p { color: var(--text-secondary); font-size: 17px; margin: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head h2 { font-size: 26px; margin: 0; letter-spacing: -0.01em; }
.link-more { font-weight: 500; font-size: 14.5px; white-space: nowrap; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms ease, transform 700ms ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- About section ---------- */
.about-section .page-heading { margin-bottom: 28px; }
.about-closing { font-size: 18px; font-weight: 600; color: var(--text); text-align: center; margin: 32px 0 0; }

.about-stats { display: flex; gap: 20px; margin-bottom: 40px; }
.about-stat {
    flex: 1; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 24px 20px; text-align: center; box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.about-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.about-stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }
.about-stat-label { display: block; font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-bottom: 36px; }
.about-block {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 26px 26px 30px; box-shadow: var(--shadow-sm);
}
.about-block-title { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 22px; }

/* Career timeline: horizontal stepper on desktop, vertical on mobile */
.career-timeline { display: flex; justify-content: space-between; position: relative; padding-top: 4px; }
.career-timeline::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 2px; background: var(--border); z-index: 0; }
.timeline-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
.timeline-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--bg-elevated); border: 2px solid var(--border); transition: all var(--transition); }
.timeline-role { font-size: 12.5px; font-weight: 600; text-align: center; color: var(--text-secondary); line-height: 1.3; }
.timeline-step.current .timeline-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16); }
.timeline-step.current .timeline-role { color: var(--text); }

.expertise-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-pill {
    padding: 8px 16px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border);
    font-size: 13.5px; font-weight: 500; color: var(--text); transition: all var(--transition);
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.tag-pill.small { padding: 4px 10px; font-size: 11.5px; }
.tag-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tag-pill.active:hover { color: #fff; }
.tag-count { opacity: .55; font-size: .9em; margin-left: 2px; }

.pull-quote {
    margin: 0 0 20px; padding: 4px 4px 4px 24px; border-left: 3px solid var(--accent);
    font-size: 19px; line-height: 1.5; color: var(--text); font-style: normal; max-width: 720px;
}

/* ---------- Technical profile grid ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.profile-card {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 20px 22px; box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition);
}
.profile-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.profile-card h3 { font-size: 15.5px; margin: 0 0 6px; color: var(--accent); letter-spacing: -0.01em; }
.profile-card p { font-size: 14px; color: var(--text-secondary); margin: 0; }

/* ---------- Card grid (posts + projects) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card, .project-card {
    background: var(--bg-elevated); border-radius: var(--radius-md); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
}
.post-card:hover, .project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.post-card-thumb, .project-card-thumb {
    height: 160px; background-size: cover; background-position: center; background-color: var(--border);
}
.post-card-body, .project-card-body { padding: 18px 20px 22px; flex: 1; }
.post-date { color: var(--text-muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.post-card h3, .project-card h3 { font-size: 18px; margin: 8px 0 6px; color: var(--text); letter-spacing: -0.01em; }
.post-card p, .project-card p { color: var(--text-secondary); font-size: 14.5px; margin: 0; }
.post-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.project-card .link-more { display: inline-block; margin-top: 10px; font-size: 13.5px; }

/* ---------- Blog: sidebar layout, archive, active filter ---------- */
.blog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: start; }
.blog-main { min-width: 0; }
.blog-sidebar { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 28px; }
.sidebar-block {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 18px 18px 20px; box-shadow: var(--shadow-sm);
}
.sidebar-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 12px; }

.archive-year { border-bottom: 1px solid var(--border); }
.archive-year:last-child { border-bottom: none; }
.archive-year-summary {
    display: flex; align-items: center; gap: 8px; padding: 9px 2px; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--text); list-style: none;
}
.archive-year-summary::-webkit-details-marker { display: none; }
.archive-chevron {
    width: 14px; height: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: transform var(--transition);
}
.archive-chevron::before {
    content: ""; width: 0; height: 0; border-style: solid; border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent currentColor;
}
.archive-year[open] > .archive-year-summary .archive-chevron { transform: rotate(90deg); }
.archive-year-summary .archive-count { margin-left: auto; }

.archive-months { list-style: none; margin: 0 0 8px; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 2px; }
.archive-month-link {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
    font-size: 13.5px; color: var(--text-secondary); transition: all var(--transition);
}
.archive-month-link:hover { background: var(--bg); color: var(--text); }
.archive-month-link.active { background: var(--accent); color: #fff; }
.archive-month-link.active .archive-count { color: rgba(255, 255, 255, 0.8); }
.archive-count {
    font-size: 11.5px; color: var(--text-muted); background: var(--bg); border-radius: 999px;
    padding: 1px 7px; margin-left: auto;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.active-filter {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: rgba(var(--accent-rgb), 0.08); border: 1px solid rgba(var(--accent-rgb), 0.2);
    border-radius: var(--radius-sm); padding: 10px 16px; margin-bottom: 24px; font-size: 14px; color: var(--text);
}
.filter-clear { font-weight: 600; font-size: 13px; white-space: nowrap; }

/* ---------- Search + pagination ---------- */
.search-bar {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 999px; padding: 12px 18px; margin-bottom: 32px;
    max-width: 460px; color: var(--text-muted);
}
.search-bar input {
    border: none; outline: none; background: transparent; flex: 1;
    font-size: 15px; color: var(--text); font-family: inherit;
}
.search-clear { font-size: 20px; color: var(--text-muted); line-height: 1; }
.empty-state { color: var(--text-secondary); padding: 40px 0; text-align: center; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.page-btn {
    min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    font-size: 14px; font-weight: 500; transition: all var(--transition);
}
.page-btn:hover { box-shadow: var(--shadow-sm); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ---------- Family tree (vertical, collapsible — no horizontal scroll) ---------- */
.about-stat-value.tight { font-size: 15px; line-height: 1.35; font-weight: 700; }

.tree-legend {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 16px; margin-top: 28px;
}
.legend-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-dot-line { background: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
.legend-dot-other { background: var(--border); }

.tree-controls { display: flex; align-items: center; gap: 8px; }
.tree-btn {
    padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--bg-elevated); color: var(--text); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
}
.tree-btn:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }

.family-tree-section { padding: 8px 0 64px; }

.family-tree, .tree-children { list-style: none; margin: 0; padding: 0; }
.tree-children { padding-left: 26px; margin-top: 4px; }

.tree-node-item { position: relative; }
.tree-children > .tree-node-item { border-left: 2px solid var(--border); padding-left: 22px; margin-left: 4px; }
.tree-children > .tree-node-item.direct-line-item { border-left-color: var(--accent); box-shadow: -2px 0 10px -3px rgba(var(--accent-rgb), 0.5); }
.tree-children > .tree-node-item:last-child { padding-bottom: 2px; }

/* Row shared by both <summary> (expandable) and the plain leaf <div> */
.tree-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 3px 0;
    border-radius: var(--radius-sm); cursor: pointer; list-style: none;
    background: transparent; border: 1px solid transparent;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
    opacity: 0; transform: translateY(10px);
}
.tree-row.in-view { opacity: 1; transform: translateY(0); }
.tree-row::-webkit-details-marker { display: none; }
.tree-row:hover { background: var(--bg); }
.tree-row.leaf { cursor: default; }
.tree-row.leaf:hover { background: var(--bg); }

.tree-row.direct-line { background: rgba(var(--accent-rgb), 0.06); border-color: rgba(var(--accent-rgb), 0.22); }
.tree-row.direct-line:hover { background: rgba(var(--accent-rgb), 0.1); }
.tree-row.is-self { animation: familyGlow 3.2s ease-in-out infinite; }
@keyframes familyGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.16); }
    50% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.16); }
}
.tree-row.is-root { font-weight: 600; }

.tree-chevron {
    flex-shrink: 0; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
    transition: transform var(--transition); color: var(--text-muted);
}
.tree-chevron::before {
    content: ""; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent currentColor;
}
details[open] > summary .tree-chevron { transform: rotate(90deg); }
.tree-chevron-spacer { visibility: hidden; }

.tree-avatar {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm);
}
.tree-avatar-initials {
    background: hsl(var(--hue) 70% 50%); color: #fff; font-weight: 700; font-size: 13.5px;
    display: flex; align-items: center; justify-content: center; letter-spacing: .01em;
}

.tree-row-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.tree-row-name { font-size: 14.5px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tree-row-meta { font-size: 12px; color: var(--text-secondary); }

.row-badge {
    font-size: 10px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.row-badge-root { background: linear-gradient(135deg, #ffd60a, #ff9f0a); color: #5b3a00; }
.row-badge-self { background: var(--accent); color: #fff; }

.tree-count {
    margin-left: auto; flex-shrink: 0; font-size: 11px; color: var(--text-muted); background: var(--bg);
    border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px;
}

/* ---------- Blog detail ---------- */
.blog-detail { max-width: 760px; }
.blog-hero-image { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); margin-bottom: 32px; }
.blog-content { font-size: 17px; color: var(--text); line-height: 1.7; }
.blog-content h2 { font-size: 26px; margin: 36px 0 16px; letter-spacing: -0.01em; }
.blog-content h3 { font-size: 20px; margin: 28px 0 12px; letter-spacing: -0.01em; }
.blog-content p { margin: 0 0 20px; }
.blog-content a { color: var(--accent); text-underline-offset: 2px; }
.blog-content ul, .blog-content ol { margin: 0 0 20px; padding-left: 24px; }
.blog-content li { margin-bottom: 8px; }
.blog-content blockquote {
    margin: 0 0 20px; padding: 2px 4px 2px 20px; border-left: 3px solid var(--accent);
    color: var(--text-secondary); font-style: italic;
}
.blog-content img { border-radius: var(--radius-md); margin: 24px 0; box-shadow: var(--shadow-sm); }
.blog-content p code, .blog-content li code, .blog-content h2 code, .blog-content h3 code {
    background: var(--border); padding: 2px 6px; border-radius: 6px; font-size: 14px;
}
.blog-content pre {
    margin: 0 0 24px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
    background: #1e1e1e; overflow: hidden;
}
.blog-content pre code {
    display: block; overflow-x: auto; padding: 18px 20px; font-size: 13.5px;
    line-height: 1.6; background: none; color: #d4d4d4;
}

.blog-engagement { display: flex; align-items: center; gap: 16px; margin: 36px 0; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.like-btn {
    display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    cursor: pointer; font-size: 14.5px; font-weight: 500; transition: all var(--transition);
}
.like-btn:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.like-btn.liked { color: #ff375f; border-color: #ff375f33; background: #ff375f14; }
.like-btn.pulse { animation: pulse 300ms ease; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.engagement-hint { color: var(--text-muted); font-size: 13.5px; }

.comments-section h2 { font-size: 22px; margin-bottom: 20px; }
.comment-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }
.comment { display: flex; gap: 12px; }
.comment img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-body { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; flex: 1; }
.comment-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.comment-time { color: var(--text-muted); font-size: 12.5px; }
.comment-body p { margin: 0; font-size: 14.5px; }

.comment-form { display: flex; gap: 12px; align-items: flex-start; }
.comment-form img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.comment-form textarea {
    flex: 1; min-height: 60px; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text);
    font-family: inherit; font-size: 14.5px; resize: vertical;
}
.login-prompt { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; text-align: center; }
.login-prompt p { margin: 0 0 16px; color: var(--text-secondary); }
.oauth-buttons { display: flex; flex-direction: column; gap: 10px; max-width: 280px; margin: 0 auto; }

/* ---------- Contact ---------- */
.contact-card {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); padding: 36px; max-width: 560px;
}
.contact-card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.contact-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); }
.contact-card-top h2 { margin: 0 0 2px; font-size: 20px; }
.muted { color: var(--text-secondary); margin: 0; font-size: 14px; }

.contact-methods { display: flex; flex-direction: column; }
.contact-method {
    display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border);
}
.method-icon {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.method-icon svg { width: 19px; height: 19px; }
.method-icon.phone, .method-icon.email { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.method-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.method-label { font-size: 12px; color: var(--text-muted); }
.method-value { font-size: 15px; font-weight: 500; color: var(--text); }
.method-actions { display: flex; gap: 8px; flex-shrink: 0; }
.method-action-btn {
    width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-elevated); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.method-action-btn svg { width: 16px; height: 16px; }
.method-action-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.method-action-btn.call:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), 0.4); }
.method-action-btn.whatsapp:hover { color: #25d366; border-color: #25d36655; }

.social-grid-title {
    font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); margin: 28px 0 14px;
}
.social-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 14px; }
.social-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.social-tile-icon {
    width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition);
}
.social-tile-icon svg { width: 24px; height: 24px; }
.social-tile:hover .social-tile-icon { transform: translateY(-3px) scale(1.06); box-shadow: var(--shadow-md); }
.social-tile-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }

.social-tile-icon.icon-linkedin { background: rgba(10, 102, 194, 0.12); color: #0a66c2; }
.social-tile-icon.icon-github { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.social-tile-icon.icon-x { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.social-tile-icon.icon-youtube { background: rgba(255, 0, 0, 0.1); color: #ff0000; }
.social-tile-icon.icon-instagram { background: linear-gradient(135deg, rgba(249, 206, 52, 0.15), rgba(238, 42, 123, 0.15), rgba(98, 40, 215, 0.15)); color: #d6249f; }
.social-tile-icon.icon-facebook { background: rgba(24, 119, 242, 0.12); color: #1877f2; }

/* ---------- Error page ---------- */
.error-page { display: flex; justify-content: center; padding: 90px 24px; }
.error-card { text-align: center; max-width: 420px; }
.error-code { font-size: 88px; font-weight: 800; color: var(--accent); letter-spacing: -0.03em; }
.error-card h1 { margin: 0 0 12px; font-size: 26px; }
.error-card p { color: var(--text-secondary); margin: 0 0 28px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; }
.footer-socials { display: flex; justify-content: center; gap: 16px; margin-bottom: 20px; }
.footer-socials a {
    width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); border: 1px solid var(--border); transition: all var(--transition);
}
.footer-socials a svg { width: 16px; height: 16px; }
.footer-socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.footer-inner p { margin: 0; color: var(--text-muted); font-size: 13.5px; }
.footer-inner p code { background: var(--border); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.footer-links { display: flex; gap: 18px; font-size: 13.5px; }

/* ---------- Toasts (used by JS for like/comment feedback) ---------- */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px;
    font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
    transition: all var(--transition); z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 48px; }
    .hero-photo { justify-self: center; }
    .hero-bio { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .about-grid { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-layout { grid-template-columns: 1fr; }
    .blog-sidebar { position: static; flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .sidebar-block { flex-shrink: 0; min-width: 260px; }
}

@media (max-width: 640px) {
    .main-nav {
        position: absolute; top: 56px; left: 0; right: 0; background: var(--bg-elevated);
        flex-direction: column; padding: 12px 24px; gap: 4px; border-bottom: 1px solid var(--border);
        transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all var(--transition);
    }
    .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .main-nav a { padding: 10px 0; }
    .nav-toggle { display: flex; }
    .card-grid { grid-template-columns: 1fr; }
    .hero-text h1 { font-size: 32px; }
    .social-icon-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .contact-card { padding: 24px 20px; }
    .method-actions { gap: 6px; }
    .method-action-btn { width: 32px; height: 32px; }
    .about-stats { flex-direction: column; }
    .profile-grid { grid-template-columns: 1fr; }
    .pull-quote { font-size: 17px; }

    .career-timeline { flex-direction: column; align-items: flex-start; gap: 20px; }
    .career-timeline::before { top: 0; bottom: 0; left: 8px; right: auto; width: 2px; height: auto; }
    .timeline-step { flex-direction: row; align-items: center; gap: 14px; width: 100%; }
    .timeline-role { text-align: left; }

    .tree-legend { justify-content: flex-start; }
    .tree-children { padding-left: 16px; }
    .tree-children > .tree-node-item { padding-left: 14px; margin-left: 2px; }
    .tree-row { padding: 9px 10px; gap: 9px; }
    .tree-row-name { font-size: 13.5px; }
    .tree-avatar { width: 34px; height: 34px; }
    .tree-count { display: none; }
}

