/* =========================
   COLOR PALETTE
========================= */

:root {
    --turquoise: #5f9995;
    --turquoise-light: #dcebea;

    --white: #ffffff;
    --black: #111111;

    --cream: #f3f1e8;
    --cream-dark: #e7e4d9;

    --border: #c9ccc5;
}


/* =========================
   GENERAL
========================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;

    overflow: hidden;

    font-family: Helvetica, Arial, sans-serif;

    background: var(--cream);
    color: var(--black);
}

#gallery {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;
}


/* =========================
   THREE.JS CSS3D RENDERER
========================= */

#css3d-renderer {
    position: fixed !important;

    top: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 100% !important;

    pointer-events: none;

    z-index: 2;
}


/* =========================
   HOME BUTTON
========================= */

.home-button {
    position: fixed;

    top: 30px;
    left: 35px;

    z-index: 50;

    color: var(--black);
    background: var(--cream);

    padding: 12px 18px;

    text-decoration: none;

    font-size: 16px;
    font-weight: bold;

    border: 1px solid var(--black);

    transition: 0.2s ease;
}

.home-button:hover {
    background: var(--turquoise);
    color: var(--white);
}


/* =========================
   GALLERY TITLE
========================= */

.gallery-title {
    position: fixed;

    top: 30px;
    left: 50%;

    transform: translateX(-50%);

    z-index: 20;

    pointer-events: none;
}

.gallery-title p {
    margin: 0;

    color: var(--black);

    background: rgba(243, 241, 232, 0.9);

    padding: 12px 20px;

    font-size: 13px;
    font-weight: bold;

    letter-spacing: 3px;
}


/* =========================
   ARTWORK INFORMATION
========================= */

.artwork-info {
    position: fixed;

    top: 30px;
    right: 30px;

    width: 360px;

    padding: 30px 32px;

    background: rgba(243, 241, 232, 0.97);

    border: 1px solid var(--black);

    z-index: 60;

    box-shadow: 7px 7px 0 var(--turquoise);
}

.artwork-info.hidden {
    display: none;
}

.artwork-info button {
    position: absolute;

    top: 8px;
    right: 12px;

    border: none;
    background: none;

    font-size: 28px;

    cursor: pointer;

    color: var(--black);
}

#artwork-year {
    margin: 0 0 12px;

    color: var(--turquoise);

    font-size: 12px;
    letter-spacing: 2px;
    font-weight: bold;
}

#artwork-title {
    margin: 0 0 10px;

    font-family: Georgia, serif;

    font-size: 32px;
    line-height: 1.05;
}

#artwork-medium {
    margin: 0 0 22px;

    font-size: 14px;
    font-style: italic;
}

#artwork-description {
    margin: 0;

    font-size: 15px;
    line-height: 1.6;
}


/* =========================
   MUSIC PLAYER
========================= */

.music-player {
    position: fixed;

    right: 30px;
    bottom: 25px;

    z-index: 50;

    pointer-events: none;
}

.ipod {
    width: 190px;

    padding: 14px;

    background: var(--white);

    border: 2px solid var(--black);

    border-radius: 14px;

    box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.25);

    pointer-events: auto;
}


/* =========================
   IPOD SCREEN
========================= */

.ipod-screen {
    height: 115px;

    padding: 12px;

    background: var(--turquoise-light);

    border: 1px solid var(--black);

    text-align: center;

    overflow: hidden;
}

.music-label {
    margin: 0 0 10px;

    font-size: 8px;
    letter-spacing: 1.5px;
    font-weight: bold;
}

.album-name {
    margin-bottom: 7px;

    font-size: 11px;
    font-weight: bold;
}

.song-title {
    font-family: Georgia, serif;

    font-size: 16px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-name {
    margin-top: 5px;

    font-size: 10px;
}


/* =========================
   IPOD WHEEL
========================= */

.ipod-wheel {
    position: relative;

    width: 100px;
    height: 100px;

    margin: 15px auto;

    background: var(--cream);

    border: 2px solid var(--black);

    border-radius: 50%;
}

.play-button,
.wheel-button {
    position: absolute;

    border: none;

    background: none;

    cursor: pointer;

    color: var(--black);
}

.play-button {
    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    font-size: 22px;
}

.wheel-button {
    font-size: 12px;
}

.previous {
    left: 14px;
    top: 50%;

    transform: translateY(-50%);
}

.next {
    right: 14px;
    top: 50%;

    transform: translateY(-50%);
}

.play-button:hover,
.wheel-button:hover {
    color: var(--turquoise);
}


/* =========================
   ALBUM BUTTON
========================= */

.album-button {
    width: 100%;

    padding: 8px;

    border: 1px solid var(--black);

    background: var(--cream);

    cursor: pointer;

    font-size: 11px;
    font-weight: bold;
}

.album-button:hover {
    background: var(--turquoise);
    color: var(--white);
}


/* =========================
   ALBUM MENU
========================= */

.album-menu {
    position: absolute;

    right: 205px;
    bottom: 0;

    width: 190px;

    padding: 20px;

    background: var(--cream);

    border: 1px solid var(--black);

    pointer-events: auto;
}

.album-menu.hidden {
    display: none;
}

.album-menu > p {
    margin: 0 0 15px;

    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
}

.album-option {
    display: block;

    width: 100%;

    padding: 10px;

    margin-bottom: 7px;

    border: 1px solid var(--border);

    background: var(--white);

    text-align: left;

    cursor: pointer;
}

.album-option:hover {
    border-color: var(--turquoise);
}


/* =========================
   INSTRUCTIONS
========================= */

.instructions {
    position: fixed;

    left: 50%;
    bottom: 25px;

    transform: translateX(-50%);

    z-index: 20;

    display: flex;
    gap: 18px;

    padding: 9px 14px;

    background: rgba(243, 241, 232, 0.85);

    font-size: 11px;

    pointer-events: none;
}


/* =====================================================
   AQUARIUM
===================================================== */

#aquarium-world {
    position: absolute;

    left: 0;
    top: 0;

    width: 1000px;
    height: auto;

    margin: 0;

    transform: none;

    visibility: visible;
    opacity: 1;

    pointer-events: auto;

    /* DO NOT use display: none here.
       art.js turns this into a CSS3DObject. */
}


