/* mores.quest - Paper texture craft eclectic collage scrapbook */

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

body {
    background-color: #FDF6EC;
    color: #4A3828;
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Paper fiber grain texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.02;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(74, 56, 40, 0.3) 2px,
        rgba(74, 56, 40, 0.3) 3px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(74, 56, 40, 0.2) 3px,
        rgba(74, 56, 40, 0.2) 4px
    );
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
}

/* Coffee ring stains */
.coffee-ring {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    animation: coffeeAppear 3s ease forwards;
}

.ring-1 {
    width: 70px;
    height: 70px;
    top: 15%;
    right: 8%;
    background: radial-gradient(circle, transparent 55%, rgba(193,154,107,0.1) 60%, rgba(193,154,107,0.06) 70%, transparent 75%);
    animation-delay: 1s;
}

.ring-2 {
    width: 60px;
    height: 60px;
    top: 55%;
    left: 5%;
    background: radial-gradient(circle, transparent 50%, rgba(193,154,107,0.08) 58%, rgba(193,154,107,0.04) 68%, transparent 73%);
    animation-delay: 2s;
}

.ring-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    right: 12%;
    background: radial-gradient(circle, transparent 55%, rgba(193,154,107,0.1) 62%, rgba(193,154,107,0.05) 72%, transparent 78%);
    animation-delay: 2.5s;
}

@keyframes coffeeAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Navigation Tabs */
.tab-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #FDF6EC;
    display: flex;
    gap: 0;
    padding: 0 24px;
    border-bottom: 2px solid #C19A6B;
    overflow-x: auto;
}

.tab {
    font-family: 'Patrick Hand', cursive;
    font-size: 15px;
    color: #4A3828;
    background-color: #E8D5B7;
    border: 2px solid #C19A6B;
    border-bottom: none;
    padding: 10px 20px;
    cursor: pointer;
    position: relative;
    top: 2px;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
    transition: background-color 200ms ease;
}

.tab:hover {
    background-color: #F5ECD7;
}

.tab.active {
    background-color: #FDF6EC;
    border-bottom: 2px solid #FDF6EC;
    color: #2C1810;
    font-weight: 400;
}

/* Hero Journal */
.hero-journal {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    min-height: 50vh;
    overflow: hidden;
    padding: 40px 24px;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.journal-cover {
    flex: 0 0 340px;
    position: relative;
    transition: transform 800ms ease;
}

.cover-border {
    background-color: #E8D5B7;
    border: 3px solid #C19A6B;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Postage stamp border on cover */
.cover-border::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px dashed #C19A6B;
}

.cover-title {
    font-family: 'Patrick Hand', cursive;
    font-weight: 400;
    font-size: 44px;
    color: #2C1810;
    margin-bottom: 8px;
}

.cover-subtitle {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 15px;
    color: #4A3828;
    margin-bottom: 24px;
}

.cover-stamp {
    display: inline-block;
    border: 2px solid #8B0000;
    padding: 6px 16px;
    transform: rotate(-8deg);
    filter: url(#rough);
}

.stamp-text {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: #8B0000;
    letter-spacing: 2px;
}

.journal-content {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.journal-intro {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 17px;
    color: #4A3828;
    line-height: 1.8;
}

/* Masonry Grid */
.masonry-grid {
    position: relative;
    z-index: 1;
    column-count: 3;
    column-gap: 20px;
    padding: 40px 24px 80px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Artifact Cards */
.artifact-card {
    break-inside: avoid;
    background-color: #F5ECD7;
    border: 1px solid #C19A6B;
    padding: 28px 24px 20px;
    margin-bottom: 20px;
    position: relative;
    transform: rotate(var(--rotation, 0deg));
    opacity: 0;
    clip-path: polygon(
        0% 1%, 3% 0%, 8% 1%, 15% 0%, 22% 1%, 30% 0%, 38% 1%, 45% 0%,
        52% 1%, 60% 0%, 68% 1%, 75% 0%, 82% 1%, 90% 0%, 95% 1%, 100% 0%,
        100% 3%, 99% 10%, 100% 18%, 99% 25%, 100% 33%, 99% 40%, 100% 48%,
        99% 55%, 100% 63%, 99% 70%, 100% 78%, 99% 85%, 100% 92%, 99% 100%,
        95% 99%, 90% 100%, 82% 99%, 75% 100%, 68% 99%, 60% 100%, 52% 99%,
        45% 100%, 38% 99%, 30% 100%, 22% 99%, 15% 100%, 8% 99%, 3% 100%, 0% 99%,
        1% 92%, 0% 85%, 1% 78%, 0% 70%, 1% 63%, 0% 55%, 1% 48%,
        0% 40%, 1% 33%, 0% 25%, 1% 18%, 0% 10%, 1% 3%
    );
}

.artifact-card.visible {
    opacity: 1;
    transform: rotate(var(--rotation, 0deg)) scale(1);
    transition: opacity 400ms ease, transform 400ms ease;
}

/* Tape decorations */
.tape {
    position: absolute;
    width: 60px;
    height: 20px;
    background-color: rgba(193, 154, 107, 0.5);
    z-index: 2;
    opacity: 0;
    transform: scale(0);
}

.tape.visible {
    animation: tapeAppear 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tapeAppear {
    0% { opacity: 0; transform: scale(0); }
    70% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.tape-top-left {
    top: -6px;
    left: 16px;
    transform-origin: center center;
    rotate: -15deg;
}

.tape-top-right {
    top: -6px;
    right: 16px;
    transform-origin: center center;
    rotate: 12deg;
}

/* Card stamp */
.card-stamp {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 2px solid #8B0000;
    padding: 3px 8px;
    transform: rotate(6deg);
    filter: url(#rough);
    opacity: 0;
}

.card-stamp.visible {
    animation: tapeAppear 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.stamp-label {
    font-family: 'Courier Prime', monospace;
    font-size: 9px;
    text-transform: uppercase;
    color: #8B0000;
    letter-spacing: 1px;
    white-space: nowrap;
}

.card-title {
    font-family: 'Patrick Hand', cursive;
    font-weight: 400;
    font-size: 28px;
    color: #2C1810;
    margin-bottom: 10px;
    line-height: 1.2;
}

.card-body {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 15px;
    color: #4A3828;
    line-height: 1.7;
    margin-bottom: 12px;
}

.card-date {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    text-transform: uppercase;
    color: #2E5A3E;
    display: block;
}

/* Card hidden during filtering */
.artifact-card.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }

    .hero-journal {
        flex-direction: column;
        align-items: center;
    }

    .journal-cover {
        flex: 0 0 auto;
    }
}

@media (max-width: 600px) {
    .masonry-grid {
        column-count: 1;
    }

    .cover-title {
        font-size: 32px;
    }

    .tab-nav {
        padding: 0 12px;
    }

    .tab {
        padding: 8px 14px;
        font-size: 13px;
    }
}
