:root {
  /* ── Colour palette ───────────────────────────────────────── */
  --bg-color: #ffffff;
  --font-color: #282828;
  --accent-color: #20B2AA;
  --accent-hover: #178f8c;
  --chip-bg: #f0faf9;
  --border-color: #a0d8d5;
  --card-bg: #f4f4f4;
  --card-bg-alt: #f5f5f5;
  --header-bg: #0f1117;

  /* ── Glassmorphism ────────────────────────────────────────── */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);

  /* ── Type scale — change these to resize the whole site ──── */
  --text-xs:   12px;
  --text-sm:   14.5px;
  --text-md:   16px;
  --text-base: 20px;
  --text-lg:   18px;
  --text-hero: clamp(2rem, 6vw, 3.2rem);
}

[data-theme="dark"] {
    --bg-color: #282828;
    --font-color: #fff;
    --chip-bg: #3a3a3a;
    --mbcard-bg: #3a3a3a;
    --card-bg: #3a3a3a;
    --card-bg-alt: #3a3a3a;
    --glass-bg: rgba(40, 40, 40, 0.65);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* ── Reading progress bar ──────────────────────────────────── */
#reading-progress-bar {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-color);
    transition: width 0.1s linear;
}

/* ── Named color utilities (for inline color-name highlighting) ─── */
.color-red    { color: #ef4444; }
.color-green  { color: #22c55e; }
.color-blue   { color: #3b82f6; }
.color-yellow { color: #eab308; }
.color-cyan   { color: #06b6d4; }
.color-magenta{ color: #d946ef; }
.color-violet { color: #8b5cf6; }
.color-white  { color: #888; }    /* not pure white — use visible gray */
.color-black  { color: #000; }
.color-gray   { color: #888; }
.color-orange { color: #f97316; }
.color-pink   { color: #ec4899; }
.color-brown  { color: #a16207; }

/* ── Focus states ──────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
    border-radius: 3px;
}

body {
    font-family: 'Inter', "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.65;
    padding: 0px;
    margin: 0px;
    background: linear-gradient(135deg, var(--bg-color) 0%, #f8fcfb 50%, #f2f8f7 100%);
    color: var(--font-color);
    background-attachment: fixed;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, var(--bg-color) 0%, #222 50%, #1e2828 100%);
}

header, section, article, footer, aside, nav, hgroup, h1, h2, h3, h4, h5, h6 {
    display: block;
}

h1 { margin-top: 0.67em; margin-bottom: 0.67em; font-size: 2.00em; font-weight: bold; }
h2 { margin-top: 0.83em; margin-bottom: 0.83em; font-size: 1.50em; font-weight: bold; }

h3 { margin-top: 1.00em; margin-bottom: 1.00em; font-size: 1.17em; font-weight: bold; }
h4 { margin-top: 1.33em; margin-bottom: 1.33em; font-size: 1.00em; font-weight: bold; }
h5 { margin-top: 1.67em; margin-bottom: 1.67em; font-size: 0.83em; font-weight: bold; }
h6 { margin-top: 2.33em; margin-bottom: 2.33em; font-size: 0.67em; font-weight: bold; }

.container {
    width: min(90%, 1100px);
    margin: auto;
    overflow: hidden;
}

#top_header {
    background-color: var(--header-bg);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

#top_header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    overflow: visible;
}

#top_header_algo {
    background-color: #1E423B;
}

#header_algo {
    text-align: center;
    padding: 20px 0;
    background-color: #065150;
    color: #ffffff;
}

p, li {
    font-family: sans-serif;
    font-variant: normal;
    text-decoration: none;
    word-spacing: normal;

}

#branding h1 {
    margin: 0;
    font-size: 1.15em;
}

#branding a{
	text-decoration: none;
	color: #ffffff;
	display: inline-block;
	outline: none;
}

#branding a:hover{
	color: #cccccc;
}

nav {
    margin-top: 0;
}

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: inline-block;
    list-style: none;
    position: relative;
    padding-bottom: 3px;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: color 0.2s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255,255,255,0.5);
    transition: width 0.25s ease;
    border-radius: 2px;
}

nav a:hover::after {
    width: 100%;
}

nav ul {
    margin: 0px;
    padding: 0px;
}

nav #post_algo{
    margin-top: 30px;
}

nav li {
    font-family: 'Inter', 'Helvetica', 'Arial', sans-serif;
    display: inline;
    padding: 0 14px;
}

nav a:hover {
    color: #ffffff;
    font-weight: 500;
}

nav > ul > li.current > a {
    color: var(--accent-color);
    font-weight: 600;
}

nav > ul > li.current > a::after {
    width: 100%;
    background: var(--accent-color);
}

.nav-dropdown-menu li.current a {
    color: var(--accent-color);
    font-weight: 600;
}

/* More dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown.current .nav-dropdown-toggle {
    color: var(--accent-color);
    font-weight: 600;
}

.nav-dropdown.current .nav-dropdown-toggle::after {
    display: none;
}

.nav-dropdown-toggle {
    cursor: default;
    user-select: none;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--header-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    padding: 16px 0 6px;
    min-width: 120px;
    z-index: 100;
    list-style: none;
    margin: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu li {
    display: block;
    padding: 0;
}

.nav-dropdown-menu li a {
    display: block;
    padding: 8px 18px;
    white-space: nowrap;
    text-decoration: none;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    transition: color 0.2s ease, text-decoration-color 0.25s ease;
}

.nav-dropdown-menu li a::after {
    display: none;
}

.nav-dropdown-menu li a:hover {
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.85);
}

[data-theme="dark"] .nav-dropdown-menu {
    background: var(--header-bg);
}

#btmnav {
    list-style: none;
}

#btmnav li {
    display: inline;
}

#showcase, #experience, #education, #projects, #skills {
    scroll-margin-top: 80px;
}

#showcase{
	text-align: center;
    margin-top: 70px;
}

#showcase h1 {
    font-size: var(--text-hero);
    margin-bottom: 10px;
}

aside {
    float: right;
    width: 30%;
    margin-top: 36px;
}

#main{
	margin-bottom: 40px;
}

#sidebar a, #main-art a, #univ a, #post a, #projects-page a{
	text-decoration: none;
	color: var(--accent-color);
	outline: none;
}

#tags a{
    text-decoration: none;
    background-color: var(--accent-color);
    color: white;
    padding: 3px 6px;
    margin-top: 3px;
    display: inline-block;
    text-align: center;
    border-radius: 3px;
}

#tags a:hover, #projects-page a:hover{
    opacity: 0.75;
}

#main-art a:hover, #sidebar a:hover{
    /* color: darkgray; */
    opacity: 0.75;
}

#univ a:hover {
	color: orange;
}

article#main-art{
    float: left;
    width: 65%;
}

.timeline {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid #e2e8f0;
    margin-left: 8px;
}

[data-theme="dark"] .timeline {
    border-left-color: #3a4a5a;
}

.timeline-item {
    position: relative;
    padding-top: 4px;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(calc(-50% - 24px));
    width: 12px;
    height: 12px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background-color: var(--bg-color);
    z-index: 1;
    transition: border-color 0.2s;
}

.timeline-item--current .timeline-icon {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    width: 14px;
    height: 14px;
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.18);
}

.timeline-content {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: var(--glass-shadow);
    position: relative;
    z-index: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.timeline-item--current .timeline-content {
    border-left: 3px solid var(--accent-color);
}

.timeline-content:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .timeline-content:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .timeline-content {
    border-color: var(--glass-border);
}

/* Experience card internals */
.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.exp-meta {
    flex: 1;
    min-width: 0;
}

.exp-role {
    font-size: var(--text-lg);
    font-weight: 700;
    margin: 0 0 3px 0;
    color: var(--font-color);
    line-height: 1.3;
}

.exp-company {
    font-size: var(--text-md);
    color: #666;
    margin: 0;
}

[data-theme="dark"] .exp-company {
    color: #999;
}

.exp-date {
    font-size: var(--text-sm);
    font-weight: 500;
    color: #888;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.exp-date.current {
    background: rgba(32, 178, 170, 0.1);
    color: var(--accent-color);
}

[data-theme="dark"] .exp-date {
    background: #2a3a4a;
    color: #aaa;
}

.exp-desc {
    font-size: var(--text-md);
    line-height: 1.65;
    color: #555;
    margin: 0 0 10px 0;
}

[data-theme="dark"] .exp-desc {
    color: #bbb;
}

.exp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.exp-tags .chip {
    font-size: var(--text-sm);
    padding: 2px 9px;
}

.exp-sub {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

[data-theme="dark"] .exp-sub {
    border-top-color: #3a3a3a;
}

.exp-sub-role {
    font-size: var(--text-sm);
    font-weight: 600;
    color: #666;
    margin: 0 0 5px 0;
}

[data-theme="dark"] .exp-sub-role {
    color: #aaa;
}

/* Adjust this for mobile view */
@media screen and (max-width: 768px) {
    .timeline {
        padding-left: 18px;
    }
    .timeline-icon {
        transform: translateX(calc(-50% - 18px));
    }
    .exp-header {
        flex-direction: column;
        gap: 6px;
    }
}

.floating-sidebar {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-color);
    padding: 6px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    border-radius: 14px;
    z-index: 1000;
    border: 1px solid rgba(0,0,0,0.07);
}

[data-theme="dark"] .floating-sidebar {
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    color: #94a3b8;
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: 9px;
    transition: all 0.18s ease;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.sidebar-link .fa {
    width: 14px;
    text-align: center;
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.sidebar-link:hover, .sidebar-link:focus {
    color: var(--accent-color);
    background: rgba(32, 178, 170, 0.08);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--accent-color);
    background: rgba(32, 178, 170, 0.10);
    font-weight: 600;
}


.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--accent-color);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.view-all-link:hover {
    gap: 10px;
    opacity: 1 !important;
    color: var(--accent-hover);
}

#projects {
	margin-top: 30px;
	font-family: sans-serif;
}

#skills {
    font-family: sans-serif;
}

/* My projects */
#myprojects {
    display: flex;
    flex-wrap: wrap;
}
#myprojects li {
    flex: 1 0 40%; /* This means that each item will take up 50% of the container's width */
    box-sizing: border-box;
    padding: 10px;
    margin: 5px;
    list-style-type: none;
    background: var(--card-bg-alt);
    cursor: pointer; /* Changes the cursor to a hand icon when hovering over the item */
}

.project-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
}

[data-theme="dark"] .project-card {
    border-color: var(--glass-border);
}

.project-card:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .project-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.project-card img {
    width: 100%;
    height: 175px;
    object-fit: cover;
    display: block;
}

.project-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.project-card h4 {
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.45;
    margin: 0;
    color: var(--font-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    transition: color 0.15s;
}

.project-card:hover h4 {
    color: var(--accent-color);
}

.project-card p {
    font-size: var(--text-sm);
    color: #777;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.project-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.project-card-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    background: rgba(32,178,170,0.08);
    border: 1px solid rgba(32,178,170,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.project-card-link {
    font-size: var(--text-sm);
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    transition: color 0.15s;
    flex-shrink: 0;
}

.project-card:hover .project-card-link {
    color: var(--accent-color);
}

/* override inherited teal link color inside cards */
#main-art .project-card a,
#projects-page .project-card a {
    color: inherit;
    text-decoration: none;
}

.btn {
    display: block;
    width: 80%;
    padding: 10px;
    background-color: var(--accent-color);
    color: white;
    text-align: center;
    margin: 0 auto 20px auto;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.btn:hover {
    background-color: var(--accent-hover);
}

/* ── Events list ──────────────────────────────────────────── */
.events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.events-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

[data-theme="dark"] .events-item {
    border-bottom-color: #383838;
}

.events-item:first-child {
    padding-top: 0;
}

.events-name {
    font-size: var(--text-md);
    color: var(--font-color);
    font-weight: 500;
}

.events-date {
    font-size: var(--text-sm);
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Project list (projects page) ────────────────────────── */
.project-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-list-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 24px 0;
}

[data-theme="dark"] .project-list-item {
    border-bottom-color: #383838;
}

.project-list-item:first-child {
    padding-top: 0;
}

.project-list-row {
    display: flex;
    gap: 20px;
    text-decoration: none !important;
    color: inherit !important;
    opacity: 1 !important;
    align-items: flex-start;
}

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

.project-list-row:hover .blog-list-thumb img {
    transform: scale(1.04);
}

.project-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.project-list-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.project-list-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--font-color);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s;
    margin: 0;
}

.project-list-title:hover {
    color: var(--accent-color);
    opacity: 1 !important;
}

.project-list-date {
    font-size: var(--text-sm);
    color: #999;
    white-space: nowrap;
    margin-left: auto;
}

.project-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.project-tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-color);
    background: rgba(32,178,170,0.08);
    border: 1px solid rgba(32,178,170,0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

.project-list-desc {
    font-size: var(--text-md);
    color: #666;
    line-height: 1.6;
    margin: 0;
}

[data-theme="dark"] .project-list-desc {
    color: #aaa;
}

.project-list-sublist {
    margin: 4px 0 0 0;
    padding-left: 20px;
    font-size: var(--text-md);
    color: #666;
    line-height: 1.7;
}

[data-theme="dark"] .project-list-sublist {
    color: #aaa;
}

.project-list-sublist li {
    margin-bottom: 4px;
}

/* ── Projects page ────────────────────────────────────────── */
.projects-page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 6px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

[data-theme="dark"] .projects-page-header {
    border-bottom-color: #3a3a3a;
}

.projects-page-title {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
}

.projects-page-subtitle {
    font-size: var(--text-md);
    color: #777;
    margin-bottom: 20px;
}

.projects-github-link {
    font-size: var(--text-md);
    color: var(--accent-color) !important;
    text-decoration: none !important;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 1 !important;
    transition: color 0.15s;
    white-space: nowrap;
}

.projects-github-link:hover {
    color: var(--accent-hover) !important;
}

.github-chart-wrap {
    margin: 0 0 2rem;
    background: var(--card-bg);
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 18px 22px 16px;
}

[data-theme="dark"] .github-chart-wrap {
    border-color: #3a3a3a;
}

.github-chart-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--font-color);
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.github-chart-wrap img {
    display: block;
    width: 100%;
    border-radius: 4px;
}

[data-theme="dark"] .github-chart-wrap img {
    opacity: 0.85;
    filter: brightness(0.9) saturate(1.1);
}

.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 5px 14px;
    margin: 0;
    border: 1.5px solid #e0e0e0;
    cursor: pointer;
    outline: none;
    background: transparent;
    color: var(--font-color);
    border-radius: 20px;
    font-size: var(--text-md);
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

[data-theme="dark"] .filter-btn {
    border-color: #444;
    color: #ddd;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}


#mypic img{
	display: block;
	margin: auto;
	width: 240px;
	max-width: 100%;
}

.dark {
    padding: 15px;
    background: #35424a;
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 10px;
}

.fa {
    padding: 5px;
}
  
.fa:hover {
    opacity: 0.7;
}

.fa-kagg:before {
    color: #429bf4;
    font-size: 1.2em;
    content: "k";
}

#social-icons {
    list-style: none;
    padding: 0;
}

#social-icons li {
    display: block;
    margin-bottom: 10px;
}

.social-icon {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: white; /* Or any color you prefer */
}

.social-icon .fa .fa-linkedin{
    font-size: 32px; /* Size of the icon */
    margin-right: 8px; /* Space between icon and text */
}

.icon-text {
    font-size: 24px;
    font-weight: bold; /* If you want the text to be bold */
}

.stack-overflow img {
    height: 32px; /* Match the height with FontAwesome icons */
    width: auto; /* Maintain the aspect ratio */
    margin-right: 8px; /* Space between icon and text */
}

.stack-overflow .icon-text {
    display: inline-block;
    vertical-align: middle;
}

#social-icons li a:hover {
    color: #cccccc; /* Change the color on hover */
}


#last_footer {
    clear: both;
    padding: 16px 24px;
    margin-top: 20px;
    color: #888;
    border-top: 1px solid #e8e8e8;
    font-size: var(--text-md);
}

[data-theme="dark"] #last_footer {
    color: #777;
    border-top-color: #3a3a3a;
}

