:root {
    --bg-color: #f9f9f7; /* Off-white / Cream */
    --card-bg: #ffffff;
    --text-main: #2c2c2c;
    --text-muted: #666666;
    --accent: #b8860b; /* Dark Goldenrod - visible on light bg */
    --shadow-color: rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animation - Subtle Light */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(45deg, #f9f9f7, #f0f0eb, #fdfdfb);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    transition: filter 1s ease;
}

/* Ripple / Pulse Effect when Music Playing */
body.music-playing .background-animation {
    /* Removed pulse animation as requested */
    animation: gradientBG 15s ease infinite;
}

@keyframes pulseLight {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.03) hue-rotate(-5deg); }
    100% { filter: brightness(1); }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

header {
    text-align: center;
    padding: 5rem 1rem 3rem;
    animation: fadeInDown 1s ease-out;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
    color: var(--text-main);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-style: italic;
    font-family: 'Playfair Display', serif;
}

/* Sections */
.gallery-section {
    max-width: 1600px;
    margin: 0 auto 4rem;
    padding: 0 40px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--accent);
    margin: 10px auto 0;
}

/* Gallery Grid */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px; /* Larger gap for gallery feel */
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px; /* Sharper corners for gallery look */
    cursor: pointer;
    aspect-ratio: 1 / 1;
    background-color: var(--card-bg);
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    padding: 10px; /* Frame effect */
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    filter: brightness(0.95); /* Slightly muted initially */
}

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

.gallery-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.95); /* Light overlay */
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 1100px;
    background-color: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    animation: zoomIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #eee;
}

@media (min-width: 768px) {
    .modal-content {
        flex-direction: row;
        height: 75vh;
    }
}

.close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    margin: 0;
    padding: 4px 10px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 35px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s;
}

.close-button:hover {
    color: var(--accent);
}

.modal-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-image-container {
    flex: 1.2; /* Give image more space */
    background-color: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-info {
    flex: 0.8;
    padding: 50px;
    overflow-y: auto;
    background-color: var(--card-bg);
}

#modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: var(--text-main);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 15px;
    display: inline-block;
}

/* Markdown Styles */
.markdown-body {
    line-height: 1.8;
    color: var(--text-main);
    font-size: 1.05rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: var(--text-main);
    font-family: 'Playfair Display', serif;
}

.markdown-body p {
    margin-bottom: 1.2em;
}

.markdown-body strong {
    color: var(--accent);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Music Player - Flat & Hidden Design */
#music-player-container {
    position: fixed;
    bottom: 40px;
    right: 0;
    display: flex;
    align-items: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    box-shadow: -5px 5px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    border-right: none;
    
    /* Hidden State */
    transform: translateX(calc(100% - 50px)); /* Show only handle */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#music-player-container:hover {
    transform: translateX(0);
}

.player-handle {
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent);
    font-size: 1.5rem;
    padding-right: 10px;
}

.player-content {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 15px;
}

/* Flat Gramophone Icon */
.flat-gramophone {
    position: relative;
    width: 60px;
    height: 60px;
}

.flat-record-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.flat-record {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1a1a1a;
    position: relative;
    /* Grooves */
    background-image: repeating-radial-gradient(
        #1a1a1a 0, 
        #1a1a1a 2px, 
        #2a2a2a 3px, 
        #2a2a2a 4px
    );
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    animation: spin 4s linear infinite;
    animation-play-state: paused;
}

/* Shine on record */
.flat-record::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
}

.flat-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid #1a1a1a;
}

.flat-tonearm {
    position: absolute;
    top: 5px; /* Lower down */
    right: 0px; /* Aligned with edge */
    width: 35px; /* Shorter */
    height: 4px;
    background: #888;
    transform-origin: right center;
    transform: rotate(0deg); /* Parked */
    transition: transform 0.5s ease;
    border-radius: 2px;
    z-index: 10;
}

.flat-tonearm::before {
    content: '';
    position: absolute;
    right: -3px;
    top: -3px;
    width: 10px;
    height: 10px;
    background: #555;
    border-radius: 50%;
}

/* Playing State */
.playing .flat-record {
    animation-play-state: running;
}

.playing .flat-tonearm {
    transform: rotate(-25deg); /* Playing: Rotates inwards to center (Counter-Clockwise) */
}

/* Music Info & Scrolling Title */
.music-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 120px; /* Reduced width */
}

.music-title-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 5px;
    mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 5%, black 95%, transparent 100%);
}

.music-title {
    display: inline-block;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: var(--text-main);
    padding-left: 100%; /* Start off-screen */
    animation: scroll-text 12s linear infinite;
}

@keyframes scroll-text {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.music-controls {
    display: flex;
    justify-content: center;
    width: 100%;
}

.control-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--accent);
    padding: 5px;
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: scale(1.1);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
