/* ==========================================
   0. CUSTOM ATMOSPHERIC SCROLLBAR
   ========================================== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #000;
}
::-webkit-scrollbar-thumb {
    background: #24150d; /* Matches dark bookshelf wood */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4b2b1d;
}

/* ==========================================
   1. RESET & GLOBAL FOUNDATIONS
   ========================================== */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Georgia, serif;
    background: #000;
    color: white;
    overflow-x: hidden;
}

/* ==========================================
   2. FIXED NAVIGATION LINK BAR
   ========================================== */
nav {
    position: fixed;
    top: 20px;
    right: 50px;
    z-index: 100;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 25px;
    font-size: 1rem;
    opacity: 0.6;
    transition: 0.3s;
}

nav a:hover, nav a.active {
    opacity: 1;
    text-shadow: 0 0 8px rgba(255,255,255,0.4);
}

nav a.active {
    border-bottom: 1px solid white;
    padding-bottom: 4px;
}

/* ==========================================
   3. HERO SECTION & ATMOSPHERIC OVERLAY
   ========================================== */
.hero {
    height: 100vh;
    background-image: url("background.jpg");
    background-size: cover;
    background-position: center;
    position: relative;
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.70);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 5rem;
    letter-spacing: 6px;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

h2 {
    margin-top: 10px;
    font-weight: normal;
}

.subtitle {
    margin-top: 12px;
    letter-spacing: 3px;
    opacity: 0.8;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* Container safety zone to keep components separate */
.quote-container {
    margin-top: 40px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 700px;
}

.hero-content .quote {
    font-size: 2rem;
    line-height: 1.6;
    color: white;
    font-style: italic;
    transition: opacity 0.5s ease;
    text-align: center;
}

.author {
    margin-top: 15px;
    opacity: 0.8;
    transition: opacity 0.5s ease;
    font-size: 1.1rem;
}

.btn {
    margin-top: 40px;
    text-decoration: none;
    color: white;
    border: 1px solid white;
    padding: 12px 30px;
    transition: 0.3s;
}

.btn:hover {
    background: white;
    color: black;
}

/* ==========================================
   4. LAYOUT SECTIONS & ANIMATION TRIGGERS
   ========================================== */
section {
    padding: 120px 10%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

section.show {
    opacity: 1;
    transform: translateY(0);
}

#about {
    padding: 100px 10%;
}

#about p {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
}

/* ==========================================
   5. BOOKSHELF DISPLAY LAYOUT
   ========================================== */
#library {
    padding: 120px 10%;
}

.library-quote {
    font-style: italic;
    opacity: 0.7;
    margin-bottom: 30px;
}

.bookshelf {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 25px;
    margin-top: 50px;
    margin-bottom: 120px;
}

.bookshelf::after {
    content: "";
    position: absolute;
    width: 100%;
    max-width: 850px;
    height: 12px;
    background: #24150d;
    top: 280px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    z-index: 1;
}

.shelf-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 180px;
}

.book-cover {
    width: 180px;
    height: 280px;
    overflow: hidden;
    transition: 0.4s ease;
    cursor: pointer;
    border-radius: 4px;
    z-index: 2;
    transform-origin: bottom;
}

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

.book-cover:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.shelf-title {
    margin-top: 25px;
    font-size: 0.95rem;
    font-style: italic;
    opacity: 0.7;
    color: white;
    text-align: center;
    line-height: 1.3;
}

/* ==========================================
   6. SECONDARY TEXT LIBRARY GRID
   ========================================== */
.library-title {
    text-align: center;
    margin-bottom: 40px;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.library-book {
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    transition: 0.3s;
}

.library-book:hover {
    border-color: white;
    transform: translateY(-5px);
}

/* ==========================================
   7. STATIONARY LITERARY CARDS SECTION
   ========================================== */
#quotes {
    padding: 120px 10%;
}

#quotes h2 {
    text-align: center;
    margin-bottom: 60px;
}

.quote-card {
    max-width: 900px;
    margin: 30px auto;
    padding: 40px;
    background: #111;
    border-left: 4px solid #4b2b1d;
    transition: 0.3s;
}

.quote-card:hover {
    transform: translateX(10px);
    background: #161616;
}

.quote-card p {
    font-size: 1.4rem;
    line-height: 1.8;
    font-style: italic;
}

.quote-card span {
    display: block;
    margin-top: 20px;
    opacity: 0.7;
}

.personal-quote {
    border-left-color: #72412c;
    background: #0d0d0d;
}

/* ==========================================
   8. CONTACT FOOTER STYLING
   ========================================== */
#contact {
    padding: 120px 10%;
    text-align: center;
}

#contact h2 {
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.contact-text {
    font-style: italic;
    opacity: 0.6;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.contact-details {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-link {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 30px;
    background: #111;
    transition: 0.3s ease;
    letter-spacing: 1px;
}

.contact-link span {
    font-family: monospace;
    opacity: 0.8;
}

.contact-link:hover {
    border-color: white;
    background: #161616;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* ==========================================
   9. FLOATING BACKGROUND PARTICLE EFFECT
   ========================================== */
.particle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    opacity: 0.2;
    border-radius: 50%;
    pointer-events: none;
    top: -10px;
    animation: float linear infinite;
}

@keyframes float {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(110vh);
    }
}