/* Base */
:root {
    --bg-canvas: #000000;
    --bg-surface: #111111;
    --bg-surface-alt: #171a24;
    --text-pure: #ffffff;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #D1CFCE;
    --blue-accent: #3b82f6;
    --blue-primary: #224ca5;
    --border-color: #202020;
    --font-sans: "Inter", "Noto Sans", sans-serif;
    --font-subtitle: "Minecraftia", var(--font-sans);
    --font-heading: "MinecraftTen", var(--font-sans);
    --max-width: 1200px;
    --icon-size-sm: 1rem;
    --icon-size-md: 1.15rem;
    --icon-size-lg: 1.4rem;
    --icon-size: var(--icon-size-md);
    --icon-gap: 0.4rem;
}

@font-face {
    font-family: "Inter";
    src: url("fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Noto Sans";
    src: url("fonts/NotoSans-VariableFont_wdth,wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Minecraftia";
    src: url("fonts/Minecraftia-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "MinecraftTen";
    src: url("fonts/MinecraftTen.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-canvas);
    overflow-x: clip;
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: clip;
}

h1,
h2,
h3 {
    color: var(--text-pure);
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 0.95;
}

.hero-subtitle,
.info-subtitle,
.stat-number,
.stat-label {
    font-family: var(--font-subtitle);
    font-weight: 400;
}

p {
    margin-bottom: 0.75rem;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover,
a:focus {
    color: var(--blue-accent);
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.content-container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
    flex: 1;
}

/* Shared Components */

.projects-grid > .project-card:nth-child(2),
.seminar-list > .seminar-row:nth-child(2),
.profile-info-grid > .info-block:nth-of-type(2) {
    --scroll-reveal-delay: 100ms;
}

.seminar-list > .seminar-row:nth-child(3) {
    --scroll-reveal-delay: 160ms;
}

.project-card.scroll-reveal {
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        border-color 120ms steps(2, end),
        box-shadow 120ms steps(2, end);
}

.project-card.scroll-reveal.is-visible:hover {
    transform: translate(-2px, -2px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        transform 120ms steps(2, end),
        border-color 120ms steps(2, end),
        box-shadow 120ms steps(2, end);
}

.seminar-row.scroll-reveal {
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        border-color 120ms steps(2, end),
        box-shadow 120ms steps(2, end);
}

.seminar-row.scroll-reveal.is-visible:hover {
    transform: translate(-2px, -2px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--scroll-reveal-delay, 0ms),
        transform 120ms steps(2, end),
        border-color 120ms steps(2, end),
        box-shadow 120ms steps(2, end);
}

.portfolio-section {
    padding: 4.5rem 0;
    scroll-margin-top: 4.5rem;
}

.icon {
    display: inline-block;
    width: var(--icon-size);
    height: var(--icon-size);
    margin-inline-end: var(--icon-gap);
    vertical-align: middle;
    flex: 0 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: #ffffff;
    text-transform: uppercase;
    padding: 0.65rem 1.2rem;
    background-color: #224ca5;
    border: 1px solid #242b3d;
    border-top: 3px solid #3b82f6;
    border-bottom: 1px solid #16366f;
    box-shadow: 0 3px 0 #16366f;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
    background-color: #3b82f6;
    border-color: #3b82f6;
    border-bottom-color: #16366f;
    color: #ffffff;
    box-shadow: 0 1px 0 #16366f;
    transform: translateY(2px);
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 4px;
}

.btn:active {
    box-shadow: none;
    transform: translateY(3px);
}

.image-modal {
    position: fixed;
    inset: 0;
    width: fit-content;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
    margin: auto;
    padding: 3.25rem 1rem 1rem;
    overflow: visible;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.image-modal.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.image-modal::backdrop {
    background-color: rgba(3, 5, 12, 0.78);
    backdrop-filter: blur(4px);
}

.image-modal img {
    width: auto;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 6rem);
    object-fit: contain;
}

.image-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--text-pure);
    font-family: var(--font-subtitle);
    font-size: 1.4rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.image-modal-close:hover,
.image-modal-close:focus-visible {
    background-color: transparent;
    color:gray;

}

.image-modal-close:focus-visible {
    outline: 2px solid var(--text-pure);
    outline-offset: 2px;
}


.section-header {
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 4rem;
}

.section-tag {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #ffffff;
    font-family: var(--font-subtitle);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.sprite-display {
    display: none;
    pointer-events: none;
}

.sprite-ground-shadow {
    position: absolute;
    z-index: 0;
    bottom: 0;
    left: 50%;
    width: 58%;
    height: 8%;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.42);
    filter: blur(4px);
    transform: translateX(-50%) scale(0.82);
    animation: minecraft-shadow-bob 3.2s ease-in-out infinite;
}

.sprite-display img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    animation: minecraft-sprite-bob 3.2s ease-in-out infinite;
}

/* Navbar */
.site-header {
    background-color: var(--bg-canvas);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 180ms ease, border-color 180ms ease, backdrop-filter 180ms ease;
}

.site-header.is-scrolled {
    background-color: rgba(0, 0, 0, 0.78);
    border-bottom-color: var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-pure);
    font-size: 1rem;
    font-weight: 700;
}

.nav-brand img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.75rem;
    flex-wrap: nowrap;
    margin-left: auto;
}

.nav-links a {
    position: relative;
    display: inline-block;
    font-size: .9rem;
    color: var(--text-muted);
    padding: 0.35rem 0;
    line-height: 1.7;
    letter-spacing: 0.02em;
    font-weight: 600;
    transition: color 120ms ease-out;
}

.nav-links a::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: var(--blue-accent);
    content: "";
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 140ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nav-links a:hover,
.nav-links a:focus {
    color: var(--text-pure);
}

.nav-links a[aria-current="location"] {
    color: var(--text-pure);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="location"]::after {
    transform: scaleX(1);
}

.nav-contact {
    font-size: .9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 1.5rem;
    position: relative;
    height: 38px;
    gap: 0.8rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-contact-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    shape-rendering: crispEdges;
}

.nav-contact:hover,
.nav-contact:focus-visible {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3B82F6;
    color: #3B82F6;
    text-decoration: none;
}

.nav-contact::after {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    padding: 0.3rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #000000;
    color: #FFFFFF;
    content: attr(data-tooltip);
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-contact:hover::after,
.nav-contact:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

/* Profile */

.hero-section {
    position: relative;
    isolation: isolate;
    border-top: none;
    padding-top: 1rem;
    padding-bottom: 3.5rem;
}

.hero-container,
.profile-info-grid {
    position: relative;
    z-index: 1;
}

.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 3.5rem;
}

.hero-text-col {
    flex: 1.2;
}

.hero-title {
    display: inline-block;
    font-size: 5.25rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    transform-origin: left top;
    transition: color 0.15s ease, transform 0.15s ease;
}

.hero-title:hover {
    color: var(--blue-accent);
    transform: scale(1.02);
}

.hero-title-letter {
    display: inline-block;
}

.hero-title.is-animating .hero-title-letter {
    animation: hero-letter-rise 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--letter-index) * 50ms);
}

