/* ============================================
   mysterious.quest — styles.css
   Mid-century séance parlor aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-mahogany: #2c1e12;
    --walnut: #3d2b1f;
    --cognac: #a0714f;
    --brass: #c49a6c;
    --parchment: #e8d5c0;
    --jade: #5e8a6e;
    --sienna: #a65a3c;
    --stone: #8a7560;
    --warm-sand: #d4c4b0;
    --card-gap: 2rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-mahogany);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- The Threshold (Hero) --- */
#threshold {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--deep-mahogany);
    overflow: hidden;
}

#labyrinth-svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vmin;
    height: 60vmin;
    pointer-events: none;
    z-index: 0;
}

#hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

#hero-title {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.12em;
    color: var(--parchment);
    line-height: 1;
    margin-bottom: 1rem;
}

#hero-title .char {
    display: inline-block;
    animation: charReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    filter: blur(12px);
}

@keyframes charReveal {
    0% {
        opacity: 0;
        filter: blur(12px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--stone);
    opacity: 0;
    animation: fadeIn 1.5s ease 2s forwards;
    letter-spacing: 0.05em;
}

.scroll-line {
    width: 1px;
    height: 0;
    background-color: var(--brass);
    margin: 3rem auto 0;
    animation: lineGrow 2s ease 3s forwards;
    opacity: 0.5;
}

@keyframes lineGrow {
    0% { height: 0; }
    100% { height: 60px; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* --- Investigation Board (Main) --- */
#investigation-board {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

/* --- Masonry Layout --- */
.masonry {
    column-count: 3;
    column-gap: 2rem;
}

/* --- Cards --- */
.card {
    break-inside: avoid;
    margin-bottom: var(--card-gap);
    padding: 2rem;
    background-color: var(--walnut);
    border-radius: 2px;
    position: relative;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.3),
        0 4px 16px rgba(0,0,0,0.4);
    border: 1px solid rgba(196, 154, 108, 0.1);
    transition:
        box-shadow 300ms ease,
        filter 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: filter, opacity, transform;
    /* Initial blur state */
    filter: blur(8px);
    opacity: 0.4;
    transform: translateY(12px);
}

.card.in-view {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0);
}

.card.past-view {
    filter: blur(2px);
    opacity: 0.85;
    transform: translateY(0);
}

/* Leather texture overlays */
.leather-1 { filter: blur(8px) url(#leather1); }
.leather-2 { filter: blur(8px) url(#leather2); }
.leather-3 { filter: blur(8px) url(#leather3); }
.leather-4 { filter: blur(8px) url(#leather4); }

.leather-1.in-view { filter: blur(0) url(#leather1); }
.leather-2.in-view { filter: blur(0) url(#leather2); }
.leather-3.in-view { filter: blur(0) url(#leather3); }
.leather-4.in-view { filter: blur(0) url(#leather4); }

.leather-1.past-view { filter: blur(2px) url(#leather1); }
.leather-2.past-view { filter: blur(2px) url(#leather2); }
.leather-3.past-view { filter: blur(2px) url(#leather3); }
.leather-4.past-view { filter: blur(2px) url(#leather4); }

/* Greek key border pattern via background */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 2px;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M0 0h10v10H0zM10 10h10v10H10zM20 0h10v10H20zM30 10h10v10H30zM0 20h10v10H0zM10 30h10v10H10zM20 20h10v10H20zM30 30h10v10H30z' fill='none' stroke='%23c49a6c' stroke-width='0.5' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 40px 40px;
    opacity: 0.4;
}

/* Brass rule connector lines */
.card::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background-color: var(--brass);
    opacity: 0.4;
    transition: width 600ms ease;
}

.card.in-view::after {
    width: 60%;
}

.card:hover {
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.3),
        0 8px 24px rgba(166, 90, 60, 0.2);
}

.card:hover::after {
    opacity: 0.7;
}

/* Card emblem */
.card-emblem {
    width: 24px;
    height: 24px;
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    opacity: 0.7;
}

/* Card label */
.card-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--stone);
    margin-bottom: 0.75rem;
}

/* Card headings */
.card h2 {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.2em;
    color: var(--parchment);
    line-height: 1.1;
    margin-bottom: 1rem;
}

/* Card body text */
.card p {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    color: #d4c4b0;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

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

.card em {
    font-style: italic;
    color: var(--brass);
}

.card blockquote {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    line-height: 1.8;
    color: var(--parchment);
    border-left: 2px solid var(--brass);
    padding-left: 1.5rem;
    margin: 1rem 0;
    position: relative;
    z-index: 1;
}

.card blockquote em {
    color: var(--brass);
}

/* Card meta */
.card-meta {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.7rem, 1vw, 0.85rem) !important;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--stone) !important;
    margin-top: 1rem;
}

/* Card size variants */
.card--tall {
    min-height: 300px;
}

.card--wide {
    padding: 2.5rem;
}

/* --- Archive Drawer (Footer) --- */
#archive-drawer {
    background-color: var(--walnut);
    padding: 2rem;
    text-align: center;
    position: relative;
    margin-top: 4rem;
}

.drawer-pull {
    width: 80px;
    height: 2px;
    background-color: var(--brass);
    margin: 0 auto 1.5rem;
    border-radius: 1px;
}

.drawer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.drawer-domain {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--parchment);
    text-transform: uppercase;
}

.drawer-copy {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--stone);
}

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

@media (max-width: 600px) {
    .masonry {
        column-count: 1;
    }
    #investigation-board {
        padding: 2rem 1rem 4rem;
    }
    .card {
        padding: 1.5rem;
    }
}
