/* ============================================================
   gabs.boo  --  the night market price war
   Street-style anti-design. Broken grid. Dark-neon palette.
   ============================================================ */

:root {
    --asphalt: #1a1a1a;
    --asphalt-warm: #2a2725;
    --warm-chalk: #e0dcd5;
    --chalk-shadow: #d5d0c8;
    --fluo-pink: #ff2d6f;
    --electric-mint: #00ff9f;
    --bruised-purple: #6b3fa0;
    --faded-ink: #8a857e;
    --cardboard: #c4a882;
    --hazard-yellow: #ffd23f;

    --bg-shift: var(--asphalt);

    --font-marker: "Permanent Marker", "Caveat", cursive;
    --font-body: "Work Sans", "Inter", system-ui, sans-serif;
    --font-mono: "Share Tech Mono", "Menlo", monospace;
    --font-stencil: "Russo One", "Impact", sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    background: var(--asphalt);
}

body {
    font-family: var(--font-body);
    color: var(--warm-chalk);
    background: var(--bg-shift);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.6s linear;
    position: relative;
}

/* Subtle grain texture using SVG-less radial flecks */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        radial-gradient(circle at 23% 17%, rgba(255,255,255,0.015) 0 1px, transparent 2px),
        radial-gradient(circle at 71% 63%, rgba(255,255,255,0.012) 0 1px, transparent 2px),
        radial-gradient(circle at 47% 89%, rgba(255,255,255,0.01) 0 1px, transparent 2px);
    background-size: 7px 7px, 11px 11px, 13px 13px;
    mix-blend-mode: screen;
    opacity: 0.6;
}

#scroll-sentinel {
    position: absolute;
    top: 50vh;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* ============================================================
   GHOST NUMBERS (ambient drift layer)
   ============================================================ */
.ghost-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ghost-num {
    position: absolute;
    font-family: var(--font-marker);
    color: var(--bruised-purple);
    opacity: 0.15;
    white-space: nowrap;
    will-change: transform;
    user-select: none;
    text-shadow: 0 0 22px rgba(107, 63, 160, 0.35);
}

@keyframes ghostDrift {
    0%   { transform: translateX(-15vw) translateY(0); }
    100% { transform: translateX(115vw) translateY(0); }
}

/* ============================================================
   SCROLL SNAP CONTAINERS
   ============================================================ */
.entrance,
.stall {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    position: relative;
    z-index: 2;
}

/* ============================================================
   ENTRANCE  /  STALL ZERO
   ============================================================ */
.entrance {
    min-height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chaos-cloud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.chaos-num {
    position: absolute;
    font-family: var(--font-marker);
    line-height: 0.95;
    user-select: none;
    transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 800ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    transform: translate(0, 0) rotate(var(--rot, 0deg));
    text-shadow: 0 0 18px rgba(255, 45, 111, 0.18);
}

.chaos-num.dispersed {
    transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--rot, 0deg)) scale(0.85);
    opacity: 0.08 !important;
}

.entrance-title-wrap {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms ease 250ms, transform 700ms ease 250ms;
}

.entrance-title-wrap.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   MASKING TAPE
   ============================================================ */
.masking-tape {
    display: inline-block;
    position: relative;
    background-color: rgba(224, 220, 213, 0.78);
    background-image: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 0 1px,
        transparent 1px 4px
    );
    color: var(--asphalt);
    padding: 0.7rem 2.4rem;
    transform: rotate(-1.4deg);
    box-shadow: 0 6px 22px rgba(0,0,0,0.45);
    clip-path: polygon(
        0% 8%, 3% 0%, 12% 6%, 25% 2%, 38% 7%, 50% 1%, 63% 5%,
        78% 0%, 92% 4%, 100% 9%, 98% 92%, 88% 100%, 73% 95%,
        58% 100%, 42% 96%, 27% 100%, 12% 95%, 2% 100%
    );
    letter-spacing: 0.02em;
}

.tape-title {
    padding: 1.2rem 3.5rem;
    transform: rotate(-2.2deg);
}

.tape-title .tape-text {
    font-family: var(--font-marker);
    font-size: clamp(3rem, 11vw, 8rem);
    color: var(--asphalt);
    line-height: 1;
    display: inline-block;
}

.tape-sub {
    margin-top: 1.2rem;
    transform: rotate(1.6deg);
    padding: 0.5rem 1.6rem;
}

.tape-sub .tape-text-sub {
    font-family: var(--font-marker);
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--asphalt);
}

.tape-section {
    transform: rotate(-1.8deg);
}

