/* about page structure and print styles. */
.about-intro-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.about-selfie {
    width: 260px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    object-fit: cover;
}
.hs-card-layout {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 2rem;
}

.hs-text {
    flex: 1;
}

.hs-logo-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-logo {
    width: 120px;
    max-width: 30vw;
    object-fit: contain;
}
/* Global color matching variable */
:root {
    --primary: #2563eb;
    --bg-body: #f7f5f0;
    --bg-card: #ffffff;
    --text-main: #1c1917;
    --text-sub: #57534e;
    --border: #e5e1d8;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    --panel-bg: #ffffff;
    --card-hover: #fcfbfa;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --bg-body: #000000;
    --bg-card: #0c0c0e;
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --border: #1f1f24;
    --shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.85);
    --panel-bg: #0c0c0e;
    --card-hover: #16161a;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; transition: background-color 0.3s, color 0.3s, border-color 0.3s; }
html, body { background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; overflow-x: hidden; }
body::before, body::after { display: none !important; }

/* Dynamic animation */
.animate-on-scroll { 
    opacity: 0; transform: translateY(30px) scale(0.98); 
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); 
}
.animate-on-scroll.show { opacity: 1; transform: translateY(0) scale(1); }
.delay-100 { transition-delay: 100ms; } .delay-200 { transition-delay: 200ms; } .delay-300 { transition-delay: 300ms; } .delay-400 { transition-delay: 400ms; }

/* --------------------------------------------------------------------------
   Capsule Navigation Bar (Pill Header) - Always Fixed to Viewport Top
   -------------------------------------------------------------------------- */
body {
    padding-top: 5.5rem !important;
}

html {
    scroll-behavior: smooth !important;
    scroll-padding-top: 6rem !important;
}

section,
footer {
    scroll-margin-top: 6rem !important;
}

nav,
nav.capsule-nav {
    position: fixed !important;
    top: 1.1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    max-width: 1180px !important;
    width: min(1180px, calc(100% - 2.4rem)) !important;
    margin: 0 !important;
    padding: 0.5rem 1.4rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

[data-theme="dark"] nav,
[data-theme="dark"] nav.capsule-nav {
    background: rgba(16, 16, 20, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}
.logo{
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
}

.brand-avatar {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    overflow: hidden !important;
}

.brand-title,
.portfolio-title {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-transform: none !important;
    color: #1c1917 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

[data-theme="dark"] .brand-title,
[data-theme="dark"] .portfolio-title {
    color: #f4f4f5 !important;
}

.nav-actions,
.nav-right,
.nav-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    position: static !important;
}

.nav-resume-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: #27272a !important;
    text-decoration: none !important;
    border: 1px solid rgba(0, 0, 0, 0.14) !important;
    border-radius: 999px !important;
    padding: 0.38rem 0.9rem !important;
    background: rgba(255, 255, 255, 0.7) !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.nav-resume-btn:hover {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
}

[data-theme="dark"] .nav-resume-btn {
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #e4e4e7 !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme="dark"] .nav-resume-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

.lang-toggle {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.14) !important;
    color: #44403c !important;
    padding: 0.38rem 0.85rem !important;
    border-radius: 999px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.lang-toggle:hover {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
    color: #1c1917 !important;
    transform: translateY(-1px) !important;
}

[data-theme="dark"] .lang-toggle {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .lang-toggle:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

#theme-toggle,
.theme-btn,
#theme-btn {
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.14) !important;
    border-radius: 50% !important;
    color: #44403c !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

#theme-toggle:hover,
.theme-btn:hover,
#theme-btn:hover {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
    color: #1c1917 !important;
    transform: scale(1.06) !important;
}

[data-theme="dark"] #theme-toggle,
[data-theme="dark"] .theme-btn,
[data-theme="dark"] #theme-btn {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] #theme-toggle:hover,
[data-theme="dark"] .theme-btn:hover,
[data-theme="dark"] #theme-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #ffffff !important;
}

/* Responsive Capsule Nav */
@media (max-width: 900px) {
    .nav-resume-btn {
        width: 34px;
        height: 34px;
        padding: 0 !important;
        justify-content: center;
        border-radius: 50% !important;
    }

    .nav-resume-btn .nav-resume-label {
        display: none;
    }

    .nav-resume-btn .nav-resume-icon {
        display: inline-block;
    }
    .nav-item-about,
    .nav-item-skills {
        display: none !important;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 4.5rem !important;
    }
    nav,
    nav.capsule-nav {
        width: calc(100% - 1.4rem) !important;
        max-width: 100% !important;
        top: 0.65rem !important;
        padding: 0.35rem 0.85rem !important;
        box-sizing: border-box !important;
    }
    .logo{
        gap: 0.45rem !important;
        flex-shrink: 0 !important;
    }
    .brand-avatar {
        width: 26px !important;
        height: 26px !important;
    }
    .brand-avatar svg {
        width: 26px !important;
        height: 26px !important;
    }
    .brand-title,
    .portfolio-title {
        font-size: 0.88rem !important;
        letter-spacing: 0.01em !important;
    }
    .nav-item-hero,
    .nav-item-about,
    .nav-item-experience,
    .nav-item-projects,
    .nav-item-skills {
        display: none !important;
    }
    .nav-actions {
        gap: 0.38rem !important;
        flex-shrink: 0 !important;
    }
    .nav-resume-btn {
        width: 28px;
        height: 28px;
        font-size: 0.82rem !important;
    }
    .lang-toggle {
        padding: 0.3rem 0.55rem !important;
        font-size: 0.75rem !important;
    }
    #theme-toggle,
    .theme-btn,
    #theme-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.82rem !important;
    }
}

