@font-face {
    font-family: jost-regular;
    src: url(/data/font/Jost/static/Jost-Regular.ttf);
}

@keyframes fadeUp {
    from {opacity: 0; transform:translateY(20px);}
    to {opacity: 1; transform:translateY(0px);}
}

@keyframes fadeDown {
    from {opacity: 0; transform:translateY(-20px);}
    to {opacity: 1; transform:translateY(0px);}
}

@keyframes fadeInPlace {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes appearing_from_above {
    from {opacity: 0; transform:translateY(-10vh)}
    to {opacity: 1; transform:translateY(0vh)}
}

@keyframes disappearing_from_above {
    from {opacity: 1; transform:translateY(0vh)}
    to {opacity: 0; transform:translateY(-10vh)}
}

@keyframes stretching {
    from { height: 0; opacity: 0; }
    to   { height: auto; opacity: 1; }
}

@keyframes selector_img_animation {
    0% {transform: scale(1.0);}
    25% {transform: scale(1.2);}
    75%{transform: scale(0.8);}
    100%{transform: scale(1.0);}
}

@supports not (interpolate-size: allow-keywords) {
    @keyframes stretching {
        from { max-height: 0; opacity: 0; }
        to   { max-height: 1000px; opacity: 1; }
    }
}

:root {
    --distance-sections: 50px;
    --icon-width: 100px;
    --line: rgba(0,0,0,0.15);
    interpolate-size: allow-keywords;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html {
    scroll-behavior:smooth;
    scroll-padding-top: 25vh;
    background-color: #211A15;
}

a {
    font-family: "Bodoni Moda", serif;
    font-size: clamp(0.8rem, 2vw, 2.5rem);
    text-decoration:none;
    width: fit-content;
}

a:visited, a:link {
    color: black;
}

a.button {
    font-size: clamp(0.9rem, 2vw, 1.5rem);
    letter-spacing: .03em;
    text-transform: uppercase;

    padding: 14px 28px;
    border-radius: 30px;

    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 44px;
    transition: background .18s ease, transform .18s ease;

    color: whitesmoke;
    text-decoration: none;
}

a.button:hover{
    transform: translateY(-1px);
}

body.non_latin_font a:not(.no-font) {
    font-family: "Noto Sans", "Noto Sans CJK JP", "Noto Sans CJK SC", sans-serif;
    font-size: clamp(0.8rem, 1.5vw, 2.0rem);
}

body.non_latin_font a.button {
    font-size: clamp(0.8rem, 1.5vw, 1.3rem);
}

h1 {
    font-family: "Bodoni Moda", serif;
    font-weight: lighter;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
}

body.non_latin_font h1 {
    font-family: "Noto Sans", "Noto Sans CJK JP", "Noto Sans CJK SC", sans-serif;
}

p {
    font-size: clamp(0.95rem, 0.5vw + 0.8rem, 1.1rem);
    font-family: "Bodoni Moda", serif;
    line-height: 1.6;
}

/* Bar Section */
.header {
    height: 20vh;
    padding: 25px;
    gap: 20px;

    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    background-color: #211A15;

    position: sticky;
    top: 0;
    z-index: 50;
}

.header > a {
    height: 100%;
    width: auto;
    display: flex;
}

.header > a > img {
    height: 100%;
    width: auto;
}

.header > img {
    height: 100%;
    width: auto;
    min-width: 0;
    max-width: 50%;
    object-fit: contain;
    animation-name: fadeDown;
    animation-duration: 1.0s;
}

.navigation_menu {
    display: flex;
    flex-direction: row;
    align-items: center;

    height: 100%;
}

.navigation_menu > button {
    width: 40px;
    height: 40px;
    border-radius: 50%;

    border: none;
    background-color: transparent;
    color: white;

    font-weight: bold;
    text-transform: uppercase;

    cursor: pointer;
    font-size: 1.5rem;

    margin-left: 5px;

    &:hover{
        scale:1.2;
    }
}

/* Languages Grid */
.languages_grid {
    display: flex;
    flex-direction: column;
    row-gap: 10px;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);
    z-index: 9999;

    text-align: center;
    align-content: center;
    position: fixed;

    padding: 10px;
    width: auto;
    max-width: 92vw;
    height: fit-content;

    border-radius: 25px;
    background-color: #211A15;
}

.languages_grid h1 {
    cursor: default;
    color: whitesmoke;
}

.language_title{
    display: flex;
    flex-direction: row;
    padding: 10px;

    justify-content: space-between;
    align-items: center;
    height: fit-content;
    width: auto;
}

#cross_language{
    height: fit-content;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
}

