/* mysterious.quest - Victorian seance parlor preserved in amber */
/* Colors: #6b1d2a #2a2226 #7a8b6f #c8bfd4 #f5ebe0 #3d0f18 #faf3e8 #a8843a */
/* Fonts: Bodoni Moda, Cormorant Garamond, Space Mono */

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

html {
    scroll-behavior: smooth;
}

body.manuscript {
    background-color: #f5ebe0;
    color: #2a2226;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ===== WATERCOLOR WASH LAYER ===== */
.watercolor-wash-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.wash {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
}

.wash-1 {
    width: 60vw;
    height: 60vw;
    top: -10%;
    left: -15%;
    background: radial-gradient(ellipse at center, rgba(107, 29, 42, 0.08) 0%, transparent 70%);
}

.wash-2 {
    width: 50vw;
    height: 50vw;
    top: 20%;
    right: -20%;
    background: radial-gradient(ellipse at center, rgba(122, 139, 111, 0.06) 0%, transparent 70%);
}

.wash-3 {
    width: 45vw;
    height: 45vw;
    top: 50%;
    left: 10%;
    background: radial-gradient(ellipse at center, rgba(200, 191, 212, 0.07) 0%, transparent 70%);
}

.wash-4 {
    width: 55vw;
    height: 55vw;
    top: 70%;
    right: -10%;
    background: radial-gradient(ellipse at center, rgba(107, 29, 42, 0.06) 0%, transparent 70%);
}

.wash-5 {
    width: 40vw;
    height: 40vw;
    bottom: -5%;
    left: -5%;
    background: radial-gradient(ellipse at center, rgba(122, 139, 111, 0.05) 0%, transparent 70%);
}

/* ===== VINE OVERLAY ===== */
.vine-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== FILIGREE CORNERS ===== */
.filigree-corner {
    position: absolute;
    width: 60px;
    height: 60px;
    pointer-events: none;
}

.filigree-corner::before,
.filigree-corner::after {
    content: '';
    position: absolute;
}

.filigree-tl {
    top: 12px;
    left: 12px;
    border-top: 1px solid rgba(168, 132, 58, 0.35);
    border-left: 1px solid rgba(168, 132, 58, 0.35);
}

.filigree-tl::before {
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    border-top: 1px solid rgba(168, 132, 58, 0.2);
    border-left: 1px solid rgba(168, 132, 58, 0.2);
}

.filigree-tr {
    top: 12px;
    right: 12px;
    border-top: 1px solid rgba(168, 132, 58, 0.35);
    border-right: 1px solid rgba(168, 132, 58, 0.35);
}

.filigree-tr::before {
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-top: 1px solid rgba(168, 132, 58, 0.2);
    border-right: 1px solid rgba(168, 132, 58, 0.2);
}

.filigree-bl {
    bottom: 12px;
    left: 12px;
    border-bottom: 1px solid rgba(168, 132, 58, 0.35);
    border-left: 1px solid rgba(168, 132, 58, 0.35);
}

.filigree-bl::before {
    bottom: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    border-bottom: 1px solid rgba(168, 132, 58, 0.2);
    border-left: 1px solid rgba(168, 132, 58, 0.2);
}

.filigree-br {
    bottom: 12px;
    right: 12px;
    border-bottom: 1px solid rgba(168, 132, 58, 0.35);
    border-right: 1px solid rgba(168, 132, 58, 0.35);
}

.filigree-br::before {
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-bottom: 1px solid rgba(168, 132, 58, 0.2);
    border-right: 1px solid rgba(168, 132, 58, 0.2);
}

/* ===== SIGIL OPENING ===== */
.sigil-opening {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 2rem;
    z-index: 2;
}

.seal {
    width: clamp(250px, 50vw, 400px);
    height: auto;
    opacity: 0;
    animation: sealFadeIn 3s ease-out 0.5s forwards;
}

@keyframes sealFadeIn {
    0% { opacity: 0; transform: scale(0.9) rotate(-5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.whisper {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: #6b1d2a;
    letter-spacing: 0.15em;
    margin-top: 2.5rem;
    opacity: 0;
    animation: whisperFade 2.5s ease-out 2s forwards;
    text-align: center;
}

@keyframes whisperFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 0.7; transform: translateY(0); }
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    opacity: 0;
    animation: scrollAppear 2s ease-out 3.5s forwards;
}

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

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

@keyframes scrollBounce {
    0%, 100% { cy: 12; }
    50% { cy: 28; }
}

/* ===== MANUSCRIPT SECTIONS ===== */
.manuscript-section {
    position: relative;
    max-width: 750px;
    margin: 0 auto;
    padding: 4rem 3rem;
    z-index: 2;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.manuscript-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.oracle-question.visible {
    transform: rotate(-0.7deg);
}

.revelation-garden.visible {
    transform: rotate(1.1deg);
}

.shadow-archive.visible {
    transform: rotate(-0.5deg);
}

.final-seal.visible {
    transform: rotate(0deg);
}

.section-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(168, 132, 58, 0.15);
    pointer-events: none;
}

.section-border::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(168, 132, 58, 0.08);
}

.section-content {
    position: relative;
}

/* ===== TYPOGRAPHY ===== */
.section-title {
    font-family: 'Bodoni Moda', 'Didot', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 4rem);
    color: #3d0f18;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0.5rem;
    font-feature-settings: 'liga' 1, 'onum' 1;
    line-height: 1.2;
}

