:root {
    --yellow: #FFF000;
    --magenta: #E8008A;
    --black: #1a1a1a;
    --white: #ffffff;
    --gray: #666666;
    --light-gray: #f5f5f5;
    --border-light: #e0e0e0;
    --page-accent: #1a1a1a;
    --page-accent-text: #ffffff;
    --panel-width: 250px;
}

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

body {
    font-family: 'Manrope', sans-serif;
    background: var(--white);
    color: var(--black);
    line-height: 1.6;
    cursor: none;
}

/* ── Custom cursor ───────────────────────────────────────────── */
.cursor {
    position: fixed;
    width: 7px; height: 7px;
    background: var(--black);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width .3s ease, height .3s ease, background .3s ease;
}
.cursor-ring {
    position: fixed;
    width: 34px; height: 34px;
    border: 1px solid var(--black);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width .3s ease, height .3s ease, opacity .3s ease;
}
.cursor.hover      { width: 11px; height: 11px; background: #555; }
.cursor-ring.hover { width: 52px; height: 52px; opacity: .35; }

/* ── Video modal ─────────────────────────────────────────────── */
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 9000;
    align-items: center;
    justify-content: center;
}
.video-modal.active { display: flex; }
.video-modal-inner {
    position: relative;
    width: 90vw;
    max-width: 1100px;
}
.video-modal-inner video {
    width: 100%;
    max-height: 80vh;
    display: block;
    outline: none;
    background: #000;
}
.video-modal-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s;
}
.video-modal-close:hover { opacity: 1; }

/* ── Page layout ─────────────────────────────────────────────── */
.page-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Left panel ──────────────────────────────────────────────── */
.left-panel {
    width: var(--panel-width);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 2rem 1.4rem 2rem 1.6rem;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.left-panel::-webkit-scrollbar { display: none; }

/* ── Site title ──────────────────────────────────────────────── */
.site-title-link { text-decoration: none; color: inherit; display: block; }
.site-title-link:hover h1 { font-weight: 700; }

h1 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    line-height: 1.2;
    color: var(--black);
    white-space: nowrap;
}

/* ── Navigation ──────────────────────────────────────────────── */
nav { background: transparent; }

.nav-links {
    display: flex;
    flex-wrap: nowrap;
    margin: 0 -0.4rem;
}

.nav-links a {
    font-family: 'Manrope', sans-serif;
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.45rem 0.4rem;
    display: flex;
    align-items: center;
    position: relative;
}

.nav-links a span {
    padding: 0.1em 0.22em;
    background: transparent;
    transition: background .15s ease, color .15s ease;
}

/* Projects underline → highlight on hover/active */
.nav-links a.nav-projects span {
    text-decoration: underline;
    text-decoration-color: var(--yellow);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.nav-links a.nav-projects:hover span,
.nav-links a.nav-projects.active span {
    background: var(--yellow);
    text-decoration: none;
    color: var(--black);
}

/* Teaching underline → highlight on hover/active */
.nav-links a.nav-teaching span {
    text-decoration: underline;
    text-decoration-color: var(--magenta);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.nav-links a.nav-teaching:hover span,
.nav-links a.nav-teaching.active span {
    background: var(--magenta);
    text-decoration: none;
    color: var(--white);
}

/* All */
.nav-links a.nav-all.active,
.nav-links a.nav-all:hover  { font-weight: 800; }

/* ── Search ───────────────────────────────────────────────────── */
.search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid var(--border-light);
    padding: 0.4rem 0;
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    color: var(--black);
    outline: none;
    margin-bottom: 1.2rem;
    transition: border-color .15s;
}
.search-input::placeholder { color: #aaa; }
.search-input:focus { border-bottom-color: var(--black); }

/* ── Sidebar tag filters ──────────────────────────────────────── */
.sidebar-filters { flex: 1; }

.sidebar-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gray);
    font-weight: 400;
    padding-bottom: 0.6rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-reset {
    background: none;
    border: none;
    font-family: 'DM Mono', monospace;
    font-size: 0.55rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: pointer;
    color: var(--gray);
    padding: 0;
    transition: color .15s;
    opacity: 0;
    pointer-events: none;
}
.filter-reset.visible { opacity: 1; pointer-events: auto; }
.filter-reset:hover   { color: var(--black); }

.tag-filters {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0.25rem;
}

.tag-count {
    opacity: 0.45;
    font-size: 0.85em;
}

.tag-filter {
    font-family: 'DM Mono', monospace;
    background: transparent;
    border: none;
    border-left: 2px solid transparent;
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all .12s ease;
    color: var(--gray);
    text-align: left;
    width: 100%;
    text-transform: lowercase;
    border-radius: 0;
}
.tag-filter:hover { color: var(--black); background: var(--light-gray); border-left-color: var(--border-light); }
.tag-filter.active { color: var(--black); font-weight: 600; border-left-color: var(--page-accent); }

/* ── Right content ───────────────────────────────────────────── */
.right-content { flex: 1; min-width: 0; }

main { padding: 0; min-height: 100vh; }

/* ── Projects grid ────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    background: var(--border-light);
    animation: fadeIn .45s ease-out;
}

/* ── Project card ────────────────────────────────────────────── */
.project-card {
    background: var(--white);
    overflow: hidden;
    position: relative;
    transition: outline-color .2s ease;
    outline: 3px solid transparent;
    outline-offset: -3px;
}


.project-card[data-color="yellow"]:hover .project-title span {
    background: var(--yellow);
}
.project-card[data-color="magenta"]:hover .project-title span {
    background: var(--magenta);
    color: var(--white);
}

/* ── Video ───────────────────────────────────────────────────── */
.video-container {
    position: relative;
    width: 100%;
    padding-top: 70%;
    background: var(--light-gray);
    overflow: hidden;
    cursor: pointer;
}
.video-container video,
.video-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border: none;
    transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.video-container iframe { object-fit: unset; }
.video-container img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .12s ease-out;
    will-change: transform;
}
.project-card:hover .video-container video { transform: scale(1.04); }

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity .3s ease, background .3s ease;
    pointer-events: none;
}
.video-container.playing .video-overlay { opacity: 0; }
.project-card:hover .video-overlay      { background: rgba(0,0,0,.1); }

