/* ===== Reset ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}




/* ===== Page Load Overlay ===== */
#page-load-overlay {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9998;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

#page-load-overlay.fade-out {
    opacity: 0;
}

/* ===== Base ===== */
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    font-family: 'DM Sans', sans-serif;
    color: #fff;
    background: #000000;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to right,
            hsl(0, 0%, 0%, 0.78) 0%,
            hsla(0, 0%, 0%, 0.7) 8.2%,
            hsla(0, 0%, 0%, 0.65) 14.6%,
            hsla(0, 0%, 0%, 0.62) 19.6%,
            hsla(0, 0%, 0%, 0.55) 23.6%,
            hsla(0, 0%, 0%, 0.52) 26.8%,
            hsla(0, 0%, 0%, 0.5) 29.7%,
            hsla(0, 0%, 0%, 0.45) 32.7%,
            hsla(0, 0%, 0%, 0.4) 36%,
            hsla(0, 0%, 0%, 0.37) 40%,
            hsla(0, 0%, 0%, 0.297) 45.2%,
            hsla(0, 0%, 0%, 0.227) 51.8%,
            hsla(0, 0%, 0%, 0.16) 60.2%,
            hsla(0, 0%, 0%, 0.1) 70.8%,
            hsla(0, 0%, 0%, 0.047) 84%,
            hsla(0, 0%, 0%, 0) 100%);
}

@media (max-width: 768px) {
    body::before {
        background: linear-gradient(to bottom,
                hsl(0, 0%, 0%) 0%,
                hsla(0, 0%, 0%, 0.947) 8.2%,
                hsla(0, 0%, 0%, 0.887) 14.6%,
                hsla(0, 0%, 0%, 0.82) 19.6%,
                hsla(0, 0%, 0%, 0.75) 23.6%,
                hsla(0, 0%, 0%, 0.677) 26.8%,
                hsla(0, 0%, 0%, 0.6) 29.7%,
                hsla(0, 0%, 0%, 0.523) 32.7%,
                hsla(0, 0%, 0%, 0.447) 36%,
                hsla(0, 0%, 0%, 0.37) 40%,
                hsla(0, 0%, 0%, 0.297) 45.2%,
                hsla(0, 0%, 0%, 0.227) 51.8%,
                hsla(0, 0%, 0%, 0.16) 60.2%,
                hsla(0, 0%, 0%, 0.1) 70.8%,
                hsla(0, 0%, 0%, 0.047) 84%,
                hsla(0, 0%, 0%, 0) 100%);
    }
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center,
            hsla(0, 0%, 0%, 0.75) 0%,
            hsla(0, 0%, 0%, 0.68) 10%,
            hsla(0, 0%, 0%, 0.6) 18%,
            hsla(0, 0%, 0%, 0.52) 26%,
            hsla(0, 0%, 0%, 0.43) 34%,
            hsla(0, 0%, 0%, 0.33) 42%,
            hsla(0, 0%, 0%, 0.22) 52%,
            hsla(0, 0%, 0%, 0.12) 65%,
            hsla(0, 0%, 0%, 0.04) 80%,
            hsla(0, 0%, 0%, 0) 100%);
    transition: opacity 0.8s ease;
}



#bg-wrapper {
    position: fixed;
    inset: -100px;
    z-index: -1;
    pointer-events: none;
    transform: scale(1.15);
    transform-origin: center;
}

.bg-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.bg-layer.active {
    opacity: 1;
}

.bg-blur {
    position: absolute;
    inset: 0;
    background: var(--bg-image) center / cover no-repeat;
    filter: blur(6vh);
    transition: filter 0.8s ease;
}

body.reveal-mode .bg-blur {
    filter: blur(0px) brightness(0.65) contrast(1.2);
}