.ornamental-rule {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.body-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    color: #2a2226;
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
    text-indent: 1.5em;
}

.body-text:first-of-type {
    text-indent: 0;
}

.body-text:first-of-type::first-letter {
    font-family: 'Bodoni Moda', 'Didot', Georgia, serif;
    font-weight: 700;
    font-size: 3.2em;
    float: left;
    line-height: 0.8;
    margin-right: 0.08em;
    margin-top: 0.05em;
    color: #6b1d2a;
}

.body-text em {
    font-style: italic;
    color: #6b1d2a;
}

/* ===== SPECIMEN CARDS ===== */
.specimen-card {
    position: relative;
    padding: 2rem 2.5rem;
    margin-top: 2.5rem;
    background: rgba(250, 243, 232, 0.5);
    text-align: center;
}

.specimen-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(168, 132, 58, 0.2);
    pointer-events: none;
}

.specimen-border::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(168, 132, 58, 0.1);
}

.specimen-label {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a8843a;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.specimen-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
    color: #3d0f18;
}

.specimen-text em {
    font-style: italic;
    color: #6b1d2a;
}

/* ===== BOTANICAL PLATE ===== */
.botanical-plate {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2.5rem 0;
    padding: 2rem;
}

.botanical-svg {
    width: clamp(180px, 40vw, 300px);
    height: auto;
    opacity: 0.7;
    transition: opacity 0.8s ease;
}

.botanical-plate:hover .botanical-svg {
    opacity: 1;
}

.plate-caption {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #a8843a;
    margin-top: 1rem;
    opacity: 0.6;
}

.plate-caption em {
    font-style: italic;
    text-transform: none;
}

/* ===== ARCHIVE GRID ===== */
.archive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.archive-card {
    position: relative;
    padding: 1.5rem;
    border: 1px solid rgba(168, 132, 58, 0.15);
    background: rgba(250, 243, 232, 0.3);
    cursor: pointer;
    transition: background 0.6s ease, border-color 0.6s ease, transform 0.6s ease;
}

.archive-card:hover {
    background: rgba(250, 243, 232, 0.6);
    border-color: rgba(168, 132, 58, 0.35);
    transform: translateY(-3px);
}

.archive-card::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(168, 132, 58, 0.06);
    pointer-events: none;
    transition: border-color 0.6s ease;
}

.archive-card:hover::before {
    border-color: rgba(168, 132, 58, 0.15);
}

.archive-card-inner {
    text-align: center;
}

.archive-numeral {
    font-family: 'Bodoni Moda', 'Didot', Georgia, serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #a8843a;
    opacity: 0.4;
    display: block;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.archive-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: 0.95rem;
    color: #3d0f18;
    line-height: 1.5;
}

/* ===== VINE CONNECTORS ===== */
.vine-connector {
    width: 100px;
    height: 120px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.vine-connector.visible {
    opacity: 1;
}

.vine-connector svg {
    width: 100%;
    height: 100%;
}

/* ===== FINAL SEAL ===== */
.final-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.closing-seal {
    width: clamp(120px, 25vw, 200px);
    height: auto;
    margin-bottom: 2rem;
    opacity: 0.6;
    animation: sealRotate 60s linear infinite;
}

@keyframes sealRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.final-title {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

.closing-whisper {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #6b1d2a;
    line-height: 2;
    margin-top: 1.5rem;
    opacity: 0.8;
    letter-spacing: 0.05em;
}

.domain-mark {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.25em;
    text-transform: lowercase;
    color: #a8843a;
    margin-top: 3rem;
    opacity: 0.4;
}

/* ===== PAGE EDGE TEXTURE ===== */
body.manuscript::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(to right, rgba(42, 34, 38, 0.04) 0%, transparent 3%, transparent 97%, rgba(42, 34, 38, 0.04) 100%),
        linear-gradient(to bottom, rgba(42, 34, 38, 0.03) 0%, transparent 2%, transparent 98%, rgba(42, 34, 38, 0.03) 100%);
    pointer-events: none;
    z-index: 100;
}

/* ===== NOISE TEXTURE ===== */
body.manuscript::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 99;
    opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .manuscript-section {
        padding: 3rem 1.5rem;
        margin: 0 1rem;
    }

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

    .filigree-corner {
        width: 40px;
        height: 40px;
    }

    .body-text {
        text-align: left;
        hyphens: none;
    }

    .oracle-question.visible,
    .revelation-garden.visible,
    .shadow-archive.visible {
        transform: rotate(0deg);
    }
}

@media (max-width: 480px) {
    .manuscript-section {
        padding: 2rem 1rem;
    }

    .specimen-card {
        padding: 1.5rem 1rem;
    }
}