/* Page header */
.header { padding: 4rem 1rem; text-align: center; }
.header-title-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 0.5rem; }
.header h1 { font-size: 2.5rem; color: var(--text-main); margin: 0; }
.header p { color: var(--text-sub); font-size: 1.1rem; }

/* Card style */
.simple-card { 
    background: var(--bg-card); padding: 2rem; border-radius: 12px; 
    max-width: 900px; margin: 0 auto 2rem auto; 
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.simple-card h2 { color: var(--text-main); margin-bottom: 1rem; border-left: 4px solid var(--primary); padding-left: 1rem; }
.simple-card ul { padding-left: 1.2rem; color: var(--text-sub); }
.simple-card p, .simple-card li { color: var(--text-sub); margin-bottom: 0.5rem; }

/* Hobbies Panel */
.showcase-container {
    max-width: 1000px; margin: 0 auto 4rem auto;
    background: var(--panel-bg);
    border-radius: 20px; padding: 2.5rem;
    color: var(--text-main);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.photo-section {
    max-width: 1000px;
    margin: 0 auto 4rem auto;
    background: var(--panel-bg);
    border-radius: 20px;
    padding: 2.5rem;
    color: var(--text-main);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.photo-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.photo-sub {
    color: var(--text-sub);
    font-size: 0.98rem;
    margin-bottom: 1.5rem;
}

.photo-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.photo-card {
    flex: 0 0 280px;
    background: var(--bg-body);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
    scroll-snap-align: start;
}

.photo-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow);
    background: var(--card-hover);
}

.photo-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.photo-caption {
    padding: 0.9rem 1.1rem 1.1rem;
    font-size: 0.9rem;
    color: var(--text-sub);
}

.photo-grid::-webkit-scrollbar {
    height: 6px;
    width: 0;
}

.photo-grid::-webkit-scrollbar-track {
    background: transparent;
}

.photo-grid::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 999px;
}

.photo-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.8);
}

.showcase-header { font-size: 1.8rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-main); }

.toggle-wrapper {
    background: var(--bg-body); width: fit-content; padding: 4px; border-radius: 10px;
    display: flex; position: relative; margin-bottom: 2rem; border: 1px solid var(--border);
}
.toggle-glider {
    position: absolute; top: 4px; left: 4px; width: 120px; height: 36px;
    background: var(--primary); border-radius: 8px;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); z-index: 1;
}
.toggle-btn {
    position: relative; z-index: 2; width: 120px; height: 36px;
    background: none; border: none; color: var(--text-sub); font-weight: 600; cursor: pointer; font-size: 0.9rem; transition: color 0.3s;
}
.toggle-btn.active { color: white; }

.grid-panel { display: none; }
.grid-panel.active { display: grid; }

