/* 
  💌 FONT CREDITS 💌
  BianZhiDai by Xiaoyuan Gao, notyourtypefoundry. 
  Steps Mono by Jean-Baptiste Morizot & Raphaël Bastide. 
  Terminal Grotesque by Raphaël Bastide & Jérémy Landes.
  All fonts distributed by velvetyne.fr.

  🎣 Color palette inspired by 
  algae, coral pink, and net-blue CRT glitch.
*/

/* 💌 FONT IMPORTS */
@font-face {
    font-family: 'BianZhiDai';
    src: url('../fonts/bianzhidai_COLR-grid.woff') format('woff');
}


@font-face {
    font-family: 'Steps Mono';
    src: url('../fonts/Steps-Mono-Mono.woff') format('woff');
}

@font-face {
    font-family: 'Terminal Grotesque';
    src: url('../fonts/Terminal-Grotesque.woff') format('woff');
}

/* 🎨 ROOT VARIABLES */
:root {
    --fishnet-blue: #A9D6E5;
    --coral-pink: #F7A1A1;
    --algae-green: #B2D7A6;
    --soft-seafoam: #F1F9F8;
    --deep-ink: #2E2E2E;

    --font-heading: "BianZhiDai", sans-serif;
    --font-body: "Steps Mono", monospace;
    --font-meta: "Terminal Grotesque", monospace;
}

/* 🌊 GLOBAL STYLES */


body {
    position: relative;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--soft-seafoam);
    color: var(--deep-ink);
    line-height: 1.6;
    overflow-x: auto;
    overflow-y: auto;
}

body::before {
    content: "";
    position: fixed;
    /* 🔥 key change */
    inset: 0;

    background:
        linear-gradient(rgba(247, 161, 161, 0.12), rgba(247, 161, 161, 0.12)),
        url("../images/fishing-net.png") center/cover no-repeat;

    opacity: 0.9;
    z-index: -2;
    pointer-events: none;
}





/* 📍 INFO MODAL */
#about-modal {
    position: fixed;
    inset: 0;
    margin: auto;

    width: min(90vw, 640px);
    max-height: 85vh;

    padding: 2.2rem 1.8rem;

    background: #ffffff;
    color: #111;

    border-radius: 1.25rem;
    border: none;

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);

    overflow-y: auto;
    overscroll-behavior: contain;

    text-align: center;
    z-index: 10;

    -webkit-overflow-scrolling: touch;
}

#about-modal[open]~.water-overlay {
    opacity: 0.35;
}

#about-modal::backdrop {
    background: rgba(0, 0, 0, 0.25);
}

.project-title {
    font-family: var(--font-heading);
    font-size: clamp(3.5rem, 9vw, 5rem);
    margin: 0 0 0.75rem;
    opacity: 0.8;
    letter-spacing: 0.03em;
}

.inspiration {
    font-family: var(--font-meta);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 1.1rem;
    opacity: 0.7;
}

.callout {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 6vw, 2.6rem);
    letter-spacing: 0.06em;
    margin: 0.25rem 0 0.25rem;
}

.phone {
    font-family: var(--font-body);
    font-size: clamp(2rem, 7vw, 2.6rem);
    letter-spacing: 0.1em;
    margin: 0.25rem 0 1.2rem;
}

.instruction {
    font-family: var(--font-meta);
    font-size: clamp(0.95rem, 3.5vw, 1.15rem);
    line-height: 1.5;
    max-width: 460px;
    margin: 0 auto 1.1rem;
}

.submissions-note {
    font-family: var(--font-meta);
    font-size: 0.85rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto 1rem;
    opacity: 0.8;
}

.anonymous {
    font-size: 0.8rem;
    margin-bottom: 1.4rem;
    opacity: 0.6;
}

.thesis {
    font-family: var(--font-body);
    font-size: clamp(1rem, 4vw, 1.4rem);
    line-height: 1.4;
    margin: 1.6rem 0 1.2rem;
}

.consent {
    font-size: 0.8rem;
    margin-bottom: 2.5rem;
    letter-spacing: 0.08em;
}

.consent a {
    text-decoration: underline;
}

.credits {
    font-size: 0.75rem;
    line-height: 1.5;
    opacity: 0.55;
    max-width: 520px;
    margin: 0 auto;
}


#close-modal {
    position: sticky;
    top: 0;
    margin-left: auto;

    background: none;
    border: none;
    font-family: var(--font-meta);
    font-size: 3rem;
    cursor: pointer;
    opacity: 0.6;
}

#close-modal:hover {
    opacity: 1;
}

/* ℹ️ INFO BUTTON */
#info-btn {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px dashed var(--deep-ink);
    background: radial-gradient(circle at top left, var(--coral-pink), #f8a5b7);
    color: var(--deep-ink);
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 0 6px rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    z-index: 9999;
}

#info-btn:hover {
    background: radial-gradient(circle at bottom right, var(--algae-green), #b3e4c0);
    transform: scale(1.12) rotate(-2deg);
    color: white;
}

/* 🔊 AUDIO SYSTEM */
.audio-net {
    position: relative;
    width: 2000px;
    min-height: 2000px;
}

.net-knot {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    gap: 0.3rem;
    z-index: 5;
}

