/* ============================================
   ppuzzl.in - Minimalist + Dopamine-Neon
   ============================================ */

/* --- Custom Properties --- */
:root {
    --deep-void: #0d0d12;
    --bone-white: #f7f3ee;
    --hot-magenta: #ff2d7b;
    --electric-cyan: #00e5ff;
    --neon-lime: #b8ff00;
    --frosted-lavender: #c8b8e8;
    --warm-smoke: #2a2530;
    --gradient-signature: linear-gradient(135deg, #ff2d7b 0%, #00e5ff 50%, #b8ff00 100%);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--deep-void);
    color: var(--bone-white);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M10 0 L13 4 L20 4 L20 10 L16 10 L16 16 L10 16 L10 20 L4 20 L4 16 L0 16 L0 10 L4 10 L4 4 L10 4 Z' fill='%23f7f3ee' stroke='%23ff2d7b' stroke-width='0.8'/%3E%3C/svg%3E") 10 10, auto;
    transition: background-color 400ms ease;
}

body.scrolled {
    background-color: var(--warm-smoke);
}

/* --- Interactive cursor variant --- */
a, button, .glass-card {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M10 0 L13 4 L20 4 L20 10 L16 10 L16 16 L10 16 L10 20 L4 20 L4 16 L0 16 L0 10 L4 10 L4 4 L10 4 Z' fill='%2300e5ff' stroke='%23ff2d7b' stroke-width='0.8'/%3E%3C/svg%3E") 10 10, pointer;
}

/* --- Typography --- */
.gradient-text {
    background: var(--gradient-signature);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    display: inline-block;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 1.2rem;
    color: var(--bone-white);
}

.section-heading.sub {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.section-heading em {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    color: var(--hot-magenta);
}

.subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: rgba(247, 243, 238, 0.7);
    opacity: 0;
    transform: translateY(12px);
}

.body-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: rgba(247, 243, 238, 0.85);
}

.watermark-numeral {
    font-family: 'Bodoni Moda', serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(4rem, 12vw, 10rem);
    opacity: 0.12;
    color: currentColor;
    position: absolute;
    right: 2rem;
    bottom: 2rem;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

/* --- Page Grid --- */
#page-grid {
    display: grid;
    grid-template-columns: minmax(2rem, 1fr) minmax(0, 72rem) minmax(2rem, 1fr);
    width: 100%;
    position: relative;
    z-index: 1;
}

#page-grid > * {
    grid-column: 2;
}

/* --- Gradient Rule --- */
.gradient-rule {
    height: 2px;
    background: var(--gradient-signature);
    width: 100%;
    margin: 0 auto;
    opacity: 0.6;
}

/* --- Horizontal Sweep Sections --- */
.horizontal-sweep {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 4rem 0;
}

.horizontal-sweep.second {
    min-height: 80vh;
}

.horizontal-sweep.closing {
    min-height: 80vh;
}

.sweep-content {
    width: 60%;
    position: relative;
    z-index: 2;
}

/* --- Hero Section --- */
#hero {
    min-height: 100vh;
    justify-content: center;
    flex-direction: column;
    gap: 0;
}

#hero .sweep-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
}

#ripple-origin {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

#ripple-origin::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--hot-magenta);
    opacity: 0;
    transform: scale(0);
    top: -20px;
    left: -20px;
}

#ripple-origin.animate::after {
    animation: heroRipple 1200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroRipple {
    0% {
        transform: scale(0);
        opacity: 0.4;
    }
    100% {
        transform: scale(80);
        opacity: 0;
    }
}

.hero-fragment {
    position: absolute;
    bottom: 15%;
    right: 10%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transform: rotate(-6deg);
}

.hero-fragment .leaf-ginkgo {
    animation: leafSpin 20s linear infinite;
}

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

/* --- Glassmorphic Cards --- */
.glass-card {
    background: rgba(200, 184, 232, 0.06);
    backdrop-filter: blur(20px) saturate(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.1);
    border: 1px solid rgba(255, 45, 123, 0.12);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 400ms ease, box-shadow 400ms ease;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 229, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.glass-card.full-sweep {
    padding: 3rem 3.5rem;
    width: 100%;
}

.glass-card.fragment {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card leaf corner decoration */
.card-leaf-corner {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0.8;
}

.card-leaf-corner.bottom-left {
    top: auto;
    right: auto;
    bottom: 1rem;
    left: 1rem;
}

/* --- Ripple effect on clickable elements --- */
.glass-card .ripple-effect,
button .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 45, 123, 0.3) 0%, transparent 70%);
    transform: scale(0);
    animation: rippleExpand 600ms ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* --- Vertical Stem Section --- */
#vertical-stem {
    position: relative;
    padding: 8rem 0;
    display: flex;
    gap: 2rem;
}

