/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::-webkit-scrollbar {
    width: 10px;
}
*::-webkit-scrollbar-track {
    background-color: #d2ccae;
    border-radius: 5px;
}
*::-webkit-scrollbar-thumb {
    background-color: #ce9135;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: bottom;
    border-radius: 5px;
}

.rotate-device-announcement {
    display: none;
}

body {
    font-family: 'Crimson Text', serif;
    background: #000000; /* Pure black background like original */
    background-attachment: fixed;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Mystical Scene Container */
.mystical-scene {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Ambient Background */
.ambient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000; /* Pure black background like original */
    background-size: auto;
    z-index: 1;
}

.candle-glow {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(255, 140, 0, 0.2) 40%, transparent 70%);
    animation: candleFlicker 4s ease-in-out infinite alternate;
}

.candle-glow-1 {
    width: 300px;
    height: 300px;
    top: 20%;
    left: 15%;
    animation-delay: 0s;
}

.candle-glow-2 {
    width: 250px;
    height: 250px;
    top: 25%;
    right: 18%;
    animation-delay: 2s;
}

/* Floating Particles */
.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.memory-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: floatUpward 8s linear infinite;
}

/* Portal Scene */
.portal-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 2s ease-in-out;
}

.portal-scene.hidden {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
    z-index: 10;
}

/* Mystical Desk */
.mystical-desk {
    position: relative;
    width: 90vw;
    max-width: 1200px;
    height: 80vh;
    background: 
        linear-gradient(135deg, rgba(101, 67, 33, 0.8) 0%, rgba(139, 69, 19, 0.6) 100%),
        url('/journal-portal/images/mystical-desk.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.8),
        inset 0 0 50px rgba(255, 215, 0, 0.1);
    overflow: hidden;
    z-index: 20;

    @media (max-width: 1400px) {
        border-radius: 0;
        height: 100vh;
        max-width: 100vw;
        width: 100vw;
    }
}

.desk-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 50% 60%, rgba(139, 69, 19, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Journal on Desk */
.journal-on-desk {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 30;
}

.journal-cover-closed {
    position: relative;
    max-width: 400px;
    margin: 0 auto 40px;
    transform: perspective(1000px) rotateX(5deg) rotateY(-3deg);
    transition: transform 0.8s ease;
    z-index: 40;

    @media (max-width: 1400px) {
        max-width: 300px;
    }
}

.journal-cover-closed:hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1.05);
}

.cover-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.8),
        0 0 0 5px #654321,
        0 0 0 10px #8b4513,
        0 0 30px rgba(255, 215, 0, 0.3);
    filter: 
        drop-shadow(0 0 20px rgba(218, 165, 32, 0.6))
        sepia(0.1)
        contrast(1.1);
    z-index: 50;
}

.mystical-aura {
    position: absolute;
    top: -30px;
    left: -30px;
    right: -30px;
    bottom: -30px;
    border-radius: 25px;
    background: radial-gradient(circle, rgba(218, 165, 32, 0.3) 0%, transparent 70%);
    animation: mysticalPulse 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 45;
}

.portal-beckoning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 150px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 48;
}

.beckoning-glow {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 215, 0, 0.4) 0%, rgba(218, 165, 32, 0.2) 50%, transparent 70%);
    animation: portalBeckoning 3s ease-in-out infinite;
}

/* Entry Invitation */
.entry-invitation {
    text-align: center;
    position: relative;
    z-index: 60;
    pointer-events: auto;
    width: 100%;
    clear: both;
}

.enter-portal-btn {
    position: relative;
    background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
    color: #ffd700;
    border: 3px solid #daa520;
    padding: 20px 40px;
    border-radius: 30px;
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.5s ease;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.6),
        inset 0 3px 6px rgba(255, 215, 0, 0.3),
        0 0 0 1px rgba(255, 215, 0, 0.5);
    overflow: visible;
    z-index: 100;
    pointer-events: auto;
    display: inline-block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.enter-portal-btn:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(218, 165, 32, 0.6),
        inset 0 3px 6px rgba(255, 215, 0, 0.4);
}