#last_footer a {
    text-decoration: none;
    color: #888;
}

[data-theme="dark"] #last_footer a { color: #777; }

#last_footer a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-linkedin {
    display: inline-flex;
    align-items: center;
    font-size: 1.2rem;
}

#last_footer .container {
    overflow: visible;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

@media (max-width: 768px) {
    .footer-right { align-items: flex-end; }
}

/* ── Skip to content ──────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    z-index: 9999;
    padding: 8px 16px;
    background: var(--accent-color);
    color: #fff !important;
    border-radius: 0 0 8px 8px;
    font-size: var(--text-md);
    font-weight: 500;
    text-decoration: none !important;
    transition: top 0.15s;
}

.skip-link:focus { top: 0; }

/* ── Post share buttons ───────────────────────────────────── */
.post-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.post-share-label {
    font-size: var(--text-sm);
    color: #888;
    font-weight: 500;
}

.post-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none !important;
    border: 1.5px solid #e0e0e0;
    color: var(--font-color) !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    cursor: pointer;
    background: transparent;
}

.post-share-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff !important;
}

[data-theme="dark"] .post-share-btn { border-color: #444; }

iframe, object, embed, video{
    max-width: 100%;
}
  
/* Switch theme */

/* ── Theme toggle button ──────────────────────────────────── */

input#themeswitch {
    display: none;
}

