/* ============================================
   Personal Website Styles
   Author: Zichen (Danny) Zhao
   ============================================ */

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }

/* ============================================
   NAVIGATION
   ============================================ */

nav {
    backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    transform: translateY(0);
}

nav.scrolled {
    background-color: rgba(255, 255, 255, 0.96);
    border-bottom-color: rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

nav.nav-hidden {
    transform: translateY(-100%);
}

.site-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.site-nav a {
    letter-spacing: 0.02em;
}

.mobile-menu-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.02) 0%, transparent 50%);
    z-index: 0;
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-card {
    backdrop-filter: blur(24px) saturate(180%);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    border: 1px solid rgba(226, 232, 240, 0.5);
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.03),
        0 8px 24px rgba(15, 23, 42, 0.08),
        0 32px 64px rgba(15, 23, 42, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.metric {
    display: grid;
    place-items: center start;
}

/* ============================================
   LIGHTBOX GALLERY
   ============================================ */

.lightbox {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
    transform: scale(0.96);
    opacity: 0.9;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
    opacity: 1;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.25s ease;
    opacity: 1;
}

.lightbox-image.loading {
    opacity: 0;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    top: 20px;
    right: 20px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-item {
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    min-height: 100px;
    transition: transform 0.35s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* ============================================
   SECTION STYLES
   ============================================ */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 9999px;
    background-color: rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.7);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-heading {
    font-size: clamp(2.25rem, 2.8vw + 1rem, 3.5rem);
    line-height: 1.15;
    color: #0f172a;
    font-weight: 600;
}

.section-subtitle {
    color: #475569;
    max-width: 42rem;
    margin: 0 auto;
}

/* ============================================
   CARDS
   ============================================ */

.card-grid {
    display: grid;
    gap: 1.5rem;
}

.card-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card-hero {
    height: 12rem;
    border-radius: 1.5rem 1.5rem 0 0;
}

.card-hero--violet {
    background: linear-gradient(140deg, rgba(255, 230, 204, 0.95) 0%, rgba(252, 242, 225, 0.9) 100%);
}

.card-hero--emerald {
    background: linear-gradient(140deg, rgba(219, 240, 226, 0.95) 0%, rgba(232, 246, 236, 0.9) 100%);
}

.card-hero--magenta {
    background: linear-gradient(140deg, rgba(223, 232, 248, 0.92) 0%, rgba(238, 243, 252, 0.92) 100%);
}

.hover-lift {
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 28px 50px rgba(15, 23, 42, 0.1);
    border-color: rgba(148, 163, 184, 0.35);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.section-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fallback for users with JavaScript disabled */
noscript .section-reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* ============================================
   CONTACT PAGE SPECIFIC STYLES
   ============================================ */

.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }

.social-icon {
    transition: all 0.3s ease;
}

/* WeChat Modal */
.wechat-modal {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wechat-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.wechat-modal-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.wechat-modal.active .wechat-modal-content {
    transform: scale(1);
    opacity: 1;
}

.wechat-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.wechat-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.wechat-qr-image {
    width: 100%;
    max-width: 350px;
    height: auto;
    border-radius: 16px;
    margin: 0 auto;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ============================================
   PHOTOGRAPHY PAGE SPECIFIC STYLES
   ============================================ */

/* Photography hero with colorful gradient background */
body.photography-page .hero {
    background: radial-gradient(circle at top left, rgba(102, 126, 234, 0.25), transparent 55%),
                radial-gradient(circle at bottom right, rgba(118, 75, 162, 0.2), transparent 50%),
                linear-gradient(135deg, #f8fafc 0%, #eef2ff 45%, #eff6ff 100%);
}

body.photography-page .hero::before {
    background: radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.12), transparent 55%),
                radial-gradient(circle at 80% 30%, rgba(236, 72, 153, 0.12), transparent 50%);
}

body.photography-page .hero-card {
    backdrop-filter: blur(24px);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.1);
}

/* Photography lightbox image with instant transitions */
.lightbox-image.instant {
    transition: none !important;
}

/* Photography hover effect with different shadow */
body.photography-page .hover-lift:hover {
    box-shadow: 0 35px 60px rgba(15, 23, 42, 0.12);
    border-color: rgba(79, 70, 229, 0.15);
}