.btn-mystical-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 30px;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.6), transparent);
    opacity: 0;
    animation: mysticalGlow 4s ease-in-out infinite;
    z-index: -1; /* Move behind the button to prevent click interference */
    pointer-events: none; /* Ensure it doesn't block clicks */
}

.invitation-text {
    color: #daa520;
    font-style: italic;
    font-size: 1.2rem;
    margin-top: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    opacity: 0.9;
    z-index: 60;
    position: relative;
}

/* Journal Opening Animation */
.journal-opening {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(139, 69, 19, 0.8) 0%, rgba(10, 6, 4, 0.9) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.journal-opening.active {
    opacity: 1;
    pointer-events: all;
}

.opening-journal {
    position: relative;
    max-width: 600px;
    text-align: center;
}

.journal-cover-opening {
    position: relative;
    animation: journalOpen 3s ease-in-out forwards;
}

.opening-cover-image {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
}

.golden-emanation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: goldenEmanation 3s ease-out;
    z-index: 210;
}

.memory-dust {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 220;
}

.dust-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.9) 0%, transparent 70%);
    border-radius: 50%;
    animation: dustRise 4s ease-out;
}

/* Journal Experience */
.journal-experience {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 40%, rgba(139, 69, 19, 0.2) 0%, rgba(26, 15, 10, 0.8) 40%, #0a0604 100%),
        url('/journal-portal/images/mystical-desk.jpg');
    background-size: cover;
    background-attachment: fixed;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    transform: scale(0.9);
    transition: all 1.5s ease;
    pointer-events: none;
}

.journal-experience.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

/* Mystical Flipbook */
.mystical-flipbook {
    width: 1400px;
    height: 900px;
    position: relative;
    box-shadow: 
        0 50px 100px rgba(0, 0, 0, 0.9),
        0 0 0 8px #654321,
        0 0 0 16px #8b4513,
        inset 0 0 50px rgba(255, 215, 0, 0.1);
    border-radius: 15px;
    background: 
        linear-gradient(135deg, rgba(139, 69, 19, 0.9) 0%, rgba(101, 67, 33, 0.8) 100%),
        url('https://jgq6a2ue5v3c.space.minimax.io/images/ancient-leather.png');
    background-size: cover;
    z-index: 310;
}

