/* ===== CSS Custom Properties ===== */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@property --holo-pos {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: false;
}

:root {
    --walnut: #3b2f1e;
    --antiquarian-gold: #c4a97d;
    --parchment: #f4e8d0;
    --brass: #8b6f4e;
    --linen: #e0ceb2;
    --holo-orchid: #d4a0e8;
    --holo-cyan: #7ecbe6;
    --holo-amber: #e8d06a;
    --mahogany: #1e1a14;
    --holo-gradient: linear-gradient(135deg, #d4a0e8, #7ecbe6, #e8d06a);
}

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    line-height: 1.72;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--walnut);
    background: var(--parchment);
    overflow-x: hidden;
}

/* ===== Dot-grid background texture ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(196, 169, 125, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* ===== Spread Base ===== */
.spread {
    min-height: 100vh;
    scroll-snap-align: start;
    display: grid;
    position: relative;
    z-index: 1;
}

/* ===== Holographic Separators ===== */
.holo-separator {
    position: fixed;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--holo-gradient);
    background-size: 200% 100%;
    animation: holoShift 4s linear infinite;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
}

@keyframes holoShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ===== COVER SPREAD ===== */
.spread-cover {
    grid-template-columns: 3fr 2fr;
    background: var(--parchment);
}

.spread-cover .spread-visual {
    position: relative;
    overflow: hidden;
}

.cover-photo {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(59,47,30,0.3) 0%, transparent 60%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="800"><rect fill="%238b6f4e" width="800" height="800"/><rect fill="%23a08060" x="100" y="100" width="250" height="250" rx="8"/><rect fill="%23705838" x="400" y="150" width="300" height="200" rx="4"/><rect fill="%23c4a97d" x="150" y="400" width="200" height="300" rx="6"/><circle fill="%23957550" cx="600" cy="500" r="120"/><rect fill="%239a7e58" x="50" y="650" width="350" height="100" rx="8"/></svg>');
    background-size: cover;
    background-position: center;
    filter: sepia(0.6) contrast(1.1) saturate(0.8);
}

.sepia-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(2px);
    background: rgba(244, 232, 208, 0.15);
}

.cover-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    position: relative;
}

.wordmark {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 6vw, 6rem);
    letter-spacing: 0.12em;
    background: conic-gradient(from var(--angle), #d4a0e8, #7ecbe6, #e8d06a, #d4a0e8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: rotateConic 6s linear infinite;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.wordmark.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes rotateConic {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}

.tagline {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--brass);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
    margin-top: 1rem;
}

.tagline.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--antiquarian-gold);
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.15); }
}

/* ===== MANIFESTO SPREAD ===== */
.spread-manifesto {
    grid-template-columns: 3fr 2fr;
    background: var(--linen);
}

.spread-manifesto .spread-visual {
    position: relative;
    overflow: hidden;
}

.manifesto-photo {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(212, 160, 232, 0.15), rgba(126, 203, 230, 0.1), rgba(232, 208, 106, 0.1)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="800"><rect fill="%237a6040" width="800" height="800"/><ellipse fill="%23a08868" cx="400" cy="350" rx="250" ry="200"/><rect fill="%23604830" x="200" y="300" width="120" height="80" rx="4"/><rect fill="%23685038" x="350" y="280" width="100" height="100" rx="4"/><circle fill="%23c4a97d" cx="300" cy="400" r="30"/><circle fill="%23b09070" cx="450" cy="380" r="20"/></svg>');
    background-size: cover;
    background-position: center;
    filter: sepia(0.6) contrast(1.1) saturate(0.8);
    opacity: 0.3;
    transition: opacity 0.6s ease;
}

.manifesto-photo.visible {
    opacity: 1;
}

.manifesto-text {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.guilloche-border {
    position: absolute;
    inset: 1rem;
    pointer-events: none;
}

.guilloche-svg {
    width: 100%;
    height: 100%;
}

.guilloche-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 1.2s ease;
}

.guilloche-path.drawn {
    stroke-dashoffset: 0;
}

/* Corner ornaments */
.corner-ornament {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.corner-ornament::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--brass);
    border-radius: 0 0 100% 0;
}

.top-left { top: 1.5rem; left: 1.5rem; }
.top-left::before { border-radius: 0 0 100% 0; border-top: none; border-left: none; }
.top-right { top: 1.5rem; right: 1.5rem; }
.top-right::before { border-radius: 0 0 0 100%; border-top: none; border-right: none; }
.bottom-left { bottom: 1.5rem; left: 1.5rem; }
.bottom-left::before { border-radius: 0 100% 0 0; border-bottom: none; border-left: none; }
.bottom-right { bottom: 1.5rem; right: 1.5rem; }
.bottom-right::before { border-radius: 100% 0 0 0; border-bottom: none; border-right: none; }

.manifesto-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    letter-spacing: 0.04em;
    color: var(--walnut);
    margin-bottom: 1.5rem;
}

.manifesto-heading .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

