/* ══════════════════════════════════════════
   STYLE.CSS — Stillopia — Global Base
══════════════════════════════════════════ */

@font-face {
    font-family: 'Typewriter';
    src: url('../fonts/Typewriter.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0;
    background: #C7A8E4;
    font-family: 'Typewriter', Georgia, serif;
    color: black;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

/* ══ LANDING (index.html) ══ */
body.landing {
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
}

.logo {
    width: min(700px, 85vw);
    height: auto;
    margin: 0 auto 40px;
}

.enter-link {
    display: inline-block;
    position: relative;
    text-decoration: none;
    z-index: 10;
}

.enter-img {
    width: min(300px, 60vw);
    height: auto;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.3s ease;
    will-change: transform;
}

.enter-link:hover .enter-img {
    transform: scale(1.12);
    animation-play-state: paused;
}

.enter-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: -15px;
    width: 100%; height: 3px;
    background: #20112D;
    transform: scaleX(0);
    transition: transform 1.8s ease;
    border-radius: 2px;
}

.enter-link:hover::after { transform: scaleX(1); }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-15px); }
}

/* ══ HOME (home.html) ══ */
body.home-page {
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

.grid-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 40px 20px;
    width: 100%;
    min-height: 100dvh;
    box-sizing: border-box;
}

.grid-item {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    background: transparent;
    flex: 1;
    max-width: 22%;
    border-radius: 8px;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.85);
    transition: transform 0.4s ease, filter 0.4s ease;
    border-radius: 8px;
}

.grid-item:hover img { transform: scale(1.06); filter: brightness(1); }

.grid-item span {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(18px, 3.5vw, 28px);
    font-weight: bold;
    text-align: center;
    width: 90%;
    pointer-events: none;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

@media (max-width: 600px) {
    body.home-page {
        scroll-snap-type: y mandatory;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .grid-container {
        flex-direction: column;
        padding: 0;
        gap: 0;
        min-height: unset;
        align-items: center;
        justify-content: flex-start;
    }

    .grid-item {
        max-width: 88%;
        width: 88%;
        flex: unset;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        opacity: 0.25;
        transform: scale(0.92);
        transition: opacity 0.5s cubic-bezier(0.33,1,0.68,1),
                    transform 0.5s cubic-bezier(0.33,1,0.68,1);
        will-change: transform, opacity;
        margin-top: 28dvh;
        margin-bottom: 28dvh;
    }

    .grid-item:first-child { margin-top: 32dvh; }
    .grid-item:last-child  { margin-bottom: 32dvh; }

    .grid-item.is-active { opacity: 1; transform: scale(1.04); }

    .grid-item img {
        width: 100%;
        height: auto;
        object-fit: contain;
        filter: brightness(1);
    }
}

/* ══ BACK BUTTON (fallback generico) ══ */
.back-button {
    position: fixed;
    top: 20px; left: 20px;
    text-decoration: none;
    color: black;
    font-weight: bold;
    background: rgba(255,255,255,0.3);
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 14px;
    transition: background 0.3s, transform 0.3s;
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.back-button:hover { background: rgba(255,255,255,0.7); transform: translateX(-4px); }

/* ══ PAGINE DEDICATE ══ */
.page-container {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px 60px;
    text-align: center;
}

.page-title { font-size: clamp(28px, 8vw, 50px); margin-bottom: 20px; }

.page-description {
    font-size: clamp(15px, 2vw, 18px);
    max-width: 600px;
    line-height: 1.7;
}