/* ==============================================
   bada.day — Street Photography Zine
   ============================================== */

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

:root {
    /* Palette */
    --darkroom-black: #121210;
    --asphalt-gray: #2A2825;
    --aged-paper: #F5F0E8;
    --signal-amber: #F2A900;
    --marker-red: #E84545;
    --neon-teal: #2DE2B8;
    --warm-shadow: #1A1815;
    --flash-white: #FFFDF7;
    --warm-charcoal: #3A3632;
    --weathered-paper: #D4CFC7;
    --near-black: #1A1A1A;

    /* Fonts */
    --font-display: 'Bebas Neue', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --font-body: 'DM Sans', sans-serif;
    --font-accent: 'Permanent Marker', cursive;
}

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

body {
    background: var(--darkroom-black);
    color: var(--aged-paper);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
}

/* --- Film Grain Overlay --- */
#film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    filter: url(#grain-filter);
    mix-blend-mode: overlay;
    background: var(--aged-paper);
    transition: opacity 0.6s ease;
}

#film-grain.visible {
    opacity: 0.06;
}

/* --- Dust Motes --- */
#dust-motes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.dust-mote {
    position: absolute;
    border-radius: 50%;
    background: var(--aged-paper);
    opacity: 0;
    animation: dustDrift linear infinite;
}

@keyframes dustDrift {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }
    10% {
        opacity: var(--mote-opacity, 0.35);
    }
    90% {
        opacity: var(--mote-opacity, 0.35);
    }
    100% {
        transform: translate(calc(var(--drift-x, 80px)), calc(var(--drift-y, -100vh)));
        opacity: 0;
    }
}

/* --- Sprocket Hole Navigation Spine --- */
#sprocket-spine {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3vw;
    min-width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    z-index: 900;
    padding: 20px 0;
    opacity: 0;
    transition: opacity 0.6s ease 1.0s, filter 0.15s ease;
}

#sprocket-spine.visible {
    opacity: 1;
}

.sprocket-hole {
    width: 8px;
    height: 14px;
    border-radius: 2px;
    border: 2px solid var(--warm-charcoal);
    background: transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, filter 0.15s ease;
}

.sprocket-hole.active {
    border-color: var(--signal-amber);
    box-shadow: 0 0 8px rgba(242, 169, 0, 0.5);
}

/* --- Day Counter --- */
#day-counter {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--signal-amber);
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.6s ease 1.2s;
}

#day-counter.visible {
    opacity: 1;
}

.day-label {
    opacity: 0.6;
}

.day-number {
    font-weight: 700;
}

/* --- Rewind Button --- */
#rewind-btn {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.3s ease;
    text-decoration: none;
}

#rewind-btn.visible {
    opacity: 0.6;
}

#rewind-btn:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.15);
}

/* --- Zine Page Base --- */
.zine-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.zine-page--dark {
    background: var(--darkroom-black);
}

.zine-page--light {
    background: var(--aged-paper);
}

.section-content {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 4rem 6%;
}

/* --- Bokeh Layer --- */
.bokeh-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bokeh {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    will-change: transform;
}

/* Dark page bokeh */
.bokeh--amber {
    background: var(--signal-amber);
    opacity: 0.15;
}
.bokeh--teal {
    background: var(--neon-teal);
    opacity: 0.10;
}
.bokeh--white {
    background: var(--flash-white);
    opacity: 0.08;
}

/* Light page bokeh */
.bokeh--teal-light {
    background: var(--neon-teal);
    opacity: 0.12;
}
.bokeh--amber-light {
    background: var(--signal-amber);
    opacity: 0.10;
}

