* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    min-height: 100vh;
    background: #afd33d;
    font-family: Arial, sans-serif;
}


/* ==========================
   NAVIGATION
   ========================== */

.transform-nav {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
}

.transform-nav a {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.transform-nav a:hover {
    opacity: 0.7;
}


/* ==========================
   MAIN LAYOUT
   ========================== */

.dive-transform {
    padding: 1rem 2rem 3rem;
}

.dive-layout {
    width: min(1500px, 100%);
    min-height: 75vh;
    margin: 0 auto;

    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}


/* ==========================
   LEFT: DIVE IMAGE
   ========================== */

.dive-panel {
    min-height: 650px;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;

    background: white;
    border-radius: 18px;
}

.dive {
    width: 100%;
    height: 100%;
    min-height: 650px;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}

.dive-step {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}


/* ==========================
   RIGHT: TILE CONTROLS
   ========================== */

.dive-controls {
    display: flex;
    justify-content: center;
    align-items: center;

    min-width: 0;
}

.choice-area {
    width: min(100%, 420px);

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);

    gap: 1rem;
}


/* ==========================
   TILES
   ========================== */

.dive-tile {
    width: 100%;
    aspect-ratio: 1 / 1;

    padding: 0;

    border: 4px solid white;
    border-radius: 14px;

    background: #84a92a;

    cursor: pointer;
    overflow: hidden;

    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.45s ease,
        opacity 0.35s ease;
}

.dive-tile:hover {
    transform: translateY(-4px);
}

.dive-tile img {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}


/* Tile transition states */

.dive-tile.entering {
    opacity: 0;
    transform: rotateY(90deg) scale(0.85);
}

.dive-tile.visible {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
}

.dive-tile.leaving {
    opacity: 0;
    transform: rotateY(-90deg) scale(0.85);
}


/* ==========================
   END MODAL
   ========================== */

.end-modal {
    position: fixed;
    inset: 0;

    display: none;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.45);

    z-index: 1000;
}

.end-modal.show {
    display: flex;
}

.end-modal-content {
    width: min(450px, 85%);
    padding: 2rem;

    background: #e97862;
    border: 4px solid white;
    border-radius: 18px;

    color: white;
    text-align: center;

    font-size: 1.3rem;
    font-weight: 700;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.end-modal-content > p {
    margin: 0.35rem 0;
}


/* ==========================
   END MODAL BUTTONS
   ========================== */

#resetDive,
.next-transform {
    display: inline-block;

    padding: 0.8rem 2rem;

    border: 3px solid white;
    border-radius: 10px;

    background: #84a92a;
    color: white;

    font-family: Arial, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: normal;

    text-decoration: none;
    cursor: pointer;
}

#resetDive {
    margin-top: 1rem;
}

.more-experiences {
    margin-top: 1rem;
}

.more-experiences p {
    margin: 0.25rem 0;
}

.experience-buttons {
    margin-top: 0.75rem;

    display: flex;
    justify-content: center;
    gap: 0.75rem;

    flex-wrap: wrap;
}

#resetDive:hover,
.next-transform:hover {
    opacity: 0.8;
}


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

@media (max-width: 800px) {

    .dive-transform {
        padding: 1rem;
    }

    .dive-layout {
        grid-template-columns: 1fr;
    }

    .dive-panel {
        height: 300px;
        min-height: 0;
    }

    .dive {
        height: 100%;
        min-height: 0;
    }

    .dive-step {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .dive-controls {
        margin-top: 1rem;
    }

    .choice-area {
        width: min(100%, 320px);
        gap: 0.75rem;
    }

    .dive-tile {
        border-width: 3px;
    }
}