html {
    margin: 0;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    transition: background-color 0.6s ease, color 0.6s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    transition: color 0.6s ease, background-color 0.6s ease, border-color 0.6s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    width: 100%;
    max-width: 1200px;
    padding: 0 1.25rem;
    padding-top: 6rem;
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
    min-width: 0;
    flex: 1;
}

/* Classic, elegant font for the title */
h1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 2.8rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.4em;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Clean, modern menu with lots of spacing */
nav {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.08em;
    color: #333;
    background: none;
    border: none;
    padding: 1rem 2rem;
    animation: fadeInUp 1s ease-out 0.2s forwards;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 0;
}

nav.scrolled {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    padding: 0.75rem 2rem;
}

/* Dark mode toggle button */
.dark-mode-toggle {
    position: fixed;
    top: 80px;
    right: 2rem;
    width: 32px;
    height: 32px;
    border: 1px solid #bdbdbd;
    border-radius: 100px;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    padding: 0;
    color: #383838;
}

.dark-mode-toggle:hover {
    border-color: #383838;
    transform: scale(1.05);
}

.dark-mode-toggle svg {
    width: 16px;
    height: 16px;
}

.dark-mode-toggle .sun-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle .moon-icon {
    display: none !important;
}

body.dark-mode .dark-mode-toggle .sun-icon {
    display: block !important;
    color: #ffffff !important;
}

body.dark-mode .dark-mode-toggle .sun-icon circle {
    fill: #ffffff !important;
}

body.dark-mode .dark-mode-toggle .sun-icon path {
    stroke: #ffffff !important;
}

.nav-brand {
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #333;
    text-decoration: none;
}

.nav-brand:hover {
    color: #000;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
    position: relative;
    padding: 0.25rem 0;
}

nav a:hover {
    color: #000;
    opacity: 0.6;
}

nav a.active {
    color: #000;
    font-weight: 600;
}

/* Intro section */
.intro-section {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 2.5rem;
    text-align: left;
    padding: 0 1.25rem;
    box-sizing: border-box;
    animation: fadeInUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

.intro-hello {
    font-family: 'Roboto', sans-serif;
    font-size: 2.25rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #000;
    margin: 0;
    line-height: 1.1;
}

.intro-hello .emoji {
    filter: grayscale(100%);
    display: inline-block;
    font-size: 0.8em;
}

.intro-name {
    font-family: 'Roboto', sans-serif;
    font-size: 2.75rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #000;
    margin: 0.75rem 0 1.5rem 0;
    line-height: 1.2;
}

.intro-description {
    font-family: 'Roboto', sans-serif;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.6;
    color: #333;
    margin: 0 0 1.5rem 0;
    max-width: 1200px;
}

.intro-highlight {
    font-weight: 700;
    color: #000;
}

.intro-highlight-color {
    font-weight: 700;
    color: #6366f1;
}

.intro-previous {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

.intro-previous a {
    color: #000;
    font-weight: 400;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.intro-previous a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.intro-previous a strong {
    font-weight: 700;
    color: #000;
}

.intro-sep {
    color: #aaa;
    margin: 0 0.2em;
}

/* Selected Works section */
.selected-works {
    width: 100%;
    max-width: 1200px;
    margin-top: 0;
    margin-bottom: 6rem;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.project-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    width: 100%;
    min-width: 0;
}

.project-box {
    min-width: 0;
}

.project-boxes:hover .project-box:not(:hover) {
    transform: scale(0.95);
    opacity: 0.6;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.project-box {
    border: 1px solid #e0e0e0;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
    border-radius: 8px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    z-index: 1;
    position: relative;
    cursor: pointer;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.project-box:nth-child(1) {
    animation-delay: 0.8s;
}

.project-box:nth-child(2) {
    animation-delay: 0.95s;
}

.project-box:nth-child(3) {
    animation-delay: 1.1s;
}

.project-box:nth-child(4) {
    animation-delay: 1.25s;
}

.project-box:nth-child(5) {
    animation-delay: 1.4s;
}

.project-box:nth-child(6) {
    animation-delay: 1.55s;
}

.project-box:nth-child(7) {
    animation-delay: 1.7s;
}

.project-box:nth-child(8) {
    animation-delay: 1.85s;
}

.project-box:nth-child(9) {
    animation-delay: 2.0s;
}

.project-box:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.project-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 2;
}

.project-box:hover::after {
    opacity: 1;
}

.project-image-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    border-radius: 8px;
    margin: 0.25rem 0 0 0;
    flex-shrink: 0;
}

.project-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease, brightness 0.3s ease;
    will-change: transform;
    filter: blur(4px);
}

.project-box:hover img {
    transform: scale(1.2);
    filter: blur(5px) brightness(0.4);
}

.project-image-wrapper {
    position: relative;
}

.project-box:hover .project-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
    pointer-events: none;
}

/* Lock overlay for private projects */
.project-box-link {
    position: relative;
}

/* Case study title — always visible on card image; blurs when lock appears on hover */
.project-box-link::after {
    content: attr(data-title);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Lora', 'Georgia', serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #fff;
    opacity: 1;
    pointer-events: none;
    z-index: 3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: filter 0.4s ease-in-out;
}
.project-box:hover .project-box-link::after {
    filter: blur(4px);
}

/* Light image background — use dark text and lock for legibility */
.project-box-link.light-bg::after {
    color: #3d3d3d;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9), 0 0 12px rgba(255, 255, 255, 0.5);
}
.project-box-link.light-bg::before {
    filter: invert(1);
}

/* Lock icon — glass-like, centered on card image, fades in on hover */
.project-box-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    transform: translate(-50%, -50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='glass' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23fff' stop-opacity='0.95'/%3E%3Cstop offset='50%25' stop-color='%23fff' stop-opacity='0.75'/%3E%3Cstop offset='100%25' stop-color='%23e0e8f0' stop-opacity='0.55'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23glass)' d='M12 2a4 4 0 0 1 4 4v3h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1V6a4 4 0 0 1 4-4zm0 2a2 2 0 0 0-2 2v3h4V6a2 2 0 0 0-2-2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
    z-index: 4;
    font-size: 2.35rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.35)) drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.project-box:hover .project-box-link::before {
    opacity: 0.88;
}

