/* Font Face */
@font-face {
    font-family: "ScrollFont";
    font-display: block;
    src:
        url("fonts/scrollfont.woff2") format("woff2-variations"),
        url("fonts/scrollfont.woff") format("woff-variations");
}

/* CSS Variables */
:root {
    --bg-primary: #faf7f2;
    --bg-secondary: #f5f0e8;
    --bg-tertiary: #e8e0d4;
    --text-primary: #2c1810;
    --text-secondary: #5c4033;
    --text-tertiary: #6b5640;
    --border-subtle: #e0d6c8;
    --accent: #c45d35;
}

[data-theme="dark"] {
    --bg-primary: #1a1210;
    --bg-secondary: #241a16;
    --bg-tertiary: #1f1714;
    --text-primary: #f5f0e8;
    --text-secondary: #c4b5a5;
    --text-tertiary: #9a8978;
    --border-subtle: #3d2e26;
    --accent: #e07650;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
    transition: background-color 0.3s ease;
}

body {
    font-family: "Work Sans", system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Nav - only visible on scroll */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 0;
    background: transparent;
    transform: translateY(-100%);
    transition:
        transform 0.3s,
        background 0.3s;
}

.nav.visible {
    transform: translateY(0);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    transition:
        transform 0.3s,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

.nav-inner {
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-mark {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
}

.nav-name {
    font-family: "Libre Barcode 39 Text", system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-link {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

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

.theme-toggle .icon-sun {
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* Landing theme toggle - playful position */
.landing-theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

/* Hide in nav until scrolled */
.nav .theme-toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.nav.visible .theme-toggle {
    opacity: 1;
    pointer-events: auto;
}

/* Landing */
.landing {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
}

.hero-above-fold {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 85vh;
    padding: 2.5rem 0;
}

@media (max-width: 767px) {
    .hero-above-fold {
        min-height: 90svh;
        padding: 2rem 0;
    }
}

.container {
    width: calc(100% - 30px);
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 767px) {
    .container {
        width: calc(100% - 16px);
        padding: 0 8px;
    }
}

/* Intro text */
.intro-line {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

@media (max-width: 767px) {
    .intro-line {
        margin-bottom: 2rem;
    }
}

.intro-line .intro-name {
    color: var(--accent);
    font-weight: 600;
}

/* Full-width title */
.title-container {
    width: 100%;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 0;
}

@media (max-width: 767px) {
    .title-container {
        margin-bottom: 2.5rem;
    }
}

.hero-photo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-6deg);
    z-index: 1;
}

.hero-photo-border {
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 3px solid var(--accent);
    border-radius: 4px;
    transform: rotate(4deg);
}

.hero-photo-inner {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-photo-inner img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .hero-photo-inner img {
        width: 200px;
        height: 200px;
    }
}

.big-title {
    font-family: "ScrollFont", sans-serif;
    text-transform: uppercase;
    line-height: 0.85;
    letter-spacing: -0.02em;
    text-align: center;
    user-select: none;
    color: var(--text-primary);
    -webkit-text-stroke: 1.5px var(--bg-primary);
    position: relative;
    z-index: 2;
}

@media (min-width: 600px) {
    .big-title {
        letter-spacing: -0.5em;
    }
}

.title-line {
    display: block;
    white-space: nowrap;
}

/* Hide title and photo until JS processes it to prevent flash */
.big-title:not(.ready) {
    visibility: hidden;
}

.title-container:has(.big-title:not(.ready)) .hero-photo {
    visibility: hidden;
}

#line2 {
    padding-left: 0.15em;
}

.title-asterisk {
    color: var(--accent);
    font-size: 0.6em;
    vertical-align: top;
}

/* Hero intro */
.hero-intro {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.intro-asterisk {
    color: var(--accent);
    font-weight: 600;
    margin-right: 0.1em;
}

/* Stats title */
.stats-title {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    max-width: 800px;
    margin: 0 auto 1rem;
}

/* Hero stats - editorial style */
.hero-stats {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

@media (max-width: 767px) {
    .hero-stats {
        padding-bottom: 3rem;
    }
}

.hero-stats li {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.hero-stats li:first-child {
    border-top: 1px solid var(--border-subtle);
}

.stat-marker {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    min-width: 2.5rem;
    flex-shrink: 0;
}

.stat-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.stat-text strong {
    font-weight: 600;
}

@media (max-width: 600px) {
    .hero-stats li {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem 0;
    }

    .stat-text {
        font-size: 1rem;
    }
}

/* Timeline Section */
.timeline-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.timeline-container {
    width: calc(100% - 30px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 767px) {
    .timeline-container {
        width: calc(100% - 16px);
        padding: 0 8px;
    }
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.timeline-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.timeline-header-line {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Experience cards */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Collapsible case studies toggle */
.timeline-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 1.25rem;
}

.timeline-expand-btn:hover {
    border-color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

.timeline-expand-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.timeline-expand-btn:hover .timeline-expand-label {
    color: var(--text-primary);
}

.timeline-expand-icon {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    transition:
        transform 0.3s ease,
        color 0.15s ease;
    flex-shrink: 0;
}

.timeline-expand-btn:hover .timeline-expand-icon {
    color: var(--text-secondary);
}

.timeline-expand-btn[aria-expanded="true"] .timeline-expand-icon {
    transform: rotate(180deg);
}

.timeline-collapsible {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease;
}

.timeline-collapsible > * {
    overflow: hidden;
}

.timeline-collapsible.expanded {
    grid-template-rows: 1fr;
}

.timeline-collapsible .timeline-projects-compact {
    padding-top: 1rem;
}

/* Experience entry card - redesigned as a cohesive unit */
.timeline-entry {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s ease;
}

@media (max-width: 767px) {
    .timeline-entry {
        padding: 1rem;
        border-radius: 8px;
    }
}

/* Job header - compact, scannable */
.timeline-job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline-job-info {
    flex: 1;
    min-width: 0;
}

.timeline-company {
    font-family: "Work Sans", sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin: 0;
}

.timeline-company-sub {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.timeline-role-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.timeline-role-line .separator {
    color: var(--text-tertiary);
}

.timeline-meta {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timeline-logo {
    height: 20px;
    width: auto;
    opacity: 0.35;
    flex-shrink: 0;
}

.timeline-logo-light {
    display: block;
}

.timeline-logo-dark {
    display: none;
}

[data-theme="dark"] .timeline-logo-light {
    display: none;
}

[data-theme="dark"] .timeline-logo-dark {
    display: block;
}

.timeline-logos {
    display: flex;
    gap: 0.625rem;
    align-items: center;
    flex-shrink: 0;
}

.timeline-logos .timeline-logo {
    height: 16px;
}

/* Case study label */
.timeline-case-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.timeline-case-label span {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
}

.timeline-case-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Projects grid - elevated as primary content */
.timeline-projects {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Compact project list for older/less important work */
.timeline-projects-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .timeline-projects-compact {
        grid-template-columns: 1fr;
    }
}

.timeline-projects-compact .timeline-project-image {
    width: 100%;
    height: 100px;
}

@media (min-width: 600px) {
    .timeline-projects-compact .timeline-project {
        flex-direction: row-reverse;
    }

    .timeline-projects-compact .timeline-project-image {
        width: 35%;
        height: auto;
    }
}

.timeline-projects-compact .timeline-project-content {
    padding: 0.75rem 1rem;
}

.timeline-projects-compact .timeline-project-type {
    font-size: 0.5rem;
    padding: 0.125rem 0.375rem;
    margin-bottom: 0.25rem;
}

.timeline-projects-compact .timeline-project-title {
    font-size: 0.75rem;
    margin-bottom: 0;
}

.timeline-projects-compact .timeline-project-desc {
    display: none;
}

.timeline-projects-compact .timeline-project-image-stack {
    height: 180px;
    min-height: 180px;
}

.timeline-projects-compact
    .timeline-project-image-stack
    .timeline-project-image {
    width: 80%;
}

/* Narrower images for phone mockups (Telstra Air) */
.timeline-projects-compact
    .timeline-project-stacked-tall
    .timeline-project-image {
    width: 55%;
}

@media (min-width: 600px) {
    .timeline-projects-compact .timeline-project-image-stack {
        width: 35%;
        height: auto;
        min-height: 140px;
    }

    .timeline-projects-compact
        .timeline-project-image-stack
        .timeline-project-image {
        width: 80%;
    }

    .timeline-projects-compact
        .timeline-project-stacked-tall
        .timeline-project-image {
        width: 60%;
    }
}

.timeline-project {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

@media (min-width: 600px) {
    .timeline-project {
        flex-direction: row-reverse;
        align-items: stretch;
    }
}

.timeline-project:hover {
    border-color: var(--text-tertiary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.timeline-project:focus {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}

.timeline-project:focus:not(:focus-visible) {
    outline: none;
}

.timeline-project:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}

.timeline-project-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    object-position: center top;
    background: var(--bg-secondary);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.timeline-project:hover .timeline-project-image {
    transform: scale(1.05);
}

/* Stacked image effect */
.timeline-project-stacked {
    overflow: hidden;
}

.timeline-project-image-stack {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

@media (min-width: 600px) {
    .timeline-project-image-stack {
        width: 45%;
        height: auto;
        min-height: 200px;
    }
}

.timeline-project-image-stack .timeline-project-image {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: auto;
    object-fit: contain;
    background: transparent;
    transition: transform 0.3s ease;
}

.timeline-project-image-stack .stack-back {
    transform: translate(-55%, -50%) rotate(-3deg) scale(0.9);
    z-index: 1;
}

.timeline-project-image-stack .stack-front {
    transform: translate(-45%, -50%) rotate(3deg) scale(0.9);
    z-index: 2;
}

.timeline-project-stacked:hover .stack-back {
    transform: translate(-62%, -50%) rotate(-6deg) scale(0.95);
}

.timeline-project-stacked:hover .stack-front {
    transform: translate(-38%, -50%) rotate(6deg) scale(0.95);
}

@media (min-width: 600px) {
    .timeline-project-image {
        width: 40%;
        height: auto;
        object-fit: contain;
        object-position: center;
    }
}

.timeline-project-content {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.timeline-project-type {
    display: inline-block;
    width: fit-content;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    padding: 0.25rem 0.625rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.timeline-project-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.375rem;
}

.timeline-project-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer links - minimal, inline with content */
.timeline-footer {
    display: flex;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.timeline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.timeline-link:hover {
    color: var(--text-primary);
}

.timeline-link svg {
    width: 12px;
    height: 12px;
}

/* Impact statement - the hook */
.timeline-impact {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Story text - supporting context */
.timeline-story {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

/* Legacy support - hide old elements */
.timeline-entry-header,
.timeline-tags,
.timeline-links {
    display: none;
}

/* What I'm Looking For Section */
.looking-for {
    padding: 5rem 0;
    background: var(--bg-primary);
    transition: background-color 0.3s ease;
}

.looking-for-inner {
    width: calc(100% - 30px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.looking-for-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.looking-for-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.looking-for-header-line {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.looking-for-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.looking-for-lead {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .looking-for-lead {
        font-size: 1.75rem;
    }
}

.looking-for-text {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.looking-for-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: 6px;
    transition: all 0.2s ease;
    width: fit-content;
    margin-top: 0.5rem;
}

.looking-for-cta:hover {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: var(--accent);
}

/* Footer */
.footer {
    background: var(--bg-tertiary);
    padding: 4rem 0 3rem;
    transition: background-color 0.3s ease;
}

.footer-inner {
    width: calc(100% - 30px);
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-header {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-label {
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.footer-header-line {
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 600px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.footer-primary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-email {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.15s;
}

.footer-email:hover {
    color: var(--accent);
}

.footer-meta {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Project Overlay - Refined Modal Experience */
.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        background-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Navigating state - content crossfade */
.project-overlay.navigating .project-overlay-scroll {
    opacity: 0;
    transform: translateY(8px);
}

.project-overlay-scroll {
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

/* Sticky header with navigation */
.project-overlay-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    gap: 1rem;
}

.project-overlay-header.scrolled {
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

/* Left side: prev nav + title */
.project-overlay-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

/* Navigation buttons */
.project-overlay-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.project-overlay-nav:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.project-overlay-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.project-overlay-nav svg {
    width: 16px;
    height: 16px;
}

.project-overlay-header-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right side: nav + counter + close */
.project-overlay-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Grouped nav arrows */
.project-overlay-nav-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.project-overlay-nav-group .project-overlay-nav:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.project-overlay-nav-group .project-overlay-nav:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.project-overlay-counter {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.project-overlay-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.project-overlay-close:hover {
    background: var(--bg-secondary);
    border-color: var(--text-tertiary);
    color: var(--text-primary);
}

.project-overlay-close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.project-overlay-close svg {
    width: 16px;
    height: 16px;
}

.project-overlay-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Hero section - matches content width */
.project-overlay-hero-container {
    position: relative;
    max-width: 720px;
    margin: 1.5rem auto 0;
    padding: 0 2rem;
}

.project-overlay-hero-inner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 45%; /* Shorter aspect ratio */
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.project-overlay-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.project-overlay-hero:hover {
    transform: scale(1.02);
}

/* Stacked hero in overlay */
.project-overlay-hero-container.stacked .project-overlay-hero-inner {
    background: transparent;
    border: none;
    overflow: visible;
    padding-bottom: 55%;
}

.project-overlay-hero-container.stacked .project-overlay-hero {
    position: absolute;
    width: 65%;
    height: auto;
    top: 50%;
    left: 50%;
    object-fit: contain;
    background: transparent;
    cursor: default;
}

.project-overlay-hero-container.stacked .stack-back {
    transform: translate(-55%, -50%) rotate(-3deg) scale(0.9);
    z-index: 1;
}

.project-overlay-hero-container.stacked .stack-front {
    transform: translate(-45%, -50%) rotate(3deg) scale(0.9);
    z-index: 2;
}

.project-overlay-hero-container.stacked:hover .stack-back {
    transform: translate(-60%, -50%) rotate(-6deg) scale(0.95);
}

.project-overlay-hero-container.stacked:hover .stack-front {
    transform: translate(-40%, -50%) rotate(6deg) scale(0.95);
}

.project-overlay-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 2rem 6rem;
}

.project-overlay-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.project-overlay-title {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.project-overlay-year {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
}

/* TLDR Section - Distinct card */
.project-overlay-tldr {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 3rem;
}

.project-overlay-tldr-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.project-overlay-tldr-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-overlay-tldr-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.project-overlay-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-overlay-skill {
    display: inline-flex;
    align-items: center;
    padding: 0.3125rem 0.625rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.project-overlay-brief {
    margin-bottom: 1.25rem;
}

.project-overlay-brief:last-child {
    margin-bottom: 0;
}

.project-overlay-brief-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.project-overlay-brief-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Full Story Divider */
.project-overlay-story-divider {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 2rem 0 1.5rem;
    margin-bottom: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.project-overlay-story-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.project-overlay-story-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Sections */
.project-overlay-sections {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.project-overlay-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-overlay-section-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.project-overlay-section-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
}

.project-overlay-section-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-overlay-section-list li {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.project-overlay-section-list li::before {
    content: "·";
    color: var(--text-tertiary);
    font-weight: bold;
    flex-shrink: 0;
}

/* Team section */
.project-overlay-team-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-top: 0.5rem;
}

.project-overlay-team-member {
    display: flex;
    gap: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.project-overlay-team-role {
    color: var(--text-primary);
    font-weight: 500;
}

.project-overlay-team-desc {
    color: var(--text-secondary);
}

.project-overlay-team-desc::before {
    content: "·";
    margin-right: 0.375rem;
    color: var(--text-tertiary);
}

/* Section items */
.project-overlay-section-items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1rem;
}

.project-overlay-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-overlay-item-subtitle {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-overlay-item-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Callout sections */
.project-overlay-callout {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-left: 3px solid var(--text-tertiary);
    border-radius: 0 8px 8px 0;
}

.project-overlay-callout-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.project-overlay-callout-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
}

.project-overlay-callout-context {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1rem 0;
    font-style: italic;
}

.project-overlay-callout-content {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
    margin: 0 0 1.25rem 0;
}

.project-overlay-callout-items {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.project-overlay-callout-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.project-overlay-callout-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-overlay-callout-item-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.7;
}

.project-overlay-callout-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-overlay-callout-list li {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.project-overlay-callout-list li::before {
    content: "·";
    color: var(--text-tertiary);
    font-weight: bold;
    flex-shrink: 0;
}

.project-overlay-callout-figure {
    margin: 1rem 0 0 0;
    overflow: hidden;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.project-overlay-callout-figure img {
    width: 100%;
    height: auto;
    display: block;
}

.project-overlay-callout-figure figcaption {
    padding: 0.625rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* Image grid for consecutive images */
.project-overlay-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .project-overlay-image-grid {
        grid-template-columns: 1fr;
    }
}

/* Figures */
.project-overlay-figure {
    margin: 0.75rem 0;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.project-overlay-figure:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.project-overlay-figure img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.project-overlay-figure:hover img {
    transform: scale(1.01);
}

.project-overlay-figure video {
    width: 100%;
    height: auto;
    display: block;
}

.project-overlay-caption {
    padding: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    font-style: italic;
}

/* Links section */
.project-overlay-links {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.project-overlay-links-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1rem;
}

.project-overlay-links-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-overlay-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.15s;
}

.project-overlay-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.project-overlay-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Lightbox */
.project-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s,
        visibility 0.3s;
}

.project-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.project-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.project-lightbox-close:hover {
    opacity: 1;
}

.project-lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.project-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    opacity: 0.7;
    transition: all 0.2s;
}

.project-lightbox-nav:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.project-lightbox-prev {
    left: 1rem;
}

.project-lightbox-next {
    right: 1rem;
}

.project-lightbox-caption {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
    max-width: 600px;
}

.project-lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .project-overlay-header {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
    }

    .project-overlay-header-left {
        gap: 0.5rem;
    }

    .project-overlay-header-title {
        font-size: 0.6875rem;
    }

    .project-overlay-nav,
    .project-overlay-close {
        width: 28px;
        height: 28px;
    }

    .project-overlay-nav svg,
    .project-overlay-close svg {
        width: 14px;
        height: 14px;
    }

    .project-overlay-counter {
        font-size: 0.625rem;
    }

    .project-overlay-hero-container {
        margin-top: 1rem;
        padding: 0 1.25rem;
    }

    .project-overlay-hero-inner {
        border-radius: 6px;
        padding-bottom: 50%; /* Slightly taller on mobile */
    }

    .project-overlay-content {
        padding: 1.5rem 1.25rem 4rem;
    }

    .project-overlay-title {
        font-size: 1.5rem;
    }

    .project-overlay-tldr {
        padding: 1.25rem;
    }

    .project-lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .project-lightbox-prev {
        left: 0.5rem;
    }

    .project-lightbox-next {
        right: 0.5rem;
    }
}

/* Animation embed for Farmer Tool */
.project-overlay-animation-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-overlay-animation-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 420 / 820;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #111111 50%, #0a0a0a 100%);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.project-overlay-animation-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.project-overlay-animation-iframe::-webkit-scrollbar {
    display: none;
}

.project-overlay-animation-fallback {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    border-radius: 39px;
}

.project-overlay-animation-caption {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
}

/* Image row for MVP (2 across) */
.project-overlay-image-row-half {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.project-overlay-figure-half {
    margin: 0;
}

.project-overlay-figure-half img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: cover;
}

/* Image row for design system (3 across) */
.project-overlay-image-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.project-overlay-figure-third {
    margin: 0;
}

.project-overlay-figure-third img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: cover;
}

@media (max-width: 600px) {
    .project-overlay-animation-wrapper {
        max-width: 100%;
        border-radius: 8px;
    }

    .project-overlay-image-row-half {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .project-overlay-image-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}
