/* =============================================
   mujun.art — Design Language Stylesheet
   Frutiger Aero on Obsidian / Gold-Black Luxury
   ============================================= */

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

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

body {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #F0ECE2;
    background: #0A0A0F;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Procedural Marble Background --- */
.marble-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    opacity: 0.04;
    pointer-events: none;
}

/* --- Gold Particle Canvas --- */
#gold-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* --- Floating Geometric Decorations --- */
.geo-float {
    position: fixed;
    pointer-events: none;
    opacity: 0.03;
    z-index: -1;
}

.geo-float--circle {
    width: 300px;
    height: 300px;
    border: 1px solid #C4A030;
    border-radius: 50%;
    top: 15%;
    left: 8%;
    animation: geoRotate 90s linear infinite;
}

.geo-float--square {
    width: 220px;
    height: 220px;
    border: 1px solid #C4A030;
    top: 45%;
    right: 5%;
    animation: geoRotate 75s linear infinite reverse;
}

.geo-float--triangle {
    width: 0;
    height: 0;
    border-left: 130px solid transparent;
    border-right: 130px solid transparent;
    border-bottom: 225px solid transparent;
    border-bottom-color: rgba(196, 160, 48, 0.3);
    top: 70%;
    left: 12%;
    animation: geoRotate 60s linear infinite;
}

.geo-float--circle.geo-float--2 {
    width: 180px;
    height: 180px;
    top: 60%;
    left: auto;
    right: 15%;
    animation-duration: 80s;
}

.geo-float--square.geo-float--2 {
    width: 150px;
    height: 150px;
    top: 25%;
    right: auto;
    left: 20%;
    animation-duration: 95s;
}

@keyframes geoRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Navigation Sigil --- */
.nav-sigil {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    cursor: pointer;
}

