:root {
    --paper:      #F5F0E6;
    --white:      #FDFAF4;
    --ink:        #2C1F14;
    --ink-mid:    #5C4535;
    --ink-light:  #8A7260;
    --red:        #8B1A1A;
    --gold:       #C9A050;
    --gold-light: #D4B07A;
    --hero-bg:    #0A0806;
    --font-script: 'Pinyon Script', cursive;
    --font-d:     'Playfair Display', Georgia, serif;
    --font-b:     'Lora', Georgia, serif;
    --max-w:      1280px;
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --t:          0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-b);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.75;
    animation: pageFadeIn 0.6s ease-out both;
}
@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    background: rgba(253, 250, 244, 0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(180, 150, 90, 0.15);
    transition: box-shadow var(--t);
}
#navbar.scrolled { box-shadow: 0 2px 20px rgba(30, 26, 21, 0.08); }
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo { display: flex; flex-direction: column; line-height: 1.2; }
.logo-en { font-family: var(--font-d); font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.logo-zh { font-size: 0.65rem; letter-spacing: 0.22em; color: var(--red); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
    font-family: var(--font-d);
    font-size: 0.83rem;
    letter-spacing: 0.06em;
    color: var(--ink-mid);
    transition: color var(--t);
    position: relative;
    padding-bottom: 2px;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-toggle {
    display: none; flex-direction: column; gap: 5px; padding: 4px; z-index: 1001;
}
.nav-toggle span {
    display: block; width: 24px; height: 2px;
    background: var(--ink);
    transition: transform var(--t), opacity var(--t);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

#hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform-origin: center;
}
@keyframes kbZoomIn {
    from { transform: scale(1.1); }
    to   { transform: scale(1.0); }
}
@keyframes kbPan {
    from { transform: scale(1.08) translateX(3%); }
    to   { transform: scale(1.04) translateX(-3%); }
}
.hero-slide img.kb-zoom-in.animating { animation: kbZoomIn 10s ease-out forwards; }
.hero-slide img.kb-pan.animating     { animation: kbPan    10s ease-in-out forwards; }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(5,4,3,0.25) 0%,
        rgba(5,4,3,0.55) 50%,
        rgba(5,4,3,0.72) 100%
    );
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0 1.5rem;
}
.hero-label {
    font-family: var(--font-b);
    font-size: 0.68rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(201,160,80,0.9);
    margin-bottom: 0.6rem;
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hero-name {
    font-family: var(--font-script);
    font-size: clamp(4rem, 10vw, 9rem);
    font-weight: 400;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 24px rgba(0,0,0,0.7), 0 1px 4px rgba(0,0,0,0.5);
}
.hero-zh {
    font-size: clamp(0.85rem, 1.4vw, 1.1rem);
    letter-spacing: 0.4em;
    color: rgba(255,255,255,0.75);
    text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hero-rule {
    width: 40px;
    height: 1px;
    background: rgba(201,160,80,0.5);
    margin: 1.1rem 0 0.9rem;
}
.hero-exhibition-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.4rem;
}
.hero-dates {
    font-family: var(--font-b);
    font-size: clamp(0.78rem, 1.2vw, 0.88rem);
    color: rgba(255,255,255,0.82);
    letter-spacing: 0.06em;
    text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.hero-exhibition-link {
    font-family: var(--font-b);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    border-bottom: 1px solid rgba(201,160,80,0.4);
    padding-bottom: 1px;
    transition: color 0.2s, border-color 0.2s;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.hero-exhibition-link:hover { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-btn {
    display: inline-block;
    font-family: var(--font-b);
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.55);
    padding: 0.65rem 1.8rem;
    transition: background 0.25s, border-color 0.25s, color 0.25s;
    backdrop-filter: blur(4px);
    background: rgba(255,255,255,0.07);
}
.hero-btn:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.9);
}
.hero-pause {
    position: absolute;
    bottom: 2rem;
    right: 2.5rem;
    z-index: 2;
    font-family: var(--font-b);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    transition: color 0.25s;
}
.hero-pause:hover { color: rgba(255,255,255,0.9); }
.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: block;
    width: 1px;
    height: 52px;
    background: rgba(255,255,255,0.15);
    overflow: hidden;
}
.hero-scroll::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(201,160,80,0.7);
    animation: inkDrip 2.2s ease-in-out infinite;
}
@keyframes inkDrip {
    0%   { top: -100%; }
    100% { top: 100%; }
}