.theme-switch-wrapper {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 1000;
}

#theme-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

#theme-switch:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.1);
}

.toggle-track {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-thumb {
    display: none;
}

/* Light mode: show sun, hide moon */
.toggle-icon.fa-sun-o {
    display: inline-block;
    color: #f9c22b;
    font-size: 16px;
    line-height: 1;
}

.toggle-icon.fa-moon-o {
    display: none;
    font-size: 15px;
    line-height: 1;
}

/* Dark mode: show moon, hide sun */
[data-theme="dark"] .toggle-icon.fa-sun-o {
    display: none;
}

[data-theme="dark"] .toggle-icon.fa-moon-o {
    display: inline-block;
    color: #e8e8e8;
}

#contact-form form input, #contact-form form textarea {
    margin-bottom: 0.5em;
}

#contact-form input, #contact-form textarea {
    border: 1px solid #ddd; 
    background: #fff;
    padding: 0.2em;
    width: 97%;
}

#contact-form button, #contact-form input, #contact-form select, #contact-form textarea {
    font-size: 100%;
    margin: 0;
    vertical-align: baseline;
}

/* Categories */
.tag-cloud {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tag-cloud li {
    display: inline-block;
    margin: 0;
}

.tag-cloud li a {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 20px;
    background-color: var(--card-bg);
    color: var(--accent-color);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1.6;
}

.tag-cloud li a:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    text-decoration: none;
}

