/* ============================================
   concengine.net - City Walk Stylesheet
   ============================================ */

:root {
    --moss: #2d4a3e;
    --park: #5b8c5a;
    --terracotta: #c45d3e;
    --apricot: #e8a87c;
    --cream: #f5f0e6;
    --white: #faf8f3;
    --slate: #1e2a25;
    --charcoal: #3a3a3a;
    --cream-green: #f2f0e6;
    --light-green: #eef2e8;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--cream);
    color: var(--charcoal);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Main Street SVG Path
   ============================================ */
.main-street-svg {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

/* ============================================
   Clouds
   ============================================ */
.clouds-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.cloud {
    position: absolute;
    top: 2vh;
}

.cloud-1 {
    left: -160px;
    animation: drift 45s linear infinite;
}

.cloud-2 {
    left: -130px;
    top: 5vh;
    animation: drift 55s linear infinite;
    animation-delay: -20s;
}

.cloud-3 {
    left: -180px;
    top: 1vh;
    animation: drift 65s linear infinite;
    animation-delay: -35s;
}

@keyframes drift {
    from { transform: translateX(-200px); }
    to { transform: translateX(calc(100vw + 200px)); }
}

/* ============================================
   Neighborhoods (Sections)
   ============================================ */
.neighborhood {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.neighborhood-1 {
    min-height: 130vh;
    padding-top: 20vh;
    justify-content: flex-start;
}

.neighborhood-2 {
    min-height: 150vh;
    padding-top: 8vh;
    padding-bottom: 10vh;
}

.neighborhood-3 {
    min-height: 120vh;
    padding-top: 8vh;
    padding-bottom: 10vh;
    background-color: var(--light-green);
    transition: background-color 2s ease;
}

.neighborhood-4 {
    min-height: 140vh;
    padding-top: 8vh;
    padding-bottom: 10vh;
    background-color: var(--slate);
    color: var(--white);
}

.neighborhood-5 {
    min-height: 100vh;
    padding-top: 6vh;
    padding-bottom: 10vh;
    background-color: var(--slate);
    color: var(--white);
}

/* ============================================
   Neighborhood Signs
   ============================================ */
.neighborhood-sign {
    position: relative;
    margin-bottom: 6vh;
    padding: 8px 24px;
    background: var(--white);
    border: 2px solid var(--moss);
    border-radius: 4px;
    transform: rotate(-2deg);
    box-shadow: 2px 3px 0 rgba(45, 74, 62, 0.15);
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.neighborhood-sign.revealed {
    opacity: 1;
}

.night-sign {
    background: var(--moss);
    border-color: var(--white);
}

.sign-text {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--moss);
    letter-spacing: 0.03em;
}

.night-sign .sign-text {
    color: var(--white);
}

/* ============================================
   NEIGHBORHOOD 1: The Approach
   ============================================ */
.horizon-line {
    position: absolute;
    bottom: 33%;
    left: 0;
    width: 100%;
    height: 4px;
}

.building-tall-narrow {
    position: relative;
    margin-bottom: 4vh;
}

.building-tall-narrow svg {
    overflow: visible;
}

/* Draw animation for SVG lines */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 3s ease-out, fill-opacity 1.2s ease-out 0.5s;
}

.fill-shape {
    transition: fill-opacity 1.2s ease-out;
}

[data-reveal="draw"].revealed .draw-line {
    stroke-dashoffset: 0;
}

[data-reveal="draw"].revealed .fill-shape {
    fill-opacity: 0.85;
}

/* Fill-in animation for buildings */
[data-reveal="fill"] .draw-line {
    stroke-opacity: 0.15;
    transition: stroke-opacity 800ms ease-out;
}

[data-reveal="fill"] .fill-shape {
    transition: fill-opacity 1.2s ease-out 0.3s;
}

[data-reveal="fill"].revealed .draw-line {
    stroke-opacity: 1;
}

[data-reveal="fill"].revealed .fill-shape {
    fill-opacity: 0.85;
}

/* Fade animation */
[data-reveal="fade"] {
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

[data-reveal="fade"].revealed {
    opacity: 1;
}

/* ============================================
   Title Block
   ============================================ */
.title-block {
    text-align: center;
    margin-bottom: 6vh;
    padding: 0 20px;
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.title-block.revealed {
    opacity: 1;
}

.site-title {
    font-family: 'Baloo 2', cursive, sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5rem);
    color: var(--moss);
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.title-underline {
    width: 0;
    height: 3px;
    background: var(--park);
    margin: 0 auto 16px;
    border-radius: 2px;
    transition: width 1.5s ease-out 0.8s;
}

.title-block.revealed .title-underline {
    width: 180px;
}

.site-tagline {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--charcoal);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.72;
}

/* ============================================
   Scroll Invite
   ============================================ */
.scroll-invite {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.scroll-invite.revealed {
    opacity: 1;
}

.scroll-text {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--park);
}

.scroll-arrow {
    animation: bob 2.5s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================================
   Chimney Smoke
   ============================================ */
.chimney-smoke {
    animation: smoke-rise 4s ease-in-out infinite;
    transform-origin: bottom;
}

@keyframes smoke-rise {
    0% { opacity: 0.4; transform: translateY(0) scaleX(1); }
    50% { opacity: 0.2; transform: translateY(-4px) scaleX(1.2); }
    100% { opacity: 0.4; transform: translateY(0) scaleX(1); }
}

/* ============================================
   NEIGHBORHOOD 2: Market Square
   ============================================ */
.market-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5vh;
    max-width: 700px;
    padding: 0 20px;
}

.building {
    position: relative;
}

.building svg {
    overflow: visible;
}

.building-label {
    display: block;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    color: var(--park);
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.8s ease-out 1s;
}

[data-reveal].revealed .building-label {
    opacity: 1;
}

.market-text-block {
    max-width: 500px;
    padding: 0 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.market-text-block.revealed {
    opacity: 1;
}

.body-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    color: var(--charcoal);
    line-height: 1.72;
    letter-spacing: 0.01em;
}

/* Laundry line sway */
.laundry-line {
    animation: sway 4s ease-in-out infinite;
    transform-origin: center;
}

@keyframes sway {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(1px) rotate(0.3deg); }
    75% { transform: translateY(-1px) rotate(-0.3deg); }
}

/* Cat tail flick */
.cat-tail {
    animation: tail-flick 3s ease-in-out infinite;
    transform-origin: top left;
}

@keyframes tail-flick {
    0%, 80%, 100% { transform: rotate(0deg); }
    85% { transform: rotate(15deg); }
    90% { transform: rotate(-5deg); }
    95% { transform: rotate(8deg); }
}

/* Plant growth animation */
.plant-grow {
    animation: grow 6s ease-in-out infinite;
    transform-origin: bottom;
}

@keyframes grow {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.05); }
}