.hero-title.is-animating ~ .hero-subtitle:not(.is-intro-animating),
.hero-title.is-animating ~ .hero-bio:not(.is-intro-animating),
.hero-title.is-animating ~ .hero-stats .stat-item:not(.is-intro-animating),
.hero-title.is-animating ~ .hero-stats .stat-divider:not(.is-intro-animating) {
    opacity: 0;
}

.hero-subtitle.is-intro-animating,
.hero-bio.is-intro-animating {
    animation: hero-content-fade-in 0.6s ease-out both;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-pure);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.hero-bio {
    font-size: 1rem;
    color: var(--text-pure);
    line-height: 1.65;
    margin-bottom: 2rem;
    max-width: 580px;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-top: 1.75rem;
}

.hero-media-col {
    flex: 0.95;
    display: flex;
    justify-content: flex-end;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.55rem;
    color: var(--text-pure);
    line-height: 1.5;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.7;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background-color: var(--border-color);
}

.stat-item.is-intro-animating,
.stat-divider.is-intro-animating {
    animation: hero-stat-rise-in 0.55s ease-out both;
    animation-delay: var(--stat-delay);
}

.portrait-container {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    width: 100%;
    max-width: 360px;
    animation: portrait-item-bob 2.8s ease-in-out infinite;
}

