/* =========================================================
   FIJ.FI
   ========================================================= */

* {
    box-sizing: border-box;
}

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

html {
    background: #111;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #fff;
}


/* =========================================================
   BACKGROUND
   ========================================================= */

body::before {
    content: "";
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100vh;

    background-image: url("/assets/fijfi.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;

    z-index: -2;
}


/* =========================================================
   LINKS PAGE DARKENING
   ========================================================= */

body.links-page::after {
    content: "";
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100vh;

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

    pointer-events: none;
    z-index: -1;
}


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

.top-nav {
    position: fixed;
    top: 18px;
    right: 22px;

    display: flex;
    align-items: center;
    gap: 18px;

    z-index: 100;
}

.top-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;

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

    transition: color 0.15s ease;
}

.top-nav a:hover {
    color: #fff;
}

.top-nav a.active {
    color: #fff;
    font-weight: 600;
}


/* =========================================================
   QR CODE
   ========================================================= */

.qr-code {
    position: fixed;

    top: 18px;
    left: 18px;

    width: 42px;
    height: 42px;

    z-index: 100;
}

.qr-code img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* =========================================================
   FRONT PAGE
   ========================================================= */

body.front-page {
    width: 100vw;
    height: 100vh;

    overflow: hidden;
}


/*
   Invisible clickable area over the complete wooden FIJFI sign.
*/

.sign-link {
    position: absolute;

    left: 28.2%;
    top: 43.2%;

    width: 53.8%;
    height: 35.2%;

    z-index: 20;
    cursor: pointer;

    background: transparent;
}


/* =========================================================
   LINKS PAGE - DESKTOP
   ========================================================= */

body.links-page {
    min-height: 100vh;

    overflow-x: hidden;
    overflow-y: auto;
}

.links-list {
    position: absolute;

    left: 7.5vw;
    top: 46%;

    transform: translateY(-50%);

    width: 220px;

    z-index: 20;
}

.links-list a {
    display: block;

    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;

    font-size: 18px;
    line-height: 1.55;
    font-weight: 400;

    padding: 3px 0;

    border-bottom: 1px solid rgba(255, 255, 255, 0.18);

    transition:
        color 0.15s ease,
        padding-left 0.15s ease;
}

.links-list a:last-child {
    border-bottom: none;
}

.links-list a:hover {
    color: #fff;
    padding-left: 4px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .links-list {
        left: 6vw;

        width: 210px;
    }

    .links-list a {
        font-size: 17px;
    }
}


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

@media (max-width: 768px) {

    html {
        min-height: 100%;
    }

    body {
        width: 100%;
        min-height: 100vh;
    }


    /* -----------------------------------------------------
       Fixed background
       ----------------------------------------------------- */

    body::before {
        position: fixed;

        inset: 0;

        width: 100vw;
        height: 100vh;

        background-image: url("/assets/fijfi.jpg");
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;

        z-index: -2;
    }


    /* -----------------------------------------------------
       Links page darkening stays fixed
       ----------------------------------------------------- */

    body.links-page::after {
        position: fixed;

        inset: 0;

        width: 100vw;
        height: 100vh;

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

        pointer-events: none;

        z-index: -1;
    }


    /* -----------------------------------------------------
       Links page itself scrolls
       ----------------------------------------------------- */

    body.links-page {
        position: relative;

        width: 100%;
        min-height: 100vh;
        height: auto;

        overflow-x: hidden;
        overflow-y: visible;

        -webkit-overflow-scrolling: touch;
    }


    /* -----------------------------------------------------
       Links are now part of normal document flow.
       This is what makes the whole list scrollable.
       ----------------------------------------------------- */

    .links-list {
        position: relative;

        top: auto;
        left: auto;

        transform: none;

        box-sizing: border-box;

        width: min(78vw, 340px);

        margin: 0;

        /*
           Space above keeps the list visually near its
           original location.

           Large bottom padding guarantees that the final
           links can be scrolled above the browser toolbar.
        */

        padding:
            30vh
            0
            max(160px, calc(100px + env(safe-area-inset-bottom)))
            7vw;

        z-index: 20;
    }

    .links-list a {
        display: block;

        width: 100%;

        color: rgba(255, 255, 255, 0.96);

        font-size: 18px;
        line-height: 1.55;

        padding: 7px 0;

        border-bottom:
            1px solid rgba(255, 255, 255, 0.18);
    }

    .links-list a:last-child {
        border-bottom: none;
    }

    .links-list a:hover {
        padding-left: 0;
    }


    /* -----------------------------------------------------
       QR code
       ----------------------------------------------------- */

    .qr-code {
        position: fixed;

        top: 14px;
        left: 14px;

        width: 42px;
        height: 42px;

        z-index: 100;
    }


    /* -----------------------------------------------------
       Navigation
       ----------------------------------------------------- */

    .top-nav {
        position: fixed;

        top: 17px;
        right: 15px;

        gap: 14px;

        z-index: 100;
    }

    .top-nav a {
        font-size: 12px;
    }


    /* -----------------------------------------------------
       Front page
       ----------------------------------------------------- */

    body.front-page {
        width: 100vw;
        height: 100vh;

        overflow: hidden;
    }

    /*
       The photograph is cropped differently on a narrow
       screen, so use a larger sign link area on mobile.
    */

    .sign-link {
        left: 12%;
        top: 43%;

        width: 76%;
        height: 34%;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

    .links-list {
        width: 82vw;

        padding-top: 27vh;
        padding-left: 6vw;
        padding-bottom:
            max(180px, calc(120px + env(safe-area-inset-bottom)));
    }

    .links-list a {
        font-size: 17px;
        padding: 8px 0;
    }

    .top-nav {
        right: 12px;
        gap: 11px;
    }

    .top-nav a {
        font-size: 11px;
    }

    .qr-code {
        top: 12px;
        left: 12px;

        width: 40px;
        height: 40px;
    }
}