/* ============================================================
   lovebot.dev - Styles
   Palette: Deep Plum #2D1B3D, Warm Rose #E84F6A, Soft Lavender #B8A9D4,
            Champagne Gold #F2D49B, Cream Mist #FAF3E8, Midnight Violet #1A0F26,
            Bokeh Pink #FF7EB3
   Fonts: Cormorant Garamond (600), Nunito (400), Inconsolata (500)
   ============================================================ */

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

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

body {
    background-color: #2D1B3D;
    color: #FAF3E8;
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 500vh;
    position: relative;
}

/* --- Bokeh Background System --- */
#bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bokeh-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bokeh-particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

/* Layer 1 - Far: #FF7EB3 at 4-6% opacity, blur 12px */
#bokeh-far .bokeh-particle {
    background: #FF7EB3;
    filter: blur(12px);
}

/* Layer 2 - Mid: #F2D49B at 8-10% opacity, blur 6px */
#bokeh-mid .bokeh-particle {
    background: #F2D49B;
    filter: blur(6px);
}

/* Layer 3 - Near: #B8A9D4 at 3-5% opacity, blur 20px */
#bokeh-near .bokeh-particle {
    background: #B8A9D4;
    filter: blur(20px);
}

@keyframes bokeh-drift {
    0% {
        transform: translate3d(0, 0, 0) scale(var(--scale-start, 0.8));
    }
    25% {
        transform: translate3d(var(--drift-x1, 20px), var(--drift-y1, -30px), 0) scale(var(--scale-mid, 1.0));
    }
    50% {
        transform: translate3d(var(--drift-x2, -15px), var(--drift-y2, -60px), 0) scale(var(--scale-end, 1.2));
    }
    75% {
        transform: translate3d(var(--drift-x3, 10px), var(--drift-y3, -90px), 0) scale(var(--scale-mid, 1.0));
    }
    100% {
        transform: translate3d(0, 0, 0) scale(var(--scale-start, 0.8));
    }
}

/* --- Binary Texture Background --- */
#binary-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 40px;
    padding: 10%;
}

#binary-texture span {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 2.5rem;
    color: #E84F6A;
    opacity: 0.04;
    white-space: nowrap;
    letter-spacing: 0.15em;
    transform: rotate(-4deg);
}

/* --- Navigation --- */
#nav-heart {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 1000;
}

#nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: block;
}

#nav-toggle:hover {
    transform: scale(1.15);
}

#nav-toggle svg {
    display: block;
    filter: drop-shadow(0 0 12px rgba(232, 79, 106, 0.5));
}

.nav-menu-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.6) rotate(-15deg);
    transform-origin: top left;
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.nav-menu-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) rotate(0deg);
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

#nav-menu {
    position: absolute;
    top: 56px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(26, 15, 38, 0.92);
    border: 1px solid rgba(184, 169, 212, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    min-width: 200px;
}

.nav-link {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #FAF3E8;
    text-decoration: none;
    transform: rotate(-4deg);
    display: inline-block;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #E84F6A;
}