#navbar.over-hero {
    background: transparent;
    backdrop-filter: none;
    border-bottom-color: transparent;
    box-shadow: none;
}
#navbar.over-hero.menu-open {
    background: #FDFAF4;
    backdrop-filter: blur(8px);
    border-bottom-color: rgba(180, 150, 90, 0.15);
}
#navbar.over-hero.menu-open .logo-en { color: var(--ink); }
#navbar.over-hero.menu-open .logo-zh { color: var(--red); }
#navbar.over-hero.menu-open .nav-toggle span { background: var(--ink); }
#navbar.over-hero.menu-open .nav-links a { color: var(--ink-mid); }
#navbar.over-hero .logo-en,
#navbar.over-hero .nav-links a { color: rgba(255,255,255,0.88); }
#navbar.over-hero .logo-zh { color: rgba(201,160,80,0.9); }
#navbar.over-hero .nav-links a:hover { color: #fff; }
#navbar.over-hero .nav-toggle span { background: #fff; }

#intro {
    background: var(--white);
    padding-top: 4.5rem;
    overflow: hidden;
}
.intro-painting-bg {
    position: absolute;
    inset: 0;
    background-image: url('hero-painting.jpg');
    background-size: cover;
    background-position: center 30%;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}
.card-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 2.5rem 3.5rem 2rem;
    position: relative;
    z-index: 1;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2.5rem;
}
.name-col {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.script-name {
    font-family: var(--font-script);
    font-size: clamp(3rem, 5.5vw, 5.5rem);
    font-weight: 400;
    color: var(--gold);
    line-height: 1.05;
    margin-bottom: 0.15rem;
    white-space: nowrap;
}
.hanzi-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.hanzi {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: 0.22em;
    color: #2C1F14;
    font-weight: 500;
}
.rule-ornament {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}
.rule-line { display: block; width: 55px; height: 1px; background: rgba(184,150,90,0.45); }
.rule-gem { font-size: 0.45rem; color: rgba(184,150,90,0.6); line-height: 1; }
.sub1 {
    font-family: var(--font-b);
    font-size: 0.9rem;
    color: #8A7260;
    letter-spacing: 0.02em;
    margin-bottom: 0;
}
.sub2 {
    font-family: var(--font-b);
    font-style: italic;
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    font-weight: 400;
    color: #5C3820;
    line-height: 1.1;
    white-space: nowrap;
}
.photo-col {
    width: 36%;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
.photo-bg-ring { display: none; }
.photo-oval {
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
.photo-oval img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: 50% 10%;
    display: block;
    -webkit-mask-image: radial-gradient(ellipse 88% 90% at 52% 38%,
        black 45%,
        rgba(0,0,0,0.85) 58%,
        rgba(0,0,0,0.4) 72%,
        transparent 90%);
    mask-image: radial-gradient(ellipse 88% 90% at 52% 38%,
        black 45%,
        rgba(0,0,0,0.85) 58%,
        rgba(0,0,0,0.4) 72%,
        transparent 90%);
}
.card-bio {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding-top: 0.5rem;
}
.card-bio p {
    font-family: var(--font-b);
    font-size: 0.86rem;
    color: #5C4535;
    line-height: 1.72;
    text-align: justify;
    margin-bottom: 0.9rem;
}
.card-bio p:last-child { margin-bottom: 0; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 2rem; }
section { padding: 6rem 0; }

.section-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(184,150,90,0.25);
}
.section-label h2 {
    font-family: var(--font-d);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.1;
}
.section-label.light h2 { color: #fff; }
.section-label.light { border-bottom-color: rgba(255,255,255,0.15); }

#exhibition { background: var(--paper); }
.exhibition-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    align-items: start;
}
.exhibition-title {
    font-family: var(--font-d);
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 1.2rem;
    line-height: 1.3;
}
.exhibition-invite {
    font-family: var(--font-b);
    font-size: 0.96rem;
    color: var(--ink-mid);
    line-height: 1.8;
    margin-bottom: 2rem;
}
.exhibition-meet {
    padding: 0.8rem 1.2rem;
    background: rgba(201,160,80,0.05);
}
.meet-title {
    font-family: var(--font-b);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.exhibition-meet p {
    font-size: 0.9rem;
    color: var(--ink-mid);
    line-height: 1.6;
}
.exhibition-meet strong { color: var(--ink); }
.exhibition-meta {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    border-left: 1px solid rgba(184,150,90,0.25);
    padding-left: 2rem;
}
.meta-block {}
.meta-label {
    font-family: var(--font-b);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-mid);
    margin-bottom: 0.35rem;
}
.meta-block p {
    font-size: 0.9rem;
    color: var(--ink-mid);
    line-height: 1.65;
}
.meta-block sup { font-size: 0.65em; }
.exhibition-meta-inline {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.exhibition-poster img {
    width: 100%;
    box-shadow: 0 8px 40px rgba(44,31,20,0.15);
    border: 1px solid rgba(184,150,90,0.2);
}

#gallery {
    background: #3D2B1A;
}
#gallery .section-label { border-bottom-color: rgba(201,160,80,0.3); }
#gallery .section-label h2 { color: #F5EFE4; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
    border-bottom: none;
}
.filter-btn {
    padding: 0.5rem 1.3rem;
    font-family: var(--font-d);
    font-size: 0.78rem;
    color: rgba(245,239,228,0.55);
    border: 1px solid rgba(201,160,80,0.25);
    border-bottom: none;
    margin-bottom: 0;
    transition: all var(--t);
    letter-spacing: 0.06em;
    background: transparent;
    cursor: pointer;
}
.filter-btn .zh { font-size: 0.76em; margin-left: 0.2em; opacity: 0.7; }
.filter-btn:hover {
    color: var(--gold-light);
    border-color: rgba(201,160,80,0.6);
    background: rgba(201,160,80,0.06);
}
.filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #1E1610;
}
.filter-btn.active .zh { opacity: 0.8; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.gallery-item {
    cursor: pointer;
    background: #fff;
    padding: 16px;
    border: 1px solid rgba(201,160,80,0.25);
    box-shadow: 0 6px 30px rgba(0,0,0,0.3);
    transition: box-shadow var(--t), transform var(--t);
    display: flex;
    flex-direction: column;
}
.gallery-item:hover {
    box-shadow: 0 12px 45px rgba(0,0,0,0.5);
    border-color: rgba(201,160,80,0.5);
}
.gallery-img-wrap {
    background: #F5F0E4;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
}
.gallery-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.5s var(--ease);
}
.gallery-item:hover .gallery-img-wrap img { transform: scale(1.03); }
.gallery-item-caption {
    padding: 0.7rem 0.2rem 0.2rem;
    text-align: center;
    background: #fff;
}
.gallery-item-label {
    font-family: var(--font-b);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: #8A7260;
}

