/* ==========================================================================
   lowball.dev -- Cinematic Negotiation Thriller
   ========================================================================== */

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

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

body {
    background: #1a2a2a;
    color: #e0dcd0;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Sections --- */
.section-wide {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.section-narrow {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: clamp(60px, 10vh, 140px) 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a2a2a;
}

.narrow-content {
    max-width: 32em;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* --- Directional Lighting Overlay --- */
.directional-light {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Cinematic single-source lighting from top-right */
    background: linear-gradient(135deg, transparent 30%, #ffffff0d 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    animation: lightSweep 800ms ease-out forwards;
}

@keyframes lightSweep {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Organic Blob Shapes --- */
.organic-blob {
    position: absolute;
    border-radius: 42% 58% 70% 30% / 45% 55% 45% 55%;
    background: rgba(42, 128, 128, 0.10);
    pointer-events: none;
    z-index: 0;
    animation: blobDrift 18s ease-in-out infinite alternate;
}

.blob-hero-1 {
    width: 600px;
    height: 500px;
    top: -100px;
    right: -150px;
    border-radius: 35% 65% 55% 45% / 60% 40% 60% 40%;
}

.blob-hero-2 {
    width: 400px;
    height: 350px;
    bottom: -80px;
    left: -100px;
    border-radius: 55% 45% 35% 65% / 40% 60% 40% 60%;
    animation-delay: -6s;
}

.blob-offer-1 {
    width: 500px;
    height: 450px;
    top: 10%;
    right: -200px;
    border-radius: 40% 60% 50% 50% / 55% 45% 55% 45%;
    animation-delay: -3s;
}

.blob-offer-2 {
    width: 350px;
    height: 300px;
    bottom: 5%;
    left: -120px;
    border-radius: 60% 40% 45% 55% / 50% 50% 50% 50%;
    animation-delay: -9s;
}

.blob-counter-1 {
    width: 700px;
    height: 500px;
    top: -150px;
    left: 30%;
    border-radius: 38% 62% 48% 52% / 52% 48% 52% 48%;
    animation-delay: -4s;
}

.blob-close-1 {
    width: 550px;
    height: 480px;
    top: -80px;
    right: -180px;
    border-radius: 48% 52% 62% 38% / 42% 58% 42% 58%;
    animation-delay: -7s;
}

.blob-close-2 {
    width: 400px;
    height: 380px;
    bottom: -60px;
    left: -100px;
    border-radius: 52% 48% 38% 62% / 58% 42% 58% 42%;
    animation-delay: -12s;
}

@keyframes blobDrift {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    50% {
        transform: translate(30px, -20px) rotate(8deg) scale(1.05);
    }
    100% {
        transform: translate(-20px, 15px) rotate(-5deg) scale(0.97);
    }
}

/* ==========================================================================
   SECTION 1: Hero - Opening Wide Shot
   ========================================================================== */

#hero {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a2a2a 0%, #2a1a18 100%);
    min-height: 100vh;
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    width: 80%;
    max-width: 1400px;
}

#hero-title {
    font-family: 'Recursive', sans-serif;
    font-weight: 200;
    font-size: clamp(48px, 10vw, 140px);
    line-height: 0.95;
    color: #e0dcd0;
    letter-spacing: -0.02em;
    animation: heroWeightIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heroWeightIn {
    0% {
        font-variation-settings: 'wght' 200;
        opacity: 0.3;
    }
    100% {
        font-variation-settings: 'wght' 900;
        opacity: 1;
    }
}

#hero-subtitle {
    font-family: 'Recursive', sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 10vw, 140px);
    line-height: 0.95;
    color: #d07830;
    letter-spacing: -0.02em;
    animation: subtitleWeightOut 800ms cubic-bezier(0.22, 1, 0.36, 1) 1.2s both;
}

@keyframes subtitleWeightOut {
    0% {
        font-variation-settings: 'wght' 900;
        opacity: 0.3;
    }
    100% {
        font-variation-settings: 'wght' 200;
        opacity: 1;
    }
}

#hero-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 20px);
    color: #8a8070;
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInUp 600ms ease-out 2s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   SECTION 2: The Offer - Close-up
   ========================================================================== */

#the-offer {
    background: #1a2a2a;
}

.section-title {
    font-family: 'Recursive', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 36px);
    color: #d07830;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.editorial-prose p {
    margin-bottom: 1.6em;
}