.tag-cloud-divider {
    border: none;
    border-bottom: 2px solid #f0f0f0;
    margin: 16px 0 0 0;
}

[data-theme="dark"] .tag-cloud-divider {
    border-bottom-color: #3a3a3a;
}

#taggs {
    padding: 5px;
}
.taggs-group {
    margin: 5px;
    border-top: 1px solid #ddd;
}
.taggs-item {
    margin-left: 5px;
}
.post-tags {
    text-align: right;
}


/* Pagination */
.pagination {
    margin-top: 32px;
    margin-bottom: 16px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span,
.pagination em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: var(--text-md);
    font-weight: 500;
    font-style: normal;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    color: var(--font-color);
}

.pagination a {
    background: var(--card-bg);
    color: var(--font-color);
}

.pagination a:hover {
    background: var(--accent-color);
    color: #ffffff;
    opacity: 1;
}

/* current page */
.pagination em {
    background: var(--accent-color);
    color: #ffffff;
    cursor: default;
}

/* disabled prev/next */
.pagination span {
    background: transparent;
    color: #ccc;
    cursor: default;
}

/* Prev / Next get a bit more padding */
.pagination a:first-child,
.pagination a:last-child {
    padding: 0 14px;
    font-size: var(--text-sm);
    letter-spacing: 0.02em;
}

[data-theme="dark"] .pagination a {
    background: #3a3a3a;
}

[data-theme="dark"] .pagination span {
    color: #555;
}

.card {
    display: inline-block;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    transition: 0.3s;
    width: 40%;
    border-radius: 5px;
    padding: 5px;
    margin: 30px;
    overflow: hidden; /* To ensure the contents are contained within the card */
}

.card:hover {
    box-shadow: 0 0 8px 8px rgba(0,0,0,0.2);
}

.card-content {
    padding: 15px;
}

.card .btn.read-more {
    display: inline-block; /* To keep the button inline */
    margin-top: 10px;
}

/* Ensure the image fits nicely in the card */
.post-image img {
    display: block;
    width: 100%; /* Makes the image responsive */
    height: auto; /* Maintains the aspect ratio */
    margin-bottom: 10px;
    border-top-left-radius: 5px; /* Match the card's border radius */
    border-top-right-radius: 5px; /* Match the card's border radius */
}

@media(max-width: 768px) {
	.container{
		width: 86%;
	}
    #showcase, #experience, #education, #projects, #skills {
        scroll-margin-top: 110px;
    }
	#top_header .container {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 6px;
    }
    header #branding,
    nav,
    aside#sidebar {
        float: none;
        text-align: center;
        width: 100%;
        word-wrap: break-word;
    }
    nav li {
        padding: 0 10px;
    }
    article#main-art,
    article#blog {
        float: none;
        width: 100%;
    }
    nav #post_algo {
        margin-top: 0px;
    }
    iframe, video{
        max-width: 100%;
        height: 80%;
    }
    label#theme{
        margin: 0;
    }
    .card {
        width: 100%;
        margin: 0;
        margin-bottom: 30px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .blog-card-img {
    height: 200px;
    }    
    
    .floating-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        transform: none;
        width: 100%;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 4px 0;
        border-radius: 0;
        border-top: 1px solid rgba(0,0,0,0.07);
    }

    .sidebar-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 6px 8px;
        font-size: 10px;
    }

    .sidebar-link span {
        display: none;
    }

    .sidebar-link .fa {
        font-size: 18px;
        width: auto;
    }

    .floating-sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        justify-content: center;
    }

    .floating-sidebar ul li {
        padding: 0 10px;
    }


}


/* ── Hero Section ─────────────────────────────────────────── */

.hero-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 40px 32px 32px;
    border-radius: 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-bottom: 32px;
}

[data-theme="dark"] .hero-grid {
    border-color: var(--glass-border);
}

.hero-photo img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e8e8e8;
    display: block;
}

[data-theme="dark"] .hero-photo img {
    border-color: #4a4a4a;
}

.hero-title {
    color: var(--font-color);
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin: 0 0 8px 0;
}

.hero-bio {
    font-size: var(--text-lg);
    line-height: 1.75;
    color: #555;
    margin-bottom: 16px;
}