#contact {
    position: relative;
    text-align: center;
    padding: 9rem 0;
    overflow: hidden;
}
#contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('images/longevity/K4.JPG');
    background-size: 130%;
    background-position: center 40%;
    filter: brightness(0.32) sepia(30%);
    z-index: 0;
}
.contact-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#contact .section-label {
    border-bottom-color: rgba(201,160,80,0.35);
    justify-content: center;
}
#contact .section-label h2 {
    color: #F5EFE4;
    font-size: clamp(2rem, 4vw, 3.5rem);
}
.contact-text {
    color: rgba(245,239,228,0.72);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
    max-width: 480px;
    line-height: 1.8;
    font-style: italic;
}
.contact-details {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 520px;
}
.contact-item {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    text-align: left;
}
.contact-label {
    font-family: var(--font-d);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-light);
    flex-shrink: 0;
    width: 40px;
}
.btn-outline {
    display: inline-block;
    padding: 1rem 3rem;
    border: 1px solid rgba(201,160,80,0.6);
    color: var(--gold-light);
    font-family: var(--font-d);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: all var(--t);
}
.btn-outline:hover {
    background: rgba(201,160,80,0.15);
    border-color: var(--gold-light);
    color: #fff;
}

footer { background: #070504; padding: 2.2rem 2rem; text-align: center; }
.footer-name { font-family: var(--font-d); color: rgba(255,255,255,0.5); font-size: 0.95rem; }
.footer-name span { margin-left: 0.5rem; letter-spacing: 0.18em; color: rgba(184,150,90,0.4); font-size: 0.85em; }
.footer-copy { margin-top: 0.4rem; font-size: 0.72rem; color: rgba(255,255,255,0.2); letter-spacing: 0.1em; }

#lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(5,4,3,0.96);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
#lightbox.open { opacity: 1; pointer-events: all; }
.lb-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90vw;
    max-width: 900px;
}
#lbImg {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
    display: block;
}
.lb-caption {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; padding: 0.9rem 0;
    color: rgba(255,255,255,0.45); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.lb-close { position: fixed; top: 1.5rem; right: 1.5rem; color: rgba(255,255,255,0.55); font-size: 2.2rem; line-height: 1; padding: 0.5rem; transition: color var(--t); z-index: 1; }
.lb-close:hover { color: #fff; }
.lb-arrow { position: fixed; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.45); font-size: 4rem; line-height: 1; padding: 0.5rem 1rem; transition: color var(--t); z-index: 1; user-select: none; }
.lb-arrow:hover { color: #fff; }
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }

.fade-up { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.fade-up.visible { opacity: 1; transform: none; }

@media (min-width: 1400px) {
    .card-wrap {
        max-width: 1180px;
        padding: 3rem 4rem 2.5rem;
    }
    .script-name {
        font-size: 6.5rem;
    }
    .sub2 {
        font-size: 2.8rem;
    }
    .hanzi {
        font-size: 2.4rem;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
    .card-bio {
        gap: 3rem;
    }
    .card-bio p {
        font-size: 0.95rem;
    }
    .exhibition-layout {
        grid-template-columns: 1fr 320px;
        gap: 5rem;
    }
}

@media (min-width: 1800px) {
    .card-wrap {
        max-width: 1400px;
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    section { padding: 8rem 0; }
}

@media (max-width: 960px) {
    .exhibition-layout { grid-template-columns: 1fr; gap: 2rem; }
    .exhibition-poster { max-width: 280px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .card-wrap { padding: 2.5rem 1.5rem 1.5rem; }
    .card-header { flex-direction: column-reverse; align-items: center; }
    .photo-col { width: 65%; max-width: 260px; }
    .card-bio { grid-template-columns: 1fr; gap: 0; }
    .card-bio p { text-align: left; }
    .card-foot { height: 200px; }
    .script-name { white-space: normal; }
    .sub2 { white-space: normal; }
}
@media (max-width: 640px) {
    .nav-links {
        position: fixed;
        top: 57px; left: 0; right: 0;
        background: #FDFAF4;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        display: none;
        z-index: 1001;
        border-bottom: 1px solid rgba(184,150,90,0.2);
        box-shadow: 0 8px 30px rgba(44,31,20,0.1);
        padding: 0.5rem 0;
    }
    .nav-links.open { display: flex; }
    .nav-links li { border-bottom: 1px solid rgba(184,150,90,0.1); }
    .nav-links li:last-child { border-bottom: none; }
    .nav-links a {
        display: block;
        padding: 0.95rem 2rem;
        font-size: 0.9rem;
        color: var(--ink);
        letter-spacing: 0.06em;
    }
    .nav-links a::after { display: none; }
    .nav-links a:hover { background: rgba(201,160,80,0.06); color: var(--ink); }
    .nav-toggle { display: flex; }
    section { padding: 4rem 0; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
    .gallery-img-wrap { height: 220px; padding: 8px; }

    .lb-arrow { font-size: 2.8rem; padding: 0.4rem 0.6rem; }
    .filter-btn { padding: 0.5rem 0.8rem; font-size: 0.75rem; }
}
