/* japan.je Kojiki pages — shared styles (extracted from kojiki-chronicles.html 2026-10-23) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #c41e3a;
    --gold: #d4af37;
    --dark-grey: #2c2c2c;
    --light-grey: #fafafa;
    --white: #ffffff;
    --divine-purple: #6b4c8a;
    --ocean-blue: #1e3a5f;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--dark-grey);
    background: var(--light-grey);
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 3px;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
}

nav.scrolled {
    padding: 15px 5%;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 24px;
    font-weight: 300;
    color: var(--primary-red);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--dark-grey);
    font-weight: 400;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-red);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary-red);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.4)),
                url('bg-kojiki-hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0,0,0,0.3) 100%);
}

.hero-content {
    text-align: center;
    max-width: 900px;
    z-index: 2;
    padding: 0 20px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 100;
    color: white;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

.hero .kanji {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--gold);
    margin-bottom: 20px;
    letter-spacing: 8px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.hero .subtitle {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 50px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    opacity: 0;
    animation: fadeInUp 1s ease 0.7s forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeInUp 1s ease 1s forwards, bounce 2s ease-in-out 2s infinite;
}

.scroll-indicator::after {
    content: '↓';
    display: block;
    margin-top: 10px;
    font-size: 1.5rem;
}

/* Constellation Map Section */
.constellation-section {
    min-height: 100vh;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1f3a 100%);
    padding: 120px 5% 80px;
    position: relative;
    overflow: hidden;
}

.constellation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 75% 25%, white, transparent);
    background-size: 200% 200%;
    animation: twinkle 8s ease-in-out infinite;
    opacity: 0.6;
    pointer-events: none;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 80px;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 100;
    color: white;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.section-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    line-height: 1.8;
}

/* Constellation Grid */
.constellation-map {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    position: relative;
    z-index: 2;
}

.myth-node {
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.myth-node::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
}

.myth-node:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.node-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    border: 3px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: rgba(26, 31, 58, 0.8);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.node-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transform: rotate(45deg);
    transition: var(--transition);
}

.myth-node:hover .node-icon {
    border-color: white;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.5);
    transform: translateY(-10px) scale(1.1);
}

.myth-node:hover .node-icon::after {
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.myth-node h3 {
    font-size: 1.5rem;
    font-weight: 300;
    color: white;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.myth-node .subtitle-text {
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.myth-node p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 300;
}

.status-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 15px;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 20px;
}

/* Story View Section */
.story-view {
    display: none;
    min-height: 100vh;
    background: var(--white);
    position: relative;
}

.story-view.active {
    display: block;
}

.story-header {
    height: 70vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.story-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

.story-header.no-image { background: linear-gradient(135deg, #1a1a2e 0%, #0d0d14 100%); }
.source-list { color: #666; font-size: 0.95rem; line-height: 1.8; padding-left: 20px; }
.source-list a { color: var(--primary-red); word-break: break-word; }
.story-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.story-title-container {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 0 20px;
}

.story-title-container h1,
.story-title-container h2 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 100;
    margin-bottom: 20px;
    letter-spacing: -2px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}

.story-title-container .story-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--gold);
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

.back-button {
    position: fixed;
    top: 100px;
    left: 5%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 400;
    color: var(--dark-grey);
    border-radius: 2px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: var(--primary-red);
    color: white;
    transform: translateX(-5px);
}

/* Story Content */
.story-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 80px 5%;
}

.story-chapter {
    margin-bottom: 100px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.story-chapter.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-number {
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 10px;
    font-weight: 500;
}

.story-chapter h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    color: var(--dark-grey);
    margin-bottom: 30px;
    letter-spacing: -1px;
}

.story-chapter p {
    font-size: 1.15rem;
    line-height: 1.9;
    color: #444;
    margin-bottom: 20px;
    font-weight: 300;
}

.story-chapter h2 + p::first-letter {
    font-size: 4rem;
    line-height: 1;
    float: left;
    margin: 5px 15px 0 0;
    color: var(--primary-red);
    font-weight: 300;
}

.highlight-quote {
    margin: 50px 0;
    padding: 40px;
    background: var(--light-grey);
    border-left: 4px solid var(--gold);
    font-size: 1.3rem;
    font-weight: 300;
    font-style: italic;
    color: var(--dark-grey);
    line-height: 1.8;
}

.chapter-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    margin: 50px 0;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* Character Profile Popup */
.character-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 2000;
    max-width: 500px;
    width: 90%;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.character-popup.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    display: block;
    opacity: 1;
}

.character-name {
    font-size: 2rem;
    font-weight: 300;
    color: var(--primary-red);
    margin-bottom: 10px;
}

.character-title {
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.character-description {
    line-height: 1.8;
    color: #666;
}

.close-popup {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: var(--transition);
}

.close-popup:hover {
    color: var(--primary-red);
    transform: rotate(90deg);
}

/* Story Navigation */
.story-navigation {
    max-width: 1000px;
    margin: 80px auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.story-nav-card {
    flex: 1;
    padding: 30px;
    background: var(--light-grey);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.story-nav-card:hover {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.nav-label {
    color: var(--gold);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.story-nav-card h3 {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--dark-grey);
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(212, 175, 55, 0.6);
    border-radius: 50%;
    animation: float 10s infinite ease-in-out;
}

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

/* Responsive */
@media (max-width: 968px) {
    .nav-links {
        display: none;
    }
    
    .constellation-map {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .story-navigation {
        flex-direction: column;
    }
    
    .back-button {
        top: 80px;
        left: 20px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

html {
    scroll-behavior: smooth;
}

/* Character Links */
.character-link {
    color: var(--primary-red);
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-red);
    transition: var(--transition);
}

.character-link:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