[data-theme="dark"] .hero-bio {
    color: #bbb;
}

.hero-title {
    min-height: 1.4em;
}

.hero-title::after {
    content: '|';
    animation: blink 0.7s step-end infinite;
    color: var(--accent-color);
    font-weight: 300;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-focus {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-focus li {
    font-size: var(--text-md);
    color: #666;
    line-height: 1.6;
}

.hero-focus li::before {
    content: '▹';
    color: var(--accent-color);
    margin-right: 8px;
}

[data-theme="dark"] .hero-focus li {
    color: #aaa;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: #888;
    margin-top: 6px;
    letter-spacing: 0.03em;
}

[data-theme="dark"] .hero-stats {
    color: #999;
}

.stat-divider {
    color: var(--accent-color);
    font-weight: 700;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

@keyframes chipFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-chips .chip {
    animation: chipFadeIn 0.4s ease both;
}

.hero-chips .chip:nth-child(1)  { animation-delay: 0.05s; }
.hero-chips .chip:nth-child(2)  { animation-delay: 0.10s; }
.hero-chips .chip:nth-child(3)  { animation-delay: 0.15s; }
.hero-chips .chip:nth-child(4)  { animation-delay: 0.20s; }
.hero-chips .chip:nth-child(5)  { animation-delay: 0.25s; }
.hero-chips .chip:nth-child(6)  { animation-delay: 0.30s; }
.hero-chips .chip:nth-child(7)  { animation-delay: 0.35s; }
.hero-chips .chip:nth-child(8)  { animation-delay: 0.40s; }
.hero-chips .chip:nth-child(n+9){ animation-delay: 0.45s; }

/* ── Chips ────────────────────────────────────────────────── */

.chip {
    display: inline-block;
    background: var(--chip-bg);
    color: var(--accent-color);
    border: 1px solid rgba(32, 178, 170, 0.3);
    border-radius: 16px;
    padding: 3px 11px;
    font-size: var(--text-sm);
    line-height: 1.6;
    white-space: nowrap;
}

[data-theme="dark"] .chip {
    background: #2a3e3e;
    border-color: rgba(32, 178, 170, 0.35);
}

/* ── Skills in sidebar ────────────────────────────────────── */

.skill-group {
    margin-bottom: 14px;
}

.skill-group:last-child {
    margin-bottom: 0;
}

.skill-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #aaa;
    margin-bottom: 7px;
}

.skill-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* ── Company links ────────────────────────────────────────── */

.company-link {
    color: var(--accent-color) !important;
    text-decoration: none;
}

/* ── Timeline date ────────────────────────────────────────── */

.timeline-date {
    font-size: var(--text-sm);
    color: #888;
    margin: 2px 0 6px 0;
}

[data-theme="dark"] .timeline-date {
    color: #999;
}

/* ── Sidebar cards ────────────────────────────────────────── */

.sidebar-section {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: var(--glass-shadow);
}

[data-theme="dark"] .sidebar-section {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.sidebar-section h2 {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #aaa;
    margin: 0 0 12px 0;
    padding: 0;
}

[data-theme="dark"] .sidebar-section h2 {
    color: #888;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #ebebeb;
    text-decoration: none !important;
    color: var(--font-color) !important;
    font-size: var(--text-md);
    font-weight: 500;
    opacity: 1 !important;
    transition: color 0.15s ease;
}

[data-theme="dark"] .social-row {
    border-bottom-color: #444;
}

.social-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.social-row:hover {
    color: var(--accent-color) !important;
    opacity: 1 !important;
}

.social-row .fa {
    width: 22px;
    text-align: center;
    font-size: var(--text-base);
    color: var(--accent-color);
    padding: 0;
}

.so-badge {
    font-size: var(--text-sm);
    color: #999;
    margin-left: auto;
    font-weight: 400;
}

.cert-item {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #ebebeb;
    text-decoration: none !important;
    color: var(--font-color) !important;
    font-size: var(--text-md);
    line-height: 1.4;
    opacity: 1 !important;
    transition: color 0.15s ease;
}

[data-theme="dark"] .cert-item {
    border-bottom-color: #444;
}

.cert-item:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.cert-item:hover {
    color: var(--accent-color) !important;
    opacity: 1 !important;
}

.sidebar-post-item {
    padding: 9px 0;
    border-bottom: 1px solid #ebebeb;
}

[data-theme="dark"] .sidebar-post-item {
    border-bottom-color: #444;
}

.sidebar-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-post-item a {
    display: block;
    font-weight: 500;
    font-size: var(--text-md);
    color: var(--font-color) !important;
    text-decoration: none !important;
    margin-bottom: 3px;
    line-height: 1.4;
    opacity: 1 !important;
    transition: color 0.15s ease;
}

.sidebar-post-item a:hover {
    color: var(--accent-color) !important;
    opacity: 1 !important;
}

.sidebar-post-date {
    font-size: var(--text-sm);
    color: #999;
}

/* ── Blog page header ────────────────────────────────────── */

.blog-page-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 24px;
    margin-bottom: 6px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
}

[data-theme="dark"] .blog-page-header {
    border-bottom-color: #3a3a3a;
}

.blog-page-title {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
}

.blog-archive-link {
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--accent-color) !important;
    text-decoration: none;
    opacity: 1 !important;
}

.blog-archive-link:hover {
    opacity: 0.75 !important;
}

.blog-page-desc {
    font-size: var(--text-md);
    color: #777;
    margin-bottom: 20px;
}

[data-theme="dark"] .blog-page-desc {
    color: #999;
}

.blog-page-desc a {
    color: var(--accent-color);
    text-decoration: none;
}

.blog-page-desc a:hover {
    opacity: 0.75;
}

.category-page-heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-back-link {
    font-size: var(--text-md);
    color: var(--accent-color) !important;
    text-decoration: none;
    font-weight: 500;
    opacity: 1 !important;
}

.category-back-link:hover {
    opacity: 0.75 !important;
}

.category-post-count {
    margin-bottom: 8px;
}

/* ── Blog list (editorial) ────────────────────────────────── */

.blog-list {
    list-style: none;
    padding: 0;
    margin-top: 24px;
}

.blog-list-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 28px 0;
    transition: background 0.15s;
}

