/* ============================================================
   loves.day - Kintsugi Love Letter in Navy Void
   Japanese Minimalism / Marble & Gold / Brutalist Love Poem
   ============================================================ */

/* CSS Custom Properties for Counter Animation */
@property --counter-val {
    syntax: "<integer>";
    initial-value: 0;
    inherits: false;
}

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

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

body {
    background-color: #0A0E1A;
    color: #E8E2D6;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.04em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Typography ---- */
.headline-gold {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2.8rem, 8vw, 6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.05;
    color: #C5A55A;
}

.headline-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    letter-spacing: 0.08em;
    line-height: 1.15;
    color: #C5A55A;
}

.counter-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8C7853;
}

.body-text {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.04em;
    color: #E8E2D6;
}

.marble-white-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: #E8E2D6;
    letter-spacing: 0.06em;
}

.fragment-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9B9282;
    margin-top: 0.5em;
}

/* ---- Dust Canvas ---- */
#dust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ---- Home Glyph ---- */
#home-glyph {
    position: fixed;
    top: 2rem;
    left: 2rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: 1.5rem;
    color: #C5A55A;
    z-index: 100;
    opacity: 0.7;
    transition: opacity 0.4s ease;
    cursor: default;
}

#home-glyph:hover {
    opacity: 1;
}

/* ---- Sections ---- */
.section-void {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.void-content {
    text-align: center;
    position: relative;
}

#title-text {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#title-text.visible {
    opacity: 1;
}

#day-counter {
    font-size: clamp(1rem, 2vw, 1.4rem);
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.8s ease 0.5s;
}

#day-counter.visible {
    opacity: 1;
}

#opening-crack {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 200px;
    opacity: 0;
    transition: opacity 0.6s ease 1s;
}

#opening-crack.visible {
    opacity: 1;
}