.tape-text-section {
    font-family: var(--font-stencil);
    font-size: clamp(0.85rem, 1.6vw, 1.1rem);
    letter-spacing: 0.18em;
    color: var(--asphalt);
}

/* ============================================================
   SCROLL HINT
   ============================================================ */
.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--electric-mint);
    z-index: 4;
    animation: bobScroll 2.4s ease-in-out infinite;
}

.scroll-hint .russo {
    display: block;
    font-family: var(--font-stencil);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 8px rgba(0, 255, 159, 0.6);
}

.scroll-hint .arrow {
    font-size: 1.6rem;
    display: block;
}

@keyframes bobScroll {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* ============================================================
   STALL LABELS (sticky-ish anchors)
   ============================================================ */
.stall-label {
    position: relative;
    text-align: left;
    padding: 4rem 5vw 2rem;
    z-index: 5;
}

.stall-label .masking-tape {
    transform: rotate(-2.5deg);
}

/* ============================================================
   STALL ONE  /  PRICE TAGS BROKEN GRID
   ============================================================ */
.stall-one {
    min-height: 150vh;
    padding-bottom: 8rem;
    position: relative;
}

.tag-field {
    position: relative;
    margin: 0 auto;
    padding: 4rem 4vw 6rem;
    max-width: 1400px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(70px, auto);
    gap: 1.2rem 1rem;
}

.price-tag {
    position: relative;
    background: var(--cardboard);
    color: var(--asphalt);
    padding: 1.6rem 1.4rem 1.6rem 2.4rem;
    border-radius: 4px 12px 6px 14px;
    box-shadow:
        0 4px 20px rgba(0,0,0,0.5),
        inset 0 0 0 1px rgba(0,0,0,0.07),
        inset 0 0 28px rgba(160, 130, 90, 0.18);
    transform: rotate(var(--rot, 0deg)) translateY(40px);
    opacity: 0;
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 600ms ease;
    background-image:
        repeating-linear-gradient(
            127deg,
            rgba(120, 88, 50, 0.05) 0 2px,
            transparent 2px 4px
        ),
        repeating-linear-gradient(
            37deg,
            rgba(60, 40, 20, 0.04) 0 2px,
            transparent 2px 5px
        );
    clip-path: polygon(
        0 6%, 4% 0, 96% 2%, 100% 8%, 100% 94%, 96% 100%,
        4% 98%, 0 92%
    );
}

.price-tag.entered {
    transform: rotate(var(--rot, 0deg)) translateY(0);
    opacity: 1;
}

.tag-hole {
    position: absolute;
    width: 16px;
    height: 16px;
    top: 14px;
    left: 14px;
    fill: var(--asphalt);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
}

.tag-string {
    position: absolute;
    width: 1px;
    height: 38px;
    top: -36px;
    left: 22px;
    background: var(--faded-ink);
    transform: rotate(8deg);
    transform-origin: bottom center;
    opacity: 0.55;
}

.tag-label {
    display: inline-block;
    font-family: var(--font-stencil);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    background: var(--asphalt);
    color: var(--fluo-pink);
    padding: 0.18rem 0.55rem;
    margin-bottom: 0.5rem;
    margin-left: 1.6rem;
    text-shadow: 0 0 8px rgba(255, 45, 111, 0.55);
}

.tag-price {
    font-family: var(--font-marker);
    font-size: clamp(2.2rem, 5vw, 4.4rem);
    color: var(--asphalt);
    line-height: 1;
    margin: 0.2rem 0 0.8rem;
    word-break: break-word;
}

.tag-name {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    color: var(--asphalt);
    margin-bottom: 0.5rem;
    line-height: 1.25;
}

.tag-body {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: rgba(26,26,26,0.78);
    line-height: 1.5;
}

/* Broken-grid placement -- intentional overlaps/asymmetry */
.tag-1 { grid-column: 1 / span 5; grid-row: 1 / span 3; z-index: 4; }
.tag-2 { grid-column: 5 / span 6; grid-row: 2 / span 3; z-index: 6; margin-top: 2rem; }
.tag-3 { grid-column: 2 / span 4; grid-row: 4 / span 3; z-index: 5; margin-top: -1rem; }
.tag-4 { grid-column: 7 / span 5; grid-row: 5 / span 3; z-index: 7; }
.tag-5 { grid-column: 1 / span 6; grid-row: 7 / span 3; z-index: 8; margin-top: 0.5rem; }
.tag-6 { grid-column: 8 / span 5; grid-row: 8 / span 3; z-index: 6; margin-top: 1rem; }
.tag-7 { grid-column: 3 / span 5; grid-row: 10 / span 3; z-index: 7; margin-top: -0.5rem; }
.tag-8 { grid-column: 7 / span 5; grid-row: 11 / span 3; z-index: 9; margin-top: 1rem; }

/* Variant accent: alternate label colors */
.tag-2 .tag-label { color: var(--electric-mint); text-shadow: 0 0 10px rgba(0,255,159,0.5); }
.tag-4 .tag-label { color: var(--hazard-yellow); text-shadow: 0 0 10px rgba(255,210,63,0.5); }
.tag-5 .tag-label { color: var(--electric-mint); text-shadow: 0 0 10px rgba(0,255,159,0.5); background: var(--asphalt-warm); }
.tag-7 .tag-label { color: var(--hazard-yellow); text-shadow: 0 0 10px rgba(255,210,63,0.5); }
.tag-8 .tag-label { color: var(--electric-mint); text-shadow: 0 0 10px rgba(0,255,159,0.5); }

/* ============================================================
   STALL TWO  /  THE HAGGLE  (diagonal clip-path)
   ============================================================ */
.stall-two {
    min-height: 130vh;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(42,39,37,0.4) 50%, transparent 100%);
}