.project-box {
    text-align: left;
    transition: opacity 0.55s ease, transform 0.6s ease;
}

.project-box h3 {
    display: none;
}

.project-box p {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: #666;
    margin: 0.7rem 0 0 0;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tooltip for truncated description */
.project-desc-wrap {
    position: relative;
}
.project-box-desc-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 6px;
    padding: 0.6rem 0.75rem;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    color: #fff;
    background: #2a2a2a;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 10;
    text-align: left;
}
.project-desc-wrap:hover .project-box-desc-tooltip {
    opacity: 1;
    visibility: visible;
}
body.dark-mode .project-box-desc-tooltip {
    background: #1a1a1a;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.project-box-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-box-link:hover h3 {
    color: #000;
}

body.dark-mode .project-box-link:hover h3 {
    color: #e0e0e0;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.7rem 0 0 0;
}

.project-tags .tag {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: #383838;
    text-transform: none;
    letter-spacing: 0.05em;
    border: 1px solid #bdbdbd;
    border-radius: 100px;
    padding: 0.2rem 0.5rem;
    display: inline-block;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.project-tags .tag:hover {
    border-color: #333;
    color: #111;
    background: #f8f8f8;
    transform: scale(1.05);
}
.project-tags .tag:focus {
    outline: none;
}
.project-tags .tag.tag--active {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Tag filter feedback: selected filter pills + Clear link (only visible when filters active) */
.filter-feedback {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin-bottom 0.5s ease, padding 0.5s ease;
}
.filter-feedback.is-visible {
    max-height: 120px;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    opacity: 1;
}
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.filter-pill {
    font-size: 10px;
    font-weight: 400;
    color: #383838;
    letter-spacing: 0.05em;
    border: 1px solid #bdbdbd;
    border-radius: 100px;
    padding: 0.2rem 0.5rem;
    line-height: 1.3;
    display: inline-block;
}
/* Clear link only visible when a filter is active (data-active set by JS) */
.filter-feedback .filter-clear {
    display: none;
}
.filter-feedback[data-active="true"] .filter-clear {
    display: inline-flex;
}
.filter-clear {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
    color: #555;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
    line-height: 1;
}
.filter-clear:hover {
    color: #111;
}
.filter-clear-icon {
    flex-shrink: 0;
    display: block;
}

/* Filter animation: non-matching cards fade out slowly, then matching cards slide into place */
.selected-works.filter-active .project-box.filter-hidden {
    opacity: 0;
    pointer-events: none;
}
.selected-works.filter-active .project-box.filter-hidden.filter-removed {
    display: none;
}

/* Collab / Contact section – modern wavy aesthetic */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.collab-section {
    width: 100%;
    position: relative;
    margin-top: 6rem;
    margin-bottom: 0;
    padding: 6rem 1.25rem 8rem;
    box-sizing: border-box;
    text-align: center;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23d5d5d5'/%3E%3Ccircle cx='7' cy='1' r='0.5' fill='%23d5d5d5'/%3E%3Ccircle cx='1' cy='7' r='0.5' fill='%23d5d5d5'/%3E%3Ccircle cx='7' cy='7' r='0.5' fill='%23d5d5d5'/%3E%3Ccircle cx='4' cy='4' r='0.5' fill='%23d5d5d5'/%3E%3C/svg%3E");
    overflow: hidden;
}

.site-footer .collab-section {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 1.25rem;
}

.collab-inner {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.collab-heading-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.collab-heading {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 4vw, 2rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #1a1a1a;
    margin: 0;
}

.floating-cursor {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.floating-cursor.cursor-visible {
    opacity: 1;
}

.cursor-arrow {
    color: #1a1a1a;
    flex-shrink: 0;
}

.cursor-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background: #c026d3;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.collab-cta {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 999px;
    background: #1a1a1a;
    color: #fff;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 2rem;
    align-self: center;
}

.collab-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.collab-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.collab-icon {
    color: #555;
    transition: color 0.2s ease, transform 0.2s ease;
}

.collab-icon:hover {
    color: #1a1a1a;
    transform: translateY(-2px);
}

.collab-icon-email svg {
    display: block;
}

.collab-icon-linkedin svg {
    display: block;
}

.collab-icon-github {
    color: #24292f;
}

.collab-icon-github svg {
    display: block;
}

.collab-icon-github:hover {
    color: #1a1a1a;
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
    .project-boxes {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    main {
        padding: 0 1.25rem;
        padding-top: 5rem;
    }
    
    .intro-section {
        padding: 0 1.25rem;
        margin-bottom: 2rem;
    }
    
    .selected-works {
        padding: 0 1.25rem;
        margin-bottom: 4rem;
    }
    
    .collab-section {
        padding: 4rem 1.25rem 6rem;
        margin-top: 4rem;
    }
    
    .site-footer {
        padding: 3rem 1.25rem 4rem;
    }
}

@media (max-width: 640px) {
    .project-boxes {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 0.75rem 1rem;
        font-size: 14px;
    }
    
    .nav-brand {
        font-size: 12px;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
    
    nav a {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 0.625rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    main {
        padding: 0 1rem;
        padding-top: 4rem;
    }
    
    .intro-section {
        padding: 0 1rem;
        margin-bottom: 1.5rem;
    }
    
    .intro-hello {
        font-size: 2rem;
    }
    
    .intro-name {
        font-size: 2.25rem;
        margin: 1.5rem 0 1rem 0;
    }
    
    .intro-description {
        font-size: 1.1rem;
        white-space: normal;
    }
    
    .intro-previous {
        font-size: 0.9rem;
    }
    
    .project-boxes {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-box {
        padding: 0.875rem;
    }
    
    .project-box h3 {
        display: none;
    }
    
    .project-box p {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .project-image-wrapper {
        height: 250px;
        margin: 0.25rem 0 0 0;
    }
    
    .project-tags {
        margin: 0.55rem 0 0 0;
    }
    
    .project-tags .tag {
        font-size: 9px;
        padding: 0.15rem 0.4rem;
    }
    
    .selected-works {
        padding: 0 1rem;
        margin-bottom: 4rem;
    }
    
    .collab-section {
        padding: 3rem 1rem 5rem;
        margin-top: 4rem;
    }
    
    .collab-heading {
        font-size: clamp(1.35rem, 4vw, 1.75rem);
    }
    
    .floating-cursor {
        transform: translate(-50%, -100%);
    }
    
    .site-footer {
        padding: 3rem 1rem 4rem;
    }
    
    .selected-works h2 {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }
    
    .nav-brand {
        font-size: 11px;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .intro-hello {
        font-size: 1.75rem;
    }
    
    .intro-name {
        font-size: 1.9rem;
    }
    
    .intro-description {
        font-size: 0.95rem;
    }
    
    .intro-previous {
        font-size: 0.85rem;
    }
    
    .project-box {
        padding: 0.75rem;
    }
    
    .project-image-wrapper {
        height: 200px;
    }
    
    .collab-icons {
        gap: 1.5rem;
    }
    
    .collab-icon {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .site-footer {
        padding: 2.5rem 1rem 3rem;
    }
    
    .dark-mode-toggle {
        top: 70px;
        right: 0.75rem;
        width: 28px;
        height: 28px;
    }
    
    .dark-mode-toggle svg {
        width: 14px;
        height: 14px;
    }
}

/* Dark mode styles */
body.dark-mode {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode nav {
    color: #e0e0e0;
    background: rgba(42, 42, 42, 0.85);
}

body.dark-mode nav.scrolled {
    background: rgba(42, 42, 42, 0.95);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-brand {
    color: #e0e0e0;
}

body.dark-mode .nav-brand:hover {
    color: #e0e0e0;
    opacity: 0.9;
}

body.dark-mode nav a {
    color: #e0e0e0;
}

body.dark-mode nav a:hover {
    color: #e0e0e0;
    opacity: 0.7;
}

body.dark-mode nav a.active {
    color: #e0e0e0;
    font-weight: 600;
}

body.dark-mode .dark-mode-toggle {
    background: #2a2a2a;
    border-color: #bdbdbd;
    color: #ffffff;
}

body.dark-mode .dark-mode-toggle:hover {
    border-color: #e0e0e0;
}

body.dark-mode .intro-hello,
body.dark-mode .intro-name {
    color: #e0e0e0;
}

body.dark-mode .intro-hello .emoji {
    filter: grayscale(100%) invert(1) brightness(1.2);
}

body.dark-mode .intro-description,
body.dark-mode .intro-previous {
    color: #e0e0e0;
}

body.dark-mode .intro-highlight,
body.dark-mode .intro-previous strong {
    color: #e0e0e0;
    font-weight: 700;
}

body.dark-mode .intro-highlight-color {
    color: #818cf8;
    font-weight: 700;
}

body.dark-mode .intro-sep {
    color: #666;
}

body.dark-mode .intro-previous a {
    color: #e0e0e0;
}

body.dark-mode .intro-previous a:hover {
    color: #e0e0e0;
    opacity: 0.7;
}

body.dark-mode .selected-works h2,
body.dark-mode .collab-section {
    background-color: #1a1a1a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ccircle cx='1' cy='1' r='0.5' fill='%23333'/%3E%3Ccircle cx='7' cy='1' r='0.5' fill='%23333'/%3E%3Ccircle cx='1' cy='7' r='0.5' fill='%23333'/%3E%3Ccircle cx='7' cy='7' r='0.5' fill='%23333'/%3E%3Ccircle cx='4' cy='4' r='0.5' fill='%23333'/%3E%3C/svg%3E");
}

body.dark-mode .collab-heading {
    color: #f0f0f0;
}

body.dark-mode .cursor-arrow {
    color: #f0f0f0;
}

body.dark-mode .cursor-pill {
    background: #e879f9;
    color: #1e1b4b;
}

body.dark-mode .collab-cta {
    background: #f0f0f0;
    color: #1a1a1a;
}

body.dark-mode .collab-cta:hover {
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.12);
}

body.dark-mode .collab-icon {
    color: #aaa;
}

body.dark-mode .collab-icon:hover {
    color: #f0f0f0;
}

body.dark-mode .collab-icon-github {
    color: #e0e0e0;
}

body.dark-mode .collab-icon-github:hover {
    color: #fff;
}

body.dark-mode .project-box {
    background: #333333;
    border-color: #404040;
}

body.dark-mode .project-box h3 {
    color: #e0e0e0;
}

body.dark-mode .project-box p {
    color: #e0e0e0;
}

body.dark-mode .project-tags .tag {
    color: #e0e0e0;
    border-color: #404040;
    background: #333333;
}

body.dark-mode .project-tags .tag:hover {
    background: #444;
    border-color: #666;
    color: #fff;
}
body.dark-mode .project-tags .tag.tag--active {
    background: #e0e0e0;
    border-color: #e0e0e0;
    color: #1a1a1a;
}

body.dark-mode .filter-pill {
    color: #e0e0e0;
    border-color: #404040;
}
body.dark-mode .filter-clear {
    color: #c0c0c0;
}
body.dark-mode .filter-clear:hover {
    color: #fff;
}



/* Footer – "Flowing Data" background (CSS-only)
   -----------------------------------------------
   How the keyframes work:
   The background is a repeating pattern of thin horizontal lines. background-size
   defines one "tile" height (e.g. 32px). The animation moves background-position
   from 0 to that tile height (e.g. 0 → 32px on the Y axis). Because the pattern
   repeats every tile, when we shift by exactly one tile the scene looks identical,
   so the animation loops seamlessly. The lines appear to drift downward (or use
   negative values to drift up). Speed = animation duration: higher seconds =
   slower shimmer (e.g. 20s), lower = faster (e.g. 8s). Use --footer-data-duration.

   Variables you can change:
   --footer-data-duration   Animation length in seconds (e.g. 15s = slow).
   --footer-data-line-size  Vertical repeat size in px; also the keyframe distance.
   --footer-data-line-color Line color (default #333 on #0A0A0A).
*/
.site-footer {
    --footer-data-duration: 18s;
    --footer-data-line-size: 32px;
    --footer-data-line-color: rgba(0, 0, 0, 0.08);

    width: 100%;
    min-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0 1.25rem 0;
    box-sizing: border-box;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    position: relative;
    background-color: transparent;
    background-image: linear-gradient(
        to bottom,
        transparent 0,
        transparent calc(100% - 1px),
        var(--footer-data-line-color) 100%
    );
    background-size: 100% var(--footer-data-line-size);
    background-position: 0 0;
    animation: footer-data-flow var(--footer-data-duration) linear infinite;
}

@keyframes footer-data-flow {
    from { background-position: 0 0; }
    to   { background-position: 0 var(--footer-data-line-size); }
}

.footer-strip {
    width: 100vw;
    margin: 0.5rem 0 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: #000;
    text-align: center;
    padding: 0.5rem 1.25rem;
}

.footer-copyright {
    font-family: 'Roboto', sans-serif;
    font-size: 0.75rem;
    color: #fff;
    letter-spacing: 0.02em;
}

/* Dark mode footer: dark base + subtle light lines */
body.dark-mode .site-footer {
    background-color: transparent;
    --footer-data-line-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .footer-strip {
    background: #000;
}

body.dark-mode .footer-copyright {
    color: #fff;
}

/* ========================================
   Aerospace case study: flowy topographic fixed background
   ======================================== */
body.aerospace-case-study {
    background: #0A0A0A;
}

.aerospace-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #0A0A0A;
    pointer-events: none;
}

.aerospace-bg-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Aerospace case study: light text on navy so content is readable */
body.aerospace-case-study .template-title,
body.aerospace-case-study .template-year,
body.aerospace-case-study .case-study-section-title,
body.aerospace-case-study .case-study-section-intro,
body.aerospace-case-study .case-study-section p,
body.aerospace-case-study .case-study-list,
body.aerospace-case-study .case-study-subtitle,
body.aerospace-case-study .quick-fact-value,
body.aerospace-case-study .template-hero-caption,
body.aerospace-case-study .case-study-fig-caption {
    color: #e8e8e8;
}
body.aerospace-case-study .template-year,
body.aerospace-case-study .quick-fact-label,
body.aerospace-case-study .template-hero-caption,
body.aerospace-case-study .case-study-fig-caption {
    color: #b0b0b0;
}
body.aerospace-case-study .case-study-section-num {
    color: #5a5a5a;
}
body.aerospace-case-study .template-hero {
    background: transparent;
}
body.aerospace-case-study nav,
body.aerospace-case-study .nav-links a {
    color: #e8e8e8;
}
body.aerospace-case-study .template-link {
    color: #2DD4BF;
}
body.aerospace-case-study .template-link:hover {
    color: #5eead4;
    opacity: 0.9;
}

/* ========================================
   Project template (Paperwhite style)
   ======================================== */
.template-main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 1.25rem 8rem;
    box-sizing: border-box;
    opacity: 1;
    animation: none;
    min-width: 0;
}

.template-header {
    margin-bottom: 4rem;
}

.template-title {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #000;
    margin: 0 0 1rem 0;
}

.template-year {
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #666;
    margin: 0;
}

.template-title-serif {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 400;
}

.template-hero-caption {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #666;
    margin: 1rem 0 0 0;
    text-align: center;
}

/* Quick Facts (case study) */
.quick-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 3rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: left;
}

.quick-fact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.quick-fact-label {
    font-family: 'Roboto', sans-serif;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #999;
}

.quick-fact-value {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9375rem;
    font-weight: 400;
    color: #333;
}

/* Case study sections */
.case-study-section {
    margin-bottom: 5rem;
    text-align: left;
}

.case-study-section-title {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.2rem, 2.75vw, 1.75rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #000;
    margin: 0 0 1.5rem 0;
}

.case-study-section-num {
    display: inline-block;
    margin-right: 0.35em;
    font-weight: 400;
    color: #999;
}

.case-study-section-intro {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.75;
    color: #333;
    margin: 0 0 1.25rem 0;
}

.case-study-section p {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.75;
    color: #333;
    margin: 0 0 1.25rem 0;
}

.case-study-section p:last-of-type {
    margin-bottom: 0;
}

.case-study-subtitle {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: #333;
    margin: 2rem 0 0.75rem 0;
}

.case-study-list {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.75;
    color: #333;
    margin: 0 0 1.25rem 0;
    padding-left: 1.5rem;
}

.case-study-list li {
    margin-bottom: 0.75rem;
}

.case-study-list li:last-child {
    margin-bottom: 0;
}

.case-study-section ol.case-study-list,
.case-study-numbered {
    list-style-type: decimal;
}

.case-study-impact {
    margin-bottom: 0;
}

/* Case study figure placeholders */
.case-study-fig {
    margin: 0 0 5rem 0;
    text-align: left;
}

.case-study-fig-placeholder {
    width: 100%;
    min-height: 280px;
    background: #FFFFFF;
    border: 1px dashed #ccc;
    border-radius: 8px;
}

.case-study-fig img,
.case-study-fig-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.case-study-fig-caption {
    font-family: 'Roboto', sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: #666;
    margin: 0.75rem 0 0 0;
    line-height: 1.5;
}

/* Hero: full viewport width; padding matches .template-main so image aligns with text */
.template-hero {
    width: 100vw;
    max-width: 100vw;
    margin: 0 0 6rem 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 0 calc((100vw - min(1200px, 100vw)) / 2 + 1.25rem);
    overflow: hidden;
    background: #FFFFFF;
    box-sizing: border-box;
}

/* Hero image: fill full viewport width; height scales proportionately */
.template-hero img {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
    object-position: center;
    box-sizing: border-box;
}

.template-process {
    margin-bottom: 6rem;
}

.template-process-heading {
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666;
    margin: 0 0 1.5rem 0;
}

.template-process-content {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.75;
    color: #333;
}

.template-process-content p {
    margin: 0 0 1.25rem 0;
}

.template-process-content p:last-child {
    margin-bottom: 0;
}

.template-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding-top: 3rem;
    border-top: 1px solid #e0e0e0;
}

.template-link {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.template-link:hover {
    color: #000;
    opacity: 0.8;
}

/* Footer Navigation (project case study) */
.footer-nav {
    padding-top: 3rem;
    margin-top: 3rem;
    border-top: 1px solid #e0e0e0;
}

.footer-nav-heading {
    font-family: 'Roboto', sans-serif;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 1.25rem 0;
}

.footer-nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-nav-prev {
    order: 1;
}

.footer-nav-overview {
    order: 2;
    font-size: 0.875rem;
    color: #666;
}

.footer-nav-overview:hover {
    color: #000;
}

.footer-nav-next {
    order: 3;
    font-size: 1rem;
    font-weight: 700;
}

.footer-nav-next:hover {
    color: #000;
    opacity: 0.9;
}

/* Project nav (Previous / Next) — in flow at bottom of page, not fixed */
.project-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: auto;
    left: auto;
    right: auto;
    top: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
}
.project-nav-top {
    margin-bottom: 2rem;
}
.project-nav-bottom {
    padding-top: 3rem;
    margin-top: 3rem;
    border-top: 1px solid #e0e0e0;
}

/* Template: responsive */
@media (max-width: 768px) {
    .template-main {
        padding: 5rem 1.25rem 6rem;
    }
    .template-header {
        margin-bottom: 3rem;
    }
    .template-title {
        font-size: 1.625rem;
    }
    .template-hero {
        margin-bottom: 4rem;
        padding-left: calc((100vw - min(1200px, 100vw)) / 2 + 1.25rem);
        padding-right: calc((100vw - min(1200px, 100vw)) / 2 + 1.25rem);
    }
    .template-process {
        margin-bottom: 4rem;
    }
    .template-nav {
        flex-direction: column;
        gap: 1rem;
    }
    .footer-nav-links,
    .project-nav {
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        text-align: center;
    }
    .footer-nav-prev { order: 1; }
    .footer-nav-overview { order: 2; }
    .footer-nav-next { order: 3; }
    .quick-facts {
        gap: 1.5rem;
    }
    .case-study-section {
        margin-bottom: 3.5rem;
    }
    .case-study-section-title {
        font-size: 1.15rem;
    }
    .case-study-fig {
        margin-bottom: 3.5rem;
    }
    .case-study-fig-placeholder {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .template-main {
        padding: 4rem 1rem 5rem;
    }
    .template-hero {
        padding-left: calc((100vw - min(1200px, 100vw)) / 2 + 1rem);
        padding-right: calc((100vw - min(1200px, 100vw)) / 2 + 1rem);
    }
}

/* Template: dark mode */
body.dark-mode .template-title {
    color: #e0e0e0;
}
body.dark-mode .template-year {
    color: #999;
}
body.dark-mode .template-process-heading {
    color: #999;
}
body.dark-mode .template-process-content {
    color: #e0e0e0;
}
body.dark-mode .template-nav {
    border-top-color: #404040;
}
body.dark-mode .template-link {
    color: #e0e0e0;
}
body.dark-mode .template-link:hover {
    color: #e0e0e0;
    opacity: 0.8;
}

body.dark-mode .footer-nav,
body.dark-mode .project-nav-bottom {
    border-top-color: #404040;
}
body.dark-mode .footer-nav-heading {
    color: #666;
}
body.dark-mode .footer-nav-overview {
    color: #999;
}
body.dark-mode .footer-nav-overview:hover {
    color: #e0e0e0;
}
body.dark-mode .footer-nav-next:hover {
    color: #e0e0e0;
}

/* Case study: dark mode */
body.dark-mode .template-hero {
    background: #2a2a2a;
}

body.dark-mode .template-hero-caption,
body.dark-mode .quick-fact-label {
    color: #999;
}
body.dark-mode .quick-facts {
    border-top-color: #404040;
}
body.dark-mode .quick-fact-value {
    color: #e0e0e0;
}
body.dark-mode .case-study-section-title {
    color: #e0e0e0;
}
body.dark-mode .case-study-section-num {
    color: #666;
}
body.dark-mode .case-study-section-intro,
body.dark-mode .case-study-section p,
body.dark-mode .case-study-list,
body.dark-mode .case-study-subtitle {
    color: #e0e0e0;
}
body.dark-mode .case-study-fig-caption {
    color: #999;
}
body.dark-mode .case-study-fig-placeholder {
    background: #2a2a2a;
    border-color: #404040;
}

/* Password Modal */
.password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.password-modal.active {
    display: flex;
}

.password-modal-content {
    background: #f7f6f2;
    padding: 3rem 2.5rem;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.password-modal-content h2 {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: #333;
    margin: 0 0 1.5rem 0;
}

.password-modal-content p {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 1.5rem 0;
}

.password-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'Lora', 'Georgia', serif;
    font-size: 1rem;
    letter-spacing: 0.02em;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    color: #333;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.password-input:focus {
    outline: none;
    border-color: #666;
}

.password-input.error {
    border-color: #d32f2f;
}

.password-error {
    font-family: 'Roboto', sans-serif;
    font-size: 0.85rem;
    color: #d32f2f;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.password-error.show {
    opacity: 1;
}

.password-submit {
    font-family: 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    padding: 0.75rem 2rem;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.password-submit:hover {
    background: #000;
    transform: translateY(-1px);
}

.password-submit:active {
    transform: translateY(0);
}

body.dark-mode .password-modal-content {
    background: #2a2a2a;
}

body.dark-mode .password-modal-content h2 {
    color: #e0e0e0;
}

body.dark-mode .password-modal-content p {
    color: #999;
}

body.dark-mode .password-input {
    background: #333;
    border-color: #404040;
    color: #e0e0e0;
}

body.dark-mode .password-input:focus {
    border-color: #666;
}

@media (max-width: 768px) {
    .password-modal-content {
        padding: 2rem 1.5rem;
    }
}