/* Variable weight intensity classes */
.weight-calm {
    font-weight: 300;
    color: #8a8070;
}

.weight-medium {
    font-weight: 400;
    color: #e0dcd0;
}

.weight-tension {
    font-weight: 600;
    color: #e0dcd0;
}

.weight-impact {
    font-weight: 600;
    color: #d07830;
    font-style: italic;
}

/* Bid Display */
.bid-display {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(208, 120, 48, 0.3);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bid-label {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: #c0c0d0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.bid-value {
    font-family: 'Fira Mono', monospace;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 400;
    color: #d0a060;
    letter-spacing: -0.02em;
}

.bid-delta {
    font-family: 'Fira Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #d07830;
}

/* Slide-in animation for narrow sections */
.section-narrow .narrow-content {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.section-narrow .narrow-content.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ==========================================================================
   SECTION 3: The Counter - Wide Section
   ========================================================================== */

#the-counter {
    background: linear-gradient(135deg, #1a2a2a 0%, #2a1a18 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: clamp(60px, 8vh, 120px) 0;
}

.section-title-wide {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-bottom: 3rem;
}

#curves-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 2;
}

#negotiation-curves {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 1;
}

.negotiation-path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.buyer-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.1s linear;
}

.seller-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0.1s linear;
}

/* Particle dots on curves */
.curve-particle {
    opacity: 0;
    transition: opacity 300ms ease;
}

.curve-particle.visible {
    opacity: 0.4;
}

/* Curve Labels */
.curve-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding: 0 2rem;
}

.curve-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.label-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-buyer {
    background: #d07830;
}

.dot-seller {
    background: #2a8080;
}

.label-text {
    font-family: 'Fira Mono', monospace;
    font-size: 12px;
    color: #8a8070;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.label-value {
    font-family: 'Fira Mono', monospace;
    font-size: 14px;
    color: #d0a060;
    margin-left: 0.5rem;
}

.counter-narrative {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 3rem;
    font-size: clamp(16px, 1.8vw, 22px);
}

/* ==========================================================================
   SECTION 4: The Close - Cinematic Ending
   ========================================================================== */

.section-close {
    background: linear-gradient(135deg, #2a1a18 0%, #1a2a2a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

#close-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
}

#close-title {
    font-family: 'Recursive', sans-serif;
    font-weight: 200;
    font-size: clamp(36px, 8vw, 120px);
    color: #e0dcd0;
    line-height: 1.0;
    letter-spacing: -0.02em;
    animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

#close-tagline {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 1.6vw, 20px);
    color: #8a8070;
    margin-top: 2rem;
    line-height: 1.8;
}

/* Metrics Row */
.close-metrics {
    display: flex;
    justify-content: center;
    gap: clamp(2rem, 5vw, 5rem);
    margin-top: 4rem;
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.metric-value {
    font-family: 'Fira Mono', monospace;
    font-size: clamp(24px, 3vw, 40px);
    font-weight: 400;
    color: #d0a060;
}

.metric-label {
    font-family: 'Fira Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: #8a8070;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ==========================================================================
   Floating Particle Effects
   ========================================================================== */

.floating-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(208, 120, 48, 0.4);
    pointer-events: none;
    z-index: 1;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.4;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-120px) translateX(40px);
        opacity: 0;
    }
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    #hero-content {
        width: 90%;
    }

    .curve-labels {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .close-metrics {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .organic-blob {
        display: none;
    }
}

@media (max-width: 480px) {
    .bid-value {
        font-size: 28px;
    }
}
