/* ============================================
   bada.city — Urban Gallery Walk
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-forest: #1a3a2a;
    --patina-green: #3d7a5c;
    --oxidized-copper: #6baa8e;
    --aged-parchment: #f0ebe1;
    --wet-concrete: #b8b3a8;
    --charcoal-wall: #2a2d25;
    --spray-orange: #d4602a;
    --frost-white: #e8f4f0;
    --brick-base: #a0756a;
    --metal-light: #8a9098;
    --metal-dark: #6e747a;
    --accent-cool-shift: #3d6a7a;
    --font-display: 'Bowlby One SC', cursive;
    --font-body: 'Jost', sans-serif;
    --font-accent: 'Permanent Marker', cursive;
    --spacing-unit: clamp(1.5rem, 3vw, 3rem);
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--deep-forest);
    background: var(--aged-parchment);
    overflow-x: hidden;
    position: relative;
}

/* --- SVG Defs (hidden) --- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Noise & Mottle Overlays --- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.75' numOctaves='4' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.mottle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='m'%3E%3CfeTurbulence baseFrequency='0.015' numOctaves='2' type='fractalNoise'/%3E%3C/filter%3E%3Crect width='600' height='600' filter='url(%23m)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Crystal Navigation --- */
.crystal-nav {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
}

.crystal-icon {
    width: 40px;
    height: 40px;
    cursor: pointer;
    animation: crystal-pulse 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.crystal-icon:hover {
    transform: scale(1.15);
}

@keyframes crystal-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.nav-menu {
    position: absolute;
    top: 50px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: rgba(42, 45, 37, 0.9);
    padding: 1rem 1.5rem;
    border-left: 2px solid var(--patina-green);
}

.nav-menu.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.nav-link {
    font-family: var(--font-accent);
    font-size: 0.95rem;
    color: var(--frost-white);
    text-decoration: none;
    transform: rotate(-1deg);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--spray-orange);
}

/* --- Crystal Margins --- */
.crystal-margin {
    position: fixed;
    top: 0;
    width: 60px;
    height: 100%;
    z-index: 500;
    pointer-events: none;
    overflow: hidden;
}

.crystal-margin-left {
    left: 0;
}

.crystal-margin-right {
    right: 0;
}

.crystal-margin svg {
    position: absolute;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.crystal-margin svg.visible {
    opacity: 1;
}

/* --- Wall Sections --- */
.wall {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wall + .wall {
    margin-top: 0;
}

.wall-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(42, 45, 37, 0.06) 100%);
}

/* --- Wall: Hero --- */
.wall-hero {
    background: var(--aged-parchment);
    flex-direction: column;
}

