/* ============================================
   a6c.quest - Street-Style Zine Aesthetic
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-worn-cardboard: #2b2520;
    --bg-warm: #2e2723;
    --bg-cool: #312a26;
    --fg-cream-chalk: #f5ece3;
    --accent-hot-coral: #e8553d;
    --accent-peach-skin: #f2a065;
    --accent-amber-signal: #f0c040;
    --pattern-dusty-mauve: #c49b8a;
    --cool-teal-spray: #3ab0a2;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Azeret Mono', monospace;

    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-worn-cardboard);
    color: var(--fg-cream-chalk);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.65;
    letter-spacing: 0.005em;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* --- Scroll Container --- */
.scroll-container {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

/* --- Fixed Logo --- */
.fixed-logo {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.logo-glyph {
    transition: transform 0.4s var(--spring-bounce);
}

.fixed-logo:hover .logo-glyph {
    transform: rotate(3deg);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: var(--fg-cream-chalk);
}

/* --- Dot Navigation --- */
.dot-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--fg-cream-chalk);
    background: transparent;
    cursor: pointer;
    transition: transform 0.4s var(--spring-bounce), background-color 0.3s ease, border-color 0.3s ease;
    padding: 0;
}

.dot:hover {
    transform: scale(1.5);
}

.dot.active {
    transform: scale(1.5);
    background-color: var(--accent-hot-coral);
    border-color: var(--accent-hot-coral);
}

.dot.final-active {
    background-color: var(--cool-teal-spray);
    border-color: var(--cool-teal-spray);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1.5); }
    50% { transform: scale(1.8); }
}

/* --- Section Base --- */
.section {
    width: 100%;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#section0 { background-color: var(--bg-worn-cardboard); }
#section1 { background-color: var(--bg-warm); }
#section2 { background-color: var(--bg-cool); }
#section3 { background-color: var(--bg-worn-cardboard); }
#section4 { background-color: var(--bg-warm); }
#section5 { background-color: var(--bg-cool); }
#section6 { background-color: var(--bg-worn-cardboard); }

/* --- Section Divider Line --- */
.section-divider {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 0;
    z-index: 10;
    transition: width 0.8s ease-in-out;
}

#section0 .section-divider { background-color: var(--accent-hot-coral); }
#section1 .section-divider { background-color: var(--accent-peach-skin); }
#section2 .section-divider { background-color: var(--accent-amber-signal); }
#section3 .section-divider { background-color: var(--accent-hot-coral); }
#section4 .section-divider { background-color: var(--accent-peach-skin); }
#section5 .section-divider { background-color: var(--accent-amber-signal); }
#section6 .section-divider { background-color: var(--cool-teal-spray); }

.section.in-view .section-divider {
    width: 100%;
}

/* --- Torn Paper Top Edge --- */
.torn-top {
    clip-path: polygon(
        0% 3%, 7% 0%, 13% 2.5%, 20% 0.5%, 28% 3.2%, 35% 0.8%,
        42% 2.8%, 50% 0.3%, 58% 3.5%, 65% 1%, 72% 2.2%, 80% 0.6%,
        87% 3.8%, 93% 0.4%, 100% 2%,
        100% 100%, 0% 100%
    );
    transition: clip-path 0.5s ease-out;
}

.torn-top.in-view {
    clip-path: polygon(
        0% 5%, 7% 1.5%, 13% 4.5%, 20% 2%, 28% 5.2%, 35% 2.3%,
        42% 4.8%, 50% 1.8%, 58% 5.5%, 65% 2.5%, 72% 4.2%, 80% 2.1%,
        87% 5.8%, 93% 1.9%, 100% 4%,
        100% 100%, 0% 100%
    );
}

/* --- Pattern Layers (Halftone) --- */
.pattern-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    mix-blend-mode: multiply;
}

.section.in-view .pattern-layer {
    opacity: 1;
}

.halftone-large {
    background-image: radial-gradient(circle, rgba(196, 155, 138, 0.25) 5px, transparent 5px);
    background-size: 28px 28px;
}