[data-theme="dark"] .blog-list-item {
    border-bottom-color: #383838;
}

.blog-list-item:first-child {
    padding-top: 0;
}

/* ── Blog post page ───────────────────────────────────────── */

/* ── Post layout: two-column (TOC sidebar + content) ─────── */
.post-container {
    overflow: visible;
}

.post-layout {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.post-toc-sidebar {
    flex: 0 0 220px;
    min-width: 0;
    position: sticky;
    top: calc(68px + 1.5rem);
    max-height: calc(100vh - 68px - 3rem);
    overflow-y: auto;
    align-self: flex-start;
}

/* ── Table of Contents ───────────────────────────────────── */
.toc-block {
    background: var(--chip-bg);
    border: 1px solid rgba(128,128,128,0.12);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: var(--text-sm);
}

[data-theme="dark"] .toc-block {
    background: #333;
    border-color: rgba(255,255,255,0.07);
}

.toc-summary {
    font-weight: 600;
    font-size: var(--text-md);
    cursor: pointer;
    user-select: none;
    color: var(--font-color);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.toc-summary::-webkit-details-marker { display: none; }

.toc-summary::before {
    content: '▶';
    font-size: 0.65em;
    color: var(--accent-color);
    transition: transform 0.2s;
}

.toc-block[open] .toc-summary::before {
    transform: rotate(90deg);
}

.toc-list {
    margin: 0.5rem 0 0;
    padding: 0;
    text-align: left;
}

.toc-list ol, .toc-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list a {
    display: block;
    text-decoration: none;
    padding: 5px 6px;
    line-height: 1.4;
    font-size: var(--text-xs);
    transition: background 0.15s, color 0.15s;
}

.toc-list .toc-h1 a {
    color: var(--font-color);
    font-weight: 600;
    padding-left: 0;
}

.toc-list .toc-h2 a {
    color: var(--font-color);
    font-weight: 400;
    padding-left: 14px;
}

.toc-list .toc-h3 a {
    color: var(--font-color);
    font-weight: 400;
    opacity: 0.65;
    font-size: calc(var(--text-xs) - 1px);
    padding-left: 28px;
}

.toc-list a:hover {
    color: var(--accent-color);
    background: rgba(32, 178, 170, 0.08);
}

[data-theme="dark"] .toc-list a:hover {
    background: rgba(32, 178, 170, 0.12);
}

.toc-list a.active {
    color: var(--accent-color);
    background: rgba(32, 178, 170, 0.1);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--accent-color);
}

[data-theme="dark"] .toc-list a.active {
    background: rgba(32, 178, 170, 0.15);
}

/* ─────────────────────────────────────────────────────────── */
.post-back-link {
    display: inline-block;
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--accent-color) !important;
    text-decoration: none !important;
    margin-top: 24px;
    opacity: 0.9;
    transition: opacity 0.15s;
}

.post-back-link:hover { opacity: 1 !important; }

.post-header {
    margin: 1rem 0 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8ecf0;
}

[data-theme="dark"] .post-header {
    border-bottom-color: #2e3a4a;
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 0.75rem;
    color: var(--font-color);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: #888;
}

.post-meta-sep {
    opacity: 0.5;
}

.post-meta .fa {
    margin-right: 4px;
    color: var(--accent-color);
}

.post-meta-actions .fa {
    margin-right: 0;
    color: inherit;
}

#post {
    font-size: var(--text-lg);
    line-height: 1.75;
}

.post-content-wrap {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

#post [class*="MathJax"] {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
}


.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--font-color);
    scroll-margin-top: 88px;
}

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

#post a {
    color: var(--accent-color);
    text-decoration: none;
}

#post a:hover {
    color: var(--accent-hover) !important;
    opacity: 1 !important;
}

#post code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
    background: #f0f4f8;
    color: #c0392b;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

[data-theme="dark"] #post code {
    background: #1e2a38;
    color: #e06c75;
    border-color: #2e3a4a;
}

#post pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

#post blockquote {
    margin: 1.5rem 0;
    padding: 0.4rem 1.5rem;
    background: #f0faf9;
    border-radius: 6px;
    color: #555;
    font-style: italic;
    overflow: hidden;
}

#post blockquote p {
    margin: 0.2rem 0;
    padding: 0 1.1em;
}

#post blockquote::before {
    content: "\201C";
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.2em;
    color: var(--accent-color);
    line-height: 0.8;
    float: left;
    margin-left: -0.25em;
    opacity: 0.4;
}

#post blockquote p:last-child::after {
    content: "\201D";
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.2em;
    color: var(--accent-color);
    line-height: 0.8;
    float: right;
    margin-right: -0.35em;
    opacity: 0.4;
}

[data-theme="dark"] #post blockquote {
    background: #0a1f1e;
}

/* ── Info callout ──────────────────────────────────────────── */
#post blockquote.info-callout {
    margin: 1.5rem 0;
    padding: 0.4rem 1.5rem;
    background: #f0faf9;
    border-radius: 6px;
    color: #555;
    overflow: hidden;
}

#post blockquote.info-callout p {
    margin: 0.2rem 0;
    padding: 0 1.1em;
}

#post blockquote.info-callout::before {
    content: "\2139";
    font-size: 1.6em;
    color: var(--accent-color);
    line-height: 0.8;
    float: left;
    margin-left: -0.25em;
    opacity: 0.5;
}

#post blockquote.info-callout p:last-child::after {
    content: none;
}