.hero-crystal-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-crystal-svg {
    width: 80%;
    max-width: 800px;
    height: auto;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.hero-crystal-svg.visible {
    opacity: 1;
}

.hero-crystal-svg line,
.hero-crystal-svg polygon.crystal-hex {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease;
}

.hero-crystal-svg.animating line,
.hero-crystal-svg.animating polygon.crystal-hex {
    stroke-dashoffset: 0;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: 0.08em;
    color: var(--deep-forest);
    text-transform: uppercase;
    position: relative;
    filter: url(#stencil-rough);
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(1.3) rotate(-3deg);
    transition: opacity 0.15s ease, transform 0.3s ease;
}

.hero-title .letter.revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.hero-title .letter.shake {
    animation: shake-entry 0.2s ease;
}

@keyframes shake-entry {
    0%, 100% { transform: translate(0, 0) scale(1); }
    10% { transform: translate(-4px, 2px) scale(1.01); }
    20% { transform: translate(3px, -2px) scale(0.99); }
    30% { transform: translate(-3px, 1px) scale(1.01); }
    40% { transform: translate(4px, -1px) scale(1); }
    50% { transform: translate(-2px, 2px) scale(1.01); }
    60% { transform: translate(3px, 0) scale(0.99); }
    70% { transform: translate(-1px, -2px) scale(1); }
    80% { transform: translate(2px, 1px) scale(1.01); }
    90% { transform: translate(-3px, -1px) scale(1); }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--patina-green);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* --- Spray Mist --- */
.spray-mist {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.spray-mist-hero {
    width: 400px;
    height: 400px;
    top: 30%;
    left: 20%;
    background: radial-gradient(circle, rgba(61, 122, 92, 0.06) 0%, transparent 70%);
}

.spray-mist-1 {
    width: 300px;
    height: 300px;
    bottom: 10%;
    right: 15%;
    background: radial-gradient(circle, rgba(61, 122, 92, 0.07) 0%, transparent 70%);
}

.spray-mist-2 {
    width: 350px;
    height: 350px;
    top: 20%;
    left: 10%;
    background: radial-gradient(circle, rgba(107, 170, 142, 0.06) 0%, transparent 70%);
}

.spray-mist-3 {
    width: 280px;
    height: 280px;
    bottom: 20%;
    left: 25%;
    background: radial-gradient(circle, rgba(61, 106, 122, 0.07) 0%, transparent 70%);
}

/* --- Tag Marks --- */
.tag-mark {
    position: absolute;
    font-family: var(--font-accent);
    font-size: 0.875rem;
    color: var(--deep-forest);
    opacity: 0.25;
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

.tag-on-dark {
    color: var(--frost-white);
    opacity: 0.2;
}

/* --- Wall: Concrete --- */
.wall-concrete {
    background: var(--wet-concrete);
}

.wall-texture-concrete {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(42, 45, 37, 0.03) 40px,
            rgba(42, 45, 37, 0.03) 41px
        ),
        linear-gradient(
            180deg,
            rgba(184, 179, 168, 1) 0%,
            rgba(174, 169, 158, 1) 50%,
            rgba(184, 179, 168, 1) 100%
        );
}

/* --- Wall: Brick --- */
.wall-brick {
    background: var(--brick-base);
}

.wall-texture-brick {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 30px,
            rgba(42, 45, 37, 0.2) 30px,
            rgba(42, 45, 37, 0.2) 33px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 60px,
            rgba(42, 45, 37, 0.15) 60px,
            rgba(42, 45, 37, 0.15) 63px
        );
}

/* --- Wall: Metal --- */
.wall-metal {
    background: linear-gradient(135deg, var(--metal-light), var(--metal-dark));
}

.wall-texture-metal {
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 18px,
            rgba(255, 255, 255, 0.07) 18px,
            rgba(255, 255, 255, 0.07) 20px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 36px,
            rgba(0, 0, 0, 0.06) 36px,
            rgba(0, 0, 0, 0.06) 38px
        );
}

/* --- Wall: Footer / Dark --- */
.wall-footer {
    min-height: 50vh;
    background: var(--charcoal-wall);
}

.wall-texture-dark {
    background: var(--charcoal-wall);
}

.footer-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

.footer-crystal {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    animation: color-breathe 15s ease-in-out infinite;
}

.footer-text {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--frost-white);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-sub {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: var(--oxidized-copper);
    letter-spacing: 0.15em;
    margin-top: 0.5rem;
}

/* --- Wall Content --- */
.wall-content {
    position: relative;
    z-index: 10;
    max-width: 680px;
    width: 90%;
    margin: 0 auto;
    padding: var(--spacing-unit) 0;
    /* Slight offset from center — centered-but-imprecise spine */
    transform: translateX(-2%);
}

.crystal-drop {
    width: 30px;
    height: 30px;
    margin-bottom: 1rem;
}

.section-label {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--deep-forest);
    margin-bottom: 0.75rem;
}

.section-label-light {
    color: var(--frost-white);
}

.wall-headline {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: 0.08em;
    color: var(--deep-forest);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    position: relative;
    filter: url(#stencil-rough);
}

.headline-light {
    color: var(--frost-white);
}

.wall-headline .letter {
    display: inline-block;
    opacity: 0;
    transform: scale(1.2) rotate(-3deg);
    transition: opacity 0.12s ease, transform 0.25s ease;
}

.wall-headline .letter.revealed {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.wall-headline .letter.shake {
    animation: shake-entry 0.2s ease;
}

.wall-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--deep-forest);
    margin-bottom: var(--spacing-unit);
    /* Slight offset for organic feel */
    padding-left: 0.5rem;
}

.body-on-dark {
    color: #e8e4dc;
}

/* --- Drip Lines --- */
.drip-container {
    position: relative;
    width: 100%;
    height: 0;
    overflow: visible;
    z-index: 5;
}

.drip-line {
    position: absolute;
    top: 0;
    width: 1.5px;
    background: linear-gradient(to bottom, var(--deep-forest), transparent);
    opacity: 0.15;
    transform-origin: top center;
    animation: drip-down var(--drip-speed, 2s) ease-out forwards;
}

.wall-brick .drip-line,
.wall-metal .drip-line {
    background: linear-gradient(to bottom, var(--frost-white), transparent);
    opacity: 0.12;
}

@keyframes drip-down {
    0% { height: 0; }
    100% { height: var(--drip-height, 80px); }
}

/* --- Clip-path Reveal for Walls --- */
.wall-concrete,
.wall-brick,
.wall-metal {
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0s;
}

.wall-concrete.revealed,
.wall-brick.revealed,
.wall-metal.revealed {
    clip-path: circle(150% at 50% 50%);
    transition: clip-path 0.8s ease-out;
}

/* --- Color Breathing Animation --- */
@keyframes color-breathe {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(20deg);
    }
}

.crystal-drop,
.footer-crystal,
.crystal-margin svg {
    animation: color-breathe 15s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .wall-content {
        transform: translateX(0);
        width: 92%;
    }

    .crystal-margin {
        width: 30px;
    }

    .tag-mark {
        font-size: 0.75rem;
    }

    .hero-crystal-svg {
        width: 95%;
    }
}

@media (max-width: 480px) {
    .crystal-margin {
        display: none;
    }

    .wall-headline {
        font-size: clamp(2rem, 10vw, 4rem);
    }
}
