/* Global Styles */
body {
    background-color: #0f0f12;
    /* Dark background */
    color: #e0e0e0;
    /* Off-white text */
    font-family: 'Zen Old Mincho', 'Sawarabi Mincho', serif;
    font-feature-settings: "palt";
    font-variant-east-asian: proportional-width;
    margin: 0;
    padding: 0;
    line-height: 1.8;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-weight: 900;
    letter-spacing: 0.15em;
    line-height: 1.4;
}

p {
    margin-bottom: 1.5rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Subtle Ink and Geometric Barrier Effect */
    background-color: #0f0f12;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(20, 20, 25, 1) 0%, rgba(15, 15, 18, 0.95) 60%, rgba(10, 10, 12, 1) 100%),
        repeating-linear-gradient(45deg, rgba(224, 247, 250, 0.008) 0px, rgba(224, 247, 250, 0.008) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(-45deg, rgba(224, 247, 250, 0.008) 0px, rgba(224, 247, 250, 0.008) 1px, transparent 1px, transparent 40px);
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeIn 2s ease-out;
}

.title {
    font-size: 5rem;
    margin: 0;
    color: #e0e0e0;
    text-shadow: 0 0 15px rgba(201, 42, 42, 0.5);
    /* Subtle glow */
    font-family: 'Zen Old Mincho', serif;
}

.subtitle {
    font-size: 1.5rem;
    color: #a0a0a0;
    margin-top: 1rem;
    letter-spacing: 0.2em;
}

.hero-text {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: #d1d1d1;
    opacity: 0.85;
}

.btn-read {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    color: #e0e0e0;
    border: 1px solid #c92a2a;
    text-decoration: none;
    background: rgba(201, 42, 42, 0.1);
    transition: all 0.3s ease;
    letter-spacing: 0.1em;
    font-family: 'Zen Old Mincho', serif;
    position: relative;
    overflow: hidden;
}

.btn-read:hover {
    background: #c92a2a;
    color: #fff;
    box-shadow: 0 0 15px rgba(201, 42, 42, 0.5);
    transform: translateY(-2px);
}

/* Red Line Animation - Balanced */
.red-line-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.red-line {
    position: absolute;
    top: 50%;
    left: -100%;
    width: 200%;
    height: 3px;
    /* Slightly thinner */
    background: linear-gradient(90deg, transparent, #c92a2a, #ff5252, #c92a2a, transparent);
    transform: rotate(-15deg);
    animation: slash 5s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    /* Slower */
    opacity: 0.8;
    box-shadow: 0 0 15px #c92a2a;
    /* Softer glow */
}

@keyframes slash {
    0% {
        left: -100%;
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Particles / White Rain (Soft) */
.particles {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    z-index: 0;
    background-image:
        linear-gradient(to bottom, rgba(224, 247, 250, 0.1) 10%, transparent 30%);
    /* Much softer gradient */
    background-size: 1px 50px;
    /* Slightly shorter */
    opacity: 0.15;
    /* Significant opacity reduction to avoid eye strain */
    animation: rain 2s linear infinite;
    /* Slower animation */
    pointer-events: none;
}

@keyframes rain {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(50%);
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections General */
section {
    padding: 6rem 2rem;
    position: relative;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    border-bottom: 1px solid #c92a2a;
    display: inline-block;
    padding-bottom: 0.5rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* Story Section */
.story {
    background-color: #141419;
}

.story-content {
    font-size: 1.05rem;
    opacity: 0.9;
    letter-spacing: 0.08em;
    text-align: justify;
    line-height: 2;
}

.story-content p {
    margin-bottom: 2rem;
}

/* Episodes Section */
.episodes {
    background-color: #0f0f12;
    overflow: hidden;
}

.episodes::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(180deg, rgba(10, 10, 14, 0.55), rgba(10, 10, 14, 0.8)),
        url('%E3%82%AD%E3%83%A3%E3%83%A9%E3%82%AF%E3%82%BF%E3%83%BC%E3%82%B7%E3%83%BC%E3%83%88/kourinroku_172.png');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat;
    opacity: 0.28;
    pointer-events: none;
}

.episodes>.container {
    position: relative;
    z-index: 1;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.episode-link {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.episode-link:hover {
    background: rgba(201, 42, 42, 0.1);
    border-color: rgba(201, 42, 42, 0.3);
    transform: translateX(5px);
}

.episode-num {
    display: block;
    color: #c92a2a;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.episode-excerpt {
    display: block;
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}

/* Character Grid */
.characters {
    background-color: #141419;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.character-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: rgba(201, 42, 42, 0.3);
}

.char-name {
    font-size: 1.5rem;
    color: #e0e0e0;
    margin-bottom: 0.5rem;
    border-left: 3px solid #c92a2a;
    padding-left: 0.5rem;
}

.char-role {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.char-desc {
    font-size: 0.95rem;
    color: #d0d0d0;
    line-height: 1.9;
    letter-spacing: 0.05em;
    text-align: justify;
}

.character-card.highlight {
    border: 1px solid rgba(201, 42, 42, 0.5);
    background: rgba(201, 42, 42, 0.05);
}


/* World / Relationship Diagram Section */
.world {
    background-color: #141419;
    padding-bottom: 6rem;
}

.relationship-diagram {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 500px;
    /* Fixed height for desktop triangle */
    margin: 4rem auto 0;
}

.diagram-node {
    position: absolute;
    width: 220px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.diagram-node:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #c92a2a;
    transform: scale(1.05);
}

.diagram-node h3 {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    color: #e0e0e0;
}

.node-desc {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
    text-align: center !important;
}

/* Node Positions */
.node-izonsha {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-color: rgba(200, 200, 255, 0.3);
}

.node-senkeisha {
    bottom: 0;
    left: 0;
    border-color: rgba(200, 50, 50, 0.3);
}

.node-shitsuishu {
    bottom: 0;
    right: 0;
    border-color: rgba(100, 100, 100, 0.5);
}

/* Lines */
.relation-line {
    position: absolute;
    background-color: #444;
    height: 1px;
    z-index: 1;
    transform-origin: 0 0;
}

.relation-line::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #0f0f12;
    padding: 2px 6px;
    font-size: 0.75rem;
    color: #888;
    border: 1px solid #333;
    border-radius: 4px;
    white-space: nowrap;
}

/* Calculate Line Positions (Approximate for 700x500 box) */
/* Top Center to Bottom Left */
.line-left {
    top: 15%;
    /* Below top node */
    left: 45%;
    width: 53%;
    transform: rotate(115deg);
}

/* Top Center to Bottom Right */
.line-right {
    top: 15%;
    left: 55%;
    width: 53%;
    transform: rotate(65deg);
}

/* Bottom Left to Bottom Right */
.line-bottom {
    bottom: 12%;
    /* Center of bottom nodes roughly */
    left: 32%;
    width: 36%;
}

/* Enemies Section */
.enemies {
    background-color: #0d0d10;
    /* Slightly darker */
    padding: 6rem 0;
}

.enemy-boss {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: linear-gradient(to right, rgba(0, 0, 20, 0.3), transparent);
    padding: 2rem;
    border-left: 3px solid #3a3a50;
    /* Blue/Dark accent */
    margin-bottom: 4rem;
}

.boss-content h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

.enemy-role {
    font-size: 1rem;
    color: #888;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.enemy-desc {
    color: #ccc;
    line-height: 1.8;
}

.boss-image {
    height: 250px;
}

.enemy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.enemy-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 4px;
}

.enemy-card h3 {
    font-size: 1.4rem;
    margin: 1rem 0 0.5rem;
}


/* Responsive */
@media (max-width: 768px) {
    .relationship-diagram {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        margin-top: 1rem;
    }

    .diagram-node {
        position: relative;
        width: 100%;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin: 0 auto;
    }

    .relation-line {
        display: none;
    }

    .enemy-boss {
        grid-template-columns: 1fr;
    }
}

/* World Section */
.world-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

@media (max-width: 768px) {
    .world-grid {
        grid-template-columns: 1fr;
    }
}

.world-item h3 {
    font-size: 1.8rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.world-item h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #c92a2a;
    transform: rotate(45deg);
}

.world-item p {
    font-size: 1rem;
    color: #ccc;
    line-height: 2;
    text-align: left;
    /* Changed from default/justify for readability */
}

/* Image Placeholders */
.img-placeholder {
    width: 100%;
    height: 150px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.img-placeholder::before {
    content: 'IMAGE';
    color: rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    font-family: sans-serif;
    letter-spacing: 0.1em;
}

.img-placeholder:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(201, 42, 42, 0.3);
}

.img-placeholder.has-image {
    border-style: solid;
    border-color: rgba(201, 42, 42, 0.35);
    background-color: rgba(0, 0, 0, 0.45);
    padding: 0.35rem;
}

.img-placeholder.has-image::before {
    content: none;
}

.img-placeholder.has-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center top;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55));
}

.boss-image .img-placeholder.has-image img {
    object-fit: contain;
    object-position: center top;
}

/* Hero Background Placeholder */
.hero-bg-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: transparent;
    /* This will be replaced by an actual image URL later */
    /* background-image: url('path/to/image.jpg'); */
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    /* Low opacity to blend with CSS effects */
    pointer-events: none;
}

.hero-bg-placeholder.hero-bg-image {
    background-image:
        linear-gradient(180deg, rgba(10, 10, 14, 0.22), rgba(10, 10, 14, 0.72)),
        url('%E3%82%AD%E3%83%A3%E3%83%A9%E3%82%AF%E3%82%BF%E3%83%BC%E3%82%B7%E3%83%BC%E3%83%88/kourinroku_171.png');
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat;
    opacity: 0.48;
}

/* Footer */
.footer {
    padding: 4rem 2rem;
    background-color: #0a0a0c;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.epilogue {
    font-style: italic;
    color: #888;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.copyright {
    color: #555;
    font-size: 0.8rem;
}
