/* ============================================
   monopole.bar — Dark Academia Reading Room
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Merriweather', Georgia, serif;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.9;
    color: #5A4A3A;
    background: #F0E8D8;
    overflow-x: hidden;
}

/* === Grain Overlay === */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* === Dust Motes === */
#dust-motes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.dust-mote {
    position: absolute;
    border-radius: 50%;
    background: #C8B890;
    opacity: 0;
    will-change: transform, opacity;
}

/* === Ripple Container === */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    border: 1.5px solid #8A7A60;
    opacity: 0;
    transform: scale(0);
    animation: ripple-expand 1.2s ease-out forwards;
    pointer-events: none;
}

.ripple-letter {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #8A7A60;
    opacity: 0;
    transform: scale(0);
    animation: ripple-letter-expand 2s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-expand {
    0% {
        transform: scale(0);
        opacity: 0.15;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes ripple-letter-expand {
    0% {
        transform: scale(0);
        opacity: 0.12;
    }
    50% {
        opacity: 0.06;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* === Parallax Sections === */
.parallax-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    z-index: 0;
    will-change: transform;
}

.parallax-mid {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 6rem 2rem;
}

/* === Curve Dividers === */
.curve-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    z-index: 3;
    display: block;
}

.curve-divider path {
    transition: d 0.6s ease;
}

/* === Hero Section === */
#hero {
    background: #F0E8D8;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hero .parallax-bg {
    background: radial-gradient(ellipse at 50% 40%, #F0E8D8 0%, #D8C8A8 70%, #C8B890 100%);
}

#hero-content {
    text-align: center;
    opacity: 0;
    animation: hero-fade-in 2s ease-out 0.3s forwards;
}

@keyframes hero-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#site-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #3A2A1A;
    letter-spacing: 0.35em;
    margin-bottom: 1rem;
    position: relative;
}

#site-title .letter {
    display: inline-block;
    opacity: 0;
    animation: letter-appear 0.6s ease-out forwards;
}

.hero-subtitle {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    color: #8A7A60;
    letter-spacing: 0.15em;
    opacity: 0;
    animation: subtitle-fade 1.5s ease-out 1.8s forwards;
}

@keyframes subtitle-fade {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes letter-appear {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Collection Section === */
#collection {
    background: #D8C8A8;
}

#collection .parallax-bg {
    background: linear-gradient(180deg, #D8C8A8 0%, #C8B890 100%);
}

/* === Section Content === */
.section-content {
    max-width: 780px;
    width: 100%;
    padding: 2rem 0;
}

.section-heading {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: #3A2A1A;
    margin-bottom: 2rem;
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-body {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 300;
    color: #5A4A3A;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.section-body.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Pull Quote === */
.pull-quote {
    border-left: 3px solid #8A7A60;
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    background: rgba(240, 232, 216, 0.4);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}

.pull-quote.visible {
    opacity: 1;
    transform: translateX(0);
}

.pull-quote p {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    color: #8A7A60;
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.pull-quote cite {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 0.85rem;
    color: #6A5A40;
    letter-spacing: 0.05em;
}

/* === Reading Room Section === */
#reading-room {
    background: #F0E8D8;
}

#reading-room .parallax-bg {
    background: radial-gradient(ellipse at 30% 50%, #F0E8D8 0%, #D8C8A8 100%);
}

.room-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 1rem;
}

.room-card {
    background: rgba(216, 200, 168, 0.35);
    border: 1px solid rgba(138, 122, 96, 0.2);
    padding: 2.5rem 2rem;
    text-align: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.room-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.room-card:nth-child(2) {
    transition-delay: 0.15s;
}

.room-card:nth-child(3) {
    transition-delay: 0.3s;
}

.room-card:hover {
    box-shadow: 0 8px 32px rgba(58, 42, 26, 0.12);
    background: rgba(216, 200, 168, 0.5);
}

.card-icon {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.card-icon svg {
    width: 48px;
    height: 48px;
}

.card-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #3A2A1A;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.card-text {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: #5A4A3A;
    line-height: 1.8;
}

/* === Journal Section === */
#journal {
    background: #D8C8A8;
}

#journal .parallax-bg {
    background: linear-gradient(180deg, #D8C8A8 0%, #C8B890 60%, #8A7A60 100%);
}

.journal-entries {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.journal-entry {
    padding: 2.5rem;
    background: rgba(240, 232, 216, 0.5);
    border-left: 2px solid #8A7A60;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.journal-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.journal-entry:nth-child(2) {
    transition-delay: 0.15s;
}

.journal-entry:nth-child(3) {
    transition-delay: 0.3s;
}

.entry-date {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    color: #8A7A60;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

.entry-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    color: #3A2A1A;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
}

.entry-excerpt {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 300;
    color: #5A4A3A;
    line-height: 1.9;
}

/* === Closing Section === */
#closing {
    background: #2A1A10;
    min-height: 70vh;
}

#closing .parallax-bg {
    background: radial-gradient(ellipse at 50% 50%, #3A2A1A 0%, #2A1A10 100%);
}

.closing-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closing-quote {
    border-left: none;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.closing-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.closing-quote p {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #C8B890;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.closing-quote cite {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 0.9rem;
    color: #8A7A60;
    letter-spacing: 0.1em;
}

.closing-mark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 1s ease 0.3s;
}

.closing-mark.visible {
    opacity: 1;
}

.mark-text {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #6A5A40;
    letter-spacing: 0.4em;
}

.mark-year {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 0.75rem;
    color: #8A7A60;
    letter-spacing: 0.15em;
}

/* === Responsive === */
@media (max-width: 900px) {
    .room-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .parallax-mid {
        padding: 4rem 1.5rem;
    }

    #site-title {
        letter-spacing: 0.15em;
    }
}

@media (max-width: 600px) {
    .section-content {
        padding: 1rem 0;
    }

    .journal-entry {
        padding: 1.5rem;
    }

    .pull-quote {
        padding: 1rem 1.5rem;
    }

    .room-card {
        padding: 2rem 1.5rem;
    }

    .parallax-mid {
        padding: 3rem 1.25rem;
    }
}

/* === Selection Color === */
::selection {
    background: #C8B890;
    color: #3A2A1A;
}
