/* =========================================
   Uncommon Windows — 姚海旭
   Personal Art Website
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d0d0d;
    --bg-alt: #141414;
    --text: #ededed;
    --text-muted: #999;
    --accent: #c9a96c;
    --accent-dim: rgba(201, 169, 108, 0.15);
    --border: #2a2a2a;
    --radius: 6px;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
    background: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.4s var(--ease);
}

nav.scrolled {
    border-bottom-color: var(--border);
}

.nav-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text);
}

/* --- Hero --- */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../images/full/looking-out-the-window--there-is-a-vast-nebula-str.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.6);
    transition: filter 0.5s var(--ease);
}

.hero:hover .hero-bg {
    filter: brightness(0.5);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13,13,13,0.3) 0%,
        rgba(13,13,13,0.5) 50%,
        rgba(13,13,13,0.95) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    animation: fadeUp 1.2s var(--ease) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    font-style: italic;
    color: var(--accent);
    margin-bottom: 1.5rem;
    animation: fadeUp 1.2s var(--ease) 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-desc {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeUp 1.2s var(--ease) 0.4s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-cta {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.4s var(--ease);
    animation: fadeUp 1.2s var(--ease) 0.6s forwards;
    opacity: 0;
    transform: translateY(20px);
}

.hero-cta:hover {
    background: var(--accent);
    color: var(--bg);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Sections --- */
section {
    padding: 6rem 2rem;
}

.section-header {
    max-width: 1300px;
    margin: 0 auto 3rem;
}

.section-number {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.2;
}

.section-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.25rem;
}


/* --- Contact --- */
.contact {
    background: var(--bg);
}

.contact-content {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info {
    max-width: 580px;
}

.contact-name {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.contact-item:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.contact-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    min-width: 3rem;
}

.contact-value {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}
/* --- Gallery --- */
.gallery {
    background: var(--bg-alt);
}

.gallery-grid {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    aspect-ratio: 4 / 3;
    background: #1a1a1a;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease), filter 0.5s;
}

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

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s var(--ease);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 1.25rem;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-cn {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--accent);
    margin-bottom: 0.15rem;
    transform: translateY(10px);
    transition: transform 0.4s var(--ease);
}

.gallery-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
    transform: translateY(10px);
    transition: transform 0.4s var(--ease);
}

.gallery-item:hover .gallery-item-cn {
    transform: translateY(0);
}

.gallery-item:hover .gallery-item-title {
    transform: translateY(0);
}

/* fade-in on scroll */
.gallery-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), box-shadow 0.5s var(--ease);
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- About --- */
.about {
    background: var(--bg);
}

.about-content {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    max-width: 580px;
}

.about-text p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about-text p:first-child {
    color: var(--text);
    font-size: 1.05rem;
}

.about-credit {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--accent) !important;
    font-size: 0.9rem !important;
}

/* --- Footer --- */
footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
}

.footer-inner {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-domain {
    color: var(--accent);
}

/* --- Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
    animation: lightboxIn 0.3s var(--ease);
}

.lightbox.active {
    display: flex;
}

@keyframes lightboxIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

.lightbox-caption {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.4;
    transition: opacity 0.3s;
    line-height: 1;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 0.5rem;
}

.lightbox-next {
    right: 0.5rem;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-text {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    nav {
        padding: 1rem 1.25rem;
    }
    section {
        padding: 4rem 1.25rem;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .lightbox-nav {
        font-size: 2rem;
        padding: 0.5rem;
    }
    .lightbox-prev { left: 0.25rem; }
    .lightbox-next { right: 0.25rem; }
    .hero-title {
        font-size: clamp(2.5rem, 15vw, 4rem);
    }
}
