/* ===========================================
   munju.im — Wabi-Sabi Kintsugi Experience
   Gold-Black Luxury / Contemplative Scroll
   =========================================== */

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

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

body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    color: #D4A84B;
    background: #080808;
    overflow-x: hidden;
    cursor: default;
}

::selection {
    background: rgba(212, 168, 75, 0.2);
    color: #F5DEB3;
}

/* --- Bubble Container --- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 75, 0.2);
    background: transparent;
    pointer-events: auto;
    will-change: transform, opacity;
    cursor: pointer;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 25%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.3) 0%, transparent 70%);
}

.bubble.popping {
    animation: bubblePop 400ms ease-out forwards;
    pointer-events: none;
}

.mini-bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 75, 0.15);
    background: transparent;
    pointer-events: none;
    animation: miniBubbleRise 600ms ease-out forwards;
}

@keyframes bubblePop {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes miniBubbleRise {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.3); opacity: 0; }
}

/* --- THE THRESHOLD --- */
.section-threshold {
    position: relative;
    height: 150vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 4.5rem);
    letter-spacing: 0.08em;
    color: #D4A84B;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeInSlow 3s ease-out forwards;
    will-change: opacity, transform;
    transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
                text-shadow 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-title:hover {
    transform: translateY(-4px);
    text-shadow: 0 4px 20px rgba(212, 168, 75, 0.15);
}

@keyframes fadeInSlow {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* --- Lens Flares --- */
.hero-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 1;
    opacity: 0;
    animation: flareBloom 5s ease-out 0.5s forwards;
    will-change: opacity;
}

@keyframes flareBloom {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.flare-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #F5DEB3 0%, rgba(212, 168, 75, 0.3) 20%, rgba(212, 168, 75, 0.1) 40%, transparent 70%);
    box-shadow: 0 0 60px rgba(245, 222, 179, 0.2), 0 0 120px rgba(212, 168, 75, 0.1);
}

.flare-core-ember {
    background: radial-gradient(circle at center, #F5DEB3 0%, #8B3A3A 25%, rgba(139, 58, 58, 0.1) 50%, transparent 70%);
    box-shadow: 0 0 60px rgba(139, 58, 58, 0.2), 0 0 120px rgba(139, 58, 58, 0.1);
}

.flare-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 75, 0.2);
    background: transparent;
}

.flare-ring-1 {
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
}

.flare-ring-2 {
    width: 350px;
    height: 350px;
    transform: translate(-50%, -50%);
    border-color: rgba(212, 168, 75, 0.08);
}

.flare-ring-cool {
    border-color: #C0C0C0;
    opacity: 0.2;
}

.flare-ring-ember {
    border-color: rgba(139, 58, 58, 0.2);
}

.flare-streak {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 2px;
    background: radial-gradient(ellipse 300% 100% at center, rgba(212, 168, 75, 0.15) 0%, transparent 70%);
}

.flare-ghost {
    position: absolute;
    border: 1px solid rgba(212, 168, 75, 0.12);
    background: transparent;
}

