/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    height: 100%;
    background-color: #fdfbf7;
    /* JSTOR Pale Beige/Yellow */
    color: #1a1a1a;
    font-family: "Georgia", "Times New Roman", Times, serif;
    /* Academic Standard */
    overflow-x: hidden;
    overflow-y: auto;
}

/* --- Canvas Layer --- */
#fire-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    /* On top to show particles */
    pointer-events: none;
    /* Let clicks pass through */
}

/* --- Magic Overlay Layer --- */
#magic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #050508;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    /* Clean mask initially so it doesn't show background */
    -webkit-mask-image: radial-gradient(circle at center, black 100%, black 100%);
    mask-image: radial-gradient(circle at center, black 100%, black 100%);
    /* We apply the rough-burn filter directly via class when burning starts */
}

.magic-circle {
    position: relative;
    width: 400px;
    height: 400px;
    z-index: 2;
    cursor: pointer;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.magic-circle:hover {
    transform: scale(1.05);
}

.rotating-circle {
    width: 100%;
    height: 100%;
    animation: rotate 30s linear infinite;
    transform-origin: center;
}

.glow {
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.6)) drop-shadow(0 0 15px rgba(212, 175, 55, 0.4));
}

/* SVG Line Drawing Animations */
.draw-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: draw 4s ease-out forwards;
}

/* Staggered drawing of the magic circle */
.outer-circle {
    animation-delay: 0s;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.inner-circle {
    animation-delay: 0.8s;
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
}

.poly-1 {
    animation-delay: 1.6s;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.poly-2 {
    animation-delay: 2.2s;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

.core-circle {
    animation-delay: 2.8s;
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
}

.star {
    animation-delay: 3.4s;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Fade in for text/symbols after drawings */
.fade-text {
    opacity: 0;
    animation: fadeIn 2s ease-in forwards;
    animation-delay: 4.5s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}


.start-text {
    margin-top: 40px;
    color: #d4af37;
    font-family: "Georgia", serif;
    font-size: 1.2rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    z-index: 2;
    cursor: pointer;
    transition: opacity 0.5s ease;
}

.pulse-text {
    /* Combine fadeIn with an infinite pulse after delay */
    animation: fadeIn 2s ease-in forwards, pulse 3s ease-in-out infinite 6.5s;
}

/* Mask Animation Class - Add SVG filter dynamically */
.burn-hole {
    filter: url(#rough-burn);
    animation: expandHole 3s ease-in forwards;
}

@keyframes expandHole {
    0% {
        -webkit-mask-image: radial-gradient(circle at center, transparent 0%, black 1%);
        mask-image: radial-gradient(circle at center, transparent 0%, black 1%);
    }

    10% {
        -webkit-mask-image: radial-gradient(circle at center, transparent 0%, black 5%);
        mask-image: radial-gradient(circle at center, transparent 0%, black 5%);
    }

    100% {
        -webkit-mask-image: radial-gradient(circle at center, transparent 150%, transparent 150%);
        mask-image: radial-gradient(circle at center, transparent 150%, transparent 150%);
    }
}

/* Animations */
@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
        text-shadow: 0 0 5px #d4af37;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 20px #d4af37, 0 0 30px #d4af37;
    }
}

/* --- Main Content (JSTOR Style) --- */
#main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 40px 80px 40px;
    line-height: 1.6;
}

header {
    margin-bottom: 50px;
    text-align: center;
}

header h1 {
    font-size: 2.2rem;
    font-weight: normal;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.author,
.date {
    font-size: 1rem;
    color: #555;
    margin-bottom: 5px;
    font-style: italic;
}

hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 40px 0;
}

h2 {
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 50px;
    margin-bottom: 20px;
}

p {
    margin-bottom: 22px;
    text-align: justify;
    font-size: 1.1rem;
}

.abstract-text {
    font-style: italic;
    margin-left: 30px;
    margin-right: 30px;
}

/* --- Navigation Dots --- */
#nav-dots {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 8000;
    display: flex;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
}

.nav-dot {
    width: 12px;
    height: 12px;
    background-color: #333;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

/* Revealed after animation */
body.revealed #nav-dots {
    opacity: 1;
    pointer-events: auto;
}

.tarot-dot:hover {
    transform: scale(1.5);
    background-color: #d4af37;
    box-shadow: 0 0 15px #d4af37, 0 0 30px #d4af37;
}

.astro-dot:hover {
    transform: scale(1.5);
    background-color: #4a6c8c;
    /* Slightly scholarly blue glow for astrology */
    box-shadow: 0 0 15px #4a6c8c, 0 0 30px #4a6c8c;
}