@import url('https://fonts.googleapis.com/css2?family=Xanh+Mono&display=swap');

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

body {
    background-color: #e1e8da; 
    color: #1a1a1a;
    font-family: 'Xanh Mono', monospace; /* Brutalist Font */
    line-height: 1.5;
    font-size: 20px;
}

a { color: inherit; text-decoration: underline; }
a:hover { text-decoration: none; }
img { max-width: 100%; display: block; }

/* LAYOUT CONTAINER */
.container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR STYLES */
.sidebar {
    width: 350px;
    padding: 40px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.section { margin-bottom: 5px; }

/* COLLAPSIBLE LOGIC */
.section-title {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    cursor: pointer;
    user-select: none;
}

/* Default Arrow (Closed) */
.section-title::before {
    content: '▶ ';
    font-size: 0.8em;
    display: inline-block;
    width: 20px;
}

/* Active Arrow (Open) */
.section.active .section-title::before {
    content: '▼ ';
}

/* Default Content (Hidden) */
.section-content {
    display: none;
    padding-left: 20px; /* Indent content */
    margin-bottom: 20px;
}

/* Active Content (Visible) */
.section.active .section-content {
    display: block;
}

.work-nav-item {
    font-size: 0.75em;
    line-height: 1.6;
}

.nav-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.nav-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 6px;
}

.nav-list li::before {
    content: '-';
    position: absolute;
    left: 0;
}

/* MAIN CONTENT STYLES */
.main-content {
    flex-grow: 1;
    padding: 40px 60px;
    margin: 0 auto;
    width: 100%;
}

/* HOMEPAGE HERO NAME WALL */
.name-wall {
    height: 80vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    padding: 0;
    margin-bottom: 20px;
}

.name-wall__text {
    font-size: 5vh;
    line-height: 0.9;
    text-align: left;
    word-break: break-all;
    width: 100%;
    font-style: italic;
    color: #444;
}

.scroll-hint {
    text-align: center;
    width: 100%;
    font-size: 0.75em;
    color: #111;
    opacity: 0.6;
    margin-bottom: 40px;
}

/* HOMEPAGE PROJECT LIST */
.project-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 80px;
}

.project-item { margin-bottom: 0; }
.project-item a { text-decoration: none; }
.project-thumb { margin-bottom: 15px; border: none; box-shadow: none; }
.project-meta { 
    display: flex; 
    justify-content: space-between; 
    font-weight: bold; 
    margin-bottom: 5px; 
    font-size: 1.1em;
}
.project-excerpt { color: #555; }

/* SIDEBAR FOOTER */
.sidebar-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #888;
    font-size: 0.85em;
    color: #888;
}