.flare-ghost-hex {
    width: 60px;
    height: 60px;
    top: 30%;
    left: 65%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.flare-ghost-oct {
    width: 45px;
    height: 45px;
    top: 70%;
    left: 30%;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

/* --- THE PASSAGE --- */
.section-passage {
    position: relative;
    padding: 0;
}

.passage-element {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    padding-top: 0;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.1s linear;
}

.passage-el-1 { margin-top: 0; }
.passage-el-2 { }
.passage-el-3 { }
.passage-el-4 { }
.passage-el-5 { }

.element-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    z-index: 0;
    opacity: 0.5;
    will-change: opacity;
}

.element-flare-cool .flare-core {
    background: radial-gradient(circle at center, #F5DEB3 0%, rgba(192, 192, 192, 0.3) 20%, rgba(192, 192, 192, 0.1) 40%, transparent 70%);
    box-shadow: 0 0 60px rgba(192, 192, 192, 0.15), 0 0 120px rgba(192, 192, 192, 0.08);
}

.element-flare-ember .flare-core-ember {
    width: 60px;
    height: 60px;
}

.passage-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: #D4A84B;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    padding: 0 2rem;
    transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
                text-shadow 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.passage-text:hover {
    transform: translateY(-4px);
    text-shadow: 0 4px 20px rgba(212, 168, 75, 0.15);
}

.passage-text-large {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.08em;
}

.passage-text-small {
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: #4A4A4A;
}

.passage-word {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(2.5rem, 7vw, 5rem);
    letter-spacing: 0.12em;
    color: #D4A84B;
    position: relative;
    z-index: 1;
    text-align: center;
    transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
                text-shadow 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.passage-word:hover {
    transform: translateY(-4px);
    text-shadow: 0 4px 30px rgba(212, 168, 75, 0.25);
}

/* --- THE VESSEL --- */
.section-vessel {
    position: relative;
    height: 150vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vessel-container {
    position: relative;
    width: min(80vw, 400px);
    height: min(80vw, 400px);
    will-change: transform;
    transition: filter 500ms ease;
}

.vessel-container:hover {
    filter: drop-shadow(0 0 15px rgba(212, 168, 75, 0.3));
}

.kintsugi-svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.vessel-circle {
    fill: #111111;
    stroke: #2A2A2A;
    stroke-width: 1;
}

.crack {
    fill: none;
    stroke: url(#gold-gradient);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    will-change: stroke-dashoffset;
    opacity: 0.7;
    transition: opacity 300ms ease;
}

.vessel-container:hover .crack {
    opacity: 1;
}

.crack-1 { stroke-width: 2.5; stroke: #D4A84B; }
.crack-2 { stroke-width: 2; stroke: #D4A84B; }
.crack-3 { stroke-width: 1.5; stroke: #D4A84B; }
.crack-4 { stroke-width: 2; stroke: #D4A84B; }
.crack-5 { stroke-width: 3; stroke: #D4A84B; }
.crack-6 { stroke-width: 1; stroke: #D4A84B; }
.crack-7 { stroke-width: 2; stroke: #D4A84B; }
.crack-8 { stroke-width: 1.5; stroke: #D4A84B; }
.crack-9 { stroke-width: 1.5; stroke: #D4A84B; }
.crack-10 { stroke-width: 1; stroke: #D4A84B; }

.crack-flare {
    fill: #F5DEB3;
    opacity: 0;
    will-change: opacity;
    transition: opacity 300ms ease;
}

.vessel-flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: opacity;
    opacity: 0;
    transition: opacity 300ms ease;
}

.vessel-flare-1 {
    width: 120px;
    height: 120px;
    top: -10%;
    left: 40%;
    background: radial-gradient(circle, rgba(245, 222, 179, 0.15) 0%, transparent 70%);
}

.vessel-flare-2 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 10%;
    background: radial-gradient(circle, rgba(192, 192, 192, 0.1) 0%, transparent 70%);
}

.vessel-flare-3 {
    width: 100px;
    height: 100px;
    bottom: 15%;
    right: 5%;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.12) 0%, transparent 70%);
}

/* --- THE RELEASE --- */
.section-release {
    position: relative;
    padding-top: 10vh;
}

.release-element {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 0.1s linear;
}

.release-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: #4A4A4A;
    letter-spacing: 0.04em;
    transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
                text-shadow 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.release-text:hover {
    transform: translateY(-4px);
    text-shadow: 0 4px 20px rgba(212, 168, 75, 0.1);
}

.release-text-small {
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    color: #2A2A2A;
}

.release-text-tiny {
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: #2A2A2A;
}

.release-period {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    will-change: opacity;
    transition: opacity 0.1s linear;
}

.period-dot {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #D4A84B;
    transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
                text-shadow 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.period-dot:hover {
    transform: translateY(-4px);
    text-shadow: 0 4px 20px rgba(212, 168, 75, 0.2);
}

/* --- Final Silence --- */
.final-silence {
    height: 100vh;
    background: #080808;
}

/* --- Cursor-responsive flare intensification --- */
.flare-intensified .flare-core {
    filter: brightness(1.3);
}

.flare-intensified .flare-ring {
    border-color: rgba(212, 168, 75, 0.35);
}
