/* ============================================
   namu.market - Goblincore Scholar's Bazaar
   ============================================ */
:root {
    --goblin-burgundy: #5B1A2A;
    --parchment-cream: #EDE0C8;
    --scholars-wine: #7A3B4A;
    --tarnished-brass: #B8860B;
    --ink-brown: #2A1215;
    --dried-moss: #5C6B4F;
    --burgundy-mist: #8B4557;
    --warm-bone: #EDE0C8;
    --forest-lichen: #7B8B6F;
    --f5-cream: #F5ECD7;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--parchment-cream);
    color: var(--ink-brown);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ==============================
   GRAIN OVERLAY
   ============================== */
.grain-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: url(#grain);
    opacity: 0.06;
    pointer-events: none;
    z-index: 1;
}

/* ==============================
   ZONE BASICS
   ============================== */
.zone {
    position: relative;
    overflow: hidden;
}

/* ==============================
   1. THE THRESHOLD
   ============================== */
.zone--threshold {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--goblin-burgundy);
}
.threshold-content {
    position: relative;
    z-index: 2;
    text-align: center;
}
.hero-title {
    font-family: 'Baloo 2', cursive;
    font-weight: 800;
    font-size: clamp(3rem, 10vw, 9rem);
    color: var(--f5-cream);
    letter-spacing: 0.08em;
    line-height: 1;
    margin-bottom: 0.1em;
}
.hero-title span {
    display: inline-block;
    opacity: 0;
    animation: letterIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.hero-title span:nth-child(1) { animation-delay: 0.2s; }
.hero-title span:nth-child(2) { animation-delay: 0.35s; }
.hero-title span:nth-child(3) { animation-delay: 0.5s; }
.hero-title span:nth-child(4) { animation-delay: 0.65s; }

@keyframes letterIn {
    0% { opacity: 0; transform: translateY(20px) rotate(0deg); }
    100% { opacity: 1; }
}

.hero-sub {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--f5-cream);
    letter-spacing: 0.35em;
    text-transform: lowercase;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.9s forwards;
}
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 0.7; transform: translateY(0); }
}

.hero-mushroom {
    display: block;
    margin: 2rem auto 0;
}
.mushroom-stem {
    animation: drawStem 1.2s ease 1.3s forwards;
}
.mushroom-cap {
    animation: drawCap 1.5s ease 2s forwards;
}
@keyframes drawStem {
    to { stroke-dashoffset: 0; }
}
@keyframes drawCap {
    to { stroke-dashoffset: 0; }
}

/* ==============================
   2. FIELD CATALOGUE
   ============================== */
.zone--catalogue {
    padding: clamp(3rem, 8vw, 8rem) clamp(1rem, 5vw, 4rem);
    background: var(--parchment-cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(2rem, 5vw, 4rem);
}

/* Specimen Card */
.specimen-card {
    position: relative;
    width: 100%;
    max-width: 540px;
    background: var(--warm-bone);
    border: 2px solid var(--scholars-wine);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(42, 18, 21, 0.08);
}
.specimen-card[data-skeleton] .card-content {
    opacity: 0;
    transition: opacity 0.6s ease;
}
.specimen-card.revealed .card-content {
    opacity: 1;
}

/* Skeleton Shimmer */
.skeleton-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--warm-bone) 0%,
        var(--burgundy-mist) 20%,
        var(--parchment-cream) 40%,
        var(--warm-bone) 100%
    );
    background-size: 300% 100%;
    animation: shimmerSweep 1.8s ease-in-out infinite;
    opacity: 0.3;
    z-index: 5;
    border-radius: 12px;
    transition: opacity 0.6s ease;
}
.specimen-card.revealed .skeleton-shimmer {
    opacity: 0;
    pointer-events: none;
}
@keyframes shimmerSweep {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Card Content */
.card-content {
    position: relative;
    padding: 1.5rem;
}

/* Card Corners */
.card-corner {
    position: absolute;
    width: 24px;
    height: 24px;
}
.card-corner--tl {
    top: 8px;
    left: 8px;
    border-top: 1.5px solid var(--scholars-wine);
    border-left: 1.5px solid var(--scholars-wine);
    opacity: 0.4;
}
.card-corner--br {
    bottom: 8px;
    right: 8px;
    border-bottom: 1.5px solid var(--scholars-wine);
    border-right: 1.5px solid var(--scholars-wine);
    opacity: 0.4;
}

/* Card Collage */
.card-collage {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}
.collage-svg {
    width: 160px;
    height: 128px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease 0.3s, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s;
}
.specimen-card.revealed .collage-svg {
    opacity: 1;
    transform: scale(1);
}

/* Card Typography */
.card-class {
    display: block;
    font-family: 'Courier Prime', monospace;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--scholars-wine);
    margin-bottom: 0.3rem;
    opacity: 0.6;
}
.card-title {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: var(--ink-brown);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.card-desc {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink-brown);
    margin-bottom: 0.75rem;
}
.card-annotation {
    display: block;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 1rem;
    color: var(--scholars-wine);
    opacity: 0.7;
    transform: rotate(-1deg);
}