/* Individual bokeh positions and sizes */
.bokeh--1 { width: 300px; height: 300px; top: 10%; right: 10%; animation: bokehDrift1 25s ease-in-out infinite; }
.bokeh--2 { width: 200px; height: 200px; bottom: 20%; left: 8%; animation: bokehDrift2 30s ease-in-out infinite; }
.bokeh--3 { width: 150px; height: 150px; top: 40%; left: 50%; animation: bokehDrift3 22s ease-in-out infinite; }
.bokeh--4 { width: 250px; height: 250px; top: 5%; left: 60%; animation: bokehDrift1 28s ease-in-out infinite; }
.bokeh--5 { width: 180px; height: 180px; bottom: 15%; right: 20%; animation: bokehDrift2 24s ease-in-out infinite; }
.bokeh--6 { width: 120px; height: 120px; top: 55%; left: 15%; animation: bokehDrift3 20s ease-in-out infinite; }
.bokeh--7 { width: 350px; height: 350px; bottom: 5%; left: 40%; animation: bokehDrift1 32s ease-in-out infinite; }
.bokeh--8 { width: 220px; height: 220px; top: 15%; right: 15%; animation: bokehDrift2 26s ease-in-out infinite; }
.bokeh--9 { width: 160px; height: 160px; bottom: 30%; left: 25%; animation: bokehDrift1 22s ease-in-out infinite; }
.bokeh--10 { width: 280px; height: 280px; top: 50%; right: 30%; animation: bokehDrift3 28s ease-in-out infinite; }
.bokeh--11 { width: 400px; height: 400px; top: 0%; left: 20%; animation: bokehDrift2 30s ease-in-out infinite; }
.bokeh--12 { width: 150px; height: 150px; bottom: 25%; right: 10%; animation: bokehDrift1 20s ease-in-out infinite; }
.bokeh--13 { width: 200px; height: 200px; top: 60%; left: 5%; animation: bokehDrift3 25s ease-in-out infinite; }
.bokeh--14 { width: 100px; height: 100px; top: 20%; right: 40%; animation: bokehDrift2 18s ease-in-out infinite; }
.bokeh--15 { width: 300px; height: 300px; bottom: 10%; left: 55%; animation: bokehDrift1 27s ease-in-out infinite; }
.bokeh--16 { width: 240px; height: 240px; top: 10%; left: 10%; animation: bokehDrift3 24s ease-in-out infinite; }
.bokeh--17 { width: 180px; height: 180px; bottom: 20%; right: 25%; animation: bokehDrift2 22s ease-in-out infinite; }
.bokeh--18 { width: 320px; height: 320px; top: 45%; right: 5%; animation: bokehDrift1 29s ease-in-out infinite; }
.bokeh--19 { width: 280px; height: 280px; top: 8%; right: 15%; animation: bokehDrift2 26s ease-in-out infinite; }
.bokeh--20 { width: 200px; height: 200px; bottom: 25%; left: 20%; animation: bokehDrift3 23s ease-in-out infinite; }
.bokeh--21 { width: 140px; height: 140px; top: 50%; left: 60%; animation: bokehDrift1 20s ease-in-out infinite; }
.bokeh--22 { width: 350px; height: 350px; bottom: 5%; right: 30%; animation: bokehDrift2 31s ease-in-out infinite; }
.bokeh--23 { width: 250px; height: 250px; top: 20%; left: 30%; animation: bokehDrift1 25s ease-in-out infinite; }
.bokeh--24 { width: 180px; height: 180px; bottom: 30%; right: 20%; animation: bokehDrift3 22s ease-in-out infinite; }
.bokeh--25 { width: 130px; height: 130px; top: 60%; left: 10%; animation: bokehDrift2 19s ease-in-out infinite; }

@keyframes bokehDrift1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-15px, 25px); }
    75% { transform: translate(20px, 10px); }
}

@keyframes bokehDrift2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-25px, 15px); }
    50% { transform: translate(20px, -30px); }
    75% { transform: translate(-10px, -15px); }
}

@keyframes bokehDrift3 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(15px, 25px); }
    50% { transform: translate(-30px, -10px); }
    75% { transform: translate(25px, -20px); }
}

/* --- Headlines --- */
.headline {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.92;
    color: var(--aged-paper);
}

.headline--hero {
    font-size: clamp(4rem, 12vw, 10rem);
    color: var(--aged-paper);
    transform: rotate(-2deg);
    opacity: 0;
    transition: none;
}

.headline--hero.animate-in {
    animation: heroSlam 0.8s cubic-bezier(0.25, 1.5, 0.5, 1) forwards;
}

@keyframes heroSlam {
    0% { opacity: 0; transform: rotate(-2deg) translateY(80px); }
    70% { opacity: 1; transform: rotate(-2deg) translateY(-8px); }
    85% { transform: rotate(-2deg) translateY(3px); }
    100% { opacity: 1; transform: rotate(-2deg) translateY(0); }
}

.headline--section {
    font-size: clamp(3rem, 8vw, 7rem);
    margin-bottom: 2rem;
}

.headline--massive {
    font-size: clamp(4rem, 14vw, 12rem);
    color: var(--aged-paper);
}

.headline--dark {
    color: var(--near-black); /* #1A1A1A - near-black on light sections */
}

.headline--final {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.92;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--aged-paper);
    text-align: center;
}

/* --- Datestamp --- */
.datestamp {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--signal-amber);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.datestamp.visible {
    opacity: 1;
}

.datestamp--dark {
    color: var(--warm-charcoal);
}

.datestamp--final {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--signal-amber);
    text-align: center;
    margin-top: 1.5rem;
}

/* --- Body Text --- */
.body-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--weathered-paper);
    max-width: 38ch;
    margin-top: 1.5rem;
}

.body-text--dark {
    color: var(--warm-charcoal);
}

/* --- Accent Text (Permanent Marker) --- */
.accent-text {
    display: inline-block;
    font-family: var(--font-accent);
    font-size: 0.95rem;
    color: var(--marker-red);
    transform: rotate(-2deg);
    margin-top: 2rem;
    position: relative;
    cursor: default;
}