.sidebar-footer p {
    margin-bottom: 5px;
}
.about-content h1 { margin-bottom: 40px; font-size: 2em; border-bottom: 1px solid #000; padding-bottom: 20px; }
.about-section { display: flex; gap: 40px; align-items: flex-start; }
.about-photo { width: 250px; height: 250px; object-fit: cover; border: none; box-shadow: none; flex-shrink: 0; }
.about-text { flex-grow: 1; }
.about-text p { margin-bottom: 15px; line-height: 1.7; }
.about-text h2 { margin-top: 30px; margin-bottom: 10px; font-size: 1.2em; text-transform: uppercase; letter-spacing: 1px; }

/* SINGLE WORK PAGE */
.work-header { margin-bottom: 30px; border-bottom: 1px solid #000; padding-bottom: 20px; }
.work-header-content { display: flex; align-items: center; gap: 30px; }
.work-emoji { font-size: 5em; line-height: 1; flex-shrink: 0; }
.work-header-text { flex-grow: 1; }
.work-header-text h1 { margin-bottom: 10px; }
.work-stats { margin-top: 10px; color: #555; }
.work-stats span { margin-right: 20px; }
.work-hero-figure { margin: 0 0 5px 0; }
.work-hero-image { margin-bottom: 20px; border: none; }
.image-subtitle {
    margin: 6px 0 0 0;
    padding: 0;
    color: #666;
    font-size: 0.85em;
    line-height: 1.2;
}
.work-body h2 { margin-top: 30px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px;}
.work-body { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
}
.work-body figure {
    grid-column: 1 / -1;
    margin: 0 0 20px 0;
}
.work-body img { 
    width: 100%; 
    height: auto; 
    border: none; 
    box-shadow: none;
}
.work-body h2,
.work-body p,
.work-body h3,
.work-body ul,
.work-body ol { 
    grid-column: 1 / -1; 
}

.toc-hamburger {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 1px solid #1a1a1a;
    background: #f2f5ee;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    z-index: 1000;
}

.toc-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1a1a1a;
}

.toc-panel {
    position: fixed;
    top: 72px;
    right: 18px;
    width: min(360px, calc(100vw - 36px));
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    background: #f7faf2;
    border: 1px solid #1a1a1a;
    padding: 14px;
    display: none;
    z-index: 999;
}

.toc-panel.active {
    display: block;
}

.toc-panel-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.toc-panel-list ul {
    list-style: none;
    margin: 0;
    padding-left: 12px;
}

.toc-panel-list > ul {
    padding-left: 0;
}

.toc-panel-list li {
    margin-bottom: 6px;
}

.toc-panel-list a {
    text-decoration: none;
    border-bottom: 1px dotted transparent;
}

.toc-panel-list a:hover {
    border-bottom-color: #1a1a1a;
}

/* BLOG PAGE */
.blog-header { margin-bottom: 30px; border-bottom: 1px solid #000; padding-bottom: 20px; }
.blog-header-content { display: flex; align-items: center; gap: 30px; }
.blog-emoji { font-size: 5em; line-height: 1; flex-shrink: 0; }
.blog-header-text { flex-grow: 1; }
.blog-header-text h1 { margin-bottom: 10px; }
.blog-meta { margin-top: 10px; color: #555; }
.blog-meta span { margin-right: 20px; }
.blog-hero-image { margin-bottom: 40px; border: none; }
.blog-body h2 { margin-top: 30px; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px;}

.blog-nav-item {
    font-size: 0.85em;
    line-height: 1.6;
}

.back-link {
    display: none;
}

@media (min-width: 888px) {
    .project-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 80px 40px;
    }
}

/* MOBILE RESPONSIVE */
@media (max-width: 888px) {
    .container { flex-direction: column; }
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
        padding: 20px; 
        border-bottom: 1px solid #ccc;
        display: flex;
        flex-direction: column;
    }
    .section {
        margin-bottom: 0;
    }
    .section-title {
        padding: 0;
        margin-bottom: 0;
    }
    .back-link {
        display: block;
        padding-top: 2px !important;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content { 
        padding: 20px;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    .name-wall {
        height: 30vh;
        width: 100%;
        padding: 0;
        margin: 0 0 40px 0;
        align-items: flex-start;
        justify-content: center;
    }
    .name-wall__text {
        font-size: 3.5vh;
    }
    .scroll-hint {
        display: none;
    }
    /* Shrink work/blog header on mobile */
    .work-header { margin-bottom: 20px; padding-bottom: 12px; }
    .work-header-content { gap: 16px; }
    .work-emoji { font-size: 3em; }
    .work-header-text h1 { font-size: 1.4em; margin-bottom: 6px; }
    .work-stats { font-size: 0.85em; margin-top: 6px; }
    .work-hero-figure { margin-bottom: 24px; }
    .work-hero-image { margin-bottom: 0; }

    .toc-hamburger {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }

    .toc-panel {
        top: 58px;
        right: 12px;
        width: calc(100vw - 24px);
        max-height: 60vh;
    }

    .blog-header { margin-bottom: 20px; padding-bottom: 12px; }
    .blog-header-content { gap: 16px; }
    .blog-emoji { font-size: 3em; }
    .blog-header-text h1 { font-size: 1.4em; margin-bottom: 6px; }
    .blog-meta { font-size: 0.9em; margin-top: 6px; }
    .blog-hero-image { margin-bottom: 24px; }
    .page-footer {
        display: block !important;
        margin-top: auto;
        padding-top: 40px;
        border-top: 1px solid #000;
        margin-bottom: 0;
        font-size: 0.85em;
        color: #666;
        text-align: center;
    }
    .page-footer p {
        margin-bottom: 5px;
    }
}
