:root {
    --bg-color: #0a0a0a;
    --card-bg: #1a1a1a;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --accent-gold: #d4af37;
    --accent-gold-glow: rgba(212, 175, 55, 0.3);
    --transition-slow: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --font-title: 'Ma Shan Zheng', cursive;
    --font-body: 'Noto Serif SC', serif;
    --font-accent: 'Zhi Mang+Xing', cursive;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 1s ease;
}

.ink-drop {
    width: 50px;
    height: 50px;
    background: var(--accent-gold);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.5); opacity: 0.2; }
    100% { transform: scale(1); opacity: 0.8; }
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    z-index: 1000;
    transition: background var(--transition-slow);
}

nav.scrolled {
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

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

.logo {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--accent-gold);
    letter-spacing: 2px;
}

.logo span {
    color: #fff;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 300;
    transition: color 0.3s;
    font-size: 0.9rem;
}

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

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

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1.1);
    filter: brightness(0.6);
    animation: zoomOut 20s infinite alternate;
}

@keyframes zoomOut {
    from { transform: scale(1.1); }
    to { transform: scale(1); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 60%, var(--bg-color));
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 10;
}

.hero-content h2 {
    font-family: var(--font-title);
    font-size: 5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #fff, var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    letter-spacing: 5px;
}

.cta-button {
    padding: 12px 40px;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.4s;
    background: transparent;
}

.cta-button:hover {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 20px var(--accent-gold-glow);
}

/* Gallery Section */
.gallery-section {
    padding: 100px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 60px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-header h3 {
    font-family: var(--font-title);
    font-size: 3rem;
    color: var(--accent-gold);
}

.filter-bar input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--text-secondary);
    color: #fff;
    padding: 10px;
    width: 300px;
    outline: none;
    font-family: var(--font-body);
}

/* Poem Grid */
.poem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.poem-card {
    background: var(--card-bg);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s var(--transition-slow), box-shadow 0.4s;
    position: relative;
}

.poem-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--transition-slow), opacity 0.5s ease;
    opacity: 0;
}

.card-image img.loaded {
    opacity: 1;
}

.poem-card:hover .card-image img {
    transform: scale(1.1);
}

.card-info {
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.poem-id {
    font-size: 0.7rem;
    color: var(--accent-gold);
    margin-bottom: 5px;
    font-family: var(--font-body);
}

.card-info h4 {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 2px;
}

.author-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    max-width: 1400px;
    margin: 50px auto;
    display: flex;
    gap: 50px;
    padding: 20px;
}

.modal-image-container {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-image-container img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-text {
    flex: 1;
    text-align: left;
}

#modal-title {
    font-family: var(--font-title);
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

#modal-author {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.poem-body {
    font-size: 1.2rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 2;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 15px;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 50px;
    font-size: 3rem;
    color: #fff;
    cursor: pointer;
}

/* Footer */
footer {
    padding: 50px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content p {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-content { padding: 0 20px; }
    .hero-content h2 { font-size: 3rem; }
    .modal-content { flex-direction: column; }
    .modal-image-container { height: 40%; }
    .modal { padding: 20px; }
    .close-modal { top: 10px; right: 20px; }
}
