/* ===================================================
   mujun.wiki - Watercolor Contradiction Wiki
   Colors: #FAFAF5, #0A6B5C, #4A1A6B, #8A8A80, #D4A0A8, #C8B468, #1A1A20
   Font: Commissioner, Noto Serif JP
   =================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.1vw, 18px);
    line-height: 2.0;
    color: #1A1A20;
    background-color: #FAFAF5;
    overflow-x: hidden;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Ink Drops Container --- */
#ink-drops-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.ink-drop {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: inkDrop 2s ease-out forwards;
}

@keyframes inkDrop {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
        transform: translate(-50%, -50%);
    }
    100% {
        width: 12px;
        height: 12px;
        opacity: 0;
        transform: translate(-50%, -50%);
    }
}

/* --- Wash Sections --- */
.wash-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: visible;
    transition: filter 0.6s ease, opacity 0.6s ease;
}

.wash-section.blurred {
    filter: blur(2px);
    opacity: 0.7;
}

.wash-section.focused {
    filter: blur(0);
    opacity: 1;
}

/* --- Wash Backgrounds --- */
.wash-bg {
    position: absolute;
    top: -60px;
    left: -60px;
    right: -60px;
    bottom: -60px;
    z-index: 0;
    pointer-events: none;
    transition: background-size 0.8s ease;
}

