/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #f4f4f4;
    --text-color: #111;
    --accent-color: #333;
    --font-primary: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-secondary: 'Courier New', Courier, monospace;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

h1, h2, h3, h4 {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Navigation Toggle (Hamburger) */
#nav-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 25px;
    mix-blend-mode: difference; /* Ensures visibility on light/dark backgrounds */
}

#nav-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff; /* Will be inverted by mix-blend-mode */
    transition: all 0.3s ease;
}

/* Overlay Navigation */
#overlay-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #000;
    color: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#overlay-nav.active {
    opacity: 1;
    visibility: visible;
}

#nav-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
}

.nav-links li {
    margin: 20px 0;
    text-align: center;
}

.nav-links a {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    color: #fff;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #888;
    text-decoration: line-through;
}

.nav-contact {
    margin-top: 50px;
    display: flex;
    gap: 20px;
}

.nav-contact img {
    width: 30px;
    height: 30px;
    filter: invert(1); /* Make icons white */
}

/* Section 1: Landing */
#landing {
    height: 100vh;
    width: 100%;
    background-image: url('../images/landing_background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-end; /* Content at bottom */
    justify-content: flex-start;
}

.landing-content {
    padding: 50px;
    color: #fff;
    /* Brutalist text shadow or background */
    text-shadow: 2px 2px 0px #000;
}

.landing-content h1 {
    font-size: 5rem;
    line-height: 0.9;
    margin-bottom: 10px;
}

.landing-content h2 {
    font-size: 1.5rem;
    font-family: var(--font-secondary);
    font-weight: 400;
    letter-spacing: 0.1em;
}

/* Section 2: About Me */
#about {
    padding: 100px 0;
    background-color: var(--bg-color);
}

#about h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    border-bottom: 3px solid #000;
    display: inline-block;
    padding-bottom: 10px;
}

.about-text {
    font-size: 1.5rem;
    max-width: 800px;
    font-weight: 300;
}

.about-text p {
    margin-bottom: 20px;
}

/* Section 3: Books */
#books {
    padding: 100px 0;
    background-color: #e5e5e5; /* Slightly darker section */
}

#books h3 {
    font-size: 2rem;
    margin-bottom: 40px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.book-item {
    display: block;
    transition: transform 0.3s ease;
}

.book-item:hover {
    transform: translateY(-5px);
}

.book-thumb {
    width: 100%;
    aspect-ratio: 2 / 3; /* Standard book ratio */
    background-color: #ccc;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #000;
    box-shadow: 5px 5px 0px #000; /* Brutalist shadow */
}

.book-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.book-info p {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    color: #555;
}

/* Section 4: Gallery */
#gallery {
    padding: 100px 0;
}

#gallery h3 {
    font-size: 2rem;
    margin-bottom: 40px;
    padding-left: 20px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-rows: 300px;
    gap: 20px;
}

/* Make grid interesting - some items span 2 columns or rows */
.gallery-item:nth-child(2n) {
    grid-column: span 2;
}
.gallery-item:nth-child(3n) {
    grid-row: span 1; /* Reset */
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    border: 1px solid #000;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.9;
}

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

.gallery-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.gallery-item .overlay p {
    color: #fff;
    font-family: var(--font-secondary);
    font-size: 1.2rem;
    text-transform: uppercase;
    border: 1px solid #fff;
    padding: 10px 20px;
}

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

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
}

#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
    font-family: var(--font-secondary);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Section 5: Footer */
footer {
    background-color: #111;
    color: #fff;
    padding: 50px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
}

.footer-links a:hover {
    color: #fff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .landing-content h1 {
        font-size: 3rem;
    }
    
    .gallery-item:nth-child(2n) {
        grid-column: span 1; /* Reset spans on mobile */
    }

    .nav-links a {
        font-size: 2rem;
    }
}
