/* EDITORIAL STYLES - INSPIRED BY STUDIO SPADING */

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

/* Custom cursor - dark gray square - applied everywhere */
* {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><rect width="12" height="12" fill="%23444444"/></svg>') 6 6, auto;
}

body {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #F4f3f2;
    color: #444444;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 24px;
    transition: background-color 0.5s ease;
}

/* Text hover effects - color inversion */
p, h1, h2, h3, h4, h5, h6, li, span, .tagline, .accordion-header {
    transition: color 0.2s ease;
    position: relative;
}

/* Dark gray text (#444444) changes to slightly lighter gray on hover */
p:hover, h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, h6:hover, li:hover, span:hover, .tagline:hover, .accordion-header:hover {
    color: #666666;
}

/* Exclude links from paragraph hover - links have their own hover styles */
p:hover a, h1:hover a, h2:hover a, h3:hover a, h4:hover a, h5:hover a, h6:hover a {
    color: inherit;
}

/* Off-white text class - changes to gray on hover */
.text-offwhite, .text-offwhite p, .text-offwhite h1, .text-offwhite h2 {
    color: #F4F4F4;
}

.text-offwhite:hover, .text-offwhite p:hover, .text-offwhite h1:hover, .text-offwhite h2:hover {
    color: #333333;
}

/* Info page specific background */
body.info-page {
    background-color: #dddddd;
}

header {
    padding: 2rem 2rem 1.5rem 0;
    background-color: transparent;
    width: 100%;
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

nav {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Navigation links with underline on hover */
nav a {
    color: #444444;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 24px;
    text-transform: none;
    letter-spacing: 0;
    padding: 0;
    position: relative;
    transition: color 0.2s ease, opacity 0.2s ease;
}

/* Projects page menu list - similar to saunalore.com style */
.projects-menu-list {
    padding: 0;
    margin: 0;
    position: fixed;
    top: 30vh;
    right: 2rem;
    text-align: right;
    z-index: 100;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2.5rem;
    /* Let clicks pass through to gallery tiles; only real links stay clickable */
    pointer-events: none;
}

.projects-menu-list a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    color: #444444;
    text-decoration: none !important;
    transition: color 0.2s ease;
    position: relative;
    display: inline-block;
    text-align: right;
    padding: 0;
    line-height: 1.5;
    height: 1.5em;
    pointer-events: auto;
}

/* Category headers only (software, sculptures, films, design, entrepreneurship) */
.projects-menu-item > a,
.projects-menu-list > a {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.projects-menu-list a:hover {
    color: #666666;
}

.projects-menu-list a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    right: 0;
    background-color: #444444;
    transition: width 0.3s ease;
    display: none;
}

.projects-menu-list a:hover::after {
    width: 100%;
    display: block;
}

/* Projects menu item with submenu */
.projects-menu-item {
    position: relative;
    min-height: 1.5em;
}

.projects-menu-item > a {
    height: 1.5em;
}

.projects-submenu {
    max-height: 0;
    overflow: hidden;
    text-align: right;
    /* delay on close so cursor has time to reach submenu items */
    transition: max-height 0.3s ease 0.3s, opacity 0.2s ease 0.3s, margin-top 0.2s ease 0.3s;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
}

.projects-menu-item:hover .projects-submenu,
.projects-menu-item.submenu-open .projects-submenu {
    max-height: 500px;
    opacity: 1;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    /* no delay on open */
    transition-delay: 0s;
}

.projects-submenu a {
    display: inline-block;
    font-size: 16px;
    color: #666666;
    white-space: nowrap;
    height: 1.5em;
    position: relative;
    text-transform: none;
    letter-spacing: 0;
}

.projects-submenu a:hover {
    color: #444444;
}

.projects-submenu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    right: 0;
    background-color: #444444;
    transition: width 0.3s ease;
    display: none;
}

.projects-submenu a:hover::after {
    width: 100%;
    display: block;
}

/* Underline animation on hover */
nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #444444;
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    opacity: 1;
}

nav a.active {
    opacity: 1;
}

nav a.active::after {
    width: 100%;
}

main {
    flex: 1;
    padding: 3rem 2rem 5rem 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    overflow: visible;
}

/* Hero section - minimal, clean */
.hero {
    margin-bottom: 5rem;
    padding: 0;
}

.hero h1 {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2.5rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    color: #444444;
}

.tagline {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #444444;
    line-height: 1.7;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    overflow: visible;
}

/* Projects page intro text */
.projects-intro {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
    max-width: 480px;
    margin-bottom: 0;
}

/* Projects gallery layout (projects page) */
.projects-gallery {
    margin-top: 4rem;
    column-count: 3;
    column-gap: 1.25rem;
}