/* Journal Pages */
.journal-page {
    position: relative;
    background: 
        /* Deep aged paper base with heavy yellowing */
        linear-gradient(135deg, 
            rgba(215, 195, 155, 0.98) 0%, 
            rgba(205, 180, 135, 0.96) 12%,
            rgba(195, 170, 125, 0.97) 25%,
            rgba(185, 160, 115, 0.95) 38%,
            rgba(200, 175, 130, 0.96) 50%,
            rgba(210, 185, 140, 0.97) 62%,
            rgba(220, 195, 150, 0.98) 75%,
            rgba(215, 190, 145, 0.96) 88%,
            rgba(210, 185, 140, 0.98) 100%
        ),
        /* Heavy coffee stains and age spots */
        radial-gradient(ellipse at 18% 25%, rgba(120, 85, 45, 0.35) 0%, rgba(140, 100, 60, 0.18) 50%, transparent 70%),
        radial-gradient(ellipse at 82% 75%, rgba(110, 75, 35, 0.32) 0%, rgba(130, 90, 50, 0.15) 45%, transparent 65%),
        radial-gradient(ellipse at 35% 15%, rgba(100, 70, 30, 0.28) 0%, rgba(120, 85, 45, 0.12) 40%, transparent 60%),
        radial-gradient(ellipse at 65% 85%, rgba(115, 80, 40, 0.30) 0%, rgba(135, 95, 55, 0.16) 48%, transparent 68%),
        radial-gradient(ellipse at 15% 65%, rgba(95, 65, 25, 0.25) 0%, rgba(115, 80, 40, 0.14) 35%, transparent 55%),
        radial-gradient(ellipse at 85% 35%, rgba(125, 90, 50, 0.33) 0%, rgba(145, 105, 65, 0.18) 42%, transparent 62%),
        /* Water damage and foxing */
        radial-gradient(ellipse at 45% 75%, rgba(140, 110, 70, 0.22) 0%, rgba(160, 125, 85, 0.10) 35%, transparent 55%),
        radial-gradient(ellipse at 75% 25%, rgba(130, 100, 60, 0.20) 0%, rgba(150, 115, 75, 0.08) 40%, transparent 60%),
        /* Heavy mold spots */
        radial-gradient(circle at 90% 15%, rgba(85, 60, 20, 0.18) 0%, rgba(105, 75, 35, 0.08) 25%, transparent 40%),
        radial-gradient(circle at 10% 85%, rgba(75, 50, 15, 0.16) 0%, rgba(95, 65, 25, 0.06) 20%, transparent 35%),
        radial-gradient(circle at 25% 40%, rgba(90, 65, 25, 0.14) 0%, rgba(110, 80, 40, 0.05) 22%, transparent 38%),
        /* Paper fiber texture overlay */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"><defs><filter id="heavyTexture"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="6" result="noise" seed="5"/><feColorMatrix in="noise" type="saturate" values="0"/><feComponentTransfer><feFuncA type="discrete" tableValues="0 .1 0 .15 0 .05 .2 0 .08"/></feComponentTransfer></filter></defs><rect width="200" height="200" fill="#c5b085" filter="url(#heavyTexture)" opacity="0.4"/></svg>'),
        /* Additional aging texture */
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><defs><filter id="agingPattern"><feTurbulence type="turbulence" baseFrequency="0.02" numOctaves="4" result="aging" seed="3"/><feComposite operator="multiply" in2="SourceGraphic"/></filter></defs><rect width="300" height="300" fill="#d4c090" filter="url(#agingPattern)" opacity="0.3"/></svg>')
        ;
    background-size: 
        cover, 
        280px 180px, 320px 220px, 200px 130px, 290px 200px, 250px 160px, 310px 210px,
        350px 240px, 270px 180px, 80px 80px, 60px 60px, 90px 90px,
        150px 150px, 200px 200px;
    background-position: 
        center, 
        18% 25%, 82% 75%, 35% 15%, 65% 85%, 15% 65%, 85% 35%,
        45% 75%, 75% 25%, 90% 15%, 10% 85%, 25% 40%,
        0% 0%, 50% 50%;
    border-radius: 8px;
    overflow: hidden;
    /* Heavy aging shadows and wear */
    box-shadow: 
        inset 0 0 50px rgba(120, 85, 45, 0.35),
        inset 0 0 150px rgba(100, 70, 30, 0.20),
        inset 0 0 80px rgba(85, 60, 20, 0.15),
        0 0 0 2px rgba(139, 105, 20, 0.5),
        0 0 0 4px rgba(120, 90, 30, 0.3);
    background-blend-mode: multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, multiply, darken, darken, darken, overlay, overlay;
    z-index: 320;
}