.haggle-track {
    position: relative;
    height: 100vh;
    margin: 2rem 0;
}

.haggle-stage {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Listed price -- bottom layer, calm Work Sans */
.haggle-listed,
.haggle-true {
    position: absolute;
    inset: 0;
    padding: 8vh 8vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.haggle-listed {
    background: var(--asphalt);
    color: var(--warm-chalk);
    z-index: 1;
}

.haggle-true {
    background: var(--asphalt-warm);
    color: var(--warm-chalk);
    z-index: 2;
    /* Default: hidden behind a left-leaning diagonal -- shifts via JS */
    --haggle-progress: 0;
    clip-path: polygon(
        calc(var(--haggle-progress, 0) * 100% - 5%) 0%,
        100% 0%,
        100% 100%,
        calc(var(--haggle-progress, 0) * 100% + 8%) 100%
    );
    transition: clip-path 200ms linear;
}

.haggle-header {
    margin-bottom: 3rem;
}

.haggle-tag {
    display: inline-block;
    font-family: var(--font-stencil);
    letter-spacing: 0.22em;
    font-size: clamp(0.85rem, 1.6vw, 1.1rem);
    background: var(--warm-chalk);
    color: var(--asphalt);
    padding: 0.45rem 1.1rem;
    transform: rotate(-1deg);
}

.haggle-tag-true {
    background: var(--fluo-pink);
    color: var(--asphalt);
    text-shadow: none;
    transform: rotate(2deg);
    box-shadow: 0 0 24px rgba(255, 45, 111, 0.55);
}

.haggle-list {
    list-style: none;
    max-width: 720px;
}

.haggle-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.9rem 0;
    border-bottom: 1px dashed rgba(224, 220, 213, 0.18);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    gap: 1.5rem;
}

.haggle-list .haggle-item {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--warm-chalk);
}

.haggle-list .haggle-num {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--faded-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.haggle-list-true li {
    border-bottom-color: rgba(255, 45, 111, 0.35);
}

.haggle-item-true {
    font-family: var(--font-marker);
    color: var(--electric-mint);
    font-size: clamp(1.4rem, 3.2vw, 2.4rem);
    text-shadow: 0 0 14px rgba(0,255,159,0.4);
    line-height: 1.1;
}

.haggle-num-true {
    font-family: var(--font-marker);
    color: var(--fluo-pink);
    font-size: clamp(1.1rem, 2.2vw, 1.7rem);
    text-shadow: 0 0 14px rgba(255,45,111,0.4);
    text-align: right;
    line-height: 1.2;
    transform: rotate(-1deg);
}

/* The diagonal pink line */
.haggle-line {
    position: absolute;
    top: -10%;
    bottom: -10%;
    left: 0;
    width: 2px;
    background: var(--fluo-pink);
    box-shadow: 0 0 12px var(--fluo-pink), 0 0 28px rgba(255,45,111,0.6);
    transform-origin: top center;
    transform: translateX(calc(var(--haggle-progress, 0) * 100vw - 4%)) rotate(8deg);
    z-index: 3;
    pointer-events: none;
    transition: transform 200ms linear;
    animation: fluoFlicker 6s infinite;
}

/* ============================================================
   STALL THREE  /  THE RECEIPT
   ============================================================ */
.stall-three {
    min-height: 150vh;
    padding: 4rem 0 12rem;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(26,26,26,0.7) 100%);
}