.halftone-medium {
    background-image: radial-gradient(circle, rgba(232, 85, 61, 0.2) 4px, transparent 4px);
    background-size: 22px 22px;
}

.halftone-small {
    background-image: radial-gradient(circle, rgba(196, 155, 138, 0.18) 3px, transparent 3px);
    background-size: 16px 16px;
}

/* --- Stencil Glyphs --- */
.stencil-glyph {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    transition: transform 0.5s var(--spring-bounce);
}

.stencil-glyph:hover {
    transform: scale(1.08);
}

.stencil-glyph svg {
    width: 100%;
    height: 100%;
}

.stencil-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.2s ease-out;
}

.section.in-view .stencil-path {
    stroke-dashoffset: 0;
}

.stencil-glyph-1 {
    width: 55vh;
    height: 55vh;
    right: 5%;
    top: 20%;
    color: rgba(245, 236, 227, 0.12);
}

.stencil-glyph-2 {
    width: 50vh;
    height: 50vh;
    right: 8%;
    top: 15%;
    color: rgba(242, 160, 101, 0.15);
}

.stencil-glyph-3 {
    width: 60vh;
    height: 60vh;
    left: -5%;
    top: 15%;
    color: rgba(240, 192, 64, 0.12);
}

.stencil-glyph-4 {
    width: 50vh;
    height: 50vh;
    left: 5%;
    top: 20%;
    color: rgba(232, 85, 61, 0.15);
}

.stencil-glyph-5 {
    width: 55vh;
    height: 55vh;
    right: -2%;
    top: 18%;
    color: rgba(242, 160, 101, 0.12);
}

.stencil-glyph-6 {
    width: 50vh;
    height: 50vh;
    left: 2%;
    top: 22%;
    color: rgba(240, 192, 64, 0.15);
}

/* --- Pattern Blocks --- */
.pattern-block {
    position: absolute;
    width: 280px;
    height: 220px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.6s ease 0.7s, transform 0.6s var(--spring-bounce) 0.7s;
}

.section.in-view .pattern-block {
    opacity: 1;
    transform: translateX(0) rotate(var(--block-rotation, 0deg));
}