.left-page {
    background: 
        /* Heavy vintage parchment with deep yellowing */
        linear-gradient(135deg, 
            rgba(237, 206, 132, 0.98) 0%, 
            rgba(234, 185, 95, 0.96) 20%,
            rgba(211, 166, 82, 0.97) 40%,
            rgba(208, 167, 91, 0.95) 60%,
            rgba(205, 165, 91, 0.96) 80%,
            rgba(230, 190, 112, 0.98) 100%
        ),
        /* Heavy coffee stains and age spots */
        radial-gradient(ellipse at 12% 20%, rgba(110, 75, 35, 0.40) 0%, rgba(130, 90, 50, 0.22) 50%, transparent 75%),
        radial-gradient(ellipse at 88% 80%, rgba(100, 70, 30, 0.38) 0%, rgba(120, 85, 45, 0.20) 45%, transparent 70%),
        radial-gradient(ellipse at 40% 12%, rgba(125, 90, 50, 0.35) 0%, rgba(145, 105, 65, 0.18) 40%, transparent 65%),
        radial-gradient(ellipse at 60% 88%, rgba(115, 80, 40, 0.33) 0%, rgba(135, 95, 55, 0.16) 48%, transparent 68%),
        /* Heavy ink blot effects */
        radial-gradient(circle at 92% 8%, rgba(55, 35, 15, 0.25) 0%, rgba(75, 50, 25, 0.12) 20%, transparent 35%),
        radial-gradient(circle at 8% 92%, rgba(65, 40, 20, 0.22) 0%, rgba(85, 55, 30, 0.10) 18%, transparent 32%),
        radial-gradient(circle at 25% 75%, rgba(70, 45, 25, 0.20) 0%, rgba(90, 60, 35, 0.08) 15%, transparent 28%),
        /* Water damage rings */
        radial-gradient(ellipse at 20% 60%, rgba(140, 105, 65, 0.18) 0%, rgba(160, 120, 80, 0.08) 40%, transparent 65%),
        radial-gradient(ellipse at 80% 40%, rgba(219, 154, 80, 0.16) 0%, rgba(155, 115, 75, 0.06) 45%, transparent 70%);
    background-size: 
        cover, 
        220px 140px, 260px 180px, 180px 120px, 240px 160px,
        70px 70px, 60px 60px, 80px 80px,
        300px 200px, 280px 190px;
    background-blend-mode: normal, multiply, multiply, multiply, multiply, darken, darken, darken, multiply, multiply;
}

.right-page {
    background: 
        /* Heavy vintage parchment with deep yellowing */
        linear-gradient(135deg, 
            rgba(237, 206, 132, 0.98) 0%, 
            rgba(234, 185, 95, 0.96) 20%,
            rgba(211, 166, 82, 0.97) 40%,
            rgba(208, 167, 91, 0.95) 60%,
            rgba(205, 165, 91, 0.96) 80%,
            rgba(230, 190, 112, 0.98) 100%
        ),
        /* Heavy coffee stains and age spots */
        radial-gradient(ellipse at 12% 20%, rgba(110, 75, 35, 0.40) 0%, rgba(130, 90, 50, 0.22) 50%, transparent 75%),
        radial-gradient(ellipse at 88% 80%, rgba(100, 70, 30, 0.38) 0%, rgba(120, 85, 45, 0.20) 45%, transparent 70%),
        radial-gradient(ellipse at 40% 12%, rgba(125, 90, 50, 0.35) 0%, rgba(145, 105, 65, 0.18) 40%, transparent 65%),
        radial-gradient(ellipse at 60% 88%, rgba(115, 80, 40, 0.33) 0%, rgba(135, 95, 55, 0.16) 48%, transparent 68%),
        /* Heavy ink blot effects */
        radial-gradient(circle at 92% 8%, rgba(55, 35, 15, 0.25) 0%, rgba(75, 50, 25, 0.12) 20%, transparent 35%),
        radial-gradient(circle at 8% 92%, rgba(65, 40, 20, 0.22) 0%, rgba(85, 55, 30, 0.10) 18%, transparent 32%),
        radial-gradient(circle at 25% 75%, rgba(70, 45, 25, 0.20) 0%, rgba(90, 60, 35, 0.08) 15%, transparent 28%),
        /* Water damage rings */
        radial-gradient(ellipse at 20% 60%, rgba(140, 105, 65, 0.18) 0%, rgba(160, 120, 80, 0.08) 40%, transparent 65%),
        radial-gradient(ellipse at 80% 40%, rgba(219, 154, 80, 0.16) 0%, rgba(155, 115, 75, 0.06) 45%, transparent 70%);
    background-size: 
        cover, 
        300px 200px, 250px 170px, 220px 150px, 280px 190px,
        120px 120px, 100px 100px, 140px 140px,
        90px 90px, 110px 110px, 130px 130px;
    background-blend-mode: normal, multiply, multiply, multiply, multiply, multiply, multiply, multiply, darken, darken, darken;
}

