/* Base Setting - Visual Doctrine Ver 2.0 */
:root {
    --bg-color: #101420;
    /* Tetsu-Kon (Iron Navy) */
    --text-color: #EBE1CD;
    /* Ivory (Old Paper) */
    --primary-accent: #B72E3E;
    /* Akane-iro (Madder Red) */
    --secondary-accent: #C7B370;
    /* Mustard/Gold Thread */
    --font-main: 'Shippori Mincho', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 17px;
    /* Slightly larger for literary feel */
    line-height: 2.5;
    /* Very loose line height */
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    width: 100vw;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-accent) var(--bg-color);

    /* Background Image Setup: Woodblock Print Style */
    background-image: linear-gradient(rgba(16, 20, 32, 0.85), rgba(16, 20, 32, 0.9)), url('bg_taisho.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

/* Noise Overlay - Washi Paper Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.12;
    /* Visible paper fibers */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}

/* Main Layout - The Letter / Writing Desk */
.canvass {
    max-width: 780px;
    margin: 0 auto;
    padding: 10vh 2rem 15vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Typography & Ink Bleed Effects */
h1.main-title {
    font-size: 3.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
    color: var(--text-color);
    text-align: center;
    /* Ink Bleed Effect */
    text-shadow: 0 0 3px rgba(235, 225, 205, 0.6), 2px 2px 0px rgba(0, 0, 0, 0.5);
    font-feature-settings: "palt";
    writing-mode: vertical-rl;
    /* Vertical Title as per Doctrine */
    text-orientation: upright;
    margin-left: auto;
    margin-right: auto;
    height: 400px;
    /* Space for vertical title */
}

h2.sub-title {
    font-size: 1.6rem;
    margin-bottom: 5rem;
    text-align: center;
    color: var(--primary-accent);
    /* Akane-iro */
    letter-spacing: 0.1em;
    font-family: serif;
    /* Stamp/Seal effect */
    background: radial-gradient(circle, rgba(183, 46, 62, 0.1) 0%, transparent 70%);
    padding: 1rem;
    text-shadow: 0 0 5px rgba(183, 46, 62, 0.4);
}

.meta-info {
    text-align: right;
    margin-bottom: 4rem;
    font-size: 0.9rem;
    color: var(--secondary-accent);
    font-style: normal;
    font-family: monospace;
    /* Typewriter feel */
    border-right: 2px solid var(--secondary-accent);
    padding-right: 1.5rem;
    display: inline-block;
    align-self: flex-end;
}

h3 {
    font-size: 1.8rem;
    margin-top: 6rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-color);
    font-feature-settings: "palt";
    text-shadow: 0 0 2px var(--text-color);
    border-bottom: 1px solid rgba(199, 179, 112, 0.3);
    /* Thin gold line */
    padding-bottom: 1rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

p {
    margin-bottom: 3.5rem;
    text-indent: 0;
    /* Remove standard indent */
    text-align: justify;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #DACFB5;
    /* Slightly darker Ivory */
    /* Punctuation hanging */
    hanging-punctuation: allow-end;
}

p::first-letter {
    font-size: 1.3em;
    margin-right: 0.1em;
    color: var(--secondary-accent);
}

strong {
    color: var(--primary-accent);
    font-weight: 700;
    background: transparent;
    border-bottom: 1px dotted var(--primary-accent);
}

/* Card / Paper Sheet Effect */
.content-block {
    margin-bottom: 6rem;
    padding: 3rem 2rem;
    /* Washi Paper Background */
    background-color: rgba(23, 28, 40, 0.8);
    border: 1px solid rgba(199, 179, 112, 0.15);
    /* Faint gold border */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    border-radius: 2px;
}

/* Decor: Vertical text decoration */
.content-block::before {
    content: '';
    display: block;
    width: 2px;
    height: 40px;
    background: var(--primary-accent);
    margin: 0 auto 2rem auto;
    opacity: 0.6;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.8s ease-out, transform 1.8s ease-out;
    /* Slower, heavier movement */
}

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

/* Selection Style */
::selection {
    background: var(--primary-accent);
    color: #fff;
    text-shadow: none;
}

/* Responsiveness */
@media screen and (max-width: 768px) {
    h1.main-title {
        font-size: 2.8rem;
        height: 300px;
    }

    .content-block {
        padding: 1.5rem 1rem;
        margin-bottom: 4rem;
    }

    p {
        line-height: 2.2;
    }
}