/* ===== Top Navbar ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px clamp(28px, 5vw, 64px);
    transition: opacity 0.8s ease;
}

.top-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: -30px;
    z-index: -1;
    backdrop-filter: blur(100px) saturate(0.7) contrast(1.2);
    -webkit-backdrop-filter: blur(100px) saturate(0.7) contrast(1.2);
    background: rgba(0, 0, 0, 0.05);
    mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
    pointer-events: none;
}

body.reveal-mode .top-nav {
    opacity: 0;
    pointer-events: none;
}

.nav-brand {
    font-weight: 800;
    font-size: clamp(1.3rem, 2vw, 1.6rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.nav-highlight {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 0px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 0;
}



.nav-highlight.sliding {
    transition: left 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        width 0.3s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.15s ease;
}

.nav-link {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #f5f5f5;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.25s ease, background-color 0.3s ease;
    opacity: 1;
    position: relative;
    z-index: 1;
    padding: 10px clamp(16px, 2vw, 24px);
}

.nav-link:hover {
    color: rgba(0, 0, 0, 0.85);
}

/* ===== Hamburger Menu ===== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
    padding: 0;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: left center;
}

body[data-active-section="projects"] .hamburger span {
    background-color: #fff;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(1.5px);
}

/* ===== Sections Container ===== */
#sections-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 500vh;
    z-index: 10;
    overflow: hidden;
    will-change: transform;
}

body.reveal-mode #sections-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* ===== Page Sections ===== */
.page-section {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section-content {
    max-width: 50vw;
    position: relative;
    z-index: 10;
    pointer-events: none;
    text-align: center;
}

.section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.8rem, 2.5vw, 2.8rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.section-content p {
    font-size: clamp(1.4rem, 1.8vw, 2rem);
    font-weight: 500;
    line-height: 1.65;
    color: #f3f3f3;
    text-align: center;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(16px, 2vw, 32px);
    width: 100%;
    height: 100%;
    padding: clamp(80px, 10vh, 120px) clamp(28px, 5vw, 64px) 60px;
    transition: opacity 0.8s ease;
    will-change: opacity;
    transform: translateZ(0);
    position: relative;
    z-index: 10;
}

body.reveal-mode .layout {
    opacity: 0;
    pointer-events: none;
}

/* ===== Intro Text ===== */
.intro {
    max-width: 50vw;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    pointer-events: none;
}

.intro p {
    font-size: clamp(1.4rem, 1.8vw, 2rem);
    font-weight: 500;
    line-height: 1.65;
    color: #f3f3f3;
    text-align: center;
    transform: translateZ(0);
    margin-top: 30vh;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    opacity: 0.5;
    animation: scrollBob 2s ease-in-out infinite;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.scroll-indicator svg {
    width: 32px;
    height: 32px;
    color: rgba(255, 255, 255, 0.7);
}

@keyframes scrollBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* ===== Card Grid ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 460px;
}

.card {
    position: relative;
    aspect-ratio: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
        box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.card-label {
    font-weight: 600;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    letter-spacing: 0.01em;
    position: relative;
    z-index: 2;
}

/* --- Light cards --- */
.card-light {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
}

.card-light .card-label {
    color: #1a1a1a;
}

/* --- Fun card (dark with subtle animated bokeh) --- */
.card-fun {
    background: #0a0a0f;
}

.card-fun .card-label {
    color: #fff;
}

/* Bokeh dots */
.card-fun::before,
.card-fun::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.7;
    animation: float 6s ease-in-out infinite;
}

.card-fun::before {
    width: 18px;
    height: 18px;
    background: rgba(255, 60, 60, 0.8);
    top: 20%;
    left: 55%;
    animation-delay: 0s;
}

.card-fun::after {
    width: 14px;
    height: 14px;
    background: rgba(60, 200, 255, 0.8);
    top: 60%;
    left: 30%;
    animation-delay: -2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-8px) scale(1.15);
        opacity: 1;
    }
}

/* Extra bokeh via box-shadows on the card itself */
.card-fun {
    box-shadow:
        inset 24px -10px 16px -12px rgba(0, 255, 80, 0.25),
        inset -30px 14px 20px -14px rgba(255, 180, 0, 0.2),
        inset 10px 30px 14px -10px rgba(100, 140, 255, 0.2);
}

/* ===== Reveal Controls ===== */
#reveal-btn {
    position: fixed;
    bottom: clamp(20px, 4vh, 48px);
    left: clamp(28px, 5vw, 64px);
    width: 4vh;
    height: 4vh;
    z-index: 20;

    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reveal-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

#reveal-btn img {
    width: 100%;
    height: 100%;
    filter: invert(1);
    /* Ensure it's white to match text */
}

/* WebGL fade */
#webgl-canvas {
    transition: opacity 0.8s ease;
}