/* Page Content */
.page-content {
    padding: 60px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    z-index: 330;
    /* Add subtle paper aging around edges */
    background: 
        linear-gradient(to right, rgba(160, 130, 98, 0.08) 0px, transparent 40px),
        linear-gradient(to left, rgba(160, 130, 98, 0.08) 0px, transparent 40px),
        linear-gradient(to top, rgba(160, 130, 98, 0.05) 0px, transparent 30px),
        linear-gradient(to bottom, rgba(160, 130, 98, 0.05) 0px, transparent 30px);
    border-radius: 4px;

    @media (max-width: 1400px) {
        height: 80%;
        overflow-y: auto;
        overflow-x: clip;
    }
}

.page-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.page-image {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    z-index: 340;
}

.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    opacity: 0.8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.gov-source {
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    color: #ffd700;
}

.full-report-link {
    margin-top: 10px;
    text-align: center;
    font-style: italic;
}

/* Handwritten Content */
.handwritten-content {
    font-family: 'Kalam', cursive;
    color: #2c1408;
    height: 100%;
    line-height: 1.2;
    overflow-y: auto;
    padding-right: 30px;
    /* Add subtle ink absorption effect */
    text-shadow: 
        0.5px 0.5px 0.5px rgba(44, 20, 8, 0.3),
        -0.5px 0.5px 0.5px rgba(44, 20, 8, 0.2);
}