.knot-button {
    all: unset;
    cursor: pointer;
    font-size: 2rem;
    font-family: var(--font-body);
    color: var(--deep-ink);
    text-shadow:
        1px 0 var(--coral-pink),
        -1px 0 var(--algae-green),
        0 1px var(--coral-pink),
        0 -1px var(--algae-green);
    transition: transform 0.2s ease;
}

.knot-button:hover {
    transform: scale(1.2) rotate(1deg);
}

.audio-label {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--deep-ink);
    opacity: 0.9;
    display: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    position: absolute;
    top: -24px;
    /* consistent offset above knot */
    left: 50%;
    transform: translateX(-50%);
}

.net-knot.active .audio-label {
    display: block;
}

.net-knot.active .knot-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;

    width: 60px;
    height: 60px;

    border-radius: 50%;

    background:
        repeating-linear-gradient(45deg,
            rgba(178, 215, 166, 0.8) 0px,
            rgba(178, 215, 166, 0.8) 2px,
            transparent 2px,
            transparent 8px);

    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
    z-index: -1;

    animation: woven-ripple 2.5s ease-out infinite;
}

@keyframes woven-ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 0;
    }
}

.explore-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);

    font-family: var(--font-body);
    font-size: clamp(2.5rem, 10vw, 4rem);
    letter-spacing: 0.2em;

    opacity: 0;
    pointer-events: none;
    z-index: 50;

    animation: hint-intro 4.5s ease forwards;
}

@keyframes hint-intro {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }

    20% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* 📱 MOBILE */
@media (max-width: 480px) {

    body::before {
        background-size: 140% auto;
    }

    #about-modal {
        width: 94vw;
        max-height: 92vh;
        padding: 1.6rem 1.3rem;
        border-radius: 1rem;
        text-align: center;
        background: #f9f9f9;
    }

    .project-title {
        font-size: clamp(2.4rem, 8vw, 3rem);
        margin-bottom: 0.5rem;
        opacity: 1;
        /* remove faded look */
    }

    .inspiration {
        font-size: 0.85rem;
        line-height: 1.55;
        margin-bottom: 1rem;
        opacity: 0.85;
    }

    .callout {
        font-size: 1.2rem;
        margin: 0.5rem 0 0.2rem;
        opacity: 0.5;
        /* subtle whisper */
    }

    .phone {
        font-size: 1.9rem;
        letter-spacing: 0.06em;
        margin-bottom: 1rem;
        font-weight: 500;
    }

    .phone a {
        color: var(--deep-ink);
        text-decoration: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.3);
    }

    .instruction {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }

    .submissions-note {
        font-size: 0.8rem;
        line-height: 1.55;
        margin-bottom: 0.8rem;
        opacity: 0.75;
    }

    .anonymous {
        font-size: 0.75rem;
        margin-bottom: 1.2rem;
        opacity: 0.65;
    }

    .thesis {
        font-size: 1.05rem;
        line-height: 1.5;
        margin: 1.4rem 0 1.2rem;
        font-weight: 500;
    }

    .consent {
        font-size: 0.75rem;
        letter-spacing: 0.06em;
        margin-bottom: 1.6rem;
    }

    .credits {
        font-size: 0.68rem;
        line-height: 1.5;
        opacity: 0.55;
    }

    #info-btn {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }


    .water-overlay {
        background-size: 200% 200%, 500px 500px, 500px 500px;
        animation-duration: 4.5s;
        opacity: 1;
    }

    body.audio-playing .water-overlay {
        animation-duration: 10s;
    }

    body::before {
        content: "";
        top: 0;
        left: 0;
        width: 100%;
        background:
            linear-gradient(rgba(247, 161, 161, 0.12), rgba(247, 161, 161, 0.12)),
            url("../images/fishing-net.png") center/cover no-repeat;

        opacity: 0.9;
        z-index: -2;
        pointer-events: none;
    }
}

/* GENERAL VIEWPORT WRAPPER */

.viewport {
    position: relative;
}




@media (max-width: 480px) {
    .viewport {
        padding: 2vw;
    }

}



/* WATTTTTERRRR */
.water-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(115deg,
            rgba(255, 255, 255, 0.75) 0%,
            rgba(255, 255, 255, 0.15) 30%,
            rgba(255, 255, 255, 0.05) 45%,
            rgba(255, 255, 255, 0.75) 65%),
        repeating-linear-gradient(45deg,
            rgba(169, 214, 229, 0.55) 0px,
            rgba(169, 214, 229, 0.55) 2px,
            transparent 2px,
            transparent 22px),
        repeating-linear-gradient(-45deg,
            rgba(169, 214, 229, 0.45) 0px,
            rgba(169, 214, 229, 0.45) 2px,
            transparent 2px,
            transparent 22px);

    background-size: 150% 150%, 600px 600px, 600px 600px;

    pointer-events: none;
    z-index: 2;

    animation: none;
    transition: opacity 0.6s ease;
    opacity: 0.5;
}

body.audio-playing .water-overlay {
    opacity: 1;
    animation: weave-drift 6s linear infinite;
}

@keyframes weave-drift {
    0% {
        background-position:
            -200% 0,
            0 0,
            0 0;
    }

    100% {
        background-position:
            200% 0,
            400px 350px,
            -400px 350px;
    }
}