@charset "UTF-8";

/* Base Styles */
body {
    background-color: #f5f0e6;
    /* background-image: radial-gradient(circle at 20% 30%, #1a2b4a 0%, #0a1628 70%); */
    background-attachment: fixed;
    color: #2a2a2a;
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    min-height: 100vh;
    /* Mobile scroll optimization */
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Typography */
h1, h2, .main-title {
    font-family: 'Ma Shan Zheng', 'Zhi Mang Xing', 'Long Cang', cursive;
    font-weight: 400;
}

h3 {
    font-family: 'Noto Serif SC', serif;
    font-weight: 700;
}

.seal-mark {
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Vertical Text Mode for Story Section - Desktop Default */
#story {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    -webkit-writing-mode: vertical-rl;
    -ms-writing-mode: tb-rl;
}

#story .vertical-content {
    /* Ensure content flows correctly in vertical mode */
    display: inline-block;
    max-height: 80vh; /* Prevent overflow on smaller vertical screens */
    line-height: 2;
    letter-spacing: 0.1em;
}

/* Specific styling for vertical paragraphs to look like columns */
#story p {
    margin-left: 1.5em; /* Turns into vertical spacing in writing-mode: vertical-rl */
    margin-bottom: 0;
}

#story h2 {
    margin-left: 2em;
    margin-bottom: 0;
    padding-bottom: 1em; /* Turns into vertical padding */
}

/* Responsive Design Overrides */
@media (max-width: 767px) {
    /* Mobile: Horizontal Flow for Story */
    #story {
        writing-mode: horizontal-tb;
        -webkit-writing-mode: horizontal-tb;
        -ms-writing-mode: horizontal-tb;
        text-orientation: initial;
        height: auto;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    /* Readability adjustments for mobile */
    body {
        font-size: 16px; /* Ensure base font size is readable */
    }
    
    p {
        font-size: 1.05rem; /* Slight boost for readability */
        line-height: 1.8;
    }

    #story .vertical-content {
        max-height: none;
        display: block;
        width: 100%;
        text-align: justify;
        padding: 0 1rem;
    }

    #story p {
        margin-left: 0;
        margin-bottom: 1.5em; /* Vertical spacing between paragraphs */
    }

    #story h2 {
        margin-left: 0;
        margin-bottom: 1.5em;
        padding-bottom: 0;
        text-align: center;
        border-bottom: 1px solid rgba(42, 42, 42, 0.3);
        display: block;
        width: 100%;
        padding-bottom: 0.5rem;
    }

    /* Touch Targets */
    a, button, .clickable {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex; /* Helps with centering/sizing */
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure sections have breathing room on mobile */
    section {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Reduce animation duration for snappier feel */
    .fade-in-up {
        transition-duration: 0.4s;
    }
}

/* Ink Spot Decorations */
/* Using pseudo-elements on body for background decorations to avoid extra DOM elements */
body::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(closest-side, rgba(60, 60, 60, 0.06) 0%, transparent 80%);
    top: -50px;
    right: -50px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(40px);
    opacity: 0.6;
    transform: translateY(var(--parallax-bg-1, 0));
    will-change: transform;
}

body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(closest-side, rgba(80, 80, 80, 0.04) 0%, transparent 70%);
    bottom: 10%;
    left: -100px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(60px);
    opacity: 0.4;
    transform: translateY(var(--parallax-bg-2, 0));
    will-change: transform;
}

/* Additional Ink Splatter simulation using a fixed element if needed, 
   but for now relying on soft gradients as requested "ink spots" */

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f0e6; 
}

::-webkit-scrollbar-thumb {
    background: #ccc5b8; 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a090; 
}


/* Scroll Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform; /* GPU hint */
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }





/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}