/* --- CSS VARIABLES --- 
   Define colors for Dark (default) and Light modes. 
   Changing these variables updates the entire site theme. 
*/
:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --accent-color: #ffffff;
    --secondary-text: #a0a0a0;
    --nav-bg: rgba(18, 18, 18, 0.8);
    --border-color: #333;
    --toast-bg: #333;
    --toast-text: #fff;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #121212;
    --accent-color: #000000;
    --secondary-text: #555555;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --border-color: #e0e0e0;
    --toast-bg: #000;
    --toast-text: #fff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* --- FLOATING HEADER --- 
   Fixed position pill-shaped menu that floats over content.
   Uses backdrop-filter for the blur effect.
*/
.site-header.floating-nav {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.site-header.floating-nav:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--text-color);
}

.logo {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-right: 2rem;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin-right: 2rem;
}

.site-nav a {
    text-decoration: none;
    color: var(--secondary-text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Theme Toggle */
.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    opacity: 0.8;
}

.theme-btn:hover {
    transform: rotate(15deg);
    opacity: 1;
}

.sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: block;
}

/* --- HERO SECTION --- 
   Full viewport height (100vh) with parallax background image.
*/
.hero-section {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background-image: url('images/Estrella_de_la_Muerte.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax effect */
}

/* Overlay for better text readability */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Dark overlay always for contrast */
    z-index: 1;
}

[data-theme="light"] .hero-section::before {
    background: rgba(255, 255, 255, 0.1);
    /* Lighter overlay in light mode if needed, but usually dark image needs dark text or vice versa. Let's keep text white on hero for now or adjust. */
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    /* Always white on hero image */
    animation: fadeIn 1.5s ease-out;
}

.hero-content h1 {
    font-size: 8rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content .subtitle {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.9;
    color: #e0e0e0;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: #ffffff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Main Content */
main {
    padding-top: 0;
    /* Reset padding as hero takes full screen */
}

/* --- MASONRY GALLERY --- 
   Uses CSS columns to create a pinterest-style layout 
   where images stack vertically in columns.
*/
.gallery-section {
    padding: 4rem 2rem;
}

.masonry-grid {
    column-count: 3;
    column-gap: 2rem;
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    border-radius: 0;
    /* Sharper, more modern look */
    overflow: hidden;
    position: relative;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), filter 0.3s ease;
    filter: grayscale(100%);
    /* Start fully grayscale */
}

.grid-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* About & Contact */
.about-section,
.contact-section {
    padding: 4rem 3rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

h2 {
    font-weight: 400;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

p {
    color: var(--secondary-text);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--secondary-text);
    padding-bottom: 2px;
    transition: border-color 0.2s ease;
}

.contact-link:hover {
    border-color: var(--text-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-text);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--toast-bg);
    color: var(--toast-text);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

/* --- RESPONSIVE DESIGN --- 
   Adjustments for Tablets (max-width: 1024px) and Mobiles (max-width: 768px).
*/
@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .site-header.floating-nav {
        top: 1rem;
        width: 90%;
        padding: 0.8rem 1.5rem;
    }

    .logo {
        margin-right: auto;
    }

    .site-nav {
        display: none;
        /* Hide nav links on mobile for simplicity, or add hamburger */
    }

    .masonry-grid {
        column-count: 1;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}