/* ---- Marble Blocks ---- */
.marble-block {
    position: relative;
    background-color: #131829;
    border: 1px solid #8C7853;
    box-shadow: 0 4px 30px rgba(140, 120, 83, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.marble-block.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Marble texture via CSS gradients - unique per block size */
.marble-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(232, 226, 214, 0.15) 0%, rgba(155, 146, 130, 0.08) 40%, transparent 100%),
        linear-gradient(17deg, rgba(197, 165, 90, 0.04) 0%, transparent 50%),
        linear-gradient(73deg, transparent 30%, rgba(197, 165, 90, 0.03) 50%, transparent 70%),
        linear-gradient(142deg, rgba(197, 165, 90, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.marble-block-large {
    width: 70vw;
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.marble-block-large::before {
    background:
        radial-gradient(ellipse at 25% 35%, rgba(232, 226, 214, 0.15) 0%, rgba(155, 146, 130, 0.06) 45%, transparent 100%),
        linear-gradient(23deg, rgba(197, 165, 90, 0.05) 0%, transparent 55%),
        linear-gradient(67deg, transparent 25%, rgba(197, 165, 90, 0.04) 50%, transparent 75%),
        linear-gradient(138deg, rgba(197, 165, 90, 0.03) 0%, transparent 35%),
        linear-gradient(195deg, transparent 60%, rgba(197, 165, 90, 0.02) 80%, transparent 100%);
}

.marble-block-small {
    width: clamp(180px, 25vw, 280px);
    min-height: clamp(150px, 20vh, 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.marble-block-small::before {
    background:
        radial-gradient(ellipse at 60% 30%, rgba(232, 226, 214, 0.12) 0%, rgba(155, 146, 130, 0.06) 50%, transparent 100%),
        linear-gradient(45deg, rgba(197, 165, 90, 0.04) 0%, transparent 40%),
        linear-gradient(110deg, transparent 40%, rgba(197, 165, 90, 0.03) 60%, transparent 80%);
}

.marble-block-medium {
    width: clamp(250px, 35vw, 420px);
    min-height: clamp(180px, 22vh, 250px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

.marble-block-medium::before {
    background:
        radial-gradient(ellipse at 40% 55%, rgba(232, 226, 214, 0.13) 0%, rgba(155, 146, 130, 0.07) 40%, transparent 100%),
        linear-gradient(33deg, rgba(197, 165, 90, 0.04) 0%, transparent 50%),
        linear-gradient(85deg, transparent 35%, rgba(197, 165, 90, 0.035) 55%, transparent 75%),
        linear-gradient(155deg, rgba(197, 165, 90, 0.03) 0%, transparent 45%);
}

.marble-block-wide {
    width: clamp(320px, 60vw, 700px);
    min-height: clamp(120px, 15vh, 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
}

.marble-block-wide::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(232, 226, 214, 0.14) 0%, rgba(155, 146, 130, 0.06) 50%, transparent 100%),
        linear-gradient(12deg, rgba(197, 165, 90, 0.05) 0%, transparent 60%),
        linear-gradient(98deg, transparent 30%, rgba(197, 165, 90, 0.04) 50%, transparent 70%),
        linear-gradient(160deg, rgba(197, 165, 90, 0.025) 0%, transparent 40%);
}

.marble-block-accent {
    width: clamp(280px, 45vw, 500px);
    min-height: clamp(200px, 28vh, 320px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.marble-block-overlap {
    width: clamp(240px, 32vw, 380px);
    min-height: clamp(170px, 22vh, 260px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    opacity: 0.85;
}

.marble-block-climax {
    width: clamp(300px, 50vw, 500px);
    height: clamp(300px, 50vw, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.marble-block-climax::before {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(232, 226, 214, 0.18) 0%, rgba(155, 146, 130, 0.10) 35%, transparent 100%),
        linear-gradient(17deg, rgba(197, 165, 90, 0.06) 0%, transparent 50%),
        linear-gradient(73deg, transparent 20%, rgba(197, 165, 90, 0.05) 50%, transparent 80%),
        linear-gradient(142deg, rgba(197, 165, 90, 0.04) 0%, transparent 50%),
        linear-gradient(220deg, transparent 40%, rgba(197, 165, 90, 0.03) 60%, transparent 80%);
}

/* ---- Block Positioning ---- */
.block-left {
    margin-right: auto;
    margin-left: 5vw;
}

.block-right {
    margin-left: auto;
    margin-right: 5vw;
}

.block-center {
    margin: 0 auto;
}

.block-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* ---- Kintsugi Crack SVGs ---- */
.kintsugi-crack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.crack-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.marble-block.animated .crack-path,
.kintsugi-crack.visible .crack-path {
    stroke-dashoffset: 0;
}

/* ---- Sections Layout ---- */
.section-marble {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 5vh 0;
    z-index: 2;
}

.section-fragmentation {
    position: relative;
    min-height: 220vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5vw;
    padding: 10vh 0;
    z-index: 2;
}

.fragment-row {
    display: flex;
    gap: 3vw;
    padding: 2vh 5vw;
}

.fragment-row-right {
    justify-content: flex-end;
}

.fragment-row-left {
    justify-content: flex-start;
}

.section-accumulation {
    position: relative;
    min-height: 200vh;
    display: flex;
    flex-direction: column;
    gap: 8vh;
    padding: 10vh 0;
    z-index: 2;
}

.accumulation-layer {
    padding: 2vh 0;
}

.section-climax {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.climax-container {
    text-align: center;
    position: relative;
}

.climax-glyph {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    font-size: clamp(5rem, 15vw, 12rem);
    color: #C5A55A;
    display: block;
    position: relative;
    z-index: 3;
}

.climax-counter {
    margin-top: 3rem;
}

/* ---- Pulse Rings ---- */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 1px solid #B04A5A;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 2;
}

.marble-block-climax.animated .pulse-ring-1 {
    animation: pulse-expand 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.2s forwards;
}

.marble-block-climax.animated .pulse-ring-2 {
    animation: pulse-expand 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.6s forwards;
}

.marble-block-climax.animated .pulse-ring-3 {
    animation: pulse-expand 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 1.0s forwards;
}

@keyframes pulse-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.4;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

/* ---- Coda ---- */
.section-coda {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 5vh;
    z-index: 2;
}

.coda-content {
    opacity: 0;
    transition: opacity 1.5s ease;
}

.coda-content.visible {
    opacity: 1;
}

.coda-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.65rem, 1vw, 0.8rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9B9282;
}

/* ---- Kinetic Text ---- */
.kinetic-text {
    overflow: hidden;
}

.kinetic-text .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.08s ease;
}

.kinetic-text .char.revealed {
    opacity: 1;
}

.kinetic-text .char-space {
    display: inline;
    width: 0.3em;
}

/* ---- Counter Animations ---- */
.fragment-counter {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    display: block;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .marble-block-large {
        width: 90vw;
        padding: 2.5rem;
    }

    .fragment-row {
        flex-direction: column;
        align-items: center;
        gap: 3vh;
        padding: 2vh 3vw;
    }

    .fragment-row-right,
    .fragment-row-left {
        justify-content: center;
    }

    .marble-block-small {
        width: clamp(200px, 80vw, 320px);
    }

    .marble-block-medium {
        width: clamp(220px, 85vw, 380px);
    }

    .marble-block-wide {
        width: clamp(240px, 90vw, 600px);
        padding: 2rem;
    }

    .marble-block-accent {
        width: clamp(240px, 85vw, 450px);
        margin-left: auto;
        margin-right: auto;
    }

    .marble-block-overlap {
        width: clamp(200px, 80vw, 350px);
        margin-left: auto;
        margin-right: auto;
    }

    .block-left,
    .block-right {
        margin-left: auto;
        margin-right: auto;
    }

    #home-glyph {
        top: 1rem;
        left: 1rem;
        font-size: 1.2rem;
    }

    .climax-glyph {
        font-size: clamp(4rem, 20vw, 8rem);
    }

    @keyframes pulse-expand {
        0% {
            width: 0;
            height: 0;
            opacity: 0.4;
        }
        100% {
            width: 250px;
            height: 250px;
            opacity: 0;
        }
    }
}

@media (max-width: 480px) {
    .marble-block-large {
        width: 95vw;
        min-height: 35vh;
        padding: 2rem 1.5rem;
    }

    .headline-text {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }
}