.portrait-frame {
    background-color: #1a1a1a;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.portrait {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.profile-info-grid {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
    margin-top: 3.5rem;
    padding: 2rem;
    color: #000000;
    align-items: start;
}

.profile-info-grid::before {
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    background-color: #FCF5F1;
    content: "";
    transform: translateX(-50%);
}

.profile-artwork {
    width: auto;
    max-width: 220px;
    margin-left: 50px;
    pointer-events: none;
    z-index: 1;
    transform: translateX(-50%);
    animation: research-sprite-bob 3.2s ease-in-out infinite;
}

.info-block {
    display: flex;
    flex-direction: column;
}

.info-block h2 {
    font-size: 1.4rem;
    color: #000000;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--blue-primary);
    display: inline-block;
}

.info-subtitle {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #000000;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.skills-container {
    display: grid;
    grid-template-rows: repeat(3, minmax(4.25rem, auto));
    gap: 0.65rem;
}

.skill-group {
    min-width: 0;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.skill-list li {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: black;
    background-color: #EDE5E2;
    box-shadow: 2.5px 2.5px 0 #B0ABA8;
    padding: 0.05rem 0.5rem;
    line-height: 1.7;
    white-space: nowrap;
}

.details-container {
    display: grid;
    grid-template-rows: repeat(4, minmax(3.2rem, auto));
    list-style: none;
}

.details-container li {
    min-width: 0;
    font-size: 0.95rem;
    color: #000000;
    margin-bottom: 0;
    line-height: 1;
    padding: 0.12rem 0 0.5rem;
}

.details-container li:last-child {
    border-bottom: none;
}

.details-container li strong {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #000000;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
}

.details-container li > span {
    display: block;
    color: #000000;
    font-size: 0.9rem;
    text-transform: uppercase;
}


/* Experience*/

#experience {
    position: relative;
    isolation: isolate;
}

#experience > .section-header,
#experience > .experience-layout {
    position: relative;
    z-index: 1;
}

.experience-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    align-items: center;
    gap: 2rem;
}

.experience-artwork {
    width: auto;
    max-width: 200px;
    margin-top: 360px;
    margin-left: -15px;
    pointer-events: none;
    z-index: 1;
    transform: translateX(-50%);
    animation: research-sprite-bob 3.2s ease-in-out infinite;
}


.experience-media {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 2px solid var(--border-color);
    border-radius: 0;
    background-color: var(--bg-surface);
}

.experience-media img {
    display: block;
    width: 100%;
    height: auto;
    border: 0;
    border-radius: 0;
}

.experience-media figcaption {
    margin: 0;
    padding: 0.65rem 0.75rem;
    background-color: var(--bg-surface);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    line-height: 1.5;
}

.experience-company {
    margin-bottom: 0.75rem;
    font-size: 2.5rem;
    letter-spacing: 0.01rem;
    line-height: 1.1;
    color: var(--text-pure);
}

.work-immersion-badge {
    display: inline-block;
    margin: 0 0 1rem;
    padding: 4px 10px;
    border-radius: 0;
    background-color: #F3F0EC;
    box-shadow: 3px 3px 0 #9CA3AF;
    color: #111111;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    text-transform: uppercase;
}

.experience-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    border-radius: 0;
    margin-bottom: 0.75rem;
}

.experience-meta-item {
    min-width: 0;
}

.experience-meta-label {
    display: block;
    margin-bottom: 0.3rem;
    color: #94A3B8;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    font-weight: 700;
    text-transform: uppercase;
}