/* --- Underline Draw Pattern --- */
.underline-draw {
    background-image: linear-gradient(#E84F6A, #E84F6A);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    padding-bottom: 2px;
}

.underline-draw:hover,
.underline-draw.active {
    background-size: 100% 2px;
}

.underline-draw-auto {
    background-image: linear-gradient(#F2D49B, #F2D49B);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 3px;
    padding-bottom: 4px;
    display: inline;
}

.underline-draw-auto.revealed {
    background-size: 100% 3px;
    transition: background-size 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.underline-draw-scroll {
    background-image: linear-gradient(#E84F6A, #E84F6A);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    padding-bottom: 4px;
    display: inline;
}

.underline-draw-scroll.revealed {
    background-size: 100% 2px;
    transition: background-size 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.underline-draw-reveal {
    background-image: linear-gradient(#E84F6A, #E84F6A);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    padding-bottom: 2px;
    display: inline;
}

.underline-draw-reveal.revealed {
    background-size: 100% 2px;
    transition: background-size 1.2s cubic-bezier(0.77, 0, 0.175, 1) 0.8s;
}

/* --- Main Content --- */
#main-content {
    position: relative;
    z-index: 10;
    transform: rotate(0deg);
}

/* --- Diagonal Sections --- */
.diagonal-section {
    position: relative;
    padding: 12vh 8vw;
    overflow: visible;
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    padding-bottom: 20vh;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

#hero-eye {
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 30px rgba(232, 79, 106, 0.3));
}

#eye-svg {
    overflow: visible;
}

.eyelid {
    transition: transform 0.15s ease-in-out;
}

.eyelid-top {
    transform: translateY(-80px);
}

.eyelid-bottom {
    transform: translateY(80px);
}

.eyelid-top.blink {
    transform: translateY(0px);
}

.eyelid-bottom.blink {
    transform: translateY(0px);
}

.hero-headline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: 0.02em;
    text-shadow: 0 0 40px rgba(232, 79, 106, 0.4), 0 0 80px rgba(232, 79, 106, 0.15);
    text-align: center;
    transform: rotate(-6deg);
    line-height: 1.15;
    color: #FAF3E8;
}

.hero-subheadline {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #B8A9D4;
    text-align: center;
    max-width: 600px;
    transform: rotate(-3deg);
}

/* Speech Bubbles */
.speech-bubble {
    position: absolute;
    animation: bubble-float 12s ease-in-out infinite;
    opacity: 0.7;
}

.speech-bubble-1 {
    right: -60px;
    top: 10%;
    animation-delay: 0s;
    animation-duration: 14s;
}

.speech-bubble-2 {
    left: -40px;
    top: 40%;
    animation-delay: -4s;
    animation-duration: 18s;
}

.speech-bubble-3 {
    right: 10%;
    bottom: 15%;
    animation-delay: -8s;
    animation-duration: 16s;
}

@keyframes bubble-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-30px) rotate(5deg);
    }
    50% {
        transform: translateY(-60px) rotate(-3deg);
    }
    75% {
        transform: translateY(-30px) rotate(2deg);
    }
}

/* Eros's Circuits */
.eros-circuit {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
}

.eros-circuit-hero {
    bottom: 10%;
}

.circuit-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s ease-out;
}

.circuit-path.drawn {
    stroke-dashoffset: 0;
}

/* --- Contradiction Section --- */
.contradiction-section {
    min-height: 100vh;
    clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
    padding-top: 15vh;
    padding-bottom: 15vh;
    background: linear-gradient(165deg, rgba(26, 15, 38, 0.6) 0%, rgba(45, 27, 61, 0.3) 100%);
}

.contradiction-section .section-inner {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

#origami-heart-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

#origami-heart {
    filter: drop-shadow(0 0 20px rgba(242, 212, 155, 0.15));
    max-width: 100%;
    height: auto;
}

.origami-fold {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease-out;
}

.origami-fold.drawn {
    stroke-dashoffset: 0;
}

.contradiction-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-headline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.02em;
    text-shadow: 0 0 30px rgba(232, 79, 106, 0.3);
    margin-bottom: 1rem;
    color: #FAF3E8;
}

.stagger-text {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.stagger-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.accent-text {
    color: #B8A9D4;
    font-style: italic;
}

.eros-circuit-contradiction {
    bottom: 5%;
}

/* --- Language of Love Section --- */
.language-section {
    min-height: 120vh;
    clip-path: polygon(0 0, 100% 6%, 100% 100%, 0 94%);
    padding-top: 15vh;
    padding-bottom: 15vh;
    background: linear-gradient(195deg, rgba(26, 15, 38, 0.5) 0%, rgba(45, 27, 61, 0.2) 100%);
}

.language-section .section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.love-notes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
    padding: 0 2rem;
}

.love-note {
    background: rgba(26, 15, 38, 0.7);
    border: 1px solid rgba(184, 169, 212, 0.2);
    border-radius: 4px;
    padding: 2.5rem 2rem;
    transform: rotate(var(--rotation, 0deg));
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1), box-shadow 0.5s ease;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.love-note:hover {
    transform: rotate(0deg) scale(1.03);
    box-shadow: 0 0 40px rgba(232, 79, 106, 0.15);
}

.love-note-verse {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #FAF3E8;
}