[data-theme="dark"] #post blockquote.info-callout {
    background: #0a1f1e;
    color: #aab;
}

[data-theme="dark"] #post blockquote {
    background: #1a2533;
    color: #aab;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 1.5rem auto;
}

.post-content figure:not(.highlight) {
    margin: 1.5rem auto;
    text-align: center;
}

.post-content figcaption {
    font-size: var(--text-sm);
    color: #888;
    font-style: italic;
    margin-top: 0.5rem;
}

[data-theme="dark"] .post-content figcaption { color: #999; }


/* ── Heading anchor links ─────────────────────────────────── */
.post-content h2,
.post-content h3,
.post-content h4 {
    position: relative;
}

.heading-anchor {
    opacity: 0;
    margin-left: 0.4em;
    font-size: 0.78em;
    font-weight: 400;
    color: var(--accent-color) !important;
    text-decoration: none !important;
    transition: opacity 0.15s;
    vertical-align: middle;
}

.post-content h2:hover .heading-anchor,
.post-content h3:hover .heading-anchor,
.post-content h4:hover .heading-anchor {
    opacity: 1;
}

/* Soundscape (shared by poems and posts) */
.post-meta-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.post-meta-tags-row .tag-cloud {
    margin-bottom: 0;
    flex: 1;
}

.post-meta-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    position: relative;
}

.poem-soundscape-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1.5px solid #e0e0e0;
    background: transparent;
    color: #888;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.poem-soundscape-toggle .fa {
    line-height: 1;
}

[data-theme="dark"] .poem-soundscape-toggle {
    border-color: #444;
    color: #999;
}

.poem-soundscape-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.poem-soundscape-toggle.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.poem-soundscape-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 95px;
    padding: 6px 0;
    background: var(--chip-bg);
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateY(-4px);
    z-index: 100;
}

[data-theme="dark"] .poem-soundscape-panel {
    background: #333;
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}

[data-theme="dark"] .poem-soundscape-panel::before {
    background: #333;
}

.poem-soundscape-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.poem-soundscape-panel::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 12px;
    width: 10px;
    height: 10px;
    background: var(--chip-bg);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.poem-soundscape-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    border: none;
    background: transparent;
    color: var(--font-color);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    text-align: left;
    white-space: nowrap;
}

.poem-soundscape-option:hover {
    background: rgba(32, 178, 170, 0.06);
}

[data-theme="dark"] .poem-soundscape-option:hover {
    background: rgba(32, 178, 170, 0.12);
}

.poem-soundscape-option.active {
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(32, 178, 170, 0.06);
}

[data-theme="dark"] .poem-soundscape-option.active {
    background: rgba(32, 178, 170, 0.12);
}

.poem-soundscape-option.active::after {
    content: '✓';
    margin-left: auto;
    font-size: 11px;
    color: var(--accent-color);
}

@media (prefers-reduced-motion: reduce) {
    .poem-soundscape-panel { transition: none; }
}

/* Edit bar */
.post-edit-bar {
    margin: 1.25rem 0 0;
}

.post-edit-link {
    font-size: var(--text-sm);
    color: #999 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    transition: color 0.15s;
}

.post-edit-link:hover {
    color: var(--accent-color) !important;
    opacity: 1 !important;
}

.post-edit-link .fa {
    margin-right: 4px;
}

/* Prev / Next navigation */
.post-nav {
    margin: 2.5rem 0 0;
    display: flex;
    gap: 12px;
}

.post-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px;
    background: #fafafa;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--font-color) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    opacity: 1 !important;
}

[data-theme="dark"] .post-nav-item {
    background: #303030;
    border-color: #3a3a3a;
}

.post-nav-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 12px rgba(32,178,170,0.1);
    opacity: 1 !important;
}

.post-nav-empty {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}

.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; }

.post-nav-label {
    font-size: var(--text-sm);
    color: var(--accent-color);
    font-weight: 500;
}

.post-nav-title {
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.4;
}


/* Related posts */
.post-related {
    margin: 2.5rem 0 0;
}

.post-related-heading {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--font-color);
}

.post-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.post-related-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    background: #fafafa;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    text-decoration: none !important;
    color: var(--font-color) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    opacity: 1 !important;
}

[data-theme="dark"] .post-related-card {
    background: #303030;
    border-color: #3a3a3a;
}

.post-related-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 2px 12px rgba(32,178,170,0.08);
    opacity: 1 !important;
}

.post-related-title {
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.4;
}

.post-related-date {
    font-size: var(--text-sm);
    color: #999;
}

.post-related-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border-radius: 6px;
    background: #eee;
    flex-shrink: 0;
}

.post-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

[data-theme="dark"] .post-related-thumb {
    background: #3a3a3a;
}

/* ── Comments section ──────────────────────────────────── */
.comments-heading {
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--font-color);
}

@media (max-width: 768px) {
    .post-layout {
        flex-direction: column;
        gap: 1.5rem;
        align-items: stretch;
    }
    .post-toc-sidebar {
        flex: none;
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
    .post-title { font-size: 1.5rem; }
    .post-nav { flex-direction: column; }
    .post-related-grid { grid-template-columns: 1fr; }
}

#post .blog-list-item a {
    display: flex;
    gap: 20px;
    text-decoration: none !important;
    color: inherit !important;
    opacity: 1 !important;
    align-items: flex-start;
}

.blog-list-thumb {
    width: 200px;
    height: 130px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f0f4f8;
}

[data-theme="dark"] .blog-list-thumb {
    background: #2a2a2a;
}

.blog-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-list-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
    color: #c0ccd8;
    font-size: 28px;
}

[data-theme="dark"] .blog-list-thumb-placeholder {
    background: linear-gradient(135deg, #2a3040, #1e2530);
    color: #3a4a5a;
}

.blog-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.blog-list-category {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-color);
}