/* ==============================
   3. SCHOLAR'S ANNOTATION
   ============================== */
.zone--scholar {
    display: flex;
    min-height: 100vh;
    padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 3rem);
    background: var(--parchment-cream);
}
.margin-border {
    flex-shrink: 0;
    width: 30px;
    margin-right: clamp(1rem, 3vw, 2rem);
    position: relative;
}
.margin-vine {
    width: 30px;
    height: 100%;
    position: sticky;
    top: 0;
}
.scholar-column {
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.scholar-column.visible {
    opacity: 1;
    transform: translateY(0);
}
.scholar-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    line-height: 1.85;
    color: var(--ink-brown);
    margin-bottom: 1.5rem;
}
.scholar-text em {
    font-style: italic;
    color: var(--scholars-wine);
}
.scholar-quote {
    font-family: 'Baloo 2', cursive;
    font-weight: 600;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--scholars-wine);
    border-left: 3px solid var(--tarnished-brass);
    padding-left: 1.25rem;
    margin: 2rem 0;
    line-height: 1.5;
}

/* ==============================
   4. COLLECTION GRID
   ============================== */
.zone--collection {
    padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem);
    background: var(--parchment-cream);
}
.collection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
    max-width: 700px;
    margin: 0 auto;
}
.collection-card {
    background: var(--warm-bone);
    border: 1.5px solid var(--scholars-wine);
    border-radius: 10px;
    padding: clamp(1.2rem, 3vw, 2rem);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 12px rgba(42, 18, 21, 0.06);
}
.collection-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.collection-card--tilt-pos.visible {
    transform: rotate(1.5deg);
}
.collection-card--tilt-neg.visible {
    transform: rotate(-1.5deg);
}
.collection-card:hover {
    box-shadow: 0 6px 24px rgba(42, 18, 21, 0.12);
    transform: rotate(0deg) translateY(-4px);
    transition: all 0.3s ease;
}
.collection-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.75rem;
}
.collection-label {
    display: block;
    font-family: 'Baloo 2', cursive;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink-brown);
    margin-bottom: 0.2rem;
}
.collection-code {
    display: block;
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--dried-moss);
    opacity: 0.7;
}

/* ==============================
   5. ARCHIVE ENTRANCE
   ============================== */
.zone--archive {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-brown);
}
.mandala-container {
    position: relative;
    z-index: 2;
    text-align: center;
}
.mandala-svg {
    width: clamp(200px, 50vw, 320px);
    height: clamp(200px, 50vw, 320px);
    animation: mandalaSpin 60s linear infinite;
}
@keyframes mandalaSpin {
    to { transform: rotate(360deg); }
}
.mandala-text {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--f5-cream);
    opacity: 0.5;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
}

/* ==============================
   6. COLOPHON
   ============================== */
.zone--colophon {
    padding: 3rem 2rem;
    background: var(--parchment-cream);
    text-align: center;
}
.colophon-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.colophon-domain {
    font-family: 'Baloo 2', cursive;
    font-weight: 600;
    font-size: 1rem;
    color: var(--dried-moss);
    letter-spacing: 0.1em;
}
.colophon-icons {
    display: flex;
    gap: 12px;
    align-items: center;
}
.colophon-icons svg {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.colophon-icons svg:hover {
    opacity: 1;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .collection-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
    }
    .margin-border {
        display: none;
    }
    .zone--scholar {
        padding-left: clamp(1.5rem, 5vw, 3rem);
    }
    .specimen-card {
        max-width: 100%;
    }
}