.play-button {
    width: 32px; height: 32px;
    background: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease;
    border-radius: 20%;
}
.project-card[data-color="magenta"] .play-button { background: var(--magenta); }
.project-card:hover .play-button { transform: scale(1.15); }
.video-container.playing .play-button { display: none; }

.play-button::after {
    content: '';
    width: 0; height: 0;
    border-left: 12px solid var(--black);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    margin-left: 3px;
}
.project-card[data-color="magenta"] .play-button::after { border-left-color: var(--white); }

/* ── Card info ───────────────────────────────────────────────── */
.project-info { padding: 1.1rem 1.3rem 1.4rem; }

.project-category {
    font-family: 'Manrope', sans-serif;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--gray);
}

.project-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.project-title a {
    color: inherit;
    text-decoration: none;
}
.project-title a:hover span {
    text-decoration: underline;
    text-decoration-color: var(--black);
    text-underline-offset: 3px;
}
.project-title span {
    transition: background .2s ease, color .2s ease;
}

/* ── Card tooltip ────────────────────────────────────────────── */
.card-tooltip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    height: 70%; /* matches video-container padding-top */
    display: flex;
    align-items: flex-end;
    padding: 0.9rem 1rem;
    background: linear-gradient(to bottom, transparent 30%, rgba(10,10,10,0.8) 100%);
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    line-height: 1.55;
    pointer-events: none;
    opacity: 0;
    transition: opacity .22s ease;
    z-index: 10;
}
.project-card:hover .card-tooltip {
    opacity: 1;
}

.project-description {
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    color: var(--gray);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0;
    margin-bottom: 0.75rem;
}
.project-tag {
    font-family: 'DM Mono', monospace;
    font-size: 0.6rem;
    color: var(--gray);
    font-weight: 400;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.project-tag::after {
    content: ' | ';
    color: var(--border-light);
}
.project-tag:last-child::after {
    content: '';
}

.project-meta {
    font-family: 'Manrope', sans-serif;
    font-size: 0.68rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.project-links {
    display: flex;
    gap: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}
.project-link {
    font-family: 'Manrope', sans-serif;
    font-size: 0.72rem;
    color: var(--black);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background .2s ease;
}
.project-link:hover {
    background: linear-gradient(180deg, transparent 60%, var(--yellow) 60%);
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 6rem 2rem; display: none; }
.empty-state.active { display: block; }
.empty-state h3 { font-size: 1.4rem; margin-bottom: 0.5rem; font-weight: 700; }
.empty-state p  { color: var(--gray); font-size: 0.85rem; }

/* ── About section ───────────────────────────────────────────── */
#about-section { scroll-margin-top: 2rem; }

.about-section {
    padding: 5rem 3rem;
    border-top: 1px solid var(--border-light);
}
.about-section h2 {
    font-family: 'Manrope', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2.5rem;
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}
.about-text p {
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 1.25rem;
}
.about-details { display: flex; flex-direction: column; gap: 2rem; }
.about-detail-block h4 {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--yellow);
    display: inline-block;
}
.about-detail-block p,
.about-detail-block ul { font-size: 0.9rem; color: var(--gray); line-height: 1.7; }
.about-detail-block ul { list-style: none; padding: 0; }
.about-detail-block ul li::before { content: '— '; color: var(--black); font-weight: 700; }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
    padding: 2rem 3rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
footer p, footer a {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray);
    text-decoration: none;
}
footer a:hover { color: var(--black); }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor, .cursor-ring { display: none; }

    .page-wrapper { flex-direction: column; }

    .left-panel {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 1.25rem 1.5rem;
        gap: 1rem;
    }

    h1 { font-size: 2rem; }

    .nav-links { flex-wrap: wrap; margin: 0; }
    .nav-links a { padding: 0.4rem 0.35rem; font-size: 0.7rem; }

    .sidebar-filters { flex: none; }
    .tag-filters { flex-direction: row; flex-wrap: wrap; gap: 0.35rem; }
    .tag-filter {
        width: auto;
        border-left: none;
        border: 1.5px solid var(--border-light);
        padding: 0.25rem 0.6rem;
        border-radius: 2px;
    }
    .tag-filter.active { border-color: var(--page-accent); background: var(--page-accent); color: var(--page-accent-text); }

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

    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .about-section { padding: 3rem 1.5rem; }
    footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; text-align: center; }
}

@media (max-width: 640px) {
    .cursor, .cursor-ring { display: none; }
}