.projects-gallery-item {
    text-decoration: none;
    color: inherit;
    display: block;
    -webkit-tap-highlight-color: transparent;
    break-inside: avoid;
    margin-bottom: 1.25rem;
}

.projects-gallery-thumb {
    width: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #dddddd, #f4f3f2);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 0.2rem;
    position: relative;
    overflow: hidden;
}

.projects-gallery-thumb img,
.projects-gallery-thumb video {
    width: 100%;
    height: auto;
    display: block;
}

/* Ono-Mato-Dada tile */
#project-ono-mato-dada .projects-gallery-thumb { background-color: #000000; }

/* Sauna Lore tile */
#project-sauna-lore .projects-gallery-thumb { background-color: #000000; }

/* Iran War Media Framing tile */
#project-iran-war-framing .projects-gallery-thumb { background-color: #f0ede8; }

/* Word Soup tile */
#project-word-soup .projects-gallery-thumb { background-color: #111111; }

/* Woodworking tile */
#project-woodworking .projects-gallery-thumb { background-color: #e8e0d8; }

/* Susurrus tile */
#project-susurrus .projects-gallery-thumb {
    background-color: #111111;
    aspect-ratio: 16 / 9;
}

#project-susurrus .projects-gallery-thumb video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hansel und Gretel tile */
#project-hansel-and-gretel .projects-gallery-thumb { background-color: #111111; }

/* Relative Compass tile */
#project-relative-compass .projects-gallery-thumb { background-color: #111111; }

/* Entrepreneurship tile */
#project-entrepreneurship .projects-gallery-thumb { background-color: #f5f5f5; }

/* PINCH Ceramics tile */
#project-pinch .projects-gallery-thumb { background-color: #f5f0ee; }

/* Platform: The Last Big Thing tile */
#project-platform .projects-gallery-thumb { background-color: #1a0a2e; }

/* The Obs tile */
#project-the-obs .projects-gallery-thumb { background-color: #1a1f1a; }

/* JSConf Asia tile */
#project-jsconf-asia .projects-gallery-thumb { background-color: #1a1a2e; }

/* Culture of Bathe-ing tile */
#project-culture-of-batheing .projects-gallery-thumb { background-color: #1a3aff; }

.projects-gallery-title {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.projects-gallery-item:hover .projects-gallery-title {
    color: #666666;
}

.projects-gallery-item.is-highlighted .projects-gallery-thumb {
    background: #e6e6e6;
    border-color: rgba(0, 0, 0, 0.15);
}

/* Native hash targeting should also highlight the tile (cross-browser) */
.projects-gallery-item:target .projects-gallery-thumb {
    background: #e6e6e6;
    border-color: rgba(0, 0, 0, 0.15);
}

.projects-gallery-item:target {
    outline: none;
}

/* Dedicated overlay so the highlight is visually obvious */
.projects-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(230, 230, 230, 0.88);
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
    z-index: 2;
}

.projects-gallery-item.is-highlighted .projects-gallery-overlay {
    opacity: 1;
}

.projects-gallery-item:target .projects-gallery-overlay {
    opacity: 1;
}


/* No gap between accordion sections */
.content:has(.accordion-section) {
    gap: 0;
}

.block {
    padding: 0;
}

.block h2 {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    color: #444444;
}

/* Accordion sections for info page */
.accordion-section {
    margin-bottom: 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    background-color: #dddddd;
    border-top: 1px solid rgba(100, 100, 100, 1);
    border-bottom: none;
    border-left: none;
    border-right: none;
    transition: background-color 0.5s ease;
    box-sizing: border-box;
    position: relative;
}

.accordion-section:hover {
    background-color: #F4f3f2;
}