.experience-meta-value {
    display: block;
    color: #FFFFFF;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.experience-meta-grid + .experience-description {
    margin-bottom: 1.2rem;
}

.experience-description {
    font-size: 1rem;
    color: var(--text-pure);
    line-height: 1.7;
    max-width: 820px;
    margin-bottom: 1.5rem;
}

.experience-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    align-items: stretch;
}

.project-card {
    background-color: var(--bg-surface);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color 120ms steps(2, end), transform 120ms steps(2, end),
        box-shadow 120ms steps(2, end);
}

.project-card:hover {
    border-color: var(--blue-accent);
    box-shadow: 4px 4px 0 #222222;
    transform: translate(-2px, -2px);
}

.project-media {
    position: relative;
    background-color: #0b0d14;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.project-pixel-grid {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(5, 1fr);
    pointer-events: none;
}

.project-pixel-grid span {
    background-color: #111827;
}

.project-card.is-pixel-revealed .project-pixel-grid span {
    animation: project-pixel-fade 0.65s steps(1, end) var(--pixel-delay, 0ms) forwards;
}

.project-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.2s ease;
}

.portal-thumb {
    filter: contrast(1.18) brightness(1.1) saturate(1.05);
}

.project-card:hover .project-img {
    transform: scale(1.02);
}

.project-card:hover .portal-thumb {
    filter: contrast(1.22) brightness(1.14) saturate(1.08);
}

.project-content {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    line-height: 0.95;
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.project-tech-list li {
    padding: 0.2rem 0.5rem;
    border-radius: 0;
    background-color: #EDE5E2;
    box-shadow: 2px 2px 0 #B0ABA8;
    color: black;
    font-family: var(--font-sans);
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.project-content p {
    font-size: 0.9rem;
    color: var(--text-pure);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.75rem;
}

.project-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
}

/* Style Change for research and seminars sections*/

.background-container {
    position: relative;
    isolation: isolate;
    background-color: #ffffff;
}

.background-container::before {
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    background-color: #ffffff;
    content: "";
    transform: translateX(-50%);
}

#research,
#seminars {
    --bg-surface: #f1f3f5;
    --bg-surface-alt: #e7e9ed;
    --text-pure: #111827;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #4b5563;
    --border-color: #d1d5db;
    --border-light: #c4cbd5;
    background-color: #ffffff;
    color: #111827;
}

#research {
    position: relative;
}

#research .section-tag,
#seminars .section-tag {
    color: black;
    font-family: var(--font-subtitle);
}

/* Research section */

.research-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
    align-items: stretch;
    gap: clamp(1.5rem, 3vw, 3rem);
}


.research-visual {
    position: relative;
    min-width: 0;
    min-height: 360px;
    overflow: visible;
}

.research-artwork {
    position: absolute;
    bottom: -26.1%;
    left: 50%;
    display: block;
    width: auto;
    max-width: none;
    height: 159.2%;
    margin: 0;
    pointer-events: none;
    z-index: 1;
    transform: translateX(-50%);
    animation: research-sprite-bob 3.2s ease-in-out infinite;
}

.research-visual .sprite-ground-shadow {
    position: absolute;
    z-index: 0;
    bottom: 3%;
    left: 43%;
    width: 36%;
    height: 7%;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.42);
    filter: blur(4px);
    pointer-events: none;
    transform: translateX(-50%) scale(0.82);
    animation: minecraft-shadow-bob 3.2s ease-in-out infinite;
}

#research .btn {
    color: #ffffff;
}

.research-title {
    margin: 0 0 0.4rem;
    color: #0F172A;
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.05;
}

.research-subtitle {
    max-width: 55ch;
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    line-height: 1.2;
}

.research-grade-badge {
    display: inline-block;
    margin: 14px 0;
    padding: 5px 8px;
    border-radius: 0;
    background-color: #292929;
    box-shadow: 2.5px 2.5px 0 #B0ABA8;
    color: #F8FAFC;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.research-description {
    font-size: 0.95rem;
    color: black;
    line-height: 1.65;
    max-width: 60ch;
    margin: 0 0 1rem;
}