body.reveal-mode #webgl-canvas {
    opacity: 0 !important;
}

/* Gradient Fade out */
body::before {
    transition: opacity 0.8s ease;
}

body.reveal-mode::before,
body.reveal-mode::after {
    opacity: 0;
}

/* ===== Author Credit ===== */
.author-credit {
    position: fixed;
    bottom: clamp(20px, 4vh, 48px);
    right: clamp(24px, 4vw, 56px);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.4vw, 1.2rem);
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.8s ease;
}

body.reveal-mode .author-credit {
    opacity: 0;
}


/* ==========================================================
   PROJECTS SECTION — Illustrator Outline View
   ========================================================== */

/* --- Transition all affected elements smoothly --- */
#bg-wrapper,
body::before,
body::after,
.top-nav::before,
.nav-highlight,
#webgl-canvas,
#reveal-btn,
.author-credit {
    transition: opacity 0.5s ease;
    will-change: opacity;
}

/* --- Hide photo bg, gradients, WebGL, and reveal controls --- */
body[data-active-section="projects"] #bg-wrapper,
body[data-active-section="projects"] #webgl-canvas,
body[data-active-section="projects"] #reveal-btn,
body[data-active-section="projects"] .author-credit,
body[data-active-section="fun"] #bg-wrapper,
body[data-active-section="fun"] #webgl-canvas,
body[data-active-section="fun"] #reveal-btn,
body[data-active-section="fun"] .author-credit,
body[data-active-section="interests"] #webgl-canvas,
body[data-active-section="contact"] #webgl-canvas {
    opacity: 0 !important;
    pointer-events: none;
}

body[data-active-section="projects"]::before,
body[data-active-section="projects"]::after,
body[data-active-section="fun"]::before,
body[data-active-section="fun"]::after {
    opacity: 0;
}

/* --- Navbar: remove blur, keep transparent --- */
body[data-active-section="projects"] .top-nav::before {
    opacity: 0;
}

/* --- Navbar: hide sliding fill highlight --- */
body[data-active-section="projects"] .nav-highlight {
    opacity: 1;
}

body[data-active-section="projects"] .nav-highlight::before {
    background-color: #000000;
}

/* --- Navbar: hide sliding fill highlight --- */
body[data-active-section="projects"] .top-nav {
    background-color: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* --- Navbar links: all white, no hover fill --- */
body[data-active-section="projects"] .nav-link {
    color: #fff;

}

body[data-active-section="projects"] .nav-link:hover {
    color: rgba(0, 0, 0, 1);

}

/* --- Active nav item (Projects) gets a stroke border --- */
body[data-active-section="projects"] .nav-link[data-section="1"] {
    background-color: #E0E0E0;
    color: #000000;
}

/* --- Active nav item for other sections --- */
body[data-active-section="fun"] .nav-link[data-section="2"],
body[data-active-section="interests"] .nav-link[data-section="3"],
body[data-active-section="contact"] .nav-link[data-section="4"] {
    background-color: rgba(255, 255, 255, 0.92);
    color: #000000;
}

/* --- Outline Grid Structure --- */
.outline-container {
    width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: auto;
    scrollbar-color: #fff #000;
}

.outline-grid {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Blocky scrollbar styling */
.outline-container::-webkit-scrollbar {
    width: 20px;
    background: #000;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    /* matches outline grid lines */
}

.outline-container::-webkit-scrollbar-track {
    background: #000;
}

.outline-container::-webkit-scrollbar-thumb {
    background: #fff;
    border: 3px solid #000;
    /* inset look */
    background-clip: padding-box;
}

.outline-container::-webkit-scrollbar-thumb:hover {
    background: #E0E0E0;
}

/* Rows: horizontal line drawn via ::after pseudo-element */
.outline-row {
    display: flex;
    position: relative;
}

.outline-row::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.5);
    transform: scale3d(0, 1, 1);
    transform-origin: left;
    transition: none;
    will-change: transform;
    backface-visibility: hidden;
}

/* Cells: vertical line drawn via ::after pseudo-element */
.outline-cell {
    position: relative;
}

.outline-cell:not(.outline-cell-scrollbar)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.5);
    transform: scale3d(1, 0, 1);
    transform-origin: top;
    transition: none;
    will-change: transform;
    backface-visibility: hidden;
}

