/* ============================================
   prototype.st — Vaporwave Honeyed Library
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #5A4A30;
    background-color: #FBF4E8;
    overflow-x: hidden;
    position: relative;
}

/* --- Scholarly Marginalia Background --- */
.marginalia {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.marginalia-icon {
    position: absolute;
    opacity: 0.06;
    color: #A08858;
    fill: #A08858;
    transition: opacity 0.6s ease;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 1;
    padding: 40px 24px;
}

/* Vaporwave Pink Accent Glow */
.hero-vaporwave-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 160, 176, 0.1) 0%, rgba(224, 160, 176, 0.04) 40%, transparent 70%);
    pointer-events: none;
    animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.hero-inner {
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 1.2s ease-out 0.3s forwards;
}

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

.hero-catalog-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    opacity: 0;
    animation: labelFadeIn 0.8s ease-out 0.8s forwards;
}

@keyframes labelFadeIn {
    to {
        opacity: 1;
    }
}

.catalog-number,
.catalog-date {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: #A08858;
}

.catalog-divider {
    width: 40px;
    height: 1px;
    background: #D8C8A8;
}

.hero-title {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    color: #2A2010;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E0A0B0, transparent);
    animation: titleLineExpand 1s ease-out 1.2s forwards;
}

@keyframes titleLineExpand {
    to { width: 80%; }
}

.hero-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: #8A7050;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-ornament {
    margin-bottom: 24px;
}

.hero-description {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #5A4A30;
    line-height: 1.85;
    max-width: 540px;
    margin: 0 auto;
}

.hero-scroll-hint {
    margin-top: 48px;
    opacity: 0;
    animation: scrollHintFadeIn 1s ease-out 2s forwards;
}

@keyframes scrollHintFadeIn {
    to { opacity: 0.5; }
}

.scroll-dot {
    animation: scrollDotBounce 2s ease-in-out infinite;
}

@keyframes scrollDotBounce {
    0%, 100% { cy: 8; opacity: 1; }
    50% { cy: 18; opacity: 0.3; }
}

/* --- Library Main Section --- */
.library {
    position: relative;
    z-index: 1;
    padding: 60px 24px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.library-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 48px;
}

.section-title {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #2A2010;
    text-align: center;
}

.section-divider {
    opacity: 0.6;
}

/* --- Filter Tags --- */
.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tag {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #A08858;
    background: transparent;
    border: 1px solid #D8C8A8;
    border-radius: 3px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    background: #FFF8EE;
    border-color: #A08858;
}

.filter-tag.active {
    background: #A08858;
    color: #FFF8EE;
    border-color: #A08858;
}

/* --- Card Grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* --- Individual Card --- */
.card {
    background: #FFF8EE;
    border: 1px solid #D8C8A8;
    border-radius: 6px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.5s ease-out, box-shadow 0.5s ease-out;
    transform-style: preserve-3d;
    cursor: default;
    opacity: 0;
    transform: translateY(20px);
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.card:hover {
    transform: perspective(800px) rotateY(2deg) rotateX(1deg);
    box-shadow:
        0 8px 32px rgba(90, 74, 48, 0.12),
        0 2px 8px rgba(90, 74, 48, 0.06);
}

.card.hidden {
    display: none;
}

/* Leather-texture edge — layered radial-gradient in warm brown tones */
.card-leather-edge {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(138, 112, 80, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(138, 112, 80, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(138, 112, 80, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, #8A7050 0%, #A08858 50%, #8A7050 100%);
    opacity: 0.5;
    border-radius: 6px 0 0 6px;
}

/* Bookmark ribbon — vaporwave pink */
.card-bookmark {
    position: absolute;
    top: -2px;
    right: 20px;
    width: 12px;
    height: 36px;
    background: #E0A0B0;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(-10px);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}

.card:hover .card-bookmark {
    opacity: 0.7;
    transform: translateY(0);
}

/* Card content */
.card-content {
    padding-left: 10px;
}

.card-catalog-number {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: #A08858;
    display: block;
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #2A2010;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-description {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: 0.88rem;
    color: #5A4A30;
    line-height: 1.75;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(160, 136, 88, 0.15);
    padding-top: 12px;
}

.card-tag {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FFF8EE;
    background: #A08858;
    padding: 3px 10px;
    border-radius: 2px;
}

.card-year {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: #A08858;
    letter-spacing: 0.1em;
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px 48px;
    border-top: 1px solid rgba(160, 136, 88, 0.1);
}

.footer-inner {
    max-width: 500px;
    margin: 0 auto;
}

.footer-ornament {
    margin-bottom: 20px;
}

.footer-text {
    font-family: 'Abril Fatface', serif;
    font-weight: 400;
    font-size: 1rem;
    color: #2A2010;
    margin-bottom: 6px;
}

.footer-catalog {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: #A08858;
    text-transform: uppercase;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FBF4E8;
}

::-webkit-scrollbar-thumb {
    background: #D8C8A8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A08858;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero {
        min-height: 80vh;
        padding: 60px 20px;
    }

    .library {
        padding: 40px 16px 60px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .library-header {
        margin-bottom: 32px;
    }

    .filter-tags {
        gap: 6px;
    }

    .filter-tag {
        font-size: 0.6rem;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .hero-catalog-label {
        gap: 10px;
    }

    .catalog-divider {
        width: 20px;
    }
}