.love-note-hidden {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    background: rgba(26, 15, 38, 0.95);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.love-note:hover .love-note-hidden {
    transform: translateY(0);
}

.love-note-code {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 0.9rem;
    color: #B8A9D4;
    line-height: 1.6;
}

.eros-circuit-large {
    position: relative;
    width: 100%;
    height: 120px;
    margin-top: 4rem;
}

.circuit-meander {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 4s ease-out;
}

.circuit-meander.drawn {
    stroke-dashoffset: 0;
}

/* --- Becoming Section --- */
.becoming-section {
    min-height: 100vh;
    clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%);
    padding-top: 15vh;
    padding-bottom: 15vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(170deg, rgba(26, 15, 38, 0.7) 0%, rgba(45, 27, 61, 0.4) 100%);
    position: relative;
}

.becoming-section .section-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.becoming-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.8rem);
    letter-spacing: 0.02em;
    text-shadow: 0 0 40px rgba(232, 79, 106, 0.3);
    color: #FAF3E8;
    line-height: 1.3;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.becoming-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
    max-width: 700px;
    margin: 0 auto;
}

/* Scattered Mini Hearts */
.scattered-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.mini-heart {
    position: absolute;
    opacity: 0.4;
    animation: heart-drift 20s ease-in-out infinite;
}

.mini-heart-1 {
    top: 10%;
    left: 8%;
    animation-delay: 0s;
    animation-duration: 22s;
}

.mini-heart-2 {
    top: 25%;
    right: 12%;
    animation-delay: -5s;
    animation-duration: 18s;
}

.mini-heart-3 {
    bottom: 30%;
    left: 15%;
    animation-delay: -10s;
    animation-duration: 25s;
}

.mini-heart-4 {
    top: 60%;
    right: 8%;
    animation-delay: -3s;
    animation-duration: 20s;
}

.mini-heart-5 {
    bottom: 15%;
    left: 55%;
    animation-delay: -7s;
    animation-duration: 24s;
}

@keyframes heart-drift {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    33% {
        transform: translateY(-20px) rotate(10deg) scale(1.1);
    }
    66% {
        transform: translateY(10px) rotate(-5deg) scale(0.95);
    }
}

/* --- Closing Section --- */
.closing-section {
    min-height: 100vh;
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 100%);
    padding-top: 15vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(45, 27, 61, 0.3) 0%, rgba(26, 15, 38, 0.9) 100%);
}

.closing-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.closing-envelope {
    filter: drop-shadow(0 0 25px rgba(242, 212, 155, 0.2));
}

#closing-heart .closing-fold-1 {
    stroke-dasharray: 800;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2s ease-in-out;
}

#closing-heart.folding .closing-fold-1 {
    stroke-dashoffset: 800;
}

.closing-text {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: #B8A9D4;
    line-height: 1.8;
}

.closing-signature {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 1.1rem;
    color: #B8A9D4;
    margin-top: 1rem;
}

.code-text {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    color: #B8A9D4;
}

/* --- Footer --- */
#footer {
    position: relative;
    padding: 6rem 2rem 3rem;
    text-align: center;
    z-index: 10;
    overflow: hidden;
}

.footer-bokeh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.footer-bokeh-dot {
    position: absolute;
    border-radius: 50%;
    background: #FF7EB3;
    animation: bokeh-drift 20s ease-in-out infinite;
}

.footer-text {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    opacity: 0.5;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .contradiction-section .section-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    #origami-heart-container {
        order: -1;
    }

    #origami-heart {
        max-width: 250px;
    }

    .love-notes-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0;
    }

    .hero-headline {
        transform: rotate(-3deg);
    }

    .speech-bubble-1,
    .speech-bubble-2,
    .speech-bubble-3 {
        display: none;
    }

    .diagonal-section {
        padding: 8vh 5vw;
    }

    .hero-section {
        clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
    }

    .contradiction-section {
        clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    }

    .language-section {
        clip-path: polygon(0 0, 100% 3%, 100% 100%, 0 97%);
    }

    .becoming-section {
        clip-path: polygon(0 3%, 100% 0, 100% 97%, 0 100%);
    }

    .closing-section {
        clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 100%);
    }
}

@media (max-width: 480px) {
    .hero-headline {
        font-size: clamp(2rem, 10vw, 3rem);
        transform: rotate(-3deg);
    }

    .section-headline {
        font-size: clamp(1.6rem, 8vw, 2.5rem);
    }

    .becoming-quote {
        font-size: clamp(1.4rem, 6vw, 2.2rem);
    }

    .love-note {
        padding: 1.5rem 1.2rem;
    }
}