.pattern-checkerboard {
    background-image:
        linear-gradient(45deg, rgba(240, 192, 64, 0.25) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(240, 192, 64, 0.25) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(240, 192, 64, 0.25) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(240, 192, 64, 0.25) 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.pattern-stripes {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(242, 160, 101, 0.2),
        rgba(242, 160, 101, 0.2) 4px,
        transparent 4px,
        transparent 12px
    );
}

.pattern-dotgrid {
    background-image: radial-gradient(circle, rgba(232, 85, 61, 0.15) 3px, transparent 3px);
    background-size: 24px 24px;
}

.pattern-zigzag {
    background-image:
        repeating-linear-gradient(
            135deg,
            rgba(196, 155, 138, 0.3),
            rgba(196, 155, 138, 0.3) 4px,
            transparent 4px,
            transparent 8px
        ),
        repeating-linear-gradient(
            45deg,
            rgba(196, 155, 138, 0.15),
            rgba(196, 155, 138, 0.15) 4px,
            transparent 4px,
            transparent 8px
        );
}

/* Pattern block positions */
#section0 .pattern-block { right: 10%; bottom: 15%; --block-rotation: 3deg; }
#section1 .pattern-block { right: 5%; top: 20%; --block-rotation: -2deg; }
#section2 .pattern-block { left: 8%; bottom: 18%; --block-rotation: 4deg; }
#section3 .pattern-block { left: 5%; top: 15%; --block-rotation: -3deg; }
#section4 .pattern-block { right: 12%; bottom: 20%; --block-rotation: 2deg; }
#section5 .pattern-block { right: 8%; top: 25%; --block-rotation: 5deg; }

.rotate-3 { transform: rotate(3deg); }
.rotate-neg2 { transform: rotate(-2deg); }
.rotate-4 { transform: rotate(4deg); }
.rotate-neg3 { transform: rotate(-3deg); }
.rotate-2 { transform: rotate(2deg); }
.rotate-5 { transform: rotate(5deg); }

/* --- Tape Strips --- */
.tape-strip {
    position: absolute;
    width: 120px;
    height: 16px;
    border-radius: 3px;
    background-color: rgba(245, 236, 227, 0.4);
    z-index: 5;
    pointer-events: none;
}

.tape-top-right {
    top: 12%;
    right: 8%;
    transform: rotate(-5deg);
}

.tape-bottom-left {
    bottom: 15%;
    left: 10%;
    transform: rotate(3deg);
}

.tape-top-left {
    top: 18%;
    left: 6%;
    transform: rotate(-2deg);
}

.tape-bottom-right {
    bottom: 12%;
    right: 6%;
    transform: rotate(4deg);
}

/* --- Spray Spatter --- */
.spray-spatter {
    position: absolute;
    pointer-events: none;
    z-index: 4;
}

.spray-spatter::before,
.spray-spatter::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.spatter-1 {
    top: 20%;
    left: 15%;
}
.spatter-1::before {
    width: 5px;
    height: 5px;
    background: var(--accent-hot-coral);
    top: 0;
    left: 0;
}
.spatter-1::after {
    width: 3px;
    height: 3px;
    background: var(--accent-hot-coral);
    top: 8px;
    left: 12px;
}

.spatter-2 {
    top: 25%;
    left: 18%;
}
.spatter-2::before {
    width: 4px;
    height: 4px;
    background: var(--accent-peach-skin);
    top: 0;
    left: 0;
}
.spatter-2::after {
    width: 2px;
    height: 2px;
    background: var(--accent-peach-skin);
    top: -5px;
    left: 8px;
}

.spatter-3 {
    top: 30%;
    right: 20%;
}
.spatter-3::before {
    width: 5px;
    height: 5px;
    background: var(--accent-peach-skin);
}
.spatter-3::after {
    width: 3px;
    height: 3px;
    background: var(--accent-amber-signal);
    top: 10px;
    left: -6px;
}

.spatter-4 {
    bottom: 30%;
    right: 25%;
}
.spatter-4::before {
    width: 4px;
    height: 4px;
    background: var(--accent-amber-signal);
}
.spatter-4::after {
    width: 3px;
    height: 3px;
    background: var(--accent-amber-signal);
    top: 7px;
    left: 9px;
}

.spatter-5 {
    top: 18%;
    right: 30%;
}
.spatter-5::before {
    width: 5px;
    height: 5px;
    background: var(--accent-hot-coral);
}
.spatter-5::after {
    width: 2px;
    height: 2px;
    background: var(--accent-hot-coral);
    top: -4px;
    left: 7px;
}

.spatter-6 {
    top: 25%;
    left: 12%;
}
.spatter-6::before {
    width: 4px;
    height: 4px;
    background: var(--accent-hot-coral);
}
.spatter-6::after {
    width: 3px;
    height: 3px;
    background: var(--accent-peach-skin);
    top: 6px;
    left: -5px;
}

.spatter-7 {
    bottom: 25%;
    left: 20%;
}
.spatter-7::before {
    width: 5px;
    height: 5px;
    background: var(--accent-peach-skin);
}
.spatter-7::after {
    width: 3px;
    height: 3px;
    background: var(--accent-amber-signal);
    top: 8px;
    left: 10px;
}

.spatter-8 {
    top: 15%;
    right: 15%;
}
.spatter-8::before {
    width: 4px;
    height: 4px;
    background: var(--accent-amber-signal);
}
.spatter-8::after {
    width: 2px;
    height: 2px;
    background: var(--accent-amber-signal);
    top: -3px;
    left: 6px;
}

.spatter-9 {
    bottom: 20%;
    left: 25%;
}
.spatter-9::before {
    width: 5px;
    height: 5px;
    background: var(--accent-hot-coral);
}
.spatter-9::after {
    width: 3px;
    height: 3px;
    background: var(--accent-peach-skin);
    top: 9px;
    left: -4px;
}

/* --- Section Content --- */
.section-content {
    position: relative;
    z-index: 10;
    padding: 60px 8vw;
    max-width: 900px;
}

.section-broadside .section-content {
    text-align: center;
    max-width: 100%;
    padding: 60px 10vw;
}

.section-collage .section-content {
    max-width: 45%;
}

.collage-left .section-content,
.section-collage .collage-left {
    margin-right: auto;
    margin-left: 8vw;
}

.collage-right .section-content,
.section-collage .collage-right {
    margin-left: auto;
    margin-right: 8vw;
}

/* Overrides for collage sections that have the class on the content div */
.section-collage .section-content.collage-left {
    margin-right: auto;
    margin-left: 8vw;
    text-align: left;
}

.section-collage .section-content.collage-right {
    margin-left: auto;
    margin-right: 8vw;
    text-align: left;
}

/* --- Section Number --- */
.section-number {
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.4s ease 0.8s;
}

.section.in-view .section-number {
    opacity: 1;
}

#section0 .section-number { color: var(--accent-amber-signal); }
#section1 .section-number { color: var(--accent-amber-signal); }
#section2 .section-number { color: var(--accent-amber-signal); }
#section3 .section-number { color: var(--accent-amber-signal); }
#section4 .section-number { color: var(--accent-amber-signal); }
#section5 .section-number { color: var(--accent-amber-signal); }

/* --- Typography --- */
.heading-hero {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 0.92;
    color: var(--fg-cream-chalk);
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-40px) rotate(-2deg);
    transition: opacity 0.5s ease-out 0.6s, transform 0.5s ease-out 0.6s;
}

