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

html {
    font-size: 14.5px;
}

body {
    font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    background-color: #fff;
    padding: 0;
    margin: 0;
}

/* Header Styles */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    padding: 2rem 3rem;
    border-bottom: 1px solid #e0e0e0;
    gap: 2rem;
    position: relative;
    z-index: 100;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.profile-info div:last-child {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.header-center {
    text-align: center;
}

.code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.index-link {
    text-decoration: none;
    color: #000;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.index-link:hover {
    opacity: 0.6;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
}

.nav-item {
    display: block;
    text-decoration: none;
    color: #000;
    font-size: 0.9rem;
    transition: opacity 0.2s;
    cursor: pointer;
    position: relative;
    padding: 0.25rem 0 0.25rem 1.2rem;
    z-index: 100;
}

.nav-item::before {
    content: '①';
    position: absolute;
    left: 0;
    font-size: 0.85rem;
    display: inline-block;
    pointer-events: none;
    z-index: 1;
}

.nav-item:nth-child(2)::before {
    content: '②';
}

.nav-item:nth-child(3)::before {
    content: '③';
}

.nav-item:nth-child(4)::before {
    content: '❹';
}

.nav-item:nth-child(5)::before {
    content: '❺';
}

.nav-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e0e0e0;
    pointer-events: none;
    z-index: -1;
}

.nav-item:hover {
    opacity: 0.6;
}