.research-role {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.6rem;
    margin: 0 0 1.5rem;
    color: black;
    font-size: 1rem;
    font-weight: 500;
}

.research-role-label {
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.research-role span {
    line-height: 1.4;
}

.research-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

/* Seminars */
.seminar-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.seminar-row {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    gap: 1rem;
    min-width: 0;
    padding: 1.25rem 1.5rem;
    border: 2px solid #0F172A;
    border-radius: 0;
    background-color: #ffffff;
    transition: transform 120ms steps(2, end), box-shadow 120ms steps(2, end),
        border-color 120ms steps(2, end);
}

.seminar-row:hover {
    z-index: 1;
    border-color: var(--blue-accent);
    box-shadow: 4px 4px 0 #0F172A;
    transform: translate(-2px, -2px);
}

.seminar-index,
.seminar-date {
    font-family: var(--font-subtitle);
}

.seminar-index {
    padding-top: 0.1rem;
    color: var(--blue-primary);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.seminar-content {
    min-width: 0;
}

.seminar-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.seminar-heading-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
}

.seminar-title {
    color: #0F172A;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
}

.seminar-organizer {
    padding: 0.2rem 0.4rem;
    border-radius: 0;
    background-color: #292929;
    box-shadow: 2.5px 2.5px 0 #B0ABA8;
    color: #F8FAFC;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    white-space: nowrap;
}

.seminar-date {
    flex: 0 0 auto;
    margin-left: auto;
    color: #0F172A;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.5;
    text-transform: uppercase;
    white-space: nowrap;
}

.seminar-takeaway {
    max-width: 65ch;
    margin: 0.65rem 0 0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Footer */
.footer-ground {
    background-color: #ffffff;
    padding-top: 2rem;
}

.footer-artwork {
    display: block;
    width: 40%;
    max-width: none;
    margin-inline: auto;
}

.site-footer {
    background-color: #060709;
    padding: 1.5rem 1.5rem 3.5rem;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-container > p {
    margin-bottom: 0;
}

.footer-container > p:first-child {
    justify-self: start;
}

.footer-socials {
    justify-self: center;
}

.footer-socials ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    list-style: none;
}

.footer-socials a {
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 0.25em;
    transition: color 0.15s ease, text-decoration-thickness 0.15s ease;
}

.footer-socials .icon {
    filter: brightness(0) invert(1);
}

.footer-socials a:hover,
.footer-socials a:focus-visible {
    color: var(--blue-accent);
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
}

.footer-container > p:last-child {
    justify-self: end;
}

.footer-container > p:last-child a {
    color: var(--text-muted);
}

.footer-back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    box-shadow: 2px 2px 0 #000000;
    color: var(--text-pure) !important;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.footer-back-to-top-arrow {
    display: inline-block;
    transition: transform 120ms steps(2, end);
}

.footer-back-to-top:hover,
.footer-back-to-top:focus-visible {
    background-color: var(--blue-primary);
    box-shadow: 1px 1px 0 #000000;
    color: var(--text-pure) !important;
    text-decoration: none;
}

.footer-back-to-top:hover .footer-back-to-top-arrow,
.footer-back-to-top:focus-visible .footer-back-to-top-arrow {
    transform: translateY(-2px);
}


/* Media queries */
@media (max-width: 900px) {
    .hero-container {
        display: block;
    }

    .hero-media-col {
        position: absolute;
        top: 0;
        right: 0;
        width: 92px;
        z-index: 1;
    }

    .hero-media-col .portrait-container.scroll-reveal {
        opacity: 1;
        transform: none;
        width: 100px;
        padding: 0.35rem;
        transition: none;
    }

    .hero-text-col {
        width: 100%;
    }

    .portrait-study {
        max-width: 100%;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .experience-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .experience-media {
        max-width: 560px;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .research-layout {
        grid-template-columns: 1fr;
    }

    .research-visual {
        display: none;
    }
}

@media (max-width: 650px) {
    .content-container {
        padding: 2rem 1.25rem 0;
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
        margin-left: 0;
    }

    .nav-contact {
        margin-left: 0;
    }

    .portfolio-section {
        scroll-margin-top: 10rem;
    }

    .hero-title {
        font-size: 2.6rem;
        padding-right: 104px;
        min-height: 96px;
    }

    .section-header h2 {
        font-size: 2.6rem;
    }

    .hero-pixel-cloud--two {
        right: 0;
    }

    .profile-info-grid::before,
    .research-showcase::before {
        left: -1.25rem;
        width: calc(100% + 2.5rem);
        transform: none;
    }

    .hero-stats {
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 0.5rem;
        justify-content: space-between;
    }

    .stat-divider {
        display: none;
    }

    .stat-item {
        flex: 1 1 0;
        min-width: 0;
    }

    .stat-label {
        font-size: 0.58rem;
        line-height: 1.35;
    }

    .seminar-row {
        grid-template-columns: 2rem minmax(0, 1fr);
        gap: 0.75rem;
        padding: 1rem;
    }

    .seminar-topline {
        flex-direction: column;
        gap: 0.5rem;
    }

    .seminar-date {
        margin-left: 0;
    }

    .footer-container {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 0.75rem;
        text-align: left;
    }

    .footer-socials,
    .footer-container > p:last-child {
        justify-self: start;
    }

    .footer-socials ul {
        justify-content: flex-start;
        gap: 0.65rem 1rem;
    }
}

@media (min-width: 1400px) {
    .sprite-display--profile {
        position: absolute;
        z-index: 0;
        top: 50%;
        right: calc(100% + 2rem);
        display: block;
        width: min(320px, calc((100vw - var(--max-width)) / 2 - 3rem));
        height: auto;
        transform: translateY(-50%);
    }

    .sprite-display--experience {
        position: absolute;
        z-index: 0;
        top: 50%;
        right: calc(100% + 2rem);
        display: block;
        width: min(250px, calc((100vw - var(--max-width)) / 2 - 3rem));
        height: auto;
        transform: translateY(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-title.is-animating .hero-title-letter {
        animation: none;
    }

    .hero-subtitle.is-intro-animating,
    .hero-bio.is-intro-animating,
    .stat-item.is-intro-animating,
    .stat-divider.is-intro-animating {
        animation: none;
    }

    .portrait-study {
        animation: none;
    }

    .sprite-display img,
    .research-artwork,
    .sprite-ground-shadow,
    .research-visual .sprite-ground-shadow {
        animation: none;
    }

    .hero-pixel-cloud,
    .hero-pixel-block {
        transform: none;
        will-change: auto;
    }

    .project-pixel-grid {
        display: none;
    }

    .site-header {
        transition: none;
    }

    .image-modal {
        transition-duration: 0.02ms;
    }

    .seminar-row {
        transition: none;
    }

    .seminar-row:hover {
        transform: none;
    }

    .nav-links a,
    .nav-links a::after,
    .footer-back-to-top-arrow,
    .nav-contact,
    .nav-contact::after {
        transition: none;
    }
}

/* CSS anims */
@keyframes hero-letter-rise {
    from {
        opacity: 0;
        filter: blur(6px);
        transform: translateY(0.55em);
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes hero-content-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes hero-stat-rise-in {
    from {
        opacity: 0;
        filter: blur(4px);
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@keyframes portrait-item-bob {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-0.75rem);
    }
}

@keyframes minecraft-sprite-bob {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-0.65rem);
    }
}

@keyframes research-sprite-bob {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(-0.65rem);
    }
}

@keyframes minecraft-shadow-bob {
    0%,
    100% {
        opacity: 0.42;
        transform: translateX(-50%) scale(0.82);
    }

    50% {
        opacity: 0.22;
        transform: translateX(-50%) scale(0.62);
    }
}

@keyframes project-pixel-fade {
    to {
        opacity: 0;
    }
}