.accent-text--light {
    display: inline-block;
}

.accent-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--marker-red);
    transition: width 0.4s ease;
}

.accent-text:hover::after {
    width: 100%;
}

/* --- Opening Section --- */
.opening-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-left: 15%;
}

/* --- Contact Sheet Section --- */
.contact-content {
    padding-top: 6rem;
}

.contact-sheet {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 600px;
    margin-top: 2rem;
    margin-left: 15%;
}

.contact-sheet--light .contact-frame--light {
    border-color: var(--warm-charcoal);
}

.contact-frame {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--warm-charcoal);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.contact-frame:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(242, 169, 0, 0.12);
    z-index: 20;
}

.contact-frame:hover .frame-number {
    color: var(--signal-amber);
}

.frame-inner {
    width: 100%;
    height: 100%;
}

/* Frame fill abstract bokeh shapes */
.frame-fill--amber {
    background: radial-gradient(circle at 30% 40%, rgba(242, 169, 0, 0.3) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(242, 169, 0, 0.15) 0%, transparent 50%);
    background-color: var(--darkroom-black);
}
.frame-fill--teal {
    background: radial-gradient(circle at 60% 30%, rgba(45, 226, 184, 0.25) 0%, transparent 55%),
                radial-gradient(circle at 25% 70%, rgba(45, 226, 184, 0.12) 0%, transparent 45%);
    background-color: var(--darkroom-black);
}
.frame-fill--cream {
    background: radial-gradient(circle at 50% 50%, rgba(255, 253, 247, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(245, 240, 232, 0.12) 0%, transparent 40%);
    background-color: var(--darkroom-black);
}
.frame-fill--amber-dim {
    background: radial-gradient(circle at 40% 60%, rgba(242, 169, 0, 0.18) 0%, transparent 55%);
    background-color: var(--darkroom-black);
}
.frame-fill--teal-dim {
    background: radial-gradient(circle at 55% 35%, rgba(45, 226, 184, 0.15) 0%, transparent 50%);
    background-color: var(--darkroom-black);
}
.frame-fill--warm {
    background: radial-gradient(circle at 45% 45%, rgba(242, 169, 0, 0.12) 0%, transparent 40%),
                radial-gradient(circle at 65% 70%, rgba(255, 253, 247, 0.1) 0%, transparent 45%);
    background-color: var(--darkroom-black);
}

/* Light page contact frame fills */
.frame-fill--dark-amber {
    background: radial-gradient(circle at 30% 40%, rgba(242, 169, 0, 0.35) 0%, transparent 60%),
                radial-gradient(circle at 70% 60%, rgba(242, 169, 0, 0.2) 0%, transparent 50%);
    background-color: var(--weathered-paper);
}
.frame-fill--dark-teal {
    background: radial-gradient(circle at 60% 30%, rgba(45, 226, 184, 0.3) 0%, transparent 55%),
                radial-gradient(circle at 25% 70%, rgba(45, 226, 184, 0.15) 0%, transparent 45%);
    background-color: var(--weathered-paper);
}
.frame-fill--dark-warm {
    background: radial-gradient(circle at 50% 50%, rgba(26, 24, 21, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(58, 54, 50, 0.15) 0%, transparent 40%);
    background-color: var(--weathered-paper);
}

.frame-number {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--warm-charcoal);
    transition: color 0.3s ease;
}

.frame-number--dark {
    color: var(--warm-charcoal);
}

/* --- Torn Spread Layout --- */
.torn-content {
    display: flex;
    min-height: 100vh;
    align-items: center;
    gap: 0;
    padding: 4rem 0;
}

.torn-left {
    flex: 0 0 60%;
    padding: 4rem 6%;
}

.tear-line {
    flex: 0 0 4px;
    min-height: 60vh;
    position: relative;
    background: transparent;
}

.tear-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--signal-amber);
    opacity: 0.3;
    clip-path: polygon(
        0% 0%, 100% 2%, 60% 5%, 100% 8%, 30% 12%,
        100% 15%, 50% 18%, 100% 22%, 20% 25%, 80% 28%,
        100% 32%, 40% 35%, 100% 38%, 60% 42%, 100% 45%,
        30% 48%, 100% 52%, 70% 55%, 100% 58%, 20% 62%,
        100% 65%, 50% 68%, 100% 72%, 40% 75%, 100% 78%,
        60% 82%, 100% 85%, 30% 88%, 100% 92%, 70% 95%,
        100% 98%, 0% 100%
    );
}

.torn-right {
    flex: 0 0 32%;
    padding: 4rem 4%;
    display: flex;
    flex-direction: column;
}

