/* Animated site title effect */
#site-title {
    display: inline-flex;
    align-items: center;
    font-family: 'Consolas', 'Fira Mono', 'Menlo', monospace;
    letter-spacing: 0.02em;
    font-weight: 700;
    font-size: 2.2rem;
    color: #e8ecff;
    transition: opacity 0.2s;
}

.splitflap-title {
    gap: 0.08em;
    perspective: 900px;
    -webkit-text-fill-color: currentColor;
}

.splitflap-char {
    display: inline-block;
    min-width: 0.72em;
    height: 1.12em;
    padding: 0 0.06em;
    color: #edf1ff;
    border: 1px solid #6a76a8;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.splitflap-top,
.splitflap-bottom,
.splitflap-flip-top,
.splitflap-flip-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    display: flex;
    justify-content: center;
    overflow: hidden;
    backface-visibility: hidden;
}

.splitflap-top,
.splitflap-flip-top {
    top: 0;
    background: linear-gradient(180deg, #2f3650 0%, #252d43 100%);
    border-bottom: 1px solid rgba(10, 13, 22, 0.85);
}

.splitflap-bottom,
.splitflap-flip-bottom {
    top: 50%;
    background: linear-gradient(180deg, #22293d 0%, #1a1f2f 100%);
}

.splitflap-text {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 1.12em;
    line-height: 1.12em;
    text-align: center;
}

.splitflap-bottom .splitflap-text,
.splitflap-flip-bottom .splitflap-text {
    top: -0.56em;
}

.splitflap-flip-top,
.splitflap-flip-bottom {
    z-index: 3;
    pointer-events: none;
    visibility: hidden;
}

.splitflap-flip-top {
    transform-origin: bottom center;
}

.splitflap-flip-bottom {
    transform-origin: top center;
}

.splitflap-char::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    transform: translateY(-50%);
    background: rgba(9, 12, 20, 0.65);
    z-index: 4;
}

.splitflap-char.flipping .splitflap-flip-top,
.splitflap-char.flipping .splitflap-flip-bottom {
    visibility: visible;
}

.splitflap-char.flipping .splitflap-flip-top {
    animation: flap-top 0.14s ease-in forwards;
}

.splitflap-char.flipping .splitflap-flip-bottom {
    animation: flap-bottom 0.14s ease-out 0.14s forwards;
}

@keyframes flap-top {
    from {
        transform: rotateX(0deg);
    }
    to {
        transform: rotateX(-90deg);
    }
}

@keyframes flap-bottom {
    from {
        transform: rotateX(90deg);
    }
    to {
        transform: rotateX(0deg);
    }
}
/* Center volunteering section buttons */
.volunteering-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
}
/* Volunteering Horizontal Card */
.volunteering-horizontal {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 1.5rem;
    width: 420px;
    max-width: 100%;
    background: #1a1c23;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border: 2px solid #31344a;
    margin-bottom: 1.2rem;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
}
.volunteering-horizontal:hover {
    box-shadow: 0 6px 24px #4e5d94cc;
    border: 2px solid #4e5d94;
    background: #232634cc;
}
.volunteering-img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: 10px;
    border: 2px solid #4e5d94;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    background: #232634;
    image-rendering: auto;
    filter: contrast(1.08) brightness(1.08) saturate(1.1);
    transition: box-shadow 0.2s, filter 0.2s;
}
.volunteering-img:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.28);
    filter: contrast(1.15) brightness(1.12) saturate(1.18);
}
/* Back button for volunteering detail */
.back-btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.5em 1.2em;
    background: #232634;
    color: #b0b8e6;
    border: 1px solid #4e5d94;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 6px rgba(0,0,0,0.13);
}
.back-btn:hover {
    background: #4e5d94;
    color: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}