/* ============================================
   NEIGHBORHOOD 3: The Park
   ============================================ */
.park-area {
    position: relative;
    width: 100%;
    max-width: 800px;
    min-height: 90vh;
    padding: 0 20px;
}

.tree {
    position: absolute;
}

.tree-1 { left: 5%; top: 10%; }
.tree-2 { right: 10%; top: 5%; }
.tree-3 { left: 15%; top: 35%; }
.tree-4 { right: 5%; top: 45%; }
.tree-5 { left: 8%; top: 65%; }
.tree-6 { right: 15%; top: 75%; }

.park-bench {
    position: relative;
    margin: 0 auto;
    width: fit-content;
    max-width: 400px;
    text-align: center;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.park-bench.revealed {
    opacity: 1;
}

.bench-1 { margin-top: 12vh; }
.bench-2 { margin-top: 10vh; }
.bench-3 { margin-top: 10vh; }
.bench-4 { margin-top: 10vh; }

.bench-plaque {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: clamp(0.9rem, 1.1vw, 1.1rem);
    color: var(--park);
    margin-top: 6px;
    line-height: 1.5;
    padding: 0 10px;
}

/* Birds */
.birds-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    pointer-events: none;
}

.bird {
    position: absolute;
    transition: transform 1.5s ease-out, opacity 1.5s ease-out;
    opacity: 0.8;
}

.bird-1 { left: 10px; top: 20px; }
.bird-2 { left: 25px; top: 15px; }
.bird-3 { left: 35px; top: 25px; }
.bird-4 { left: 15px; top: 10px; }
.bird-5 { left: 40px; top: 18px; }

.birds-scattered .bird-1 { transform: translate(-60px, -120px) rotate(-20deg); opacity: 0; }
.birds-scattered .bird-2 { transform: translate(40px, -140px) rotate(15deg); opacity: 0; }
.birds-scattered .bird-3 { transform: translate(-30px, -160px) rotate(-10deg); opacity: 0; }
.birds-scattered .bird-4 { transform: translate(70px, -100px) rotate(25deg); opacity: 0; }
.birds-scattered .bird-5 { transform: translate(-50px, -130px) rotate(-30deg); opacity: 0; }

/* ============================================
   NEIGHBORHOOD 4: The Evening Quarter
   ============================================ */
.evening-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6vh;
    max-width: 700px;
    padding: 0 20px;
    position: relative;
}

.lamppost {
    position: absolute;
}

.lamppost-1 {
    left: -80px;
    top: 20%;
}

.lamppost-2 {
    right: -80px;
    top: 50%;
}

.lamp-glow {
    transition: fill-opacity 1.5s ease-out;
}

.neighborhood-4.in-view .lamp-glow {
    fill-opacity: 0.6;
    filter: blur(4px);
}

/* Church bell swing */
.church-bell {
    animation: bell-swing 4s ease-in-out infinite;
    transform-origin: top center;
}

@keyframes bell-swing {
    0%, 100% { transform: translate(80px, 32px) rotate(0deg); }
    25% { transform: translate(80px, 32px) rotate(4deg); }
    75% { transform: translate(80px, 32px) rotate(-4deg); }
}

