/* ==========================================================================
   RAIMU.CH – HOMEPAGE
   Indice:
     1. Font (caricati dalla cartella css/fonts)
     2. Base
     3. Angoli
     4. Logo e grana
     5. Menu
     6. Finestre (Watch, Sign-Up, Contact, Tour) e pulsante ✕
     7. Animazioni
     8. Telefono (fino a 800 px)
     9. Footer e particelle
   ========================================================================== */


/* ===== 1. FONT ===== */

@font-face {
    font-family: 'Shadows Into Light';
    src: url('fonts/shadowsintolight-regular-webfont.woff2') format('woff2'),
         url('fonts/shadowsintolight-regular-webfont.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Font degli angoli. Il file va scaricato da Google Fonts (Amatic SC, "Bold")
   e messo in css/fonts/ con questo nome: AmaticSC-Bold.ttf */
@font-face {
    font-family: 'Amatic SC';
    src: url('fonts/AmaticSC-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* ===== 2. BASE ===== */

* {
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
    cursor: url('../img/cursor.png'), auto;
}

/* Contorno visibile solo per chi naviga con la tastiera (con il mouse non si vede) */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid #54aedb;
    outline-offset: 3px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    font-family: 'Shadows Into Light', sans-serif;
}

body {
    background: url('../img/meditative-flow-bg.webp') #3787b3;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: cover;
}

a {
    text-decoration: none;
    color: #fff;
}

/* Cursore "mano" sopra link e icone */
a, a *, button, button *, .corner, .footer-icon {
    cursor: url('../img/pointerr.png'), auto;
}

/* Telefono: su iPhone serve per far arrivare il tocco alle particelle (tap = nuove palline) */
@media (hover: none) {
    .noise {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}


/* ===== 3. ANGOLI =====
   Triangoli fatti in CSS: il testo si cambia nell'HTML (index.html).
   Per cambiare colore, font o dimensione della scritta, modifica le
   variabili qui sotto. */

.corner {
    --corner-bg: rgba(0, 0, 0, 0.7);        /* colore del triangolo (nero al 70%) */
    --corner-text: #fff;                     /* colore della scritta */
    --corner-font: 'Amatic SC', 'Arial Narrow', sans-serif;
    --corner-size: 11.5cqw;                  /* dimensione della scritta rispetto all'angolo */

    width: 200px;
    height: 200px;
    position: fixed;
    z-index: 6;
    bottom: 0;
    opacity: 0.8;
    transition: opacity 0.5s;
    display: block;
    container-type: size;                    /* serve per --corner-size */
    background: var(--corner-bg);
    color: var(--corner-text);
}

.corner:hover,
.corner:focus-visible {
    opacity: 1;
}

/* Con la tastiera: la scritta si sottolinea (il contorno verrebbe tagliato dal triangolo) */
.corner:focus-visible span {
    text-decoration: underline;
}

.corner span {
    position: absolute;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-family: var(--corner-font);
    font-weight: 700;
    font-size: 28px;                         /* per browser molto vecchi */
    font-size: var(--corner-size);
    line-height: 1.05;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}

/* Forma di ogni angolo (quale metà del quadrato è colorata) e posizione della scritta */
.corner.topleft          { clip-path: polygon(0 0, 100% 0, 0 100%); }
.corner.topleft span     { left: 30%; top: 30%; }

.corner.topright         { clip-path: polygon(0 0, 100% 0, 100% 100%); }
.corner.topright span    { left: 70%; top: 30%; transform: translate(-50%, -50%) rotate(45deg); }

.corner.left,
.corner.bottomleftmobile { clip-path: polygon(0 0, 0 100%, 100% 100%); }
.corner.left span,
.corner.bottomleftmobile span { left: 37%; top: 63%; transform: translate(-50%, -50%) rotate(45deg); }

.corner.right,
.corner.bottomrightmobile { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.corner.right span,
.corner.bottomrightmobile span { left: 63%; top: 63%; }

/* Angoli del telefono: scritta un po' più piccola */
.corner.bottomleftmobile, .corner.bottomrightmobile { --corner-size: 10cqw; }

/* Posizione e dimensione */
.corner.left { left: 0; }
.corner.right { right: 0; }

/* Discord e Patreon (in basso, oggi spenti): colori invertiti come le vecchie immagini */
.corner.right, .corner.left {
    --corner-bg: rgba(255, 255, 255, 0.7);
    --corner-text: #000;
}

.corner.topleft, .corner.topright {
    width: 275px;
    height: 275px;
    bottom: auto;
    top: 0;
    filter: brightness(0.8);
    animation: blur2 2s forwards ease;
}
.corner.topleft { left: 0; }
.corner.topright { right: 0; }

@media (min-width: 800px) and (max-width: 1300px) {
    .corner.topleft, .corner.topright {
        width: 250px;
        height: 250px;
    }
}

.corner.bottomleftmobile {
    top: auto;
    bottom: 0;
    left: 0;
    width: 130px;
    display: none;
}

.corner.bottomrightmobile {
    top: auto;
    bottom: 0;
    right: 0;
    width: 130px;
    display: none;
}


/* ===== 4. LOGO E GRANA ===== */

.logo.blur {
    height: 10vh;
    width: auto;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) scale(1.3);
    filter: blur(100px);
    opacity: 0;
    z-index: 4;
    animation: blur 2s forwards ease;
}

.noise {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: url("../img/noise.gif");
    background-repeat: repeat;
    opacity: 0.08;
    mix-blend-mode: multiply;
}


/* ===== 5. MENU ===== */

#menu {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 0 10px;
    display: table;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#menu a {
    font-size: 1.3rem;
    color: #fff;
    padding: 10px;
    transition: 0.5s;
    font-weight: bold;
    display: table-cell;
}

#menu a:hover {
    color: #54aedb;
}

@media (max-width: 768px) {
    #menu {
        border-radius: 3px;
        padding: 0 10px;
        top: 35px;
    }
}


/* ===== 6. FINESTRE ===== */

#loading {
    background: #000 url('../img/loading.gif') no-repeat 50% 50%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lightbox {
    z-index: 50;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
}