.receipt {
    position: relative;
    margin: 4rem auto 0;
    max-width: 380px;
    width: 92%;
    padding: 2rem 1.4rem 2.5rem;
    color: var(--asphalt);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.4;
    letter-spacing: 0.02em;
    background-color: var(--warm-chalk);
    background-image:
        repeating-linear-gradient(
            to bottom,
            var(--warm-chalk) 0px,
            var(--warm-chalk) calc(1.4em - 1px),
            var(--chalk-shadow) calc(1.4em - 1px),
            var(--chalk-shadow) 1.4em
        );
    box-shadow:
        0 30px 60px rgba(0,0,0,0.65),
        0 0 0 1px rgba(0,0,0,0.05);
    clip-path: polygon(
        0% 1%, 8% 0%, 22% 1.2%, 38% 0%, 55% 1%, 72% 0%, 88% 1%, 100% 0%,
        100% 99%, 92% 100%, 78% 98.8%, 62% 100%, 45% 98.8%, 28% 100%, 12% 99%, 0% 100%
    );
    transform: rotate(-0.6deg);
    z-index: 5;
}

.receipt::before,
.receipt::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1.6rem;
    pointer-events: none;
}

.receipt::before {
    top: 0;
    background: linear-gradient(180deg, var(--warm-chalk), transparent);
}

.receipt::after {
    bottom: 0;
    background: linear-gradient(0deg, var(--warm-chalk), transparent);
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    color: var(--faded-ink);
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 280ms ease, transform 280ms ease;
}

.receipt-line.shown {
    opacity: 1;
    transform: translateY(0);
}

.receipt-center {
    justify-content: center;
}

.receipt-divider {
    color: var(--faded-ink);
    text-align: center;
    margin: 0.4rem 0;
    opacity: 0;
    transition: opacity 280ms ease;
    font-family: var(--font-mono);
}

.receipt-divider.shown { opacity: 1; }

.receipt-items {
    list-style: none;
    margin: 0.4rem 0;
}

.receipt-items li {
    margin: 0.05rem 0;
}

.receipt-items li.receipt-ghost {
    color: var(--bruised-purple);
}

.receipt-totals .receipt-line.receipt-total {
    color: var(--fluo-pink);
    font-weight: bold;
    text-shadow: 0 0 6px rgba(255, 45, 111, 0.25);
    position: relative;
}

.cursor {
    display: inline-block;
    margin-left: 2px;
    color: var(--fluo-pink);
    animation: cursorBlink 0.9s step-end infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.receipt-faint {
    color: var(--faded-ink);
    opacity: 0.85;
}

/* ============================================================
   CLOSING TAGS (decorative floats)
   ============================================================ */
.closing-tags {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.float-tag {
    position: absolute;
    font-family: var(--font-marker);
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--electric-mint);
    transform: rotate(var(--rot, 0deg));
    opacity: 0.55;
    text-shadow: 0 0 18px rgba(0,255,159,0.4);
    animation: fluoFlicker 5s infinite;
}

.float-tag:nth-child(2) { color: var(--fluo-pink); text-shadow: 0 0 18px rgba(255,45,111,0.4); }
.float-tag:nth-child(4) { color: var(--hazard-yellow); text-shadow: 0 0 18px rgba(255,210,63,0.4); }

/* ============================================================
   FLUORESCENT FLICKER  --  irregular tube light
   ============================================================ */
@keyframes fluoFlicker {
    0%, 92%   { opacity: 1; }
    93%       { opacity: 0.85; }
    93.5%     { opacity: 1; }
    94%       { opacity: 0.92; }
    94.6%     { opacity: 1; }
    100%      { opacity: 1; }
}

.tag-label,
.haggle-tag-true {
    animation: fluoFlicker 6.4s infinite;
}

/* ============================================================
   RESPONSIVE -- collapse broken-grid for narrow viewports
   ============================================================ */
@media (max-width: 820px) {
    .tag-field {
        display: flex;
        flex-direction: column;
        gap: 1.4rem;
        padding: 3rem 6vw 5rem;
    }
    .price-tag {
        width: 92%;
        margin: 0 auto;
    }
    .tag-1, .tag-3, .tag-5, .tag-7 { align-self: flex-start; }
    .tag-2, .tag-4, .tag-6, .tag-8 { align-self: flex-end; }

    .haggle-listed,
    .haggle-true {
        padding: 6vh 6vw;
    }

    .haggle-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .haggle-num-true {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .tape-title { padding: 0.9rem 1.8rem; }
    .stall-label { padding: 3rem 5vw 1.5rem; }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .ghost-num,
    .float-tag,
    .tag-label,
    .haggle-line,
    .haggle-tag-true,
    .scroll-hint {
        animation: none !important;
    }
    .price-tag {
        transition: opacity 300ms ease;
    }
}