.outline-cell-scrollbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: #fff;
    /* Solid white to act as scrollbar track border */
    transform: scaleY(0);
    transform-origin: top;
    transition: none;
}

.outline-cell:last-child::after {
    display: none;
}

/* ===== Draw-in Animations (triggered on section enter) ===== */

/* Horizontal lines — draw left to right, staggered top to bottom */
body[data-active-section="projects"] .outline-row::after {
    animation: drawLineH 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Vertical lines — draw top to bottom, staggered by row */
body[data-active-section="projects"] .outline-cell:not(.outline-cell-scrollbar)::after,
body[data-active-section="projects"] .outline-cell-scrollbar::before {
    animation: drawLineV 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Spacer row draws instantly */
body[data-active-section="projects"] .outline-spacer::after {
    animation-delay: 0.0s;
}

/* Gutter vertical lines */
body[data-active-section="projects"] .outline-content-row .outline-cell-gutter::after {
    animation: drawLineV 0.5s cubic-bezier(0.25, 1, 0.5, 1) 0.05s forwards;
}

/* Content fade-in staggered with lines */
.project-card,
.outline-cell-heading {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
    transition: none;
    will-change: transform, opacity;
}

body[data-active-section="projects"] .outline-cell-heading {
    animation: fadeContent 0.4s ease-out 0.1s forwards;
}

body[data-active-section="projects"] .projects-scroll-area .outline-project-row:nth-child(1) .project-card {
    animation: fadeContent 0.4s ease-out 0.15s forwards;
}

body[data-active-section="projects"] .projects-scroll-area .outline-project-row:nth-child(2) .project-card {
    animation: fadeContent 0.4s ease-out 0.2s forwards;
}

body[data-active-section="projects"] .projects-scroll-area .outline-project-row:nth-child(3) .project-card {
    animation: fadeContent 0.4s ease-out 0.25s forwards;
}

body[data-active-section="projects"] .projects-scroll-area .outline-project-row:nth-child(4) .project-card {
    animation: fadeContent 0.4s ease-out 0.3s forwards;
}

body[data-active-section="projects"] .projects-scroll-area .outline-project-row:nth-child(5) .project-card {
    animation: fadeContent 0.4s ease-out 0.35s forwards;
}

body[data-active-section="projects"] .outline-project-row:nth-child(6) .project-card {
    animation: fadeContent 0.4s ease-out 0.55s forwards;
}

body[data-active-section="projects"] .outline-project-row:nth-child(7) .project-card {
    animation: fadeContent 0.4s ease-out 0.65s forwards;
}

@keyframes drawLineH {
    from {
        transform: scale3d(0, 1, 1);
    }

    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes drawLineV {
    from {
        transform: scale3d(1, 0, 1);
    }

    to {
        transform: scale3d(1, 1, 1);
    }
}

@keyframes fadeContent {
    from {
        opacity: 0;
        transform: translate3d(0, 6px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Nav row — spacing only, no outline */
.outline-nav-row {
    min-height: 76px;
    border-bottom: none;
}

.outline-nav-row .outline-cell {
    border-right: none;
}

.outline-cell-brand {
    width: 20%;
}

.outline-cell-nav {
    width: 40%;
}


/* Spacer row — must clear the fixed navbar */
.outline-spacer {
    min-height: max(10vh, 90px);
}

.outline-spacer::after {
    display: none;
}

/* Heading row */
.outline-heading-row {
    min-height: 60px;
    align-items: center;
}

.outline-cell-gutter {
    width: 20%;
    flex-shrink: 0;
}

.outline-cell-scrollbar {
    width: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

/* Main content row: fills remaining height below spacer */
.outline-content-row {
    flex: 1;
    min-height: 0;
    display: flex;
}

/* Centre column that holds heading + scroll area */
.outline-cell-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.outline-cell-heading {
    flex-shrink: 0;
    padding: 12px 16px;
    background-color: #E0E0E0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.projects-heading {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    font-weight: 700;
    color: #000000;
    letter-spacing: -0.02em;
}

/* Project rows — sized so exactly 3 are visible; scroll for more */
.outline-project-row {
    flex: none;
    height: calc((100vh - 160px) / 3);
    min-height: 140px;
    padding: 16px;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

/* Project card layout */
.project-card {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

.project-card:hover {
    cursor: pointer;
    background-color: #E0E0E0;
    transition: background-color 0.3s ease;
    color: #000;
}

.project-card:hover .project-title,
.project-card:hover .project-desc,
.project-card:hover .project-link {
    color: #000000;
}

.project-thumb {
    width: 20vw;
    max-width: 300px;
    height: 20vh;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    align-self: center;
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.project-title {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    font-weight: 700;
    color: #E0E0E0;
    letter-spacing: -0.01em;
}

.project-desc {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    font-weight: 400;
    color: #E0E0E0;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.project-link {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: #E0E0E0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.project-link:hover {
    opacity: 0.7;
}

.project-tag {
    display: inline-block;
    width: 80px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: #fff;
}

/* Empty rows at bottom */
.outline-empty-row {
    min-height: 32px;
}

/* Projects section: scrollable with custom scrollbar */
.projects-section {
    overflow: hidden;
}

.projects-section .outline-grid {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.projects-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Custom blocky scrollbar */
.projects-scroll-area::-webkit-scrollbar {
    width: 20px;
}

.projects-scroll-area::-webkit-scrollbar-track {
    background: #000;
    border: 1px solid #fff;
    border-left: 2px solid #fff;
}

.projects-scroll-area::-webkit-scrollbar-thumb {
    background: #00ffff;
    background-clip: padding-box;
    border: 4px solid #000;
    /* this creates a black gap between cyan thumb and white track border */
}

.projects-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #ffffff;
}

/* Firefox scrollbar */
.projects-scroll-area {
    scrollbar-width: auto;
    scrollbar-color: #ffffff #000;
}



/* ===== Responsive ===== */

/* --- Mid-size: tablets & small laptops (≤1024px) --- */
@media (max-width: 1024px) {
    .outline-cell-gutter {
        width: 10%;
    }

    .project-thumb {
        width: 18vw;
        max-width: 220px;
        height: 16vh;
    }

    .project-title {
        font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    }

    .project-desc {
        font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    }

    .project-link {
        font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
        gap: 16px;
        padding: 20px 24px 80px;
    }

    .intro {
        max-width: 100%;
        text-align: left;
    }

    .intro p {
        margin-top: 0;
    }

    .section-content {
        max-width: 85vw;
    }

    .card-grid {
        max-width: 360px;
    }

    .card {
        aspect-ratio: 1.4;
    }

    .author-credit {
        bottom: 16px;
        right: 24px;
        font-size: 0.85rem;
    }

    .top-nav {
        padding: 20px 24px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease;
        z-index: 90;
    }

    .nav-links.active {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-link {
        font-size: 1.8rem;
        padding: 16px;
    }

    .nav-highlight {
        display: none !important;
    }

    body[data-active-section="projects"] .nav-links {
        background: #000;
        border-bottom: none;
    }

    /* --- Projects outline grid: mobile --- */
    .outline-cell-gutter {
        width: 5%;
    }

    .outline-spacer {
        min-height: 70px;
    }

    .outline-heading-row {
        min-height: 44px;
    }

    .outline-cell-heading {
        padding: 8px 12px;
    }

    .projects-heading {
        font-size: 1.1rem;
    }

    /* Allow internal scroll if cards overflow 100vh */
    .projects-section .outline-grid {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .outline-project-row {
        flex: none;
        min-height: auto;
    }

    .outline-cell-project {
        padding: 10px 12px;
    }

    .project-card {
        flex-direction: column;
        gap: 10px;
    }

    .project-thumb {
        width: 100%;
        max-width: none;
        height: 120px;
        min-height: 0;
    }

    .project-info {
        padding-bottom: 4px;
        gap: 4px;
    }

    .project-title {
        font-size: 0.95rem;
    }

    .project-desc {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .project-link {
        font-size: 0.75rem;
    }

    .project-tag {
        width: 50px;
        height: 18px;
    }
}

/* --- Small mobile (≤480px) --- */
@media (max-width: 480px) {
    .outline-cell-gutter {
        width: 3%;
    }

    .project-thumb {
        height: 100px;
    }

    .outline-cell-project {
        padding: 8px;
    }

    .project-card {
        gap: 8px;
    }

    .card-grid {
        gap: 10px;
    }

    .card {
        aspect-ratio: 1.2;

    }
}