.lightbox.signup, .lightbox.tour, .lightbox.contact, .lightbox.watchvids {
    overflow-y: scroll;
    z-index: 1000;
    text-transform: none;
    letter-spacing: 0;
    -webkit-overflow-scrolling: touch;
}

.lightbox p {
    font-size: 1.3rem;
    font-family: sans-serif;
    line-height: 1.5rem;
    font-weight: bold;
    margin: 20px auto;
}

.lightbox a {
    transition: 0.5s;
}

.lightbox a:hover {
    color: #54aedb;
}

/* Video di "Watch" in formato 16:9 */
.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
}
.embed-container iframe,
.embed-container object,
.embed-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tour */
.tourcontainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow-y: scroll;
}

.tourwrapper {
    max-width: 800px;
    display: block;
    margin: 0 auto;
}

h3 {
    font-size: 3rem;
    text-align: center;
    margin: 50px auto;
    color: #fff;
    text-transform: uppercase;
    max-width: 400px;
}

/* Contact */
#contactwrap {
    z-index: 1000;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

#contactwrapper {
    color: #fff;
    margin: 0 auto;
    font-weight: normal;
    font-size: 15px;
    line-height: 13px;
    text-align: center;
    letter-spacing: 4px;
    z-index: 4;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media screen and (max-width: 768px) {
    #contactwrapper p {
        font-size: 15px;
        line-height: 1.4;
    }
}

/* Pulsante ✕ (nascosto sopra lo schermo finché non si apre una finestra) */
.close {
    position: fixed;
    top: 0;
    right: 0;
    padding: 13px 20px;
    color: #fff;
    background: #000;
    border: 0;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: 28px;
    line-height: normal;
    transform: translateY(-100px);
    z-index: 10003;
    display: block;
}


/* ===== 7. ANIMAZIONI ===== */

/* Logo: entra sfocato e si mette a fuoco */
@keyframes blur {
    0%   { opacity: 0; transform: translateX(-50%) scale(1.3); filter: blur(100px); }
    100% { opacity: 1; transform: translateX(-50%) scale(1);   filter: blur(0); }
}

/* Angoli in alto: entrano sfocati */
@keyframes blur2 {
    0%   { opacity: 0; filter: blur(100px) brightness(0.8); }
    100% { opacity: 1; filter: blur(0) brightness(0.8); }
}

/* Pulsante ✕: scende quando si apre una finestra, risale quando si chiude */
.movedown { animation: movedown 2s ease forwards; }
.moveup   { animation: moveup 2s ease forwards; }

@keyframes movedown {
    0%   { transform: translateY(-100px); }
    100% { transform: translateY(0); }
}

@keyframes moveup {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

/* Finestre: si ingrandiscono all'apertura, si rimpiccioliscono alla chiusura */
.zoomin  { animation: zoomin 2s forwards ease; }
.zoomout { animation: zoomout 2s forwards ease; }

@keyframes zoomin {
    0%   { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes zoomout {
    0%   { transform: scale(1); }
    100% { transform: scale(0); }
}


/* ===== 8. TELEFONO (fino a 800 px) ===== */

@media (max-width: 800px) {

    body {
        background: url('../img/meditative-flow-mobile-bg.webp') #3787b3;
        background-repeat: no-repeat;
        background-position: center bottom;
        background-size: cover;
    }

    .logo.blur {
        width: 95px;
        height: 95px;
    }

    /* Sul telefono si vedono solo i due angoli in basso */
    .corner {
        display: none;
    }
    .corner.bottomleftmobile, .corner.bottomrightmobile {
        display: block;
        width: 150px;
        height: 150px;
    }

    #menu {
        display: table;
        width: 100%;
    }

    #menu a {
        display: table-cell;
        text-align: center;
        font-size: 1.2rem;
        padding: 0 5px;
    }

    /* Sign-Up */
    #signupwrap {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #000;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #signupwrapper {
        color: #fff;
        margin: 0 auto;
        font-weight: normal;
        width: 100%;
        font-size: 15px;
        line-height: 13px;
        text-align: center;
        letter-spacing: 4px;
        z-index: 4;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    @media screen and (max-width: 768px) {
        .lightbox.signup {
            max-width: 100%;
            padding: 10px;
        }
    }

    .noise {
        opacity: 0.05;
    }
}

@media (max-width: 340px) {
    .corner.bottomleftmobile, .corner.bottomrightmobile {
        width: 130px;
        height: 130px;
    }
}


/* ===== 9. FOOTER E PARTICELLE ===== */

.footer {
    text-align: center;
    padding: 5px 0;
    background-color: transparent;
    color: #fff;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

.footer-icons {
    display: inline-block;
}

.footer-icon {
    width: 20px;
    margin: 0 3px;
    opacity: 1;
    transition: transform 0.3s ease;
    filter: invert(1);                       /* icone bianche */
    cursor: pointer;
}

.footer-icon:hover {
    transform: scale(1.3);
    filter: invert(36%) sepia(78%) saturate(565%) hue-rotate(166deg) brightness(93%) contrast(89%); /* azzurro #54aedb */
}

@media (min-width: 768px) {
    .footer-icon {
        opacity: 0.6;
    }
    footer:hover .footer-icon {
        opacity: 1;
    }
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}