.accordion-header,
h2.accordion-header,
.accordion-section h2.accordion-header,
.accordion-section .accordion-header {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: max(24px, min(4vw, 24px)) !important;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    padding: 1.5rem 0;
    margin-bottom: 0;
    color: #444444;
    pointer-events: none;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.accordion-section.active .accordion-content {
    max-height: 5000px;
    padding: 0 0 1.5rem 0;
}

.accordion-content p {
    margin-bottom: 1rem;
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 24px;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #444444;
}

/* Info page body text responsive font size */
.info-page .accordion-content p {
    font-size: max(24px, min(4vw, 24px));
    line-height: 1.2;
}

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

.accordion-content a {
    color: #444444;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 24px;
    line-height: 1.3;
}

/* Info page accordion links - same size as accordion paragraphs */
.info-page .accordion-content a {
    font-size: max(24px, min(4vw, 24px));
    line-height: 1.2 !important;
}

.accordion-content a:visited {
    color: #444444;
}

.accordion-content a:hover {
    color: #666666 !important;
    opacity: 1;
}

.block p {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #444444;
    margin-bottom: 1.5rem;
}

/* Links in content with underline */
.block a,
.content a {
    color: #444444;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.block a:visited,
.content a:visited {
    color: #444444;
}

.block a:hover,
.content a:hover,
p a:hover {
    color: #666666 !important;
    opacity: 1;
}

/* List styles for work/projects */
.block ul {
    list-style: none;
    padding: 0;
}

.block li {
    margin-bottom: 1rem;
    font-size: 17px;
    line-height: 1.7;
}

.block li::before {
    content: '●';
    margin-right: 0.5rem;
    color: #444444;
}

footer {
    padding: 3rem 0 2rem 0;
    text-align: left;
    background-color: transparent;
    margin-top: auto;
    border-top: 1px solid rgba(68, 68, 68, 0.1);
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

footer p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #444444;
}

footer a {
    color: #444444;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

footer a:visited {
    color: #444444;
}

footer a:hover {
    color: #666666 !important;
    opacity: 1;
}

/* PROJECT INFO CONTAINER */
.project-info-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    margin-top: 3rem;
}

.project-info-title {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1rem;
    color: #444444;
    text-transform: none;
    letter-spacing: 0;
    display: inline-block;
    position: relative;
}

.project-info-description {
    font-family: 'BDO Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #444444;
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* NAV ITEM WITH MENU */
.nav-item-with-menu {
    position: relative;
    display: inline-block;
}

.nav-item-with-menu .menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 1rem;
    text-align: right;
    min-width: 150px;
    opacity: 1;
    visibility: visible;
    z-index: 1000;
}

.nav-item-with-menu .menu-list li {
    margin-bottom: 0.5rem;
}

.nav-item-with-menu .menu-list a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 20px;
    color: #444444;
    text-decoration: none;
    transition: color 0.2s ease;
    position: relative;
    display: inline-block;
}

.nav-item-with-menu .menu-list a:hover {
    color: #666666;
}

.nav-item-with-menu .menu-list a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #444444;
    transition: width 0.3s ease;
}

.nav-item-with-menu .menu-list a:hover::after {
    width: 100%;
}

/* RESPONSIVE */

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    /* Keep outbound links consistent with surrounding body copy on mobile */
    main a[target="_blank"] {
        font-family: inherit !important;
        font-size: inherit !important;
        line-height: inherit !important;
    }

    header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }
    
    .right-menu-overlay {
        padding-top: 1.5rem;
        padding-right: 1.5rem;
    }

    nav {
        gap: 2rem;
    }

    nav a {
        font-size: 20px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 16px;
    }

    main {
        padding: 2rem 1.5rem 4rem 1.5rem;
    }

    .content {
        gap: 3rem;
    }

    .content:has(.accordion-section) {
        gap: 0;
    }

    .accordion-header,
    h2.accordion-header,
    .accordion-section h2.accordion-header,
    .accordion-section .accordion-header {
        padding: 1.25rem 1.5rem;
        font-size: max(24px, min(4vw, 24px)) !important;
        margin-left: 0;
        margin-right: 0;
        max-width: none;
    }

    .accordion-content {
        padding: 0 1.5rem;
        margin-left: 0;
        margin-right: 0;
        max-width: none;
    }

    .accordion-section.active .accordion-content {
        max-height: 5000px;
        padding: 0 1.5rem 1.25rem 1.5rem;
    }

    .block h2 {
        font-size: 1.1rem;
    }

    .block p {
        font-size: 16px;
    }
    
    .right-menu-overlay {
        padding-right: 1.5rem;
    }

    /* Mobile: make the right-side projects menu scale down and stop overlapping */
    .projects-menu-list {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        width: 100%;
        margin-top: 1.5rem;
        text-align: left;
        align-items: flex-start;
        gap: 1.25rem !important;
    }

    .projects-menu-list a {
        font-size: 16px !important;
    }

    .projects-submenu {
        text-align: left;
        align-items: flex-start;
    }

    .projects-submenu a {
        font-size: 14px;
    }

    .projects-menu-item:hover .projects-submenu,
    .projects-menu-item.submenu-open .projects-submenu {
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .menu-list a {
        font-size: 20px;
    }
    
    .project-info-container {
        padding: 0 1.5rem;
        margin-top: 2rem;
    }
    
    .project-info-title {
        font-size: 1.2rem;
    }
    
    .project-info-description {
        font-size: 16px;
    }

    /* Mobile: project pages use an inline 2-col grid; collapse to 1 column */
    .project-info-container > div {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        align-items: start !important;
    }

    .projects-gallery {
        column-count: 1;
    }
}
