/* Project cards: icons, badges, illustrations, hover effects */

.projects-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.75em;
	margin-top: 1em;
}

.project-card {
	--accent: #b8d96b;
	position: relative;
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-top: 4px solid var(--accent);
	border-radius: 10px;
	padding: 1.4em 1.4em 1.6em;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35);
	border-color: rgba(255, 255, 255, 0.18);
}

.project-card .illustration {
	width: 100%;
	height: 100px;
	margin-bottom: 0.9em;
	color: var(--accent);
}

.project-card .illustration svg {
	width: 100%;
	height: 100%;
	display: block;
}

.project-card h3 {
	display: flex;
	align-items: center;
	gap: 0.55em;
	margin: 0 0 0.6em;
	font-size: 1.05em;
}

.project-card h3 .icon {
	color: var(--accent);
}

.project-card p.desc {
	flex: 1;
	opacity: 0.85;
	font-size: 0.95em;
	line-height: 1.65;
	margin: 0 0 1.1em;
}

.tech-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.tech-badges span {
	font-size: 0.72em;
	padding: 0.25em 0.7em;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: var(--accent);
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.project-card.cat-ai { --accent: #9b7bff; }
.project-card.cat-travel { --accent: #4fc3f7; }
.project-card.cat-rec { --accent: #f5c344; }
.project-card.cat-mobile { --accent: #5ddab4; }
.project-card.cat-chat { --accent: #ff7aa8; }

/* Writing: article list (home popup + /writing/ archive) */

.writing-intro p {
    max-width: 46rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.75;
}

.writing-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0 1.25rem;
}

#main article a.writing-card,
.page-shell a.writing-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.4rem 1.6rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

#main article a.writing-card.has-cover,
.page-shell a.writing-card.has-cover {
    grid-template-columns: 220px minmax(0, 1fr);
}

#main article a.writing-card:hover,
.page-shell a.writing-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(184, 217, 107, 0.55);
    transform: translateY(-2px);
}

.writing-card-cover {
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

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

.writing-meta {
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.writing-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #ffffff;
}

.writing-summary {
    margin: 0 0 0.9rem;
    font-size: 0.92rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

.writing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.writing-tags span {
    padding: 0.15rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
}

.writing-read {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b8d96b;
}

.writing-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.85rem;
}

.writing-links a {
    color: #b8d96b;
}

.writing-empty {
    margin: 1.5rem 0;
    padding: 2.5rem 1.5rem;
    border: 1px dashed rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
}

.writing-empty .icon {
    display: inline-block;
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: #b8d96b;
    border: 0;
}

.writing-empty p {
    margin: 0;
}

@media screen and (max-width: 736px) {
    #main article a.writing-card.has-cover,
    .page-shell a.writing-card.has-cover {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    #main article a.writing-card,
    .page-shell a.writing-card {
        padding: 1.1rem 1.15rem;
    }
}

/* Standalone pages: single article + /writing/ archive */

body.page-standalone #bg:before {
    background-image: linear-gradient(to top, rgba(19, 21, 25, 0.88), rgba(19, 21, 25, 0.88));
}

.page-shell {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 2rem;
}

.page-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0 1.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.page-topbar a {
    border-bottom: 0;
    color: rgba(255, 255, 255, 0.75);
}

.page-topbar a:hover {
    color: #ffffff;
}

.post {
    padding: 3rem 3.25rem 2.5rem;
    background: rgba(27, 31, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.post-header {
    margin-bottom: 2.25rem;
}

.post-header h1 {
    margin: 0 0 1rem;
    font-size: 2.1rem;
    line-height: 1.25;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #ffffff;
}

.post-lede,
.post-lede p {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
}

.post-cover {
    margin: 0 0 2.25rem;
}

.post-cover img {
    display: block;
    width: 100%;
    border-radius: 10px;
}

.post-cover figcaption,
.post-content figcaption {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
}

/* Article body typography: undo the theme's uppercase/letter-spaced headings */

.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.86);
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table,
.post-content figure {
    margin: 0 0 1.5rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin: 2.5rem 0 1rem;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-transform: none;
    color: #ffffff;
}

.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.2rem; }
.post-content h4 { font-size: 1.05rem; }

.post-content ul,
.post-content ol {
    padding-left: 1.4rem;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li {
    margin-bottom: 0.45rem;
    padding-left: 0.25rem;
}

.post-content a {
    color: #b8d96b;
    border-bottom: 1px solid rgba(184, 217, 107, 0.4);
}

.post-content a:hover {
    border-bottom-color: #b8d96b;
}

.post-content strong {
    color: #ffffff;
}

.post-content blockquote {
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 3px solid #b8d96b;
    font-style: normal;
    color: rgba(255, 255, 255, 0.78);
}

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

.post-content :not(pre) > code {
    margin: 0 0.1rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.post-content pre {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}

.post-content pre code {
    margin: 0;
    padding: 1.1rem 1.25rem;
    background: transparent;
    font-size: 0.85rem;
    line-height: 1.7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.post-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.post-content th,
.post-content td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.post-content th {
    font-weight: 600;
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.post-content tbody tr:nth-child(2n + 1) {
    background: transparent;
}

.post-content hr {
    margin: 2.5rem 0;
}

/* Article footer: author + newer/older */

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-author img {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
}

.post-author p {
    margin: 0;
    line-height: 1.5;
}

.post-author-name {
    font-weight: 600;
    color: #ffffff;
}

.post-author-role {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.post-pager {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.post-pager a {
    display: block;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #ffffff;
    line-height: 1.45;
}

.post-pager a:hover {
    border-color: rgba(184, 217, 107, 0.55);
}

.post-pager a span {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #b8d96b;
}

.page-footer {
    padding: 2rem 0 0;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.45);
}

@media screen and (max-width: 736px) {
    .post {
        padding: 2rem 1.25rem 1.75rem;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .post-content {
        font-size: 1rem;
    }
}

/* Bio: profile card (portrait + identity) beside the bio copy */

#main article.bio-article {
    background: rgba(27, 31, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

#main article.bio-article h2.major {
    margin-bottom: 2rem;
    color: #ffffff;
}

.bio-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: start;
    gap: 3rem;
}

/* Left column */

.bio-profile {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.bio-photo-frame {
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.bio-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 10px;
    /* soften the white studio backdrop against the dark panel */
    filter: brightness(0.96);
}

.bio-identity p {
    margin: 0;
    line-height: 1.4;
}

.bio-identity .bio-name {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #ffffff;
}

.bio-identity .bio-role {
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: #b8d96b;
}

.bio-identity .bio-location {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.bio-identity .bio-location .icon {
    border: 0;
    margin-right: 0.25rem;
}

.bio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#main article .bio-actions a.bio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#main article .bio-actions a.bio-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

#main article .bio-actions a.bio-btn-primary {
    flex: 1 1 100%;
    background: #b8d96b;
    border-color: #b8d96b;
    color: #1b1f22;
    font-weight: 600;
}

#main article .bio-actions a.bio-btn-primary:hover {
    background: #c9e585;
    border-color: #c9e585;
    color: #1b1f22;
}

#main article .bio-actions a.bio-btn:not(.bio-btn-primary) {
    flex: 1 1 0;
}

/* Right column */

.bio-copy {
    min-width: 0;
    color: rgba(255, 255, 255, 0.84);
}

.bio-copy p {
    font-size: 1rem;
    line-height: 1.8;
    margin: 0 0 1.25rem;
}

.bio-copy h3,
.bio-copy h4 {
    color: #b8d96b;
    margin: 2rem 0 0.8rem;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
}

.bio-copy ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.bio-copy li {
    margin-bottom: 0.45rem;
    padding-left: 0.2rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.86);
}

.bio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bio-tags span {
    padding: 0.3rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Tablet and phone: profile on top, centred */

@media screen and (max-width: 860px) {
    .bio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .bio-profile {
        position: static;
        width: min(300px, 100%);
        margin: 0 auto;
        text-align: center;
    }

    .bio-actions {
        justify-content: center;
    }
}

/* Publications: stat tiles + year timeline */

.pub-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1em;
	margin: 1.4em 0 2em;
}

.pub-stat {
	text-align: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	padding: 1.2em 0.8em;
}

.pub-stat-num {
	font-size: 2.2rem;
	font-weight: 600;
	line-height: 1;
	color: #b8d96b;
}

.pub-stat-num span {
	font-size: 1.3rem;
}

.pub-stat-label {
	font-size: 0.78em;
	opacity: 0.75;
	margin-top: 0.5em;
}

.pub-timeline {
	position: relative;
	padding-left: 1.8em;
}

.pub-timeline::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0.35em;
	bottom: 0.35em;
	width: 2px;
	background: rgba(255, 255, 255, 0.15);
}

.pub-year {
	position: relative;
	margin-bottom: 2em;
}

.pub-year:last-child {
	margin-bottom: 0;
}

.pub-year-label {
	position: relative;
	margin: 0 0 1em;
	font-size: 1.05em;
	color: #b8d96b;
}

.pub-year-label::before {
	content: '';
	position: absolute;
	left: -1.86em;
	top: 0.4em;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #b8d96b;
}

.pub-card {
	display: flex;
	gap: 1em;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 10px;
	padding: 1.1em 1.3em;
	margin-bottom: 1em;
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.pub-card:last-child {
	margin-bottom: 0;
}

.pub-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
	border-color: rgba(255, 255, 255, 0.26);
}

.pub-card-icon {
	color: #b8d96b;
	font-size: 1.25em;
	flex-shrink: 0;
	padding-top: 0.15em;
}

.pub-card-body h4 {
	margin: 0 0 0.6em;
	font-size: 0.98em;
	line-height: 1.5;
}

.pub-venue-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6em;
}

.pub-venue-name {
	font-size: 0.82em;
	opacity: 0.7;
}

.pub-badge {
	font-size: 0.72em;
	padding: 0.25em 0.7em;
	border-radius: 999px;
	border: 1px solid;
	white-space: nowrap;
}

.pub-badge-springer {
	color: #5ddab4;
	border-color: rgba(93, 218, 180, 0.5);
	background: rgba(93, 218, 180, 0.08);
}

.pub-badge-iccit {
	color: #4fc3f7;
	border-color: rgba(79, 195, 247, 0.5);
	background: rgba(79, 195, 247, 0.08);
}

.pub-badge-ieee {
	color: #ff9f5a;
	border-color: rgba(255, 159, 90, 0.5);
	background: rgba(255, 159, 90, 0.08);
}

.scholar-btn {
	display: inline-block;
	margin-top: 2em;
	padding: 0.7em 1.4em;
	border-radius: 999px;
	border: 1px solid #b8d96b;
	color: #b8d96b;
	text-decoration: none;
	font-size: 0.9em;
	transition: background 0.25s ease, color 0.25s ease;
}

.scholar-btn:hover {
	background: #b8d96b;
	color: #1b1f22;
}


/* Header menu: even dividers, and wrap into rows on smaller screens */

#header nav ul li a {
    text-align: center;
}

@media screen and (max-width: 1280px) {
    #header nav ul {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    #header nav ul li {
        border-left: solid 1px #ffffff;
    }

    #header nav ul li:nth-child(4n + 1) {
        border-left: 0;
    }

    #header nav ul li:nth-child(n + 5) {
        border-top: solid 1px #ffffff;
    }

    #header nav ul li a {
        min-width: 0;
        padding: 0 1rem;
    }
}

@media screen and (max-width: 736px) {
    #header nav ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    #header nav ul li:nth-child(n) {
        border-left: solid 1px #ffffff;
    }

    #header nav ul li:nth-child(odd) {
        border-left: 0;
    }

    #header nav ul li:nth-child(n + 3) {
        border-top: solid 1px #ffffff;
    }
}

@media screen and (max-width: 480px) {
    #header nav ul {
        grid-template-columns: minmax(0, 1fr);
    }

    #header nav ul li:nth-child(n) {
        border-left: 0;
        border-top: solid 1px #ffffff;
    }

    #header nav ul li:first-child {
        border-top: 0;
    }
}

/* Hero: one line per item, also on small screens (the theme hides <br> there) */

#header .content p.hero-lines span {
    display: block;
}

#header .content p.hero-lines span + span {
    margin-top: 0.35rem;
}
