:root {
    --sapphire: #1B3A6B;
    --emerald: #2E6B4F;
    --ruby: #9B2335;
    --amber: #C4962C;
    --amethyst: #5B3E7A;
    --parchment: #F5F0E6;
    --ivory: #FFF8EE;
    --binding: #2A1F14;
    --ink-wash: #6B5E52;
    --cyan-slip: #3B8EA5;
    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'Source Serif 4', Georgia, serif;
    --font-hand: 'Caveat', cursive;
    --font-label: 'Barlow', sans-serif;
}

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

html { font-size: 16px; }

body {
    background-color: var(--parchment);
    color: var(--binding);
    font-family: var(--font-body);
    min-height: 100vh;
}

/* Title Page */
.title-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(ellipse at 40% 50%, rgba(196, 150, 44, 0.06) 0%, transparent 60%),
        var(--parchment);
}

.title-page-inner {
    max-width: 500px;
    padding: 2rem;
}

.title-vignette {
    margin-bottom: 2rem;
    opacity: 0.6;
}

.title-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--binding);
    text-shadow: -2px -1px 0 rgba(59, 142, 165, 0.3);
    margin-bottom: 1rem;
}

.title-annotation {
    font-family: var(--font-hand);
    font-weight: 400;
    font-size: 1.3rem;
    color: var(--ruby);
}

/* Masonry Container */
.masonry-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 3fr 4fr 3fr;
    gap: 2rem;
    align-items: start;
}

/* Artifact Cards */
.artifact-card {
    transform: rotate(var(--rotation, 0deg));
    margin-bottom: var(--gap, 1.6rem);
    break-inside: avoid;
    position: relative;
}

/* Notebook Page */
.notebook-page {
    background: var(--parchment);
    background-image: repeating-linear-gradient(
        transparent, transparent calc(1.6em - 1px), #D4C9B0 calc(1.6em - 1px), #D4C9B0 1.6em
    );
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    clip-path: polygon(0 0, 3% 2%, 1% 5%, 4% 8%, 0 12%, 2% 100%, 100% 100%, 100% 0);
    box-shadow: 2px 3px 12px rgba(42, 31, 20, 0.12);
}

/* Newspaper Clipping */
.newspaper-clipping {
    background: #EBEBDF;
    max-width: 280px;
    padding: 1.2rem 1rem;
    border-top: 2px solid var(--binding);
    border-bottom: 2px solid var(--binding);
    text-align: justify;
}

.clipping-headline {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

/* Index Card */
.index-card {
    background: var(--ivory);
    border-radius: 2px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 1px 2px 8px rgba(42, 31, 20, 0.08);
}

.index-card::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 33%;
    height: 1px;
    background: #D4C9B0;
    opacity: 0.5;
}

.pin-hole {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    border: 1px solid #8B7355;
    margin: 0 auto 1rem;
}

.index-content {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    font-style: italic;
}

/* Margin Note Card */
.margin-note-card {
    max-width: 180px;
    padding: 0.5rem;
}

.margin-annotation {
    font-family: var(--font-hand);
    font-size: 1rem;
    line-height: 1.4;
}

/* Pamphlet Fold */
.pamphlet-fold {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    background: var(--parchment);
    box-shadow: 2px 3px 12px rgba(42, 31, 20, 0.1);
}

.pamphlet-left {
    padding: 1.5rem;
    background: var(--parchment);
}

.pamphlet-crease {
    width: 1px;
    background: var(--ink-wash);
    opacity: 0.3;
    border-style: dashed;
}

.pamphlet-right {
    padding: 1.5rem;
    background: #F0EBE0;
}

/* Typography */
.card-label {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-wash);
    display: block;
    margin-bottom: 0.5rem;
}

.card-headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.15;
    margin-bottom: 1rem;
    text-shadow: -2px -1px 0 rgba(59, 142, 165, 0.2);
}

.card-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    margin-bottom: 1rem;
}

.card-body:last-child {
    margin-bottom: 0;
}

.drop-cap {
    float: left;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 3.5rem;
    line-height: 0.8;
    padding-right: 0.1em;
    color: var(--amber);
}

.card-quote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 2px solid var(--amethyst);
    font-style: italic;
    color: var(--amethyst);
}

.card-quote cite {
    display: block;
    font-family: var(--font-hand);
    font-style: normal;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--ink-wash);
}

/* Back Cover */
.back-cover {
    padding: 4rem 2rem 6rem;
    text-align: center;
    max-width: 480px;
    margin: 4rem auto 0;
}

.colophon-text {
    font-family: var(--font-hand);
    font-size: 0.9rem;
    color: var(--ink-wash);
    line-height: 1.6;
}

/* Fade Reveal */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotation, 0deg));
}

@media (prefers-reduced-motion: reduce) {
    .fade-reveal {
        transition: none;
        opacity: 1;
        transform: rotate(var(--rotation, 0deg));
    }
}

@media (max-width: 1024px) {
    .masonry-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .masonry-container {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .newspaper-clipping {
        max-width: 100%;
    }
    .margin-note-card {
        max-width: 100%;
    }
    .pamphlet-fold {
        grid-template-columns: 1fr;
    }
    .pamphlet-crease {
        height: 1px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .card-body {
        font-size: 0.95rem;
    }
    .card-headline {
        font-size: 1.3rem;
    }
    .title-heading {
        font-size: 2.2rem;
    }
}
