/* ===========================================
   hil.st - Spray-Paint Cosmos
   Graffiti-infused celestial journey
   =========================================== */

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

:root {
    --night-dark: #1A1520;
    --deep-night: #2D2235;
    --warm-vanilla: #F5E6D3;
    --soft-lavender: #E8DDF0;
    --pale-rose: #F0D6E0;
    --muted-rose: #D4A0B8;
    --muted-lavender: #B8A0D4;
    --star-white: #FFF8F0;
    --margin-width: 32px;
    --gutter: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--night-dark);
    color: var(--warm-vanilla);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* --- Navigation Tags --- */
#nav-tags {
    position: fixed;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-tag {
    font-family: 'Permanent Marker', cursive;
    font-size: 10px;
    color: var(--muted-rose);
    text-decoration: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    letter-spacing: 0.05em;
    padding: 4px 2px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-tag::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 0;
    background: var(--muted-rose);
    transition: height 0.4s ease;
}

.nav-tag.active {
    color: var(--star-white);
}

.nav-tag.active::after {
    height: 100%;
    background: var(--star-white);
}

/* --- Star Field --- */
#star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: var(--star-white);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.star.visible {
    opacity: var(--star-opacity, 0.5);
    transform: scale(1);
}

.star.rooftop-bright {
    transition: opacity 0.8s ease;
}

@keyframes starPulse {
    0%, 100% { opacity: var(--star-min-opacity, 0.4); }
    50% { opacity: var(--star-max-opacity, 0.8); }
}

.star.pulsing {
    animation: starPulse 3s ease-in-out infinite;
    animation-delay: var(--pulse-delay, 0s);
}

/* --- Lens Flare Layer --- */
#lens-flare-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    will-change: transform;
}