/* Main Title Section */
.main-title-section {
    text-align: center;
    padding: 4rem 2rem 2rem;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.checkbox-icon {
    font-size: 3.5rem;
    line-height: 1;
}

.main-subtitle {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Content Wrapper */
.content-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 3rem;
    padding: 2rem 3rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Main Content */
.main-content {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.content-paragraph {
    font-size: 1rem;
    line-height: 1.5;
    text-align: justify;
}

/* Image Placeholder */
.image-placeholder {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    position: relative;
    overflow: hidden;
}

.image-placeholder.large {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1rem 0;
}

.image-placeholder.small {
    width: 100%;
    aspect-ratio: 1;
    margin-top: 1rem;
}

.placeholder-grid {
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 19px, #ccc 19px, #ccc 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, #ccc 19px, #ccc 20px);
    background-size: 20px 20px;
    opacity: 0.3;
}

.placeholder-label {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    color: #666;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
}

.image-caption {
    margin-top: -1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.image-caption p {
    margin-bottom: 0.3rem;
}

/* Sidebars */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: fixed;
    top: 15rem;
    width: 250px;
    max-height: calc(100vh - 17rem);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-left {
    grid-column: 1;
    left: 3rem;
}

.sidebar-right {
    grid-column: 3;
    right: 3rem;
}

/* Center sidebars when content is centered */
@media (min-width: 1400px) {
    .sidebar-left {
        left: calc((100vw - 1400px) / 2 + 3rem);
    }
    
    .sidebar-right {
        right: calc((100vw - 1400px) / 2 + 3rem);
    }
}

.sidebar-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-list li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.7;
}

.sidebar-list li::before {
    content: '●';
    position: absolute;
    left: 0;
    font-size: 0.5rem;
    top: 0.5em;
}

/* Footer */
.footer {
    padding: 3rem 3rem 4rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 3rem;
}

.footer-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: decimal;
    list-style-position: inside;
    font-size: 0.9rem;
    line-height: 1.7;
}

.footer-list li {
    padding-left: 0.5rem;
}

/* Project Page Styles */
.project-title-section {
    text-align: center;
    padding: 3rem 2rem 2rem;
}

.project-title {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
    font-family: 'Courier New', monospace; /* Match homepage style */
    margin: 0 auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

.project-main-text {
    max-width: 800px;
    margin: 0 auto 4rem;
    font-size: 1.05rem;
    color: #333;
}

.project-main-text p {
    margin-bottom: 1.8rem;
    line-height: 1.8;
    text-align: justify;
}

.project-main-text h1, 
.project-main-text h2, 
.project-main-text h3, 
.project-main-text h4 {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #000;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.project-main-text h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.project-main-text h3 {
    font-size: 1.3rem;
}

.project-main-text ul, 
.project-main-text ol {
    margin-bottom: 1.8rem;
    padding-left: 2rem;
}

.project-main-text li {
    margin-bottom: 0.8rem;
    line-height: 1.8;
}

.project-main-text blockquote {
    border-left: 4px solid #000;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-family: 'Courier New', monospace;
    font-style: italic;
    color: #555;
    background: #f9f9f9;
    padding: 1.5rem;
}

.project-main-text code {
    font-family: 'Courier New', monospace;
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.project-main-text pre {
    background: #f4f4f4;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.project-main-text pre code {
    background: none;
    padding: 0;
    color: #333;
}

.underlined {
    text-decoration: underline;
}

.project-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.project-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.content-paragraph.numbered {
    /* Numbered paragraphs - numbers are in HTML content */
}

.image-placeholder.square {
    width: 100%;
    aspect-ratio: 1;
}

.image-placeholder.tall {
    width: 100%;
    aspect-ratio: 2 / 3;
}

/* Project Page Responsive */
@media (max-width: 768px) {
    .project-two-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-title {
        font-size: 2.5rem;
    }
    
    .project-content-wrapper {
        padding: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .content-wrapper {
        grid-template-columns: 200px 1fr 200px;
        gap: 2rem;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .sidebar-left {
        left: 2rem;
    }
    
    .sidebar-right {
        right: 2rem;
    }
}

@media (max-width: 768px) {
    .header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .header-center {
        text-align: left;
    }
    
    .header-right {
        justify-content: flex-start;
    }
    
    .main-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .checkbox-icon {
        font-size: 2rem;
    }
    
    .main-subtitle {
        font-size: 2rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 2rem;
    }
    
    .main-content {
        grid-column: 1;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    .sidebar-left,
    .sidebar-right {
        position: relative !important;
        top: 0 !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 2rem;
    }
    
    .footer {
        padding: 2rem 1.5rem;
    }
}

/* ========================================= */
/* NEW HOMEPAGE STYLES (Split Layout)        */
/* ========================================= */

.split-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Left Column */
.work-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevent flex overflow */
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    height: 4rem;
}

.header-title {
    font-family: 'Courier New', monospace;
    font-weight: 400;
    letter-spacing: 0.1em;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.header-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

.project-list {
    display: flex;
    flex-direction: column;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    border-bottom: 1px solid #e0e0e0;
    min-height: 300px;
}

.project-image {
    background-color: #f5f5f5;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
}

.project-image .placeholder-grid {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 2rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
    max-width: 90%;
}

.project-icon {
    font-size: 1.5rem;
    color: #999;
}

.project-meta {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.read-more {
    margin-top: auto; /* Push to bottom if container has height */
    text-decoration: none;
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Right Column */
.info-column {
    width: 420px;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    flex-shrink: 0;
}

.header-time {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.info-content {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-block {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-link a {
    text-decoration: none;
    color: #000;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.info-link a:hover {
    opacity: 0.6;
}

.info-footer {
    padding: 1.5rem 2rem;
    border-top: none; /* Screenshot doesn't show border? */
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #999;
    margin-top: auto;
}

/* Responsive split layout */
@media (max-width: 1024px) {
    .split-layout {
        flex-direction: column;
    }
    
    .work-column {
        width: 100%;
    }
    
    .info-column {
        width: 100%;
        height: auto;
        position: relative;
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
    
    .project-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-info {
        padding-right: 0;
    }
}

/* Search Styles */
.search-container {
    position: relative;
    width: 200px;
}

.search-input {
    width: 100%;
    padding: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid #e0e0e0;
    outline: none;
    background: transparent;
}

.search-input:focus {
    border-color: #000;
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0; /* Align right for header placement */
    width: 300px;
    background: white;
    border: 1px solid #000;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-item-title {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    font-family: 'Courier New', monospace;
}

.search-item-snippet {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    font-family: 'Helvetica', 'Helvetica Neue', Arial, sans-serif;
}

mark {
    background-color: #ffeb3b;
    padding: 0 2px;
}

/* Tags Styles */
.project-tags {
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #999;
}

.project-date {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.header-right .search-container {
    margin-left: auto;
}

/* Tag Link Styles */
.tag-link {
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.tag-link:hover {
    border-bottom: 1px solid currentColor;
    opacity: 0.8;
}

/* Graph Container */
#graph-container {
    width: 100%;
    height: 250px;
    border-top: 1px solid #e0e0e0;
    background-color: #fafafa;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

svg {
    width: 100%;
    height: 100%;
}

/* TOC Styles */
.toc-content nav ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-content nav ul li {
    font-size: 0.95rem;
    line-height: 1.6;
}

.toc-content nav ul li a {
    text-decoration: none;
    color: #666;
    transition: color 0.2s;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.toc-content nav ul li a:hover {
    color: #000;
    text-decoration: underline;
}

/* Nested TOC lists */
.toc-content nav ul ul {
    padding-left: 1rem;
    margin-top: 0.3rem;
    border-left: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Graph Controls */
.graph-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.graph-btn {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
    color: #333;
}

.graph-btn:hover {
    background: #f0f0f0;
}