.handwritten-title {
    font-family: 'Cinzel', serif;
    font-size: 2.8rem;
    color: #4a2c0a;
    text-align: center;
    margin-bottom: 40px;
    text-shadow: 
        1px 1px 2px rgba(74, 44, 10, 0.4),
        0 0 8px rgba(139, 105, 20, 0.3);
    position: relative;
    /* Add vintage ink effect */
    background: linear-gradient(180deg, #4a2c0a 0%, #3a220a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.handwritten-title::after {
    content: '';
    display: block;
    width: 150px;
    height: 4px;
    background: linear-gradient(90deg, #8b4513, #daa520, #8b4513);
    margin: 20px auto;
    border-radius: 2px;
}

.handwritten-text {
    flex: 1;
}

.journal-date {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #5a3818;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    letter-spacing: 1px;
    /* Add vintage date stamp effect */
    background: linear-gradient(45deg, #5a3818 0%, #4a2c0a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0.5px 0.5px 1px rgba(90, 56, 24, 0.3);
}

.handwritten-text p {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-indent: 40px;
    color: #2c1408;
    /* Simulate aged ink */
    background: linear-gradient(180deg, #2c1408 0%, #22100a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Add subtle ink bleed effect */
    filter: drop-shadow(0.5px 0.5px 0.5px rgba(44, 20, 8, 0.2));
}

.signature {
    text-align: right;
    font-style: italic;
    font-size: 1.3rem;
    color: #4a2c0a;
    margin-top: 40px;
    font-family: 'Cinzel', serif;
    /* Add authentic signature ink effect */
    background: linear-gradient(45deg, #4a2c0a 0%, #3a220a 50%, #2a1808 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0.5px 0.5px 1px rgba(74, 44, 10, 0.4));
}

/* Sacred Elements */
.sacred-seal {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    border: 2px solid #daa520;
    border-radius: 15px;
    background: rgba(218, 165, 32, 0.1);
}

.portal-symbol {
    font-size: 3rem;
    color: #daa520;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(218, 165, 32, 0.8);
    animation: portalPulse 3s ease-in-out infinite;
}

.seal-text {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    color: #8b4513;
    font-weight: 600;
    letter-spacing: 2px;
}

/* Evidence Pages */
.evidence-page {
    position: relative;
}

.mystical-reveal {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.2s ease-in-out;
    z-index: 350;
}

.mystical-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.swirling-magic {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 70%, rgba(218, 165, 32, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(255, 215, 0, 0.01) 0%, transparent 50%);
    animation: magicSwirl 6s ease-in-out infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
    z-index: 345;
}

.mystical-reveal.revealing .swirling-magic {
    opacity: 0.02;
}

.evidence-content {
    position: relative;
    z-index: 360;
    pointer-events: auto;
}

.evidence-title {
    font-family: 'Cinzel', serif;
    font-size: 2.4rem;
    color: #4a2c0a;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 
        1px 1px 2px rgba(74, 44, 10, 0.4),
        0 0 6px rgba(139, 105, 20, 0.3);
    /* Add vintage title effect */
    background: linear-gradient(180deg, #4a2c0a 0%, #3a220a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.evidence-item {
    text-align: center;
    margin-bottom: 30px;
}

.evidence-image {
    max-width: 350px;
    max-height: 280px;
    border-radius: 10px;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),
        0 0 0 4px #8b4513,
        0 0 30px rgba(218, 165, 32, 0.4);
    transition: transform 0.4s ease;
}

.evidence-image:hover {
    transform: scale(1.08);
}

.evidence-image.sepia-glow {
    filter: sepia(0.4) contrast(1.2);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),
        0 0 0 4px #8b4513,
        0 0 30px rgba(255, 215, 0, 0.6);
}

.evidence-image.document-glow {
    filter: sepia(0.2) contrast(1.1);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),
        0 0 0 4px #654321,
        0 0 30px rgba(218, 165, 32, 0.5);
}

.evidence-image.portal-glow {
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),
        0 0 0 4px #daa520,
        0 0 40px rgba(255, 215, 0, 0.8);
    animation: portalImageGlow 4s ease-in-out infinite;
}

.evidence-caption {
    font-style: italic;
    color: #4a2c0a;
    margin-top: 15px;
    font-size: 1.1rem;
    /* Add vintage caption styling */
    background: linear-gradient(180deg, #4a2c0a 0%, #3a220a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0.5px 0.5px 1px rgba(74, 44, 10, 0.2);
}

.evidence-text {
    text-align: justify;
    line-height: 1.7;
    color: #2c1408;
    /* Add paper text effect */
    background: linear-gradient(180deg, #2c1408 0%, #22100a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.evidence-text p {
    margin-bottom: 18px;
    font-size: 1.2rem;
    /* Enhance vintage text appearance */
    background: linear-gradient(180deg, #2c1408 0%, #22100a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0.3px 0.3px 0.3px rgba(44, 20, 8, 0.15));
}

.mystical-insight {
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.2), rgba(255, 215, 0, 0.1));
    padding: 20px;
    border-left: 5px solid #daa520;
    border-radius: 8px;
    font-style: italic;
    margin: 25px 0;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.mystical-insight::before {
    content: '✦';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.5rem;
    color: #daa520;
    animation: sparkle 3s ease-in-out infinite;
}

/* Interactive Elements */
.mystical-learn-more {
    background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.4s ease;
    box-shadow: 
        0 8px 20px rgba(218, 165, 32, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 400;
    pointer-events: auto;
    display: inline-block;
}

.mystical-learn-more:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 30px rgba(218, 165, 32, 0.6),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.mystical-learn-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.8s ease;
}

.mystical-learn-more:hover::before {
    left: 100%;
}

/* Mystical Navigation */
.mystical-navigation {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 40px;
    background: rgba(139, 69, 19, 0.9);
    padding: 20px 40px;
    border-radius: 30px;
    border: 3px solid #daa520;
    backdrop-filter: blur(15px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transition: opacity 1s ease-in-out;
    opacity: 0.2;
    z-index: 500;
}

.mystical-navigation:hover {
    opacity: 1;
}

.mystical-nav-btn {
    background: linear-gradient(135deg, #daa520, #b8860b);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(218, 165, 32, 0.4);
    z-index: 510;
    position: relative;
}

.mystical-nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.6);
}

.mystical-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.2);
}

.consciousness-indicator {
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 510;
    position: relative;
}

/* Return Portal */
.return-portal {
    opacity: 0.2;
    position: fixed;
    top: 40px;
    transition: opacity 1s ease-in-out;
    right: 40px;
    z-index: 500;
}

.return-portal:hover {
    opacity: 1;
}

.return-link {
    display: block;
    background: rgba(139, 69, 19, 0.9);
    color: #ffd700;
    text-decoration: none;
    padding: 15px 25px;
    border-radius: 20px;
    border: 2px solid #daa520;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    z-index: 510;
}

.return-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(218, 165, 32, 0.5);
}

.return-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.4), transparent);
    border-radius: 20px;
    opacity: 0;
    animation: returnGlow 4s ease-in-out infinite;
}