.section.in-view .heading-hero {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

.heading-broadside {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 0.9;
    color: var(--fg-cream-chalk);
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-40px) rotate(-2deg);
    transition: opacity 0.5s ease-out 0.6s, transform 0.5s ease-out 0.6s;
}

.section.in-view .heading-broadside {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

.heading-section {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 1.0;
    color: var(--fg-cream-chalk);
    margin-bottom: 24px;
    opacity: 0;
    transform: translateX(-40px) rotate(-2deg);
    transition: opacity 0.5s ease-out 0.6s, transform 0.5s ease-out 0.6s;
}

.section.in-view .heading-section {
    opacity: 1;
    transform: translateX(0) rotate(0);
}

.body-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: rgba(245, 236, 227, 0.85);
    max-width: 520px;
    opacity: 0;
    transition: opacity 0.4s ease 0.8s;
}

.section.in-view .body-text {
    opacity: 1;
}

.section-broadside .body-text {
    margin: 0 auto;
    text-align: center;
}

/* --- Final Section --- */
.section-final {
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(58, 176, 162, 0.3) 0%,
        var(--bg-worn-cardboard) 70%
    );
    z-index: 1;
}

.final-content {
    text-align: center;
    z-index: 10;
    max-width: 100%;
}

.heading-final {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.04em;
    color: var(--fg-cream-chalk);
    animation: breathe 3s ease-in-out infinite;
}

.final-domain {
    display: block;
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cool-teal-spray);
    margin-top: 24px;
    opacity: 0.7;
}

@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Mobile Tap Pulse --- */
@media (hover: none) {
    .dot:active,
    .stencil-glyph:active,
    .pattern-block:active {
        animation: tapPulse 0.4s ease;
    }
}

@keyframes tapPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-collage .section-content {
        max-width: 85%;
        margin-left: auto;
        margin-right: auto;
    }

    .section-collage .section-content.collage-left,
    .section-collage .section-content.collage-right {
        margin-left: auto;
        margin-right: auto;
    }

    .fixed-logo {
        top: 16px;
        left: 16px;
    }

    .dot-nav {
        right: 12px;
    }

    .pattern-block {
        width: 180px;
        height: 140px;
    }

    .stencil-glyph {
        opacity: 0.6;
    }

    .heading-hero {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .heading-broadside {
        font-size: clamp(2.5rem, 12vw, 6rem);
    }

    .tape-strip {
        width: 80px;
        height: 12px;
    }
}