#cross_language > span {
    width: 25px;
    height: 3px;
    background-color: whitesmoke;
    border-radius: 2px;
}

#cross_language > span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 1px)
}

#cross_language > span:nth-child(2) {
    transform: rotate(-45deg) translate(5px, -1px)
}

.list_languages {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 16px;
    width: auto;
}

.list_languages > a {
    width: 100%;
    min-width: 0;
    min-height: 60px;
    
    text-align: center;

    padding: 14px 24px;
    background-color: #d2b17f;
    color: #1d1a17;
    border: 3px solid #d2b17f ;
    border-radius: 20px;

    font-family: "Bodoni Moda", serif;
    font-size: clamp(1.2rem, 4vw, 2rem);

    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease;
}

.list_languages > a:hover {
    transform: scale(1.05);
    background-color: #DFC18F;
}

body.non_latin_font .list_languages > a{
    font-family: "Bodoni Moda", serif;
    font-size: clamp(1.2rem, 4vw, 2rem);
} 

/* Overlay */
#overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.4),
        rgba(0,0,0,0.7)
    );

    opacity: 0;
    pointer-events: none;
    z-index: 999;
}

#overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Up Button */
#up_button {
    display: none;
    position: fixed;
    bottom: clamp(1rem, calc(0.143rem + 4.286vw), 7rem);
    right: 2%;
    z-index: 100;

    background: url(/data/img/icons/arrow_up.webp);
    background-color: rgb(255 255 255 / 75%);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    width: clamp(3rem, calc(2.571rem + 2.143vw), 6rem);
    height: clamp(3rem, calc(2.571rem + 2.143vw), 6rem);
    border-radius: 50%;
    border: none;
    cursor: pointer;

    &:hover {
        transform: scale(1.1);
    }
}

#up_button.displayed {
    display: block;
}

/* Experience Section */
.experience_variants {
    list-style: none;
}

.experience_variants > li{
    display: none;
}

.experience_variants > li.active{
    display: flex;
    align-items: center;
    height: fit-content;
}

.experience_variants > li.active > div{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
}

.experience_selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.experience_selector > ul {
    display: flex;
    align-items: center;
    justify-content: center;

    list-style: none;
    perspective: 300px;
}

.experience_selector li {
    display: flex;
    opacity: 0.5;
    transform: scale(0.8);
}

.experience_selector li > img {
    width: var(--icon-width);
    height: auto;
    transition: transform 0.3s ease;
    backface-visibility: hidden;
}

.experience_selector li.active {
    opacity: 1;
    transform: scale(1.1);
    transition: transform 0.4s ease;
}

.experience_contents {
    list-style: none;
}

.experience_contents > li {
    display: none;

    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;

    column-gap: clamp(20px, 6vw, 15%);
    row-gap: 4vh;
}

.experience_contents > li.active {
    display: flex;
    animation-name: fadeInPlace;
    animation-duration: 500ms;
}

.experience_description {
    display: flex;
    flex-direction: column;
    justify-content: center;

    row-gap: 20px;

    flex: 1 1 300px;
}

.exp_details_table {
    border-collapse: separate;
    border-spacing: 0 15px;
    width: 100%;
    table-layout: auto;
}

.exp_details_table td {
    padding: 5px;
}

.exp_details_table ul {
    list-style-type:circle;
    >li::marker{
        color: white;
    }
}

.experience_imgs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 250px;
}

.experience_imgs > img {
    width: 100%;
    height: auto;
    max-width: 500px;
    border-radius: 5%;
}

.experience_header_icons{
    display: flex;
    align-items: center;
    justify-content: center;
}

.experience_header_icons > ul{
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 20px;
    row-gap: 10px;
    list-style: none;
}

.experience_header_icons li > img{
    width: var(--icon-width);
    height: auto;
}

.experience_header_icons li > img:hover{
    scale: 1.1;
    transition: scale 0.2s ease; 
}

.experience_header_icons.interacted li.active > img{
    scale: 1.2;
    border: 5px solid rgba(255, 255, 255, 0.5);
    border-radius: 55px;
    background-clip: padding-box;
    transition: scale 0.2s ease;
}


.exp_scroll_wrapper {
    width: 100%;
    position: relative;
    flex: 1 1 320px;
}

.swiper-slide {
    width: 80%;
    max-width: 480px;
}

.exp_scroll img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 6/7;
    object-fit: cover;
    object-position: center 35%;
    border-radius: 6px;
}

section[class$="exp_section"]{
    overflow: hidden;

    animation-name: stretching;
    animation-duration: 0.6s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;

}

section[class$="exp_section"] h1,
section[class$="exp_section"] p{
    color: #fdfcf9;
}