.torn-right-bokeh {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 226, 184, 0.15) 0%, transparent 70%);
    margin-top: 2rem;
    filter: blur(20px);
}

/* --- Torn Edge Dividers --- */
.torn-edge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 15;
}

.torn-edge--bottom {
    background: transparent;
}

.torn-edge--bottom::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--signal-amber);
    opacity: 0.2;
    clip-path: polygon(
        0% 0%, 3% 80%, 6% 20%, 9% 60%, 12% 10%, 15% 70%,
        18% 30%, 21% 90%, 24% 40%, 27% 80%, 30% 15%, 33% 65%,
        36% 25%, 39% 85%, 42% 35%, 45% 75%, 48% 10%, 51% 60%,
        54% 20%, 57% 80%, 60% 30%, 63% 70%, 66% 15%, 69% 65%,
        72% 25%, 75% 85%, 78% 35%, 81% 75%, 84% 10%, 87% 60%,
        90% 20%, 93% 80%, 96% 30%, 100% 50%, 100% 100%, 0% 100%
    );
    transition: opacity 0.2s ease;
}

.torn-edge--cream::before {
    background: var(--aged-paper);
    opacity: 0.3;
}

.torn-edge--dark::before {
    background: var(--darkroom-black);
    opacity: 0.4;
}

.torn-edge.flash::before {
    opacity: 0.6;
}

/* --- Full Bleed Section --- */
.fullbleed-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding-left: 10%;
}

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

.final-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

#final-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darkroom-black);
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity 3s ease;
}

#final-fade.active {
    opacity: 0.85;
}

/* --- Spring-in Animation Base --- */
.spring-in {
    opacity: 0;
    transform: translateY(30px);
    transition: none;
}

.spring-in.visible {
    animation: springInSoft 0.7s cubic-bezier(0.25, 1.4, 0.5, 1) forwards;
}

.headline.spring-in.visible {
    animation: springInSnappy 0.5s cubic-bezier(0.25, 1.6, 0.5, 1) forwards;
}

@keyframes springInSnappy {
    0% { opacity: 0; transform: translateY(30px); }
    60% { opacity: 1; transform: translateY(-5px); }
    80% { transform: translateY(2px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes springInSoft {
    0% { opacity: 0; transform: translateY(25px); }
    70% { opacity: 1; transform: translateY(-4px); }
    85% { transform: translateY(1px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Preserve inline rotation transforms on spring-in */
.headline.spring-in.visible[style*="rotate"] {
    animation: springInSnappyRot 0.5s cubic-bezier(0.25, 1.6, 0.5, 1) forwards;
}

@keyframes springInSnappyRot {
    0% { opacity: 0; }
    60% { opacity: 1; }
    100% { opacity: 1; }
}

/* --- Halation Glow --- */
.halation {
    box-shadow: 0 0 30px rgba(242, 169, 0, 0.12);
}

/* --- Contact Sheet Grid Sprocket Marks (left side) --- */
.zine-page--contact::before {
    content: '';
    position: absolute;
    left: 4%;
    top: 10%;
    height: 80%;
    width: 10px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 16px,
        var(--warm-charcoal) 16px,
        var(--warm-charcoal) 30px,
        transparent 30px,
        transparent 38px
    );
    opacity: 0.3;
    border-radius: 1px;
    z-index: 5;
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: var(--darkroom-black);
}
::-webkit-scrollbar-thumb {
    background: var(--warm-charcoal);
    border-radius: 2px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .torn-content {
        flex-direction: column;
    }
    .torn-left {
        flex: none;
        width: 100%;
        padding: 2rem 6%;
    }
    .tear-line {
        width: 80%;
        min-height: 4px;
        height: 4px;
        flex: none;
        margin: 1rem auto;
    }
    .tear-line::before {
        width: 100%;
        height: 4px;
        clip-path: polygon(
            0% 50%, 2% 0%, 5% 80%, 8% 20%, 12% 60%, 15% 10%,
            18% 70%, 22% 30%, 25% 90%, 28% 40%, 32% 80%, 35% 15%,
            38% 65%, 42% 25%, 45% 85%, 48% 35%, 52% 75%, 55% 10%,
            58% 60%, 62% 20%, 65% 80%, 68% 30%, 72% 70%, 75% 15%,
            78% 65%, 82% 25%, 85% 85%, 88% 35%, 92% 75%, 95% 10%,
            98% 60%, 100% 50%, 100% 100%, 0% 100%
        );
    }
    .torn-right {
        flex: none;
        width: 100%;
        padding: 2rem 6%;
    }
    .contact-sheet {
        margin-left: 5%;
        max-width: 90%;
    }
    .opening-content {
        padding-left: 8%;
    }
    .headline--massive {
        font-size: clamp(3rem, 10vw, 6rem);
    }
    #sprocket-spine {
        display: none;
    }
}