.lens-flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.flare-1 {
    width: 350px;
    height: 350px;
    top: 30%;
    left: 20%;
    background: radial-gradient(circle, #F5E6D340 0%, transparent 70%);
}

.flare-2 {
    width: 280px;
    height: 280px;
    top: 55%;
    right: 15%;
    background: radial-gradient(circle, #E8DDF030 0%, transparent 70%);
}

.flare-3 {
    width: 400px;
    height: 400px;
    top: 120%;
    left: 40%;
    background: radial-gradient(circle, #D4A0B820 0%, transparent 70%);
}

.flare-4 {
    width: 300px;
    height: 300px;
    top: 200%;
    right: 25%;
    background: radial-gradient(circle, #F5E6D330 0%, transparent 65%);
}

.flare-5 {
    width: 250px;
    height: 250px;
    top: 350%;
    left: 10%;
    background: radial-gradient(circle, #E8DDF025 0%, transparent 70%);
}

/* --- Constellation SVG --- */
#constellation-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

.constellation-line {
    stroke: #FFF8F010;
    stroke-width: 0.5;
    fill: none;
    stroke-dasharray: var(--line-length, 100);
    stroke-dashoffset: var(--line-length, 100);
    transition: stroke-dashoffset 2s ease;
}

.constellation-line.drawn {
    stroke-dashoffset: 0;
}

/* --- Section: The Alley Entrance --- */
.section-alley {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: radial-gradient(ellipse at 50% 50%, var(--deep-night) 0%, var(--night-dark) 70%);
}

.alley-content {
    position: relative;
    margin-left: -5%;
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 80px;
    line-height: 0.95;
    letter-spacing: -0.01em;
    color: var(--warm-vanilla);
    display: inline-flex;
    gap: 2px;
}

.hero-letter {
    display: inline-block;
    transform: rotate(var(--rotation, 0deg));
    opacity: 0;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.hero-letter.sprayed {
    opacity: 1;
}

.alley-subtitle {
    font-family: 'Permanent Marker', cursive;
    font-size: 14px;
    color: var(--muted-lavender);
    margin-top: 16px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease 1.5s, transform 0.6s ease 1.5s;
}

.alley-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Spray splatter particles */
.splatter {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--warm-vanilla);
    opacity: 0.6;
    pointer-events: none;
    animation: splatterDrift 0.3s ease-out forwards;
}

@keyframes splatterDrift {
    0% {
        opacity: 0.6;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--drift-x, 10px), var(--drift-y, -10px)) scale(0.5);
    }
}

/* --- Section: The Murals --- */
.section-mural {
    position: relative;
    z-index: 2;
    padding: 60px var(--margin-width);
    transition: padding 0.8s ease;
}

.mural-panel {
    position: relative;
    max-width: 720px;
    padding: 48px 40px;
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.panel-odd {
    margin-left: var(--margin-width);
    transform: translateX(-30px);
}

.panel-odd.visible {
    opacity: 1;
    transform: translateX(0);
}

.panel-even {
    margin-left: auto;
    margin-right: var(--margin-width);
    transform: translateX(30px);
}

.panel-even.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Panel background colors with jittered clip-paths */
.panel-lavender {
    background: var(--soft-lavender);
    color: var(--night-dark);
    clip-path: polygon(
        1% 3%, 24% 0%, 51% 2%, 76% 0%, 99% 1%,
        100% 24%, 99% 52%, 100% 78%, 98% 99%,
        75% 100%, 49% 97%, 23% 100%, 2% 98%,
        0% 76%, 1% 48%, 0% 22%
    );
}

.panel-vanilla {
    background: var(--warm-vanilla);
    color: var(--night-dark);
    clip-path: polygon(
        0% 2%, 26% 0%, 52% 1%, 78% 0%, 98% 3%,
        100% 26%, 99% 50%, 100% 74%, 97% 100%,
        74% 98%, 48% 100%, 22% 99%, 3% 97%,
        0% 75%, 2% 49%, 0% 25%
    );
}

.panel-rose {
    background: var(--pale-rose);
    color: var(--night-dark);
    clip-path: polygon(
        2% 0%, 25% 2%, 50% 0%, 77% 1%, 100% 2%,
        98% 25%, 100% 51%, 99% 77%, 97% 100%,
        76% 99%, 50% 100%, 24% 98%, 0% 100%,
        1% 74%, 0% 50%, 2% 24%
    );
}

/* Tag stamps */
.tag-stamp {
    font-family: 'Permanent Marker', cursive;
    font-size: 10px;
    color: var(--muted-rose);
    border: 1px solid var(--muted-rose);
    border-radius: 2px;
    padding: 2px 8px;
    display: inline-block;
    position: absolute;
    top: 16px;
    right: 24px;
}

.stamp-1 {
    transform: rotate(-3deg);
    color: var(--muted-rose);
    border-color: var(--muted-rose);
}

.stamp-2 {
    transform: rotate(2deg);
    color: var(--muted-lavender);
    border-color: var(--muted-lavender);
}

.stamp-3 {
    transform: rotate(5deg);
    color: var(--muted-rose);
    border-color: var(--muted-rose);
}

.stamp-4 {
    transform: rotate(-2deg);
    color: var(--muted-lavender);
    border-color: var(--muted-lavender);
}

.mural-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 48px;
    line-height: 1.0;
    letter-spacing: -0.01em;
    color: var(--night-dark);
    margin-bottom: 24px;
}

.mural-body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: var(--night-dark);
    margin-bottom: 16px;
}

.pull-quote {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.05;
    color: var(--deep-night);
    margin: 32px 0 16px;
    padding-left: 16px;
    border-left: 3px solid var(--muted-rose);
}

/* Drip lines */
.drip-lines {
    position: absolute;
    bottom: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
}

.drip {
    position: absolute;
    bottom: 0;
    width: 1px;
    height: 0;
    border-radius: 0 0 1px 1px;
    transition: height 0.6s ease 0.2s;
}

.panel-lavender .drip {
    background: #E8DDF066;
}

.panel-vanilla .drip {
    background: #F5E6D366;
}

.panel-rose .drip {
    background: #F0D6E066;
}

.mural-panel.visible .drip {
    height: var(--drip-height);
}

/* --- Section: The Rooftop --- */
.section-rooftop {
    position: relative;
    z-index: 2;
    min-height: 200vh;
    padding: 120px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rooftop-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    width: 600px;
    height: 600px;
    opacity: 0;
    transition: transform 1.2s ease-out, opacity 1s ease-out;
    pointer-events: none;
}

.rooftop-flare.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.rooftop-flare-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 40% 40%, #F5E6D340 0%, transparent 50%),
        radial-gradient(circle at 60% 55%, #E8DDF030 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, #F0D6E020 0%, transparent 60%);
}

.rooftop-content {
    position: relative;
    max-width: 600px;
    text-align: center;
}

.rooftop-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 64px;
    line-height: 0.95;
    letter-spacing: -0.01em;
    color: var(--warm-vanilla);
    margin-bottom: 32px;
}

.rooftop-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.75;
    color: #C4B8CC;
    margin-bottom: 20px;
}

.rooftop-quote {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 48px;
    line-height: 1.0;
    color: var(--warm-vanilla);
    margin-top: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
}

.rooftop-quote.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 56px;
    }

    .mural-heading {
        font-size: 36px;
    }

    .mural-panel {
        padding: 32px 24px;
    }

    .panel-odd,
    .panel-even {
        margin-left: 16px;
        margin-right: 16px;
    }

    .section-rooftop {
        padding: 80px 32px;
    }

    .rooftop-heading {
        font-size: 48px;
    }

    .rooftop-quote {
        font-size: 36px;
    }

    .pull-quote {
        font-size: 24px;
    }

    #nav-tags {
        display: none;
    }
}