/* Intestazioni delle sezioni */
.research_header,
.cc_header,
.nature_header{
    padding: 40px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;

    justify-content: space-between;
    align-items: center;
    text-align: center;
    height: fit-content;
    width: 100%;
}

.research_header > h1,
.cc_header > h1,
.nature_header > h1 {
    font-size: clamp(1.5rem, 5vw, 5rem);
    font-weight: normal;
}

.general_experience{
    display: none;
}

.general_experience.active{
    padding: 40px;
    width: 100%;
    display: flex;
    flex-direction: column;
    backdrop-filter: brightness(85%);
    animation-name: appearing_from_above;
    animation-duration: 200ms;
}

/* Research Section */
.research_exp_section,
.cc_exp_section,
.nature_exp_section{
    display: flex;
    flex-direction: column;
    align-items: center;

    height: fit-content;
    position: relative;
}

.research_exp_section{
    background-color: #0c7a84;
    animation-delay: 0s;
}

.research_exp_section a.button{
    background-color: #064b52;
}

.research_exp_section a.button:hover{
    background-color: #053439;
}

/* Cooking Class Section */
.cc_exp_section{
    background-color: rgb(185, 81, 81);
    animation-delay: 0.4s;
}

.cc_exp_section a.button{
    background-color: #692626;
}

.cc_exp_section a.button:hover{
    background-color: #491b1b;
}

/* Nature Section */
.nature_exp_section{
    background-color: rgb(83, 159, 112);
    animation-delay: 0.8s;
}

.nature_exp_section a.button{
    background-color: #26573a;
}

.nature_exp_section a.button:hover{
    background-color: rgb(47, 58, 49);
}

/* Footer Section */
.footer {
    padding: 5px 20px 5px 20px;
    height: fit-content;

    display: flex;
    flex-direction: column;
    align-items: center;

    background-color: #211A15;
    position: relative;
}

.footer > img {
    height: 15vh;
    width: auto;
}

.informations {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    row-gap: 20px;
    align-items: center;
    width: 100%;
}

.general_info {
    display: flex;
    flex-direction: column;
    row-gap: 10px;
    height: fit-content;
}

.general_info a {
    font-family: jost-regular;
    font-size: clamp(1rem, 0.9rem + 0.4vw, 1.25rem);
    overflow-wrap: anywhere;
}

.general_info a:visited,
.general_info a:link {
    color: white;
}

.general_info img {
    width: 8%;
    height: auto;
    filter: invert(100%);
}

.where,
.cell,
.mail {
    display: flex;
    align-items: center;
    flex-direction: row;
    column-gap: 5%;
}

.social_info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    column-gap: 20px;
    height: 100%;
}

.social_info img {
    width: clamp(28px, 8vw, 40px);
    height: auto;
    filter: invert(100%);
}

.social_info img:hover{
    transform: scale(1.1);
}

.social_info a {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
}

hr.solid {
    border-top: 3px solid whitesmoke;
    width: 100%;
}

.bottom-bar{
    padding-top: 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    flex-direction: column;
    gap:12px;
    font-size: 12.5px;

    color: white;
}

/* Tablet */
@media screen and (max-width: 1100px) {
    :root {
        --icon-width: 80px;
    }
}

/* Mobile */
@media screen and (max-width: 1023px) {

    :root {
        --icon-width: 70px;
    }

    body.non_latin_font h1 {
        font-size: 2rem;
    }

    .header {
        height: auto;
        min-height: 60px;
        padding: 10px 16px;
    }

    .header > a > img,
    .header > img {
        height: auto;
        width: auto;
        max-height: clamp(50px, 14vw, 90px);
    }

    .header > img {
        max-width: 45%;
    }

    .research_header,
    .cc_header,
    .nature_header {
        justify-content: center;
        flex-direction: column;
    }

    .experience_contents > li {
        flex-direction: column;
        column-gap: 0;
    }

    .experience_description,
    .experience_imgs {
        flex-basis: auto;
        width: 100%;
    }

    .exp_scroll_wrapper{
        flex: 0 0 auto;
        height: fit-content;
    }

    .swiper-slide {
        width: 78%; 
    }

    .languages_grid {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        width: 90vw;
    }

    .footer > img {
        height: auto;
        width: 40%;
        max-width: 160px;
    }

    .bottom-bar {
        text-align: center;
    }
}

