/* loves.day - Neon confession on aged paper */
/* Colors: #1a0f2e, #ff2d7b, #00d4ff, #d4c4a8, #8a7a64, #f0e6d3, #e0fff8 */
/* Fonts: Josefin Sans (headlines), Nunito (body) */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background-color: #f0e6d3;
    color: #8a7a64;
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    line-height: 1.85;
    letter-spacing: 0.015em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image:
        radial-gradient(circle at 20% 35%, rgba(139, 119, 101, 0.06) 0%, transparent 1px),
        radial-gradient(circle at 75% 44%, rgba(139, 119, 101, 0.04) 0%, transparent 1px),
        radial-gradient(circle at 46% 67%, rgba(139, 119, 101, 0.07) 0%, transparent 1px),
        radial-gradient(circle at 62% 23%, rgba(139, 119, 101, 0.05) 0%, transparent 1px);
    background-size: 4px 4px, 5px 5px, 3px 3px, 6px 6px;
}

/* Edge darkening vignette */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(180, 160, 130, 0.12) 100%);
}

/* Cursor canvas */
#cursor-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Love letter container */
.love-letter {
    position: relative;
    z-index: 2;
    max-width: 620px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Stanza sections */
.stanza {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10vh 0;
    position: relative;
}

.stanza__content {
    position: relative;
}

/* Light zone stanzas */
.stanza--light {
    background-color: transparent;
}

/* Dark zone stanzas (magnetic zones) */
.stanza--dark {
    background-color: #1a0f2e;
    color: #e0fff8;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50% + 24px);
    padding-right: calc(50vw - 50% + 24px);
}

.stanza--dark .stanza__content {
    max-width: 620px;
    margin: 0 auto;
}

/* Scroll snap on magnetic zones */
.magnetic-zone {
    scroll-snap-align: start;
}

/* Dark zone transitions */
.stanza__transition-in {
    position: absolute;
    top: -15vh;
    left: 0;
    right: 0;
    height: 15vh;
    background: linear-gradient(to bottom, transparent, #1a0f2e);
    pointer-events: none;
}

.stanza__transition-out {
    position: absolute;
    bottom: -15vh;
    left: 0;
    right: 0;
    height: 15vh;
    background: linear-gradient(to top, transparent, #1a0f2e);
    pointer-events: none;
}

/* Headlines - Josefin Sans */
.stanza__headline {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5.5vw, 4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    will-change: opacity, text-shadow;
}

/* Neon text effect */
.neon-text {
    color: #ff2d7b;
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px #ff2d7b,
        0 0 82px #ff2d7b;
    animation: neonFlicker 4s ease-in-out infinite alternate;
}

.neon-text--intense {
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px #ff2d7b,
        0 0 82px #ff2d7b,
        0 0 120px #ff2d7b;
}

@keyframes neonFlicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow:
            0 0 7px #fff,
            0 0 10px #fff,
            0 0 21px #fff,
            0 0 42px #ff2d7b,
            0 0 82px #ff2d7b;
    }
    20%, 24%, 55% {
        text-shadow:
            0 0 4px #fff,
            0 0 7px #fff,
            0 0 15px #fff,
            0 0 30px #ff2d7b,
            0 0 60px #ff2d7b;
    }
}

/* Flowing curve SVGs */
.flowing-curve {
    width: 100%;
    height: 60px;
    margin-bottom: 2.5rem;
    overflow: visible;
}

.curve-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease-in-out;
}

.curve-path.animated {
    stroke-dashoffset: 0;
}

.flowing-curve--dark .curve-path {
    opacity: 0.5;
}

/* Paragraph styles */
.stanza__paragraphs p {
    margin-bottom: 1.5em;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.stanza__paragraphs p.visible {
    opacity: 1;
    transform: translateY(0);
}

.stanza--dark .stanza__paragraphs p {
    color: #e0fff8;
}

/* Neon phrase */
.neon-phrase {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2.8vw, 1.5rem);
    color: #ff2d7b;
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px #ff2d7b,
        0 0 82px #ff2d7b;
    margin-top: 3rem;
    padding: 1.5rem 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1000ms ease-out 400ms, transform 1000ms ease-out 400ms;
    will-change: opacity, text-shadow;
}

.neon-phrase.visible {
    opacity: 1;
    transform: translateY(0);
}

.neon-phrase--intense {
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px #ff2d7b,
        0 0 82px #ff2d7b,
        0 0 120px #ff2d7b;
}

.neon-phrase--blue {
    color: #00d4ff;
    text-shadow:
        0 0 7px #fff,
        0 0 10px #fff,
        0 0 21px #fff,
        0 0 42px #00d4ff,
        0 0 82px #00d4ff;
}

/* Paper fold effect */
.stanza.folding::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50vw;
    right: -50vw;
    height: 60px;
    background: linear-gradient(to bottom,
        rgba(180, 160, 130, 0.08),
        transparent);
    transform-origin: top center;
    transform: perspective(800px) rotateX(2deg);
    pointer-events: none;
    z-index: 3;
}

.stanza--dark.folding::before {
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.15),
        transparent);
}

/* Fiber lines (decorative) */
.stanza--light::after {
    content: '';
    position: absolute;
    top: 20%;
    left: -20%;
    right: -20%;
    height: 0.5px;
    background-color: #d4c4a8;
    opacity: 0.15;
    pointer-events: none;
}

/* Closing mark */
.closing {
    text-align: center;
    padding: 6rem 0 4rem;
}

.closing__mark {
    font-size: 2rem;
    display: inline-block;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .love-letter {
        padding: 0 20px;
    }

    .stanza {
        min-height: 90vh;
        padding: 8vh 0;
    }

    .stanza--dark {
        padding-left: calc(50vw - 50% + 20px);
        padding-right: calc(50vw - 50% + 20px);
    }

    .stanza__headline {
        margin-bottom: 1.5rem;
    }

    .neon-phrase {
        margin-top: 2rem;
        padding: 1rem 0;
    }
}

@media (max-width: 480px) {
    .stanza {
        min-height: 85vh;
    }

    .flowing-curve {
        height: 40px;
        margin-bottom: 1.5rem;
    }
}