.volunteering-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.volunteering-info h3 {
    margin: 0 0 0.3rem 0;
    font-size: 1.2rem;
    color: #b0b8e6;
}
.volunteering-desc {
    font-size: 1rem;
    color: #e0e0e0;
    margin: 0;
}
/* Gallery Button Style for Home */
.gallery-btn {
    display: inline-block;
    padding: 0.6rem 2.2rem;
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(90deg, #4e5d94 60%, #232634 100%);
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    margin-bottom: 0.5rem;
}
.gallery-btn:hover {
    background: linear-gradient(90deg, #232634 0%, #4e5d94 100%);
    box-shadow: 0 6px 24px #4e5d94cc;
    transform: scale(1.04);
    color: #b0b8e6;
}
/* Gallery Card Styles */
.gallery-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}
.gallery-card {
    position: relative;
    background: #1a1c23;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border: 2px solid #31344a;
    padding: 1.2rem 1rem 1.5rem 1rem;
    width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
}
.gallery-card:hover {
    box-shadow: 0 6px 24px #4e5d94cc;
    border: 2px solid #4e5d94;
    background: #232634cc;
}
.gallery-card img {
    width: 100%;
    height: 260px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    border: 2px solid #4e5d94;
    box-shadow: 0 1px 8px rgba(0,0,0,0.18);
    padding: 8px;
    background: #232634;
}
.gallery-hover-info {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #232634ee;
    color: #b0b8e6;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2;
}
.gallery-card:hover .gallery-hover-info {
    opacity: 1;
}
.gallery-detail-info {
    display: none;
    margin-top: 1rem;
    background: #232634;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    z-index: 3;
}
.gallery-card.show-detail .gallery-detail-info {
    display: block;
}
/* Gallery Folders Page Styles */

/* Home Gallery Styles */
.home-gallery {
    margin: 3rem auto 2rem auto;
    max-width: 800px;
    text-align: center;
}
.home-gallery h2 {
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: #b0b8e6;
}
.gallery-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}
.gallery-img {
    width: 48%;
    max-width: 320px;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 16px;
    border: 4px solid #4e5d94;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.7s;
    opacity: 1;
}
.gallery-img.fade-out {
    opacity: 0;
}
.gallery-img.fade-in {
    opacity: 1;
}
.gallery-img:hover {
    transform: scale(1.04) rotate(-1deg);
    box-shadow: 0 8px 32px #4e5d94cc;
}
.gallery-img.left {
    align-self: flex-start;
}
.gallery-img.right {
    align-self: flex-end;
}
/* Particle background canvas styling */
#bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: auto;
    display: block;
}
body > *:not(#bg-particles) {
    position: relative;
    z-index: 1;
}
/* Card link hover effect for all cards */
.card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
    border-radius: 10px;
}
.card-link:hover, .menu-card:hover {
    box-shadow: 0 6px 24px 0 #4e5d94, 0 0 0 4px #4e5d9433;
    border: 2px solid #4e5d94;
    background: #232634cc;
    cursor: pointer;
}
.menu-list {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}
.menu-card {
    background: #1a1c23;
    border-radius: 10px;
    padding: 2rem 2.5rem;
    min-width: 220px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    border: 2px solid #31344a;
    text-align: center;
    text-decoration: none;
    color: #e0e0e0;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
    font-size: 1.2rem;
}
.menu-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}
.menu-card p {
    font-size: 1rem;
    color: #b0b0b0;
}
body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #181a20;
    color: #e0e0e0;
}
header {
    background: #232634;
    color: #fff;
    padding: 1.5rem 0 1rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 10;
    box-sizing: border-box;
}
header h1 {
    width: 100%;
    text-align: center;
    margin: 0;
}
header nav {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.8rem;
    padding: 0 0.8rem;
}
header nav a {
    color: #fff;
    margin: 0 0.2rem;
    text-decoration: none;
    font-weight: bold;
}
header nav a:hover {
    text-decoration: underline;
}
main {
    max-width: 1000px;
    margin: 5.5rem auto 3.5rem auto;
    width: calc(100% - 2rem);
    background: #232634;
    padding: 2.5rem 2rem 3.5rem 2rem;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    text-align: center;
}
section {
    margin-bottom: 2rem;
}
.project-list {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}
/* Center the section headings */
#projects h2 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
.project {
    background: #1a1c23;
    border-radius: 10px;
    padding: 1.2rem 1rem 1.5rem 1rem;
    width: 300px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #31344a;
    transition: box-shadow 0.2s, border 0.2s;
}
.project:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    border: 2px solid #4e5d94;
}
.project img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #232634;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    border: 2px solid #4e5d94;
    box-shadow: 0 1px 8px rgba(0,0,0,0.18);
    padding: 8px;
}