@media screen and (max-width: 480px) {

    :root {
        --icon-width: 55px;
    }

    h1 {
        font-size: clamp(1.8rem, 8vw, 2.4rem);
    }

    body.non_latin_font h1 {
        font-size: 1.6rem;
    }

    a.button {
        padding: 12px 22px;
    }

    .research_header,
    .cc_header,
    .nature_header,
    .general_experience.active,
    .experience_disclaimer {
        padding: 20px 16px;
    }

    .swiper-slide {
        width: 88%;
        max-width: none;
    }

    .list_languages > a {
        padding: 12px 16px;
    }

    #up_button {
        width: 48px;
        height: 48px;
        bottom: 6%;
        right: 4%;
    }

    .general_info img {
        width: clamp(16px, 5vw, 22px);
    }

    .social_info img {
        width: clamp(24px, 9vw, 32px);
    }
}

/* Mobile language grid */
@media screen and (max-width: 425px) {
    .list_languages {
        grid-template-columns: auto;
    }

    .list_languages > a {
        font-size: clamp(1.4rem, 8vw, 2rem);
    }
}

/* Landscape mode */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .header > a > img,
    .header > img {
        max-height: 60px;
    }

    #up_button {
        width: clamp(1.5rem, calc(0.786rem + 3.571vw), 2.5rem);
        height: clamp(1.5rem, calc(0.786rem + 3.571vw), 2.5rem);
    }
}

/* 4k and beyond support */
@media screen and (min-width: 2560px) {

    :root {
        --icon-width: 200px;
        --distance-sections: 100px;
    }

    html {
        scroll-padding-top: 20vh;
    }

    a { font-size: 3rem; }
    body.non_latin_font a:not(.no-font) { font-size: 2.8rem; }

    a.button,
    body.non_latin_font a.button {
        font-size: 2.6rem;
        padding: 28px 56px;
        border-radius: 60px;
        min-height: 88px;
    }

    h1 { font-size: 8rem; }
    body.non_latin_font h1 { font-size: 7rem; }

    p { font-size: 2.5rem; }

    .header {
        padding: 50px;
        gap: 40px;
    }

    .navigation_menu > button {
        width: 80px;
        height: 80px;
        font-size: 3rem;
    }

    .languages_grid {
        padding: 40px;
        row-gap: 20px;
        border-radius: 50px;
    }

    .language_title {
        padding: 20px;
    }

    .list_languages {
        grid-template-columns: repeat(3, auto);
        gap: 40px;
    }

    .list_languages > a {
        font-size: 5rem;
        padding: 28px 48px;
        border-width: 6px;
        border-radius: 40px;
    }

    #cross_language {
        gap: 10px;
        padding: 20px;
    }

    #cross_language > span {
        width: 50px;
        height: 6px;
    }

    #cross_language > span:nth-child(1) {
        transform: rotate(45deg) translate(10px, 2px);
    }

    #cross_language > span:nth-child(2) {
        transform: rotate(-45deg) translate(10px, -2px);
    }

    .swiper-slide {
        width: 88%;
        max-width: none;
    }

    .experience_selector {
        gap: 20px;
        margin-bottom: 60px;
    }

    .experience_header_icons > ul {
        column-gap: 40px;
        row-gap: 20px;
    }

    .experience_header_icons.interacted li.active > img {
        border-width: 10px;
        border-radius: 50%;
    }

    .research_header,
    .cc_header,
    .nature_header {
        padding: 80px;
        gap: 32px 48px;
    }

    .research_header > h1,
    .cc_header > h1,
    .nature_header > h1 {
        font-size: 9rem;
    }

    body.non_latin_font .research_header > h1,
    body.non_latin_font .cc_header > h1,
    body.non_latin_font .nature_header > h1 {
        font-size: 7rem;
    }

    .general_experience.active {
        padding: 80px;
    }

    .experience_contents > li {
        column-gap: clamp(40px, 6vw, 15%);
        row-gap: 8vh;
    }

    .experience_description {
        row-gap: 40px;
        flex: 1 1 640px;
    }

    .experience_imgs {
        flex: 1 1 500px;
    }

    .experience_imgs > img {
        max-width: 1000px;
    }

    .experience_disclaimer {
        padding: 80px;
    }

    .footer {
        padding: 10px 60px;
    }

    .informations {
        row-gap: 40px;
    }

    .general_info {
        row-gap: 20px;
    }

    .general_info a {
        font-size: 3rem;
    }

    .general_info img {
        width: 64px;
    }

    .social_info {
        margin-top: 3vh;
        column-gap: 40px;
    }

    .social_info img {
        width: 90px;
    }

    .social_info a {
        min-width: 110px;
        min-height: 110px;
    }

    hr.solid {
        border-top-width: 6px;
    }

    .bottom-bar {
        font-size: 2rem;
        gap: 24px;
        padding-top: 48px;
    }
}