/* miris.monster — Bestiary Grimoire */

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

:root {
    --bg: #1A1412;
    --gold: #C9A96E;
    --amethyst: #9B59B6;
    --parchment: #D4C5A9;
    --leather: #231C18;
    --crimson: #C0392B;
    --sepia: #3D3028;
}

body {
    background: var(--bg);
    font-family: 'Crimson Text', serif;
    color: var(--parchment);
    overflow-x: hidden;
}

/* Paper grain */
#paper-grain {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.05;
    background:
        repeating-conic-gradient(rgba(201,169,110,0.3) 0% 25%, transparent 0% 50%) 0 0 / 3px 3px,
        repeating-conic-gradient(rgba(201,169,110,0.2) 0% 25%, transparent 0% 50%) 1px 1px / 4px 4px;
}

/* Spine Navigation */
#spine-nav {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.spine-item {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 400;
    font-size: 14px;
    color: var(--gold);
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.2s ease, font-size 0.2s ease;
    display: block;
    text-align: center;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.spine-item.active {
    opacity: 1;
    font-size: 18px;
    border-bottom-color: var(--crimson);
}

.spine-item:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Hero */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-creature {
    position: absolute;
    width: 500px;
    height: 600px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    z-index: 1;
}

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

.draw-path {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    transition: stroke-dashoffset 2.5s ease;
}

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

.eye {
    transition: opacity 1s ease;
}

.eye.glow {
    opacity: 0.6;
    animation: eyePulse 3s ease-in-out infinite;
}

@keyframes eyePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.creature-eye {
    animation: eyePulse 3s ease-in-out infinite;
}

.hero-text {
    position: relative;
    z-index: 5;
    text-align: center;
    margin-top: 280px;
}

.hero-title {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 700;
    font-size: 42px;
    letter-spacing: 0.12em;
    color: var(--gold);
    display: flex;
    justify-content: center;
    gap: 4px;
}

.title-letter {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.title-letter.visible {
    opacity: 1;
}

.hero-subtitle {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 18px;
    color: var(--amethyst);
    margin-top: 12px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-frame {
    position: absolute;
    inset: 20px;
    z-index: 0;
}

.frame-draw {
    stroke-dasharray: 2200;
    stroke-dashoffset: 2200;
    transition: stroke-dashoffset 1.5s ease;
}

.frame-draw.drawn {
    stroke-dashoffset: 0;
}

/* Torn edges */
.torn-edge {
    position: relative;
    z-index: 10;
    margin-top: -20px;
    margin-bottom: -20px;
}

.torn-edge svg {
    width: 100%;
    height: 40px;
    display: block;
}

/* Creature Plates */
.creature-plate {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.creature-plate.reveal {
    opacity: 1;
    transform: translateY(0);
}

.plate-frame {
    position: absolute;
    inset: 20px;
    pointer-events: none;
}

.ornate-frame {
    width: 100%;
    height: 100%;
}

.frame-draw-plate {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.5s ease;
}

.creature-plate.reveal .frame-draw-plate {
    stroke-dashoffset: 0;
}

.plate-spread {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.plate-illustration {
    flex: 1;
    position: relative;
    max-width: 300px;
}

.creature-illustration {
    width: 100%;
    height: auto;
}

/* Creature plate draw paths */
.creature-plate .draw-path {
    transition: stroke-dashoffset 1.5s ease;
}

.creature-plate.reveal .draw-path {
    stroke-dashoffset: 0;
}

.plate-text {
    flex: 1;
}

.creature-name {
    font-family: 'Cinzel Decorative', cursive;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: 0.12em;
    color: var(--gold);
    margin-bottom: 8px;
}

.creature-taxonomy {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--amethyst);
    margin-bottom: 20px;
}

.creature-description {
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 17px;
    line-height: 1.8;
    color: var(--parchment);
    margin-bottom: 20px;
}

.marginalia {
    font-family: 'IM Fell English', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--amethyst);
    display: inline-block;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.3s ease;
}

.creature-plate.reveal .marginalia {
    opacity: 1;
}

.danger-note {
    background: rgba(192, 57, 43, 0.1);
    padding: 6px 12px;
    border-left: 2px solid var(--crimson);
    color: var(--crimson);
}

/* Ink splatters */
.ink-splatter {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(192,57,43,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.s1 { bottom: 20%; right: -10px; width: 50px; height: 50px; }
.s2 { top: 15%; left: -15px; width: 35px; height: 35px; }
.s3 { bottom: 30%; right: 10px; width: 45px; height: 45px; }

/* End space */
.end-space {
    height: 30vh;
}

/* Responsive */
@media (max-width: 768px) {
    .creature-plate {
        padding: 40px 20px;
    }

    .plate-spread {
        flex-direction: column;
    }

    .plate-illustration {
        max-width: 200px;
        margin: 0 auto;
    }

    #spine-nav {
        display: none;
    }

    .hero-creature {
        width: 300px;
        height: 400px;
    }

    .hero-title {
        font-size: 32px;
    }
}