.manifesto-body {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

.manifesto-body p {
    margin-bottom: 1rem;
    color: var(--walnut);
}

/* ===== FEATURED PUZZLE SPREAD ===== */
.spread-featured {
    grid-template-columns: 2fr 3fr;
    background: var(--parchment);
}

.featured-description {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.catalog-number {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 0.5rem;
}

.featured-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 3vw, 3rem);
    letter-spacing: 0.04em;
    color: var(--walnut);
    margin-bottom: 1rem;
}

.featured-body {
    font-family: 'Lora', serif;
    color: var(--walnut);
    margin-bottom: 1.5rem;
}

.difficulty-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.difficulty-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brass);
}

.difficulty-stars {
    color: var(--antiquarian-gold);
    font-size: 1.1rem;
    letter-spacing: 0.15em;
}

.difficulty-stars.small {
    font-size: 0.9rem;
}

.bid-prompt {
    border-top: 1px solid var(--antiquarian-gold);
    padding-top: 1rem;
}

.bid-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--walnut);
    display: block;
    margin-bottom: 0.25rem;
}

.bid-detail {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--brass);
}

.featured-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 600px;
}

.holographic-card {
    width: 320px;
    height: 440px;
    border-radius: 12px;
    background: conic-gradient(from var(--angle), #d4a0e8, #7ecbe6, #e8d06a, #d4a0e8);
    animation: rotateConic 6s linear infinite;
    padding: 3px;
    transition: transform 0.1s ease-out;
    cursor: pointer;
    position: relative;
}

.holographic-card:hover {
    animation: rotateConic 6s linear infinite, shake 0.3s ease 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

.card-inner {
    width: 100%;
    height: 100%;
    background: var(--parchment);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}

.card-number {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 3.5rem;
    color: var(--walnut);
    letter-spacing: 0.04em;
}

.card-title {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--walnut);
    text-align: center;
}

.card-season {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brass);
}

.puzzle-piece-icon {
    opacity: 0.5;
}

/* ===== ARCHIVE SPREAD ===== */
.spread-archive {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 3rem;
    background: var(--linen);
    overflow-y: auto;
}

.archive-heading {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    letter-spacing: 0.04em;
    color: var(--walnut);
    margin-bottom: 0.5rem;
}

.archive-subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    color: var(--brass);
    margin-bottom: 2.5rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 1200px;
}

.archive-card {
    background: var(--parchment);
    border: 1px solid var(--antiquarian-gold);
    border-radius: 4px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

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

.archive-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 47, 30, 0.15);
    border-image: linear-gradient(135deg, #d4a0e8, #7ecbe6, #e8d06a) 1;
}

.card-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--holo-gradient);
    opacity: 0.6;
}

.card-corner.tl { top: 0; left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
.card-corner.tr { top: 0; right: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.card-corner.bl { bottom: 0; left: 0; clip-path: polygon(0 0, 0 100%, 100% 100%); }
.card-corner.br { bottom: 0; right: 0; clip-path: polygon(100% 0, 0 100%, 100% 100%); }

.archive-card h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: var(--walnut);
    margin: 0.5rem 0;
}

.archive-card p {
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    color: var(--walnut);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* ===== COLOPHON SPREAD ===== */
.spread-colophon {
    background: var(--mahogany);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.colophon-content {
    text-align: center;
    z-index: 2;
}

.gavel-seal {
    margin-bottom: 2rem;
}

.colophon-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: 0.12em;
    color: var(--antiquarian-gold);
    margin-bottom: 0.25rem;
}

.colophon-est {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: var(--brass);
    margin-bottom: 2rem;
}

.colophon-details {
    margin-bottom: 2rem;
}

.colophon-details p {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--antiquarian-gold);
    line-height: 1.8;
}

.colophon-latin {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--brass);
    margin-top: 1.5rem;
}

/* Floating puzzle pieces */
.floating-pieces {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-piece {
    position: absolute;
    opacity: 0.08;
}

.fp1 { top: 10%; left: 5%; animation: drift1 12s ease-in-out infinite alternate; }
.fp2 { top: 20%; right: 8%; animation: drift2 14s ease-in-out infinite alternate; }
.fp3 { bottom: 15%; left: 12%; animation: drift3 10s ease-in-out infinite alternate; }
.fp4 { bottom: 25%; right: 15%; animation: drift1 16s ease-in-out infinite alternate-reverse; }

@keyframes drift1 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(10px, -10px) rotate(5deg); }
}

@keyframes drift2 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-8px, 12px) rotate(-4deg); }
}

@keyframes drift3 {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(12px, 8px) rotate(3deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .spread-cover,
    .spread-manifesto {
        grid-template-columns: 1fr;
        grid-template-rows: 55vh 45vh;
    }

    .spread-featured {
        grid-template-columns: 1fr;
        grid-template-rows: 45vh 55vh;
    }

    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .spread-cover,
    .spread-manifesto {
        grid-template-rows: 60vh auto;
    }

    .spread-featured {
        grid-template-rows: auto 60vh;
    }

    .archive-grid {
        grid-template-columns: 1fr;
    }

    .holographic-card {
        width: 260px;
        height: 360px;
    }

    .manifesto-text {
        padding: 2rem 1.5rem;
    }

    .featured-description {
        padding: 2rem 1.5rem;
    }
}