/* Game Card */
.games-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.game-card {
    background: var(--bg-body); border-radius: 12px; padding: 1.5rem; text-align: center;
    border: 1px solid var(--border); transition: all 0.3s;
}
.game-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow); background: var(--card-hover); }
.card-img-box {
    width: 80px; height: 80px; margin: 0 auto 1rem auto;
    border-radius: 16px; overflow: hidden; background: #e2e8f0;
}
.card-img-box img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-main); }
.card-stat { font-size: 0.85rem; color: var(--text-sub); margin-bottom: 0.2rem; }
.stat-badge { display: inline-block; margin-top: 0.8rem; padding: 4px 12px; background: rgba(37, 99, 235, 0.1); color: var(--primary); border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

/* Music Card */
.music-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.2rem; }
.music-card {
    background: var(--bg-body); border-radius: 12px; overflow: hidden; 
    border: 1px solid var(--border); transition: all 0.3s;
}
.music-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow); }
.music-cover-wrapper { width: 100%; aspect-ratio: 1/1; position: relative; overflow: hidden; background: #eee; }
.music-cover { width: 100%; height: 100%; object-fit: cover; }
.music-info { padding: 0.8rem; }
.music-title { font-size: 0.95rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.2rem; }
.music-artist { font-size: 0.75rem; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 0.6rem; }
audio { width: 100%; height: 28px; opacity: 0.8; outline: none; margin-top: auto; }
[data-theme="dark"] audio { filter: invert(0.9) hue-rotate(180deg); }

.btn-home {
    display: block;
    width: fit-content;
    margin: 2.5rem auto 1.5rem auto;
    padding: 0.85rem 2.2rem;
    background: #18181b;
    color: #ffffff;
    border: 1.5px solid #18181b;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}
.btn-home:hover {
    background: #27272a;
    border-color: #27272a;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] .btn-home,
html[data-theme="dark"] .btn-home {
    background: #ffffff;
    color: #09090b;
    border: 1.5px solid #ffffff;
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] .btn-home:hover,
html[data-theme="dark"] .btn-home:hover {
    background: #f4f4f5;
    color: #000000;
    border-color: #f4f4f5;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255, 255, 255, 0.25);
}
/* Footer — same watermark footer as index.html */
footer.watermark-footer {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 4rem;
    padding: 7rem 1rem 2.25rem;   /* room above the contact bar so the watermark isn't clipped */
    color: var(--text-main);
    background: #000000 !important;
    border-top: 1px solid #18181b !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

footer.watermark-footer::before {
    content: "BAOWEN";
    position: absolute;
    left: 50%;
    top: var(--wm-top, 46%);
    transform: translate(-50%, -50%);
    z-index: -1;
    font-size: clamp(5rem, 20vw, 16.5rem);
    line-height: 0.8;
    font-weight: 800;
    letter-spacing: 0;
    color: rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

[data-theme="dark"] footer.watermark-footer::before {
    color: rgba(255, 255, 255, 0.18) !important;
}

footer.watermark-footer::after {
    display: none !important;
}

.footer-socials {
    margin-top: 0.35rem;
}

/* Footer contact info layout */
.footer-contact {
    width: min(100%, 760px);
    margin: 0 auto 0.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 0.8rem 1.45rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.footer-contact p {
    margin: 0;
    color: #1c1917;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.footer-contact p+p {
    border-left: 1px solid rgba(0, 0, 0, 0.12);
    margin-left: 1.25rem;
    padding-left: 1.25rem;
}

[data-theme="dark"] .footer-contact {
    background: rgba(255, 255, 255, 0.015) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .footer-contact p {
    color: #ffffff !important;
}

[data-theme="dark"] .footer-contact p+p {
    border-left: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.footer-socials a {
    color: rgba(51, 65, 85, 0.58);
    margin: 0 10px;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.footer-socials a:hover {
    color: var(--primary);
}

.footer-copyright {
    margin-top: 0.25rem;
    color: rgba(51, 65, 85, 0.48);
    font-size: 0.86rem;
}

.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 5rem;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background-color: var(--text-main);
    color: #ffffff;
    font-size: 0.85rem;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 130;
}

.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, -6px);
}


@media (max-width: 768px) {
    /* Mobile spacing + fonts */
    body {
        font-size: 0.95rem;
    }

    .header {
        padding: 3rem 1rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 0.95rem;
    }

    .simple-card, .showcase-container {
        padding: 1.5rem;
        width: 95%;
        border-radius: 16px;
    }

    .about-intro-layout {
        flex-direction: column;
        align-items: center;
    }

    .about-selfie {
        width: 70vw;
        max-width: 260px;
    }

    .hs-card-layout {
        flex-direction: column;
        align-items: center;
    }

    .hs-logo-wrapper {
        margin-bottom: 0.5rem;
    }

    .hs-text {
        width: 100%;
    }

    .photo-section {
        padding: 1.5rem;
        width: 95%;
        border-radius: 16px;
    }

    .photo-title {
        font-size: 1.5rem;
    }

    .photo-sub {
        font-size: 0.9rem;
    }

    .photo-grid {
        grid-template-columns: 1fr;
    }

    .simple-card h2 {
        font-size: 1.4rem;
    }

    .simple-card p,
    .simple-card li {
        font-size: 0.95rem;
    }

    .showcase-header {
        font-size: 1.5rem;
    }

    .card-title {
        font-size: 1rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .music-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    audio {
        height: 24px;
    }

    footer.watermark-footer {
        min-height: 360px;
        padding: 4rem 1rem 2rem;
    }

    footer.watermark-footer::before {
        top: var(--wm-top, 42%);
        font-size: clamp(4.75rem, 28vw, 7rem);
    }

    .footer-contact {
        width: min(100%, 360px);
        flex-direction: column;
        align-items: center;
        gap: 0.65rem;
        padding: 1rem 1.1rem;
        border-radius: 14px;
    }

    .footer-contact p {
        width: 100%;
        text-align: center;
        white-space: normal;
        margin: 0;
    }

    .footer-contact p+p {
        border-left: none !important;
        border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
        padding-top: 0.65rem !important;
    }

    [data-theme="dark"] .footer-contact p+p {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    }

}
