/* pencloser.com — Monochrome Vaporwave Pen Meditation */

@property --reveal-radius {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0a0a0a;
    color: #b0b0b0;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.72;
    letter-spacing: 0.015em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Bubbles */
#bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bubble {
    position: absolute;
    width: var(--size);
    height: var(--size);
    left: var(--x);
    top: var(--y);
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.03) 0%, transparent 70%);
    animation: bubble-drift var(--dur) ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes bubble-drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(var(--dx), calc(var(--dy) * -0.5)) scale(1.04);
    }
    66% {
        transform: translate(calc(var(--dx) * -0.3), var(--dy)) scale(0.97);
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1.02);
    }
}

/* Acts */
.act {
    position: relative;
    z-index: 1;
}

/* ACT I — The Void */
#act-one {
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 20%;
    background-color: #0a0a0a;
}

#title-container {
    opacity: 0;
    animation: title-fade-in 0.1s 1.5s forwards;
}

#title-svg {
    width: clamp(300px, 60vw, 700px);
    height: auto;
    overflow: visible;
}

#title-text {
    stroke-dasharray: 2500;
    stroke-dashoffset: 2500;
    animation: draw-title 4s 1.6s ease-out forwards;
    fill: none;
}

@keyframes draw-title {
    to {
        stroke-dashoffset: 0;
        fill: #f5f5f5;
        fill-opacity: 0.9;
        stroke-opacity: 0;
    }
}

@keyframes title-fade-in {
    to {
        opacity: 1;
    }
}

#title-text {
    text-shadow: 0 0 40px rgba(245,245,245,0.08);
}

#subtitle {
    font-family: 'Cormorant', serif;
    font-variant: small-caps;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    color: #707070;
    margin-top: 1.2rem;
    margin-left: 0.5rem;
    opacity: 0;
    animation: subtitle-reveal 2s 5.6s ease-out forwards;
}

@keyframes subtitle-reveal {
    to {
        opacity: 1;
    }
}

/* ACT II — The Collection */
#act-two {
    padding-top: 8rem;
    padding-bottom: 12rem;
    background: linear-gradient(
        to bottom,
        #0a0a0a 0%,
        #141414 15%,
        #141414 100%
    );
    min-height: 270vh;
}

/* Ink Pool Content Clusters */
.ink-pool {
    background: #1e1e1e;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: clamp(2rem, 4vw, 4rem);
    max-width: clamp(320px, 45vw, 520px);
    position: relative;
    opacity: 0;
    transition: opacity 1.2s ease-out;
    --reveal-radius: 0%;
    -webkit-mask-image: radial-gradient(circle at 50% 30%, black var(--reveal-radius), transparent calc(var(--reveal-radius) + 20%));
    mask-image: radial-gradient(circle at 50% 30%, black var(--reveal-radius), transparent calc(var(--reveal-radius) + 20%));
}

.ink-pool.revealed {
    opacity: 1;
    animation: ink-spread 1.5s ease-out forwards;
}

@keyframes ink-spread {
    from {
        --reveal-radius: 0%;
    }
    to {
        --reveal-radius: 200%;
    }
}

/* Pool spacing — irregular, along diagonal axis */
.pool-1 {
    margin-bottom: 6rem;
}
.pool-2 {
    margin-bottom: 10rem;
}
.pool-3 {
    margin-bottom: 4rem;
}
.pool-4 {
    margin-bottom: 12rem;
}
.pool-5 {
    margin-bottom: 8rem;
}
.pool-6 {
    margin-bottom: 3rem;
}

.pool-icon {
    width: 6rem;
    height: 6rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    transition: opacity 1.2s ease-out 0.3s;
}

.ink-pool.revealed .pool-icon {
    opacity: 1;
}

.pool-icon svg {
    width: 100%;
    height: 100%;
}

.pool-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: #e0e0e0;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(224,224,224,0.15);
}

.pool-body {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    line-height: 1.72;
    letter-spacing: 0.015em;
    color: #b0b0b0;
    margin-bottom: 1.2rem;
}

.pool-body em, .pool-body strong {
    color: #d0d0d0;
    font-weight: 600;
}

.pool-meta {
    font-family: 'Cormorant', serif;
    font-variant: small-caps;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: #707070;
    display: block;
}

/* ACT III — The Impression */
#act-three {
    min-height: 70vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        #141414 0%,
        #0a0a0a 60%,
        #0a0a0a 100%
    );
    padding-top: 5rem;
    padding-bottom: 10rem;
}

#vertical-line {
    width: 1px;
    height: 40vh;
    background: linear-gradient(
        to bottom,
        #2a2a2a 0%,
        #2a2a2a 50%,
        transparent 100%
    );
    position: absolute;
    left: 50%;
    top: 5rem;
    transform: translateX(-50%);
}

#final-text {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 25vh;
    opacity: 0;
    transition: opacity 2s ease-out;
}

#final-text.revealed {
    opacity: 1;
}

#final-text p {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    color: #b0b0b0;
    line-height: 2.2;
}

#final-text .closer-word {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 1.4rem;
    color: #e0e0e0;
    margin-top: 0.5rem;
    text-shadow: 0 0 30px rgba(224,224,224,0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #act-one {
        padding-left: 10%;
    }

    .ink-pool {
        max-width: 85vw !important;
        margin-left: 5% !important;
    }

    .pool-1, .pool-2, .pool-3, .pool-4, .pool-5, .pool-6 {
        margin-bottom: 5rem;
    }

    #title-svg {
        width: 85vw;
    }
}

/* Selection style */
::selection {
    background: rgba(176, 176, 176, 0.2);
    color: #f5f5f5;
}

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

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #707070;
}