/* Memory Effects */
.memory-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 600;
}

.memory-sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.9) 0%, transparent 70%);
    border-radius: 50%;
    animation: sparkleFloat 5s ease-in-out infinite;
}

/* Mystical Modal */
.mystical-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.95) 0%, rgba(101, 67, 33, 0.9) 100%);
    padding: 50px;
    border-radius: 20px;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    border: 4px solid #daa520;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 50px rgba(218, 165, 32, 0.4);
    position: relative;
    z-index: 1010;
    pointer-events: auto;
}

.modal-glow {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    border-radius: 20px;
    animation: mysticalGlow 4s ease-in-out infinite;
    z-index: -1;
}

/* Animations */
@keyframes candleFlicker {
    0%, 100% { 
        opacity: 0.8;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes floatUpward {
    0% {
        opacity: 0;
        transform: translateY(100vh) translateX(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) translateX(50px);
    }
}

@keyframes mysticalPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

@keyframes portalBeckoning {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

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

/* Fixed animation for the book opening */
@keyframes journalOpen {
    0% {
        transform: perspective(1000px) rotateY(0deg) scale(1);
        opacity: 1;
    }
    30% {
        transform: perspective(1000px) rotateY(-10deg) scale(1.05);
        opacity: 1;
    }
    70% {
        transform: perspective(1000px) rotateY(-20deg) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: perspective(1000px) rotateY(-30deg) scale(1.2);
        opacity: 0;
    }
}

@keyframes goldenEmanation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(3);
    }
}

@keyframes dustRise {
    0% {
        opacity: 0;
        transform: translateY(200px) translateX(0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateY(150px) translateX(10px) scale(1);
    }
    80% {
        opacity: 1;
        transform: translateY(-100px) translateX(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-200px) translateX(-40px) scale(0);
    }
}

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

@keyframes sparkle {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

@keyframes portalPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.3);
    }
}

@keyframes portalImageGlow {
    0%, 100% {
        box-shadow: 
            0 15px 30px rgba(0, 0, 0, 0.5),
            0 0 0 4px #daa520,
            0 0 40px rgba(255, 215, 0, 0.8);
    }
    50% {
        box-shadow: 
            0 15px 30px rgba(0, 0, 0, 0.5),
            0 0 0 4px #ffd700,
            0 0 60px rgba(255, 215, 0, 1);
    }
}

@keyframes sparkleFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(20px) translateX(0) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) translateX(10px) scale(1);
    }
}

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

/* Responsive Design */
@media (max-width: 1600px) {
    .mystical-flipbook {
        width: 1200px;
        height: 800px;
    }
}

@media (max-width: 1400px) {
    .mystical-flipbook {
        width: 1000px;
        height: 700px;
    }
    
    .page-content {
        padding: 40px;
    }
}

