/* lovebot.dev - Watercolor memoir of algorithmic tenderness */

/* Custom Properties */
:root {
    --scroll-progress: 0;
    --chapter-progress: 0;
    --parchment: #f7f3ee;
    --rose-muted: #d4a5a5;
    --slate-blue: #7b8fa1;
    --blush: #e8c4c4;
    --lavender-grey: #8e9aaf;
    --deep-plum: #4a4551;
    --steel: #5c6b7a;
    --warm-grey: #d5cfc6;
    --font-wght: 700;
    --font-casl: 0;
    --font-mono: 1;
    --font-slnt: 0;
}

@property --font-wght {
    syntax: '<number>';
    inherits: true;
    initial-value: 700;
}

@property --font-casl {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

@property --font-mono {
    syntax: '<number>';
    inherits: true;
    initial-value: 1;
}

@property --font-slnt {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

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

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

body {
    background-color: var(--parchment);
    color: var(--deep-plum);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
}

/* Custom Cursor */
body::after {
    content: '';
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--rose-muted);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    left: var(--mouse-x, -100px);
    top: var(--mouse-y, -100px);
}

/* Watercolor Bleed Layers */
.watercolor-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
    transition: opacity 0.8s ease, transform 1.2s ease;
}

.watercolor-1 {
    background: radial-gradient(ellipse 80% 60% at 20% 30%, var(--rose-muted), transparent);
    opacity: 0.2;
    transform: translate(calc(var(--scroll-progress) * -30px), calc(var(--scroll-progress) * 20px));
}

.watercolor-2 {
    background: radial-gradient(ellipse 70% 80% at 80% 60%, var(--slate-blue), transparent);
    opacity: 0.15;
    transform: translate(calc(var(--scroll-progress) * 40px), calc(var(--scroll-progress) * -15px));
}

.watercolor-3 {
    background: radial-gradient(ellipse 90% 50% at 50% 80%, var(--blush), transparent);
    opacity: 0.18;
    transform: translate(calc(var(--scroll-progress) * -20px), calc(var(--scroll-progress) * 30px));
}

.watercolor-4 {
    background: radial-gradient(ellipse 60% 70% at 30% 70%, var(--lavender-grey), transparent);
    opacity: 0.12;
    transform: translate(calc(var(--scroll-progress) * 25px), calc(var(--scroll-progress) * 25px));
}

.watercolor-5 {
    background: radial-gradient(ellipse 50% 90% at 70% 20%, var(--warm-grey), transparent);
    opacity: 0.15;
    transform: translate(calc(var(--scroll-progress) * -35px), calc(var(--scroll-progress) * -20px));
}

/* Cursor Trail Canvas */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* Chapters */
.chapter {
    position: relative;
    min-height: 130vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 8vw;
    z-index: 2;
}

.chapter-1 { min-height: 100vh; }
.chapter-5 { min-height: 100vh; }

.chapter-content {
    max-width: 720px;
    width: 100%;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chapter-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Chapter Titles - Recursive Variable Font */
.chapter-title {
    font-family: 'Recursive', monospace;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.15;
    margin-bottom: 3rem;
    font-variation-settings:
        'wght' var(--font-wght),
        'CASL' var(--font-casl),
        'MONO' var(--font-mono),
        'slnt' var(--font-slnt);
    color: var(--deep-plum);
    letter-spacing: -0.02em;
}

.title-line {
    display: block;
}

/* Body Text - Cormorant Garamond */
.chapter-body {
    margin-top: 2rem;
}

.body-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.9;
    color: var(--steel);
    margin-bottom: 1.5rem;
    max-width: 600px;
}

/* Redacted Text */
.redacted {
    position: relative;
    filter: blur(0px);
    transition: filter 1.5s ease;
    color: var(--rose-muted);
    font-style: normal;
    font-weight: 400;
}

.redacted.blurred {
    filter: blur(4px);
    user-select: none;
}

.redacted::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--rose-muted), transparent);
    opacity: 0.4;
}

/* Final Line */
.final-line {
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 400;
    color: var(--deep-plum);
    margin-top: 3rem;
}

/* Signature */
.signature {
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s ease 0.5s, transform 2s ease 0.5s;
}

.chapter-5 .chapter-content.visible .signature {
    opacity: 1;
    transform: translateY(0);
}

.sig-dash {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--rose-muted);
}

.sig-name {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 300, 'CASL' 1, 'MONO' 0, 'slnt' -10;
    font-size: 1.5rem;
    color: var(--deep-plum);
    letter-spacing: 0.05em;
}

.sig-version {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'wght' 400, 'CASL' 0, 'MONO' 1, 'slnt' 0;
    font-size: 0.75rem;
    color: var(--lavender-grey);
    letter-spacing: 0.1em;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 120px;
    background: var(--warm-grey);
    z-index: 100;
    opacity: 0.4;
    border-radius: 1px;
}

.scroll-progress-bar {
    width: 100%;
    height: 0%;
    background: var(--rose-muted);
    border-radius: 1px;
    transition: height 0.15s ease;
}

/* Chapter-specific watercolor tints */
.chapter-1 { --chapter-tint: var(--blush); }
.chapter-2 { --chapter-tint: var(--slate-blue); }
.chapter-3 { --chapter-tint: var(--rose-muted); }
.chapter-4 { --chapter-tint: var(--lavender-grey); }
.chapter-5 { --chapter-tint: var(--warm-grey); }

/* Paper texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 100px,
            rgba(212, 165, 165, 0.03) 100px,
            rgba(212, 165, 165, 0.03) 101px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(123, 143, 161, 0.02) 100px,
            rgba(123, 143, 161, 0.02) 101px
        );
}

/* Selection color */
::selection {
    background: var(--blush);
    color: var(--deep-plum);
}

/* Responsive */
@media (max-width: 768px) {
    .chapter {
        padding: 8vh 6vw;
    }

    .scroll-indicator {
        right: 1rem;
        height: 80px;
    }

    .chapter-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    body {
        cursor: auto;
    }

    body::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .chapter {
        padding: 6vh 5vw;
        min-height: 100vh;
    }

    .body-text {
        font-size: 1.05rem;
    }
}