.evening-text-block {
    text-align: center;
    max-width: 520px;
    padding: 0 20px;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.evening-text-block.revealed {
    opacity: 1;
}

.evening-heading {
    font-family: 'Baloo 2', cursive, sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--white);
    letter-spacing: 0.02em;
    margin-bottom: 20px;
    line-height: 1.3;
}

.evening-body {
    color: var(--white);
    font-size: calc(clamp(1rem, 1.2vw, 1.15rem) * 1.1);
    line-height: 1.85;
    margin-bottom: 16px;
}

/* Window glow animation for evening */
.window-glow-warm {
    transition: fill-opacity 1.5s ease-out;
}

.neighborhood-4.in-view .window-glow-warm {
    fill-opacity: 0.7;
}

/* ============================================
   NEIGHBORHOOD 5: The Letterbox
   ============================================ */
.letterbox-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4vh;
    max-width: 500px;
    padding: 0 20px;
}

.letterbox-illustration {
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.letterbox-illustration.revealed {
    opacity: 1;
}

.letterbox-form {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.letterbox-form.revealed {
    opacity: 1;
}

.form-field {
    position: relative;
}

.form-field input,
.form-field textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(250, 248, 243, 0.3);
    padding: 8px 0;
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--white);
    outline: none;
    transition: border-color 0.4s ease;
    resize: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    font-family: 'Caveat', cursive;
    color: rgba(250, 248, 243, 0.5);
}

.form-field input:focus,
.form-field textarea:focus {
    border-bottom-color: var(--apricot);
}

.field-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--apricot);
    transition: width 0.6s ease;
}

.form-field input:focus ~ .field-line,
.form-field textarea:focus ~ .field-line {
    width: 100%;
}

.send-letter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--terracotta);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
    align-self: center;
}

.send-letter-btn:hover {
    transform: translateY(-2px);
    background: #b5512f;
}

.send-letter-btn:active .letter-icon {
    animation: insert-letter 0.5s ease-out;
}

@keyframes insert-letter {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.btn-text {
    font-family: 'Caveat', cursive;
}

.fin-text {
    margin-top: 8vh;
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.fin-text.revealed {
    opacity: 1;
}

.fin-text span {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    color: var(--white);
    opacity: 0.7;
}

/* ============================================
   Cobblestone Base
   ============================================ */
.cobblestone-base {
    height: 40px;
    background-color: var(--slate);
    background-image: radial-gradient(circle, rgba(45, 74, 62, 0.1) 2px, transparent 2px);
    background-size: 12px 12px;
}

/* ============================================
   Compass Rose
   ============================================ */
.compass-rose {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease;
    filter: drop-shadow(1px 2px 3px rgba(30, 42, 37, 0.2));
}

.compass-rose:hover {
    transform: scale(1.1) rotate(15deg);
}

/* ============================================
   City Map Overlay
   ============================================ */
.city-map-overlay {
    position: fixed;
    top: 0;
    right: -400px;
    width: 340px;
    height: 100vh;
    background: rgba(30, 42, 37, 0.95);
    backdrop-filter: blur(8px);
    z-index: 200;
    transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.city-map-overlay.open {
    right: 0;
}

.map-content {
    padding: 40px 30px;
    position: relative;
}

.map-title {
    font-family: 'Baloo 2', cursive, sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--white);
    margin-bottom: 30px;
}

.map-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    padding: 4px;
}

.map-close:hover {
    color: var(--apricot);
}

.map-nav {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.map-landmark {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.map-landmark:hover {
    background: rgba(250, 248, 243, 0.08);
}

.map-landmark span {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: var(--white);
}

/* ============================================
   Responsive (Mobile)
   ============================================ */
@media (max-width: 768px) {
    .main-street-svg {
        width: 100px;
    }

    .compass-rose {
        bottom: 16px;
        right: 50%;
        transform: translateX(50%);
    }

    .compass-rose:hover {
        transform: translateX(50%) scale(1.1) rotate(15deg);
    }

    .city-map-overlay {
        width: 100%;
        right: -100%;
    }

    .lamppost-1,
    .lamppost-2 {
        display: none;
    }

    .tree {
        transform: scale(0.7);
    }

    .neighborhood-1 {
        min-height: 100vh;
        padding-top: 15vh;
    }

    .neighborhood-2,
    .neighborhood-3,
    .neighborhood-4,
    .neighborhood-5 {
        min-height: auto;
        padding-top: 6vh;
        padding-bottom: 6vh;
    }

    .market-cluster,
    .evening-cluster {
        gap: 4vh;
    }

    .park-area {
        min-height: 80vh;
    }

    .building-tower svg {
        width: 80px;
        height: 288px;
    }

    .building-squat-wide svg {
        width: 180px;
        height: 148px;
    }
}

/* ============================================
   Watercolor pooling effect between sections
   ============================================ */
.neighborhood-2::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(91, 140, 90, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.neighborhood-3::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 30%;
    width: 200px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(91, 140, 90, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.neighborhood-3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, var(--light-green), var(--slate));
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .cloud,
    .scroll-arrow,
    .chimney-smoke,
    .laundry-line,
    .cat-tail,
    .plant-grow,
    .church-bell {
        animation: none;
    }

    .draw-line {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