.sigil-icon {
    width: 40px;
    height: 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sigil-triangle {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 34px solid transparent;
    border-bottom-color: rgba(196, 160, 48, 0.5);
    top: 0;
    left: 0;
    transition: border-bottom-color 0.3s ease;
}

.sigil-square {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(196, 160, 48, 0.5);
    top: 10px;
    left: 8px;
    transition: border-color 0.3s ease;
}

.sigil-circle {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(196, 160, 48, 0.5);
    border-radius: 50%;
    top: 14px;
    left: 12px;
    transition: border-color 0.3s ease;
}

.nav-sigil:hover .sigil-triangle {
    border-bottom-color: #C4A030;
}

.nav-sigil:hover .sigil-square {
    border-color: #C4A030;
}

.nav-sigil:hover .sigil-circle {
    border-color: #C4A030;
}

.sigil-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: rgba(22, 22, 31, 0.85); /* #16161F */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(196, 160, 48, 0.3);
    border-radius: 8px;
    padding: 12px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.nav-sigil:hover .sigil-dropdown,
.sigil-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sigil-link {
    display: block;
    padding: 8px 24px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #8A8278;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.sigil-link:hover {
    color: #E8D48B;
    padding-left: 30px;
}

/* --- Hero Section --- */
.hero {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.hero-kanji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: 260px;
    line-height: 1;
    position: relative;
    user-select: none;
}

.kanji-spear {
    color: #F0ECE2;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.kanji-spear.visible {
    opacity: 1;
    transform: translateX(0);
}

.kanji-divider {
    display: inline-block;
    width: 2px;
    height: 0;
    background: #C4A030;
    margin: 0 8px;
    transition: height 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.kanji-divider.visible {
    height: 220px;
}

.kanji-shield {
    color: #C4A030;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.kanji-shield.visible {
    opacity: 1;
    transform: translateX(0);
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.subtitle-text {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #F0ECE2;
}

.hero-scroll-hint {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeInHint 0.6s ease 2.6s forwards;
}

.scroll-hint-text {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #8A8278;
}

.scroll-hint-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, #C4A030, transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes fadeInHint {
    to { opacity: 1; }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.7); }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Glass Panel (Frutiger Aero) --- */
.glass-panel {
    background: rgba(240, 236, 226, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(196, 160, 48, 0.3);
    border-radius: 16px;
    padding: 32px 36px;
    box-shadow: inset 0 1px 0 rgba(232, 212, 139, 0.1);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.glass-panel:hover { /* surface: #16161F */
    background: rgba(240, 236, 226, 0.10);
    border-color: rgba(196, 160, 48, 0.5);
}

.hero-subtitle.glass-panel {
    padding: 14px 36px;
}

/* --- Timeline Spine --- */
.timeline-spine {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: #C4A030;
    transform: translateX(-50%) scaleY(0);
    transform-origin: top;
    z-index: 1;
    pointer-events: none;
    transition: none;
}

/* --- Timeline Section --- */
.timeline {
    position: relative;
    padding: 80px 0 120px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Timeline Nodes --- */
.timeline-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 120px;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.timeline-node--left {
    justify-content: flex-start;
    padding-left: calc(50% - 520px - 60px);
    padding-right: calc(50% + 60px);
    transform: translateX(-80px);
}

.timeline-node--right {
    justify-content: flex-end;
    padding-left: calc(50% + 60px);
    padding-right: calc(50% - 520px - 60px);
    transform: translateX(80px);
}

.timeline-node.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-node .glass-panel {
    max-width: 520px;
    width: 100%;
    position: relative;
}

/* --- Node Labels --- */
.node-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8A8278;
    margin-bottom: 16px;
}

/* --- Node Titles --- */
.node-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 36px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #F0ECE2;
    line-height: 1.2;
    margin-bottom: 20px;
}

/* --- Node Body --- */
.node-body {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: #F0ECE2;
    max-width: 48ch;
    margin-bottom: 12px;
}

.node-body:last-of-type {
    margin-bottom: 0;
}

/* --- Node Markers --- */
.node-marker {
    position: absolute;
    left: 50%;
    top: 30px;
    transform: translateX(-50%);
    z-index: 2;
}

.marker-shape {
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-node.visible .marker-shape {
    opacity: 1;
    transform: scale(1);
}

.marker-circle {
    width: 24px;
    height: 24px;
    border: 1px solid #C4A030;
    border-radius: 50%;
    background: #16161F;
    box-shadow: 0 0 0 0 rgba(196, 160, 48, 0);
}

.timeline-node.visible .marker-circle {
    animation: markerPulse 2s ease 0.8s 1;
}

.marker-diamond {
    width: 18px;
    height: 18px;
    border: 1px solid #C4A030;
    background: #16161F;
    transform: rotate(45deg) scale(0);
}

.timeline-node.visible .marker-diamond {
    transform: rotate(45deg) scale(1);
    animation: markerPulse 2s ease 0.8s 1;
}

.marker-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid transparent;
    position: relative;
}

.marker-triangle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: -9px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 15px solid #16161F;
}

.marker-triangle {
    border-bottom-color: #C4A030;
}

.timeline-node.visible .marker-triangle {
    animation: markerPulse 2s ease 0.8s 1;
}

@keyframes markerPulse {
    0% { box-shadow: 0 0 0 0 rgba(196, 160, 48, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(196, 160, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(196, 160, 48, 0); }
}

/* --- Node Connectors --- */
.node-connector {
    position: absolute;
    top: 40px;
    height: 1px;
    background: #C4A030;
    width: 0;
    transition: width 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0.6s;
    z-index: 1;
}

.timeline-node--left .node-connector {
    right: calc(50% - 12px);
    left: auto;
    transform-origin: right;
}

.timeline-node--right .node-connector {
    left: calc(50% + 12px);
    right: auto;
    transform-origin: left;
}

.timeline-node.visible .node-connector {
    width: 48px;
}

/* --- Spear and Shield Motifs --- */
.spear-motif {
    border-color: #B87333;
    position: absolute;
    top: -10px;
    left: -20px;
    width: 80px;
    height: 1px;
    background: linear-gradient(30deg, #B87333, transparent);
    transform: rotate(30deg);
    pointer-events: none;
}

.shield-motif {
    position: absolute;
    bottom: -10px;
    right: -15px;
    width: 50px;
    height: 35px;
    border: 1px solid rgba(196, 160, 48, 0.15);
    border-radius: 8px;
    pointer-events: none;
}

/* --- Resolution Section --- */
.resolution {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 20px;
}

.resolution-gold-expand {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #C4A030;
    transform: translateX(-50%);
    z-index: 0;
    transition: none;
}

.resolution-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    max-width: 680px;
    text-align: center;
}

.resolution-glass {
    transition: background 0.3s ease, border-color 0.3s ease, color 1s ease;
}

.resolution-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 42px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #F0ECE2;
    line-height: 1.2;
    margin-bottom: 24px;
    transition: color 1s ease;
}

.resolution-body {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    color: #F0ECE2;
    max-width: 48ch;
    margin: 0 auto 12px;
    transition: color 1s ease;
}

.resolution-kanji {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.resolution-kanji.visible {
    opacity: 1;
    transform: translateY(0);
}

.resolution-kanji-char {
    font-family: 'Noto Serif JP', serif;
    font-weight: 900;
    font-size: 120px;
    color: #C4A030;
    transition: color 1s ease;
}

/* Resolution palette inversion */
.resolution.inverted .resolution-title,
.resolution.inverted .resolution-body,
.resolution.inverted .node-label {
    color: #0A0A0F;
}

.resolution.inverted .resolution-kanji-char {
    color: #0A0A0F;
}

.resolution.inverted .glass-panel {
    background: rgba(10, 10, 15, 0.12);
    border-color: rgba(10, 10, 15, 0.3);
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .timeline-node--left {
        padding-left: 40px;
        padding-right: calc(50% + 40px);
    }
    .timeline-node--right {
        padding-left: calc(50% + 40px);
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    .hero-kanji {
        font-size: 140px;
    }

    .kanji-divider.visible {
        height: 120px;
    }

    .timeline-node--left,
    .timeline-node--right {
        padding-left: 20px;
        padding-right: 20px;
        justify-content: center;
        transform: translateY(40px);
    }

    .timeline-node.visible {
        transform: translateY(0);
    }

    .timeline-node .glass-panel {
        max-width: 100%;
    }

    .node-marker {
        display: none;
    }

    .node-connector {
        display: none;
    }

    .timeline-spine {
        left: 20px;
    }

    .node-title {
        font-size: 28px;
    }

    .resolution-title {
        font-size: 30px;
    }

    .resolution-kanji-char {
        font-size: 80px;
    }

    .nav-sigil {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 480px) {
    .hero-kanji {
        font-size: 100px;
    }

    .kanji-divider.visible {
        height: 80px;
    }

    .glass-panel {
        padding: 24px 20px;
    }

    .node-title {
        font-size: 22px;
    }
}