.project-detail .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.project-detail .gallery img {
    width: 100%;
    max-width: 260px;
    height: 200px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 10px;
    border: 2px solid #4e5d94;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    background: #1a1c23;
    padding: 8px;
    box-sizing: border-box;
}

.project-detail .gallery.gallery-3x2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.volunteering-detail .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.volunteering-detail .gallery img {
    width: 100%;
    max-width: 260px;
    height: 200px;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 10px;
    border: 2px solid #4e5d94;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    background: #1a1c23;
    padding: 8px;
    box-sizing: border-box;
}

.project-video-wrap {
    position: relative;
    width: 100%;
    max-width: 680px;
    margin: 0 auto 1.5rem auto;
    border: 2px solid #4e5d94;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    background: #11131a;
}

.project-loop-video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: contain;
}

.video-audio-toggle {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #b0b8e6;
    border-radius: 999px;
    background: rgba(15, 17, 24, 0.85);
    color: #e8ecff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.video-audio-toggle:hover {
    background: rgba(35, 38, 52, 0.95);
    border-color: #d4dbff;
}

.video-audio-toggle.sound-on {
    background: rgba(78, 93, 148, 0.9);
    border-color: #d4dbff;
}
footer {
    text-align: center;
    padding: 0.4rem 0.5rem;
    font-size: 0.95rem;
    background: #232634;
    color: #fff;
    position: fixed;
    width: 100vw;
    bottom: 0;
    left: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
    z-index: 10;
}

.pdf-embed {
    width: 100%;
    max-width: 100%;
}

.pdf-ios-note {
    display: none;
    margin: 1rem auto 0 auto;
    padding: 0.9rem 1rem;
    border: 1px solid #4e5d94;
    border-radius: 10px;
    background: #1a1c23;
    color: #e0e0e0;
}

.document-hidden {
    display: none;
}

@media (max-width: 900px) {
    #site-title {
        font-size: 1.8rem;
    }
    .menu-list {
        flex-wrap: wrap;
    }
    .menu-card {
        min-width: 260px;
    }
}

@media (max-width: 700px) {
    header {
        padding: 1rem 0 0.8rem 0;
    }
    main {
        width: calc(100% - 1rem);
        margin: 7.2rem auto 1.5rem auto;
        padding: 1.2rem 0.9rem 2rem 0.9rem;
        border-radius: 10px;
    }
    .menu-list {
        flex-direction: column;
        gap: 1rem;
    }
    .menu-card {
        width: 100%;
        min-width: 0;
        padding: 1.25rem 1rem;
    }
    .gallery-row {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .gallery-img {
        width: 100%;
        max-width: 420px;
    }
    .gallery-card,
    .project,
    .volunteering-horizontal {
        width: 100%;
        max-width: 380px;
    }
    .volunteering-horizontal {
        gap: 0.8rem;
        padding: 0.9rem;
        align-items: flex-start;
    }
    .volunteering-img {
        width: 88px;
        height: 88px;
    }
    .video-audio-toggle {
        top: 0.55rem;
        right: 0.55rem;
        font-size: 0.8rem;
        padding: 0.38rem 0.62rem;
    }
    footer {
        position: static;
        width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 600px) {
    main {
        padding: 1rem;
    }
    .project-list {
        flex-direction: column;
        align-items: center;
    }
    .project {
        width: 100%;
    }
    .project img {
        height: 160px;
    }
    .project-detail .gallery {
        grid-template-columns: 1fr;
    }
    .project-detail .gallery img {
        max-width: 100%;
        height: 180px;
    }
    .project-detail .gallery.gallery-3x2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .volunteering-detail .gallery {
        grid-template-columns: 1fr;
    }
    .volunteering-detail .gallery img {
        max-width: 100%;
        height: 180px;
    }
}

@media (max-width: 520px) {
    .project-detail .gallery.gallery-3x2 {
        grid-template-columns: 1fr;
    }
}