.blog-list-title {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.4;
    color: var(--font-color);
    margin: 0;
    transition: color 0.15s ease;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.blog-list-excerpt {
    font-size: var(--text-md);
    color: #666;
    line-height: 1.55;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

[data-theme="dark"] .blog-list-excerpt {
    color: #aaa;
}

.blog-list-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.blog-list-date,
.blog-list-readtime {
    font-size: var(--text-sm);
    color: #999;
}

.blog-list-date .fa,
.blog-list-readtime .fa {
    color: var(--accent-color);
}

.blog-list-sep {
    color: #ccc;
    font-size: var(--text-sm);
}

@media (max-width: 768px) {
    #post .blog-list-item a,
    .project-list-row {
        flex-direction: column;
    }
    .blog-list-thumb {
        width: 100%;
    height: 180px;
    }
}

/* ── Blog post list ───────────────────────────────────────── */

.posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-item {
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 13px 0;
    border-bottom: 1px solid #f2f2f2;
}

[data-theme="dark"] .post-item {
    border-bottom-color: #383838;
}

.post-date {
    font-size: var(--text-md);
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 88px;
    font-variant-numeric: tabular-nums;
}

#post .post-link {
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--font-color) !important;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s ease;
    opacity: 1 !important;
}

#post .post-link:hover {
    color: var(--accent-color) !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .hero-grid {
        padding: 24px 0 20px;
    }
    .hero-photo img {
        width: 110px;
        height: 110px;
    }
    .hero-chips {
        justify-content: center;
    }
    .post-item {
        flex-direction: column;
        gap: 4px;
    }
}

/* ── Reduced motion ────────────────────────────────────────── */
/* ── Giscus dark mode ────────────────────────────────────── */
/* Giscus handles its own theme via data-theme="preferred_color_scheme" */

.sidebar-events-desc {
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.6;
}



/* ── About site page ─────────────────────────────────────── */
.about-site-favicon {
    float: right;
    margin: 0 0 12px 20px;
}

/* ── 404 page ─────────────────────────────────────────────── */
.error-404 {
    text-align: center;
    padding: 5rem 1rem 4rem;
}

.error-404-code {
    font-size: 7rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    margin: 0 0 0.25em;
}

.error-404-title {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 0.6em;
}

.error-404-desc {
    color: #777;
    font-size: var(--text-md);
    margin: 0 0 2rem;
}

[data-theme="dark"] .error-404-desc { color: #999; }

.error-404-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.error-404-btn {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1.5px solid var(--accent-color);
    color: var(--accent-color) !important;
    font-size: var(--text-md);
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
}

.error-404-btn:hover {
    background: var(--accent-color);
    color: #fff !important;
}

/* ── Categories index page ────────────────────────────────── */
.categories-index-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.categories-index-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid #e8e8e8;
    text-decoration: none !important;
    transition: border-color 0.15s, background 0.15s;
}

[data-theme="dark"] .categories-index-link {
    border-color: #3a3a3a;
}

.categories-index-link:hover {
    border-color: var(--accent-color);
    background: rgba(32,178,170,0.05);
}

.categories-index-name {
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--font-color);
}

.categories-index-count {
    font-size: var(--text-sm);
    color: var(--accent-color);
    font-weight: 600;
    background: rgba(32,178,170,0.1);
    border-radius: 20px;
    padding: 1px 9px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* The box model: to see every box that makes up the page */
/* * {
   outline: 1px solid red !important;
   background-color:rgba(0,2,54,.1) !important
} */

/* ── Chat widget ──────────────────────────────────────────── */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 230px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--glass-border);
}

[data-theme="dark"] .chat-container {
    background: #333;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
}

.chat-msg {
    display: flex;
    max-width: 88%;
    animation: msg-fadein 0.2s ease;
}

@keyframes msg-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }

.chat-bubble {
    padding: 8px 14px;
    border-radius: 16px;
    font-size: var(--text-sm);
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
}

.chat-msg.bot .chat-bubble {
    background: #f0f0f0;
    color: #282828;
    border-bottom-left-radius: 4px;
}

[data-theme="dark"] .chat-msg.bot .chat-bubble {
    background: #444;
    color: #eee;
}

.chat-msg.user .chat-bubble {
    background: var(--accent-color);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid #eee;
    background: var(--bg-color);
}

[data-theme="dark"] .chat-input-area {
    border-top-color: #444;
    background: #333;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: var(--text-sm);
    border-radius: 20px;
    background: #f5f5f5;
    color: var(--font-color);
    font-family: inherit;
}

[data-theme="dark"] .chat-input {
    background: #555;
    color: #eee;
}

.chat-send-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 16px;
    cursor: pointer;
    padding: 6px 8px;
    transition: color 0.15s;
}

.chat-send-btn:hover {
    color: var(--accent-hover);
}

.chat-send-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ── Typing indicator ──────────────────────────────────── */

.chat-msg.bot.typing .chat-bubble {
    padding: 10px 16px 8px;
}

.typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
    height: 16px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    display: inline-block;
    animation: dot-blink 1.4s infinite both;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

/* ── Done state ────────────────────────────────────────── */

.chat-done {
    text-align: center;
    margin-top: 4px;
    animation: msg-fadein 0.3s ease;
}

.chat-status {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: var(--text-sm);
    line-height: 1.5;
}

.chat-status.success {
    background: var(--chip-bg);
    color: var(--accent-color);
    font-weight: 500;
}

[data-theme="dark"] .chat-status.success {
    background: #1a3a3a;
    color: var(--accent-color);
}

.chat-status.error {
    background: #fde8e8;
    color: #a33;
    font-size: var(--text-xs);
}

[data-theme="dark"] .chat-status.error {
    background: #3a1a1a;
    color: #f77;
}

.chat-status.error a {
    color: var(--accent-color);
    text-decoration: underline;
}


/* The box model: to see every box that makes up the page (don't delete this) */
/* * { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); } */