@media (max-width: 1200px) {
    .mystical-flipbook {
        width: 90vw;
        height: 70vw;
        max-width: 900px;
        max-height: 600px;
    }
    
    .page-content {
        padding: 30px;
    }
    
    .handwritten-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    *::-webkit-scrollbar {
        width: 3px;
    }
    *::-webkit-scrollbar-track {
        background-color: #d2ccae;
        border-radius: 5px;
    }
    *::-webkit-scrollbar-thumb {
        background-color: #ce9135;
        background-repeat: no-repeat;
        background-size: cover;
        background-position: bottom;
        border-radius: 5px;
    }

    .mystical-desk {
        height: 100%;
        width: 100%;
    }

    .journal-experience .mystical-flipbook {
        height: 100% !important;
        overflow-y: auto;
        overflow-x: clip;
        width: 100% !important;
    }

    /* We use overflow:visible only when is not being animated, added this into the JS */
    /* .turn-page-wrapper,
    .turn-page-wrapper > div {
        overflow: visible !important;
    } */

    .turn-page-wrapper .journal-page {
        height: 680px !important;
        overflow: visible;
    }

    .journal-page .page-content {
        justify-content: flex-start;
    }

    .portal-scene .journal-on-desk {
        display: flex;
        flex-direction: row;
        width: 100%;
    }

    .journal-cover-closed {
        align-items: center;
        justify-content: center;
        display: flex;
        margin: 0;
        width: 50%;
    }

    .cover-image {
        max-width: 220px;
    }
    
    .entry-invitation {
        align-items: center;
        display: flex;
        flex-direction: column;
        
        justify-content: center;
        width: 50%;
    }

    .entry-invitation .enter-portal-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .mystical-flipbook {
        width: 95vw;
        height: 75vw;
    }
    
    .page-content {
        padding: 20px;
    }
    
    .handwritten-title {
        font-size: 1.8rem;
    }
    
    .handwritten-text p {
        font-size: 1.2rem;
        text-indent: 20px;
    }
    
    .mystical-navigation {
        bottom: 0px;
        border: none;
        border-bottom-left-radius: 0px;
        border-bottom-right-radius: 0px;
        display: flex;
        justify-content: space-between;
        opacity: 1;
        padding: 5px 10px;
        width: 100%;
    }

    .mystical-navigation .mystical-nav-btn {
        font-size: 0.7rem !important;
        padding: 6px 12px;
    }

    .mystical-navigation .portal-state {
        font-size: 0.7rem !important;
    }

    .return-portal {
        display: none;
    }
    
    .candle {
        display: none;
    }

    .modal-content {
        overflow: auto;
    }

    * h2,
    * h3 {
        font-size: 1rem !important;
    }

    * p {
        font-size: 0.8rem !important;
    }

    * .evidence-item {
        align-items: center;
        display: flex;
    }

    * .evidence-content .mystical-learn-more {
        font-size: 0.8rem;
        padding: 10px 20px;
    }

    .mystical-modal .close-portal {
        font-size: 0.8rem !important;
        padding: 10px 20px !important;
    }

    * .evidence-item img {
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5),
        0 0 0 3px #8b4513,
        0 0 30px rgba(218, 165, 32, 0.4) !important;
        max-width: 120px !important;
        margin-right: 10px;
    }

    * .signature {
        font-size: 1rem !important;
        margin-top: 10px !important;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .rotate-device-announcement {
        align-items: center;
        background: linear-gradient(135deg, rgba(101, 67, 33, 0.8) 0%, rgba(139, 69, 19, 0.6) 100%), url('/journal-portal/images/mystical-desk.jpg');
        background-size: cover;
        color: #ffd700;
        display: flex;
        flex-direction: column;
        font-weight: bold;
        height: 100vh;
        justify-content: center;
        left: 0;
        position: fixed;
        top: 0;
        width: 100vw;
        z-index: 100000;
    }

    .rotate-device-announcement h2 {
        font-size: 2rem !important;
        text-align: center;
    }

    .rotate-device-announcement p {
        font-size: 1.2rem !important;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .enter-portal-btn {
        padding: 15px 25px;
        font-size: 1.2rem;
    }
    
    .invitation-text {
        font-size: 1rem;
    }
    
    .evidence-image {
        max-width: 250px;
        max-height: 200px;
    }
    
    .return-portal {
        top: 20px;
        right: 20px;
    }
    
    .return-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}