/* =====================================================
   TANK
===================================================== */

#aquarium-world .tank {

    position: relative;

    width: 100%;

    aspect-ratio: 2.5 / 1;

    overflow: hidden;

    background-image:
        url("BG.JPG");

    background-size: cover;

    background-position: center;

    border: 3px solid white;

    box-sizing: border-box;

    pointer-events: auto;
}


/* =====================================================
   AQUARIUM LAYERS
===================================================== */

#fish-layer,
#food-layer,
#bubble-layer,
#water-overlay {

    position: absolute;

    inset: 0;

    overflow: hidden;
}


#fish-layer {
    z-index: 2;
}


#water-overlay {
    z-index: 3;

    pointer-events: none;
}


#food-layer {
    z-index: 4;

    pointer-events: none;
}


#bubble-layer {
    z-index: 5;

    pointer-events: none;
}


/* =====================================================
   FISH
===================================================== */

#aquarium-world .fish {

    position: absolute;

    transform-origin: center;

    cursor: pointer;

    user-select: none;

    -webkit-user-select: none;

    z-index: 5;
}


#aquarium-world .fish img {

    display: block;

    max-width: none;

    user-select: none;

    -webkit-user-drag: none;
}


/* =====================================================
   WATER OVERLAY
===================================================== */

#aquarium-world #water-overlay {

    background:

        linear-gradient(
            120deg,
            rgba(255,255,255,0.08),
            rgba(255,255,255,0),
            rgba(255,255,255,0.08)
        );

    opacity: 0.45;

    animation:
        aquariumWaterMovement
        18s
        linear
        infinite;
}


/* =====================================================
   WATER RIPPLE
===================================================== */

#aquarium-world .water-ripple {

    position: absolute;

    width: 20px;
    height: 20px;

    border-radius: 50%;

    border:
        1px solid
        rgba(255,255,255,0.35);

    transform:
        translate(-50%, -50%)
        scale(0.2);

    opacity: 0.7;

    pointer-events: none;

    animation:
        aquariumWaterRipple
        1.8s
        ease-out
        forwards;
}


@keyframes aquariumWaterRipple {

    0% {

        transform:
            translate(-50%, -50%)
            scale(0.2);

        opacity: 0.65;
    }

    60% {

        opacity: 0.22;
    }

    100% {

        transform:
            translate(-50%, -50%)
            scale(8);

        opacity: 0;
    }
}


/* =====================================================
   FOOD
===================================================== */

#aquarium-world .food {

    position: absolute;

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #d6a65c;

    z-index: 10;
}


/* =====================================================
   BUBBLES
===================================================== */

#aquarium-world .bubble {

    position: absolute;

    border:
        2px solid
        rgba(255,255,255,0.55);

    border-radius: 50%;

    box-sizing: border-box;

    animation:
        aquariumBubble
        var(--bubble-duration)
        ease-in
        forwards;
}


@keyframes aquariumBubble {

    0% {

        transform:
            translate(0, 0);

        opacity: 0;
    }

    10% {

        opacity: 0.7;
    }

    100% {

        transform:
            translate(
                var(--bubble-drift),
                -250px
            );

        opacity: 0;
    }
}


/* =====================================================
   AQUARIUM BUTTONS
===================================================== */

.aquarium-controls {

    display: flex;

    justify-content: center;

    gap: 12px;

    margin-top: 15px;

    pointer-events: auto;
}


.aquarium-button {

    padding:
        10px
        18px;

    border:
        1px solid
        #111;

    background:
        #f3f1e8;

    color:
        #111;

    font-family:
        Helvetica,
        Arial,
        sans-serif;

    font-size: 15px;

    cursor: pointer;
}


.aquarium-button:hover {

    background: #ffffff;
}


/* =====================================================
   BOOKS
===================================================== */

#book-world {

    position: absolute;

    left: 0;
    top: 0;

    width: 0;
    height: 0;

    margin: 0;

    pointer-events: none;
}


.book-object {

    position: absolute;

    left: 0;
    top: 0;

    cursor: pointer;

    pointer-events: auto;
}


.book-object img {

    display: block;

    width: 100%;
    height: auto;

    user-select: none;

    -webkit-user-drag: none;
}


/* =====================================================
   AQUARIUM WATER ANIMATION
===================================================== */

@keyframes aquariumWaterMovement {

    0% {

        background-position:
            0% 50%;
    }

    50% {

        background-position:
            100% 45%;
    }

    100% {

        background-position:
            0% 50%;
    }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    .gallery-title {
        display: none;
    }

    .instructions {
        display: none;
    }

    .home-button {
        top: 15px;
        left: 15px;
    }

    .music-player {
        right: 15px;
        bottom: 15px;
    }

    .ipod {
        width: 150px;
    }

    .ipod-screen {
        height: 95px;
    }

    .ipod-wheel {
        width: 80px;
        height: 80px;
    }

    .artwork-info {
        top: 20px;
        left: 20px;
        right: 20px;

        width: auto;
    }
}