.wash-bg-hero {
    background:
        radial-gradient(ellipse at 30% 40%, rgba(10, 107, 92, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(74, 26, 107, 0.10) 0%, transparent 55%),
        conic-gradient(from 180deg at 50% 50%, rgba(10, 107, 92, 0.06) 0deg, rgba(74, 26, 107, 0.06) 120deg, rgba(212, 160, 168, 0.04) 240deg, rgba(10, 107, 92, 0.06) 360deg),
        linear-gradient(180deg, #FAFAF5 0%, #FAFAF5 100%);
    background-size: 100% 100%;
}

.wash-bg-hero.bloomed {
    background-size: 200% 200%;
}

.wash-bg-teal {
    background:
        radial-gradient(ellipse at 40% 30%, rgba(10, 107, 92, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse at 80% 70%, rgba(10, 107, 92, 0.08) 0%, transparent 50%),
        conic-gradient(from 90deg at 60% 40%, rgba(10, 107, 92, 0.05) 0deg, transparent 180deg, rgba(10, 107, 92, 0.05) 360deg),
        linear-gradient(180deg, #FAFAF5 0%, #FAFAF5 100%);
}

.wash-bg-purple {
    background:
        radial-gradient(ellipse at 60% 35%, rgba(74, 26, 107, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 65%, rgba(74, 26, 107, 0.08) 0%, transparent 55%),
        conic-gradient(from 270deg at 45% 50%, rgba(74, 26, 107, 0.05) 0deg, transparent 180deg, rgba(74, 26, 107, 0.05) 360deg),
        linear-gradient(180deg, #FAFAF5 0%, #FAFAF5 100%);
}

.wash-bg-pink {
    background:
        radial-gradient(ellipse at 50% 40%, rgba(212, 160, 168, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 25% 70%, rgba(212, 160, 168, 0.10) 0%, transparent 50%),
        conic-gradient(from 0deg at 55% 45%, rgba(212, 160, 168, 0.06) 0deg, transparent 180deg, rgba(212, 160, 168, 0.06) 360deg),
        linear-gradient(180deg, #FAFAF5 0%, #FAFAF5 100%);
}

.wash-bg-gold {
    background:
        radial-gradient(ellipse at 35% 45%, rgba(200, 180, 104, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 55%, rgba(200, 180, 104, 0.09) 0%, transparent 55%),
        conic-gradient(from 135deg at 50% 50%, rgba(200, 180, 104, 0.05) 0deg, transparent 180deg, rgba(200, 180, 104, 0.05) 360deg),
        linear-gradient(180deg, #FAFAF5 0%, #FAFAF5 100%);
}

.wash-bg-teal-light {
    background:
        radial-gradient(ellipse at 55% 35%, rgba(10, 107, 92, 0.09) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 75%, rgba(74, 26, 107, 0.06) 0%, transparent 50%),
        conic-gradient(from 45deg at 50% 50%, rgba(10, 107, 92, 0.04) 0deg, transparent 180deg, rgba(10, 107, 92, 0.04) 360deg),
        linear-gradient(180deg, #FAFAF5 0%, #FAFAF5 100%);
}

/* --- Section Content --- */
.section-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 120px 24px;
}

/* --- Hero --- */
#hero {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
}

.hero-content {
    padding-top: 25vh;
    text-align: left;
}

.hero-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    letter-spacing: -0.01em;
    color: #1A1A20;
    opacity: 0;
    filter: blur(4px);
    animation: heroFadeIn 1s ease-out 0.8s forwards;
}

.hero-subtitle {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(16px, 1.3vw, 20px);
    color: #8A8A80;
    margin-top: 16px;
    opacity: 0;
    animation: subtitleFadeIn 1.2s ease-out 1.2s forwards;
}

@keyframes heroFadeIn {
    0% {
        opacity: 0;
        filter: blur(4px);
    }
    100% {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes subtitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Initial hero wash bloom animation */
.wash-bg-hero {
    background-size: 0% 0%;
    animation: washBloom 1.5s ease-out forwards;
}

@keyframes washBloom {
    0% {
        background-size: 0% 0%;
    }
    100% {
        background-size: 200% 200%;
    }
}

/* --- Kanji Display --- */
.kanji {
    font-family: 'Noto Serif JP', serif;
    font-weight: 600;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 52px);
    letter-spacing: -0.01em;
    color: #1A1A20;
    margin-bottom: 8px;
}

/* --- Wiki Metadata --- */
.wiki-meta {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    color: #8A8A80;
    margin-bottom: 40px;
}

/* --- Wiki Body --- */
.wiki-body p {
    margin-bottom: 28px;
    color: #1A1A20;
}

/* --- Pull Quotes with Marble Texture --- */
.pull-quote {
    position: relative;
    padding: 32px 36px;
    margin: 40px -12px;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(17px, 1.2vw, 20px);
    line-height: 1.8;
    color: #1A1A20;
    background: rgba(250, 250, 245, 0.6);
    border-left: 3px solid #0A6B5C;
    overflow: hidden;
}

.pull-quote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        82deg,
        transparent,
        transparent 30px,
        rgba(138, 138, 128, 0.04) 30px,
        rgba(138, 138, 128, 0.04) 31px
    );
    filter: url(#marble-filter);
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0.6;
}

.pull-quote:hover::before {
    opacity: 1;
}

.pull-quote cite {
    display: block;
    margin-top: 16px;
    font-size: 13px;
    color: #8A8A80;
    font-style: italic;
}

/* --- Sharp-Angle Dividers --- */
.sharp-divider {
    position: absolute;
    bottom: -2px;
    left: -10%;
    right: -10%;
    height: 60px;
    background: #1A1A20;
    z-index: 3;
    clip-path: polygon(0 70%, 100% 40%, 100% 100%, 0 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.sharp-divider.visible {
    opacity: 1;
}

.sharp-divider-1 {
    clip-path: polygon(0 65%, 100% 35%, 100% 100%, 0 100%);
}

.sharp-divider-2 {
    clip-path: polygon(0 40%, 100% 60%, 100% 100%, 0 100%);
}

.sharp-divider-3 {
    clip-path: polygon(0 55%, 100% 45%, 100% 100%, 0 100%);
}

.sharp-divider-4 {
    clip-path: polygon(0 35%, 100% 65%, 100% 100%, 0 100%);
}

.sharp-divider-5 {
    clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0 100%);
}

/* --- Wiki Links --- */
.wiki-body a {
    color: #0A6B5C;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.wiki-body a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #0A6B5C;
    transition: width 0.3s ease;
}

.wiki-body a:hover::after {
    width: 100%;
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 200px;
    height: 100vh;
    z-index: 100;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.sidebar-inner {
    width: 100%;
    padding: 24px 20px;
    background: rgba(250, 250, 245, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(138, 138, 128, 0.15);
    pointer-events: all;
    position: relative;
    overflow: hidden;
}

.sidebar-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        78deg,
        transparent,
        transparent 20px,
        rgba(138, 138, 128, 0.03) 20px,
        rgba(138, 138, 128, 0.03) 21px
    );
    filter: url(#marble-filter);
    pointer-events: none;
}

.sidebar-label {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8A8A80;
    margin-bottom: 20px;
    position: relative;
}

.sidebar-list {
    list-style: none;
    position: relative;
}

.sidebar-list li {
    margin-bottom: 12px;
}

.sidebar-link {
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: 13px;
    font-stretch: 75%;
    color: #1A1A20;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.sidebar-link:hover {
    color: #0A6B5C;
}

.sidebar-link.active {
    color: #0A6B5C;
    font-weight: 700;
}

.sidebar-dot {
    display: inline-block;
    width: 0;
    height: 8px;
    border-radius: 50%;
    transition: width 0.3s ease, background-color 0.3s ease;
    flex-shrink: 0;
}

.sidebar-link:hover .sidebar-dot,
.sidebar-link.active .sidebar-dot {
    width: 8px;
}

/* Dot colors per section */
.sidebar-link[data-section="section-contradiction"] .sidebar-dot {
    background-color: #0A6B5C;
}
.sidebar-link[data-section="section-dialectics"] .sidebar-dot {
    background-color: #4A1A6B;
}
.sidebar-link[data-section="section-paradox"] .sidebar-dot {
    background-color: #D4A0A8;
}
.sidebar-link[data-section="section-wabisabi"] .sidebar-dot {
    background-color: #C8B468;
}
.sidebar-link[data-section="section-koans"] .sidebar-dot {
    background-color: #0A6B5C;
}

/* --- Footer --- */
#footer {
    position: relative;
    padding: 80px 24px 60px;
    background: #1A1A20;
    text-align: center;
}

.footer-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 2vw, 24px);
    color: #FAFAF5;
    margin-bottom: 8px;
}

.footer-meta {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    color: #8A8A80;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .section-content {
        padding: 80px 20px;
    }
}

@media (max-width: 600px) {
    .section-content {
        padding: 60px 16px;
    }

    .pull-quote {
        padding: 24px 20px;
        margin: 32px 0;
    }

    .hero-content {
        padding-top: 20vh;
    }
}

/* --- Wash approach animation (JS controlled) --- */
.wash-bg.approaching {
    background-size: 102% 102% !important;
}

/* --- Selection color --- */
::selection {
    background: rgba(10, 107, 92, 0.2);
    color: #1A1A20;
}