.stem-content {
    max-width: 32rem;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
    z-index: 2;
}

.stem-text-block {
    opacity: 0;
    transform: translateY(20px);
}

.stem-text-block.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.stem-fragments {
    position: absolute;
    right: 0;
    top: 0;
    width: 55%;
    height: 100%;
    pointer-events: none;
}

.stem-fragments .glass-card {
    pointer-events: auto;
    position: absolute;
}

.stem-frag-1 {
    top: 10%;
    right: 20%;
}

.stem-frag-2 {
    top: 40%;
    right: 5%;
    width: 150px !important;
    height: 150px !important;
}

.stem-frag-3 {
    top: 70%;
    right: 25%;
    width: 140px !important;
    height: 140px !important;
}

/* Stem decorative leaves */
.stem-leaf {
    position: absolute;
    pointer-events: none;
}

.stem-leaf-1 {
    top: 5%;
    right: 40%;
}

.stem-leaf-2 {
    top: 25%;
    right: 55%;
}

.stem-leaf-3 {
    top: 45%;
    right: 35%;
}

.stem-leaf-4 {
    top: 65%;
    right: 50%;
}

.stem-leaf-5 {
    top: 85%;
    right: 42%;
}

/* --- Card entrance animations --- */
[data-animate-card] {
    opacity: 0;
    transform: translateX(60px);
}

[data-animate-card].visible {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Closing Section --- */
#closing .sweep-content {
    width: 80%;
}

/* --- Parallax Leaf Layer --- */
#leaf-parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.parallax-leaf {
    position: absolute;
    opacity: 0.04;
}

.parallax-monstera {
    top: 5%;
    left: 8%;
    stroke: var(--electric-cyan);
}

.parallax-fern {
    top: 15%;
    right: 12%;
    stroke: var(--neon-lime);
}

.parallax-ginkgo {
    top: 30%;
    left: 65%;
    stroke: var(--hot-magenta);
}

.parallax-monstera-2 {
    top: 45%;
    left: 3%;
    stroke: var(--hot-magenta);
    opacity: 0.03;
}

.parallax-fern-2 {
    top: 55%;
    right: 5%;
    stroke: var(--electric-cyan);
    opacity: 0.05;
}

.parallax-ginkgo-2 {
    top: 70%;
    left: 20%;
    stroke: var(--neon-lime);
    opacity: 0.035;
}

.parallax-monstera-3 {
    top: 80%;
    right: 25%;
    stroke: var(--electric-cyan);
    opacity: 0.04;
}

.parallax-fern-3 {
    top: 10%;
    left: 45%;
    stroke: var(--hot-magenta);
    opacity: 0.03;
}

.parallax-ginkgo-3 {
    top: 60%;
    left: 50%;
    stroke: var(--neon-lime);
    opacity: 0.05;
}

.parallax-monstera-4 {
    top: 90%;
    left: 75%;
    stroke: var(--hot-magenta);
    opacity: 0.035;
}

.parallax-fern-4 {
    top: 35%;
    right: 30%;
    stroke: var(--neon-lime);
    opacity: 0.04;
}

.parallax-ginkgo-4 {
    top: 75%;
    right: 15%;
    stroke: var(--electric-cyan);
    opacity: 0.06;
}

/* --- Section spacing --- */
.horizontal-sweep + .gradient-rule {
    margin-top: 0;
}

.gradient-rule + .horizontal-sweep,
.gradient-rule + #vertical-stem {
    margin-top: 0;
}

#vertical-stem + .gradient-rule {
    margin-top: 0;
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    #page-grid {
        grid-template-columns: 1rem 1fr 1rem;
    }

    .horizontal-sweep {
        min-height: 100vh;
        padding: 3rem 0;
    }

    .sweep-content {
        width: 100%;
    }

    .glass-card.full-sweep {
        padding: 2rem 1.5rem;
    }

    #hero-title {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .hero-fragment {
        right: 5%;
        bottom: 10%;
        width: 100px;
        height: 100px;
    }

    #vertical-stem {
        flex-direction: column;
        padding: 4rem 0;
    }

    .stem-content {
        max-width: 100%;
    }

    .stem-fragments {
        position: relative;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
        padding: 2rem 0;
    }

    .stem-fragments .glass-card {
        position: relative;
        top: auto !important;
        right: auto !important;
    }

    .stem-frag-2 {
        width: 120px !important;
        height: 120px !important;
    }

    .stem-frag-3 {
        width: 120px !important;
        height: 120px !important;
    }

    .stem-leaf {
        display: none;
    }

    #closing .sweep-content {
        width: 100%;
    }

    .watermark-numeral {
        font-size: clamp(3rem, 10vw, 6rem);
        right: 0.5rem;
        bottom: 1rem;
    }

    .section-heading {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }

    .section-heading.sub {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
