body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #ffffff;
}

canvas {
    position: fixed;
    inset: 0;
    display: block;
}

#maskCanvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* ── Scrollable page wrapper ── */
.page-content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding-bottom: 80px;
}

.portfolio-header {
    max-width: 900px;
    width: 90%;
    margin: 60px auto 0;
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 30px;
    background: transparent;
    border-radius: 12px;
}

.profile-photo {
    flex-shrink: 0;
}

.profile-photo img {
    width: 140px;
    height: 200px;

}

.header-content {
    flex: 1;
}

.header-content h1 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.header-content .thesis {
    margin: 0;
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* ── Contact bar ── */
.contact-bar {
    max-width: 900px;
    width: 90%;
    margin: 16px auto 0;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9rem;
    color: #555;
}

.contact-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 6px;
}

.contact-row a {
    color: #555;
    text-decoration: none;
    transition: color 0.15s ease;
}

.contact-row a:hover {
    color: #0066cc;
}

.contact-row .sep {
    margin: 0 6px;
    color: #ccc;
}

.contact-row i {
    width: 1em;
    text-align: center;
    margin-right: 3px;
    color: #888;
}

/* ── Case studies section ── */
.case-studies {
    max-width: 900px;
    width: 90%;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Accordion ── */
.case-study {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.case-study[open] {
    border-color: #ccc;
}

.case-study summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s ease;
}

.case-study summary::-webkit-details-marker { display: none; }
.case-study summary::marker { display: none; content: ''; }

.case-study summary:hover {
    background: rgba(0, 0, 0, 0.03);
}

.case-study-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
}

.chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-left: 16px;
    position: relative;
}

.chevron::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: translate(-50%, -60%) rotate(45deg);
    transition: transform 0.2s ease;
}

.case-study[open] .chevron::before {
    transform: translate(-50%, -40%) rotate(-135deg);
}

/* ── Accordion body ── */
.case-study-body {
    padding: 0 24px 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #333;
    line-height: 1.7;
    font-size: 0.95rem;
    border-top: 1px solid #eee;
}

.case-study-body h3 {
    margin: 24px 0 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #222;
}

.case-study-body p {
    margin: 0 0 12px;
}

.case-study-body ul,
.case-study-body ol {
    margin: 0 0 12px;
    padding-left: 24px;
}

.case-study-body li {
    margin-bottom: 6px;
}

.case-study-body a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.case-study-body a:hover {
    border-bottom-color: #0066cc;
}

.case-study-body em {
    font-style: italic;
    color: #444;
}

.case-study-meta {
    margin-top: 16px;
    font-size: 0.9rem;
    color: #666;
}

/* ── Image inside accordion ── */
.case-study-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 16px 0;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* ── YouTube responsive embed ── */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 16px 0;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Mermaid diagram ── */
.mermaid-diagram {
    margin: 20px 0 8px;
    display: flex;
    justify-content: center;
}

.mermaid-diagram .mermaid {
    background: transparent;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .portfolio-header {
        flex-direction: column;
        text-align: center;
        margin-top: 30px;
        gap: 20px;
        padding: 20px;
    }

    .header-content h1 {
        font-size: 1.2rem;
    }

    .header-content .thesis {
        font-size: 0.9rem;
    }

    .profile-photo img {
        width: 120px;
        height: 120px;
    }

    .case-study summary {
        padding: 14px 16px;
    }

    .case-study-title {
        font-size: 1rem;
    }

    .case-study-body {
        padding: 0 16px 20px;
        font-size: 0.9rem;
    }
}
