html{
    overfow: hidden;
}

body{
	// font-family: 'Open Sans', open-sans;
	font-family: $sansfont;
	background-color: $lightgray;
	color: #333;
    @include transition(background-color 1s);
}

article{
    overflow: hidden;
}

hr.thick{
    border: none;
    height: .6rem;
    background-color: rgba(2, 17, 34, .5);
    margin: 1.5em 0;
}

body > header{
    position: fixed;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    -webkit-align-items: center;
    -webkit-justify-content: flex-start;
    justify-content: flex-start;
    width: 100%;
    min-height: 55px;
    background-color: black;
    z-index: 50;
    @include transform(translateZ(0));

    img{
        border-right: 1px solid rgba(255, 255, 255, .5);
        vertical-align: middle;
    }

    h2{
        margin-left: 1em;
        color: white;
        vertical-align: middle;
    }

    button{
        border: 0;
        background-color: transparent;
        border-left: 1px solid rgba(255, 255, 255, .5);
        display: inline-block;
        padding: 10px;
        height: 60px;
        color: white;
        
        &.active, 
        .no-touch &:hover {
            background-color: $blue;
        }
    }
    
    #sort-btn{
        margin-left: auto;
        margin-right: 0;
    }
}

sup{
    vertical-align: super;
    font-size: .5rem;
}

article{
    overflow: hidden;
}

blockquote{
    width: 70vw;
    margin: auto;
    padding: .4em 0;
    font-family: $seriffont;
    font-size: 2rem;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
    border-top: 1px solid rgba(0, 0, 0, .1);
    border-bottom: 1px solid rgba(0, 0, 0, .1);
}

#beacon{
    position: absolute;
    height: 1px;
    width: 42px;
}

#main{
	overflow-x: hidden;
}

#share-tools{
    display: none;
    position: absolute;
    right: 10px;
}

#tag-holder{
    margin-top: 10px;
    width: 400px;
}

.square{
    display: inline-block;
    position: relative;
    padding: .2em;
    width: 40px;
    height: 40px;
    color: $blue;
    vertical-align: top;
    font-size: .8rem;
    font-weight: bold;
    border: 2px solid $blue;
    cursor: pointer;
    -webkit-box-sizing: border-box;
    @include transition(none);

    &:hover{
        border: 2px solid rgba(77, 88, 236, .2);
        background: $blue;
        color: $lightgray;

        svg polygon, svg path{
            fill: $lightgray;
        }
    }

    .square-label{
        position: absolute;
        bottom: 5px;
        right: 5px;
    }

    svg{
        position: absolute;
        top: 0;
        left: 0;
    }
}

.tag{
    display: inline-block;
    padding: .75em 1.5em;
    margin: 0 0 4px;
    height: 40px;
    color: rgb(154, 160, 167);
    text-transform: uppercase;
    background-color: rgb(245, 245, 246);
    -webkit-box-sizing: border-box;
    @include transition(none);

    &:hover{
        color: rgb(245, 245, 246);
        background-color: rgb(154, 160, 167);
    }
}

.popup{
    display: none;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 90;
    @include perspective(3000);
}

.popup-box{
    position: relative;
}

.popup-hit-area{
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    cursor: pointer;
}

.popup-close{
    position: absolute;
    top: 0px;
    right: 0px;
    width: 50px;
    height: 50px;
    background-image: url(../assets/images/close-btn.svg);
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    cursor: pointer;

    @include transition(background-color 1s);

    &:hover{
        background-color: $blue;
    }

    &.dark{
        background-image: url(../assets/images/close-btn-dark.svg);
    }
}

#popup-elevation, #popup-forest{
    height: 100%;
    // background-color: rgba(0, 0, 0, .5);

    .popup-box{
        margin: 20vh auto;
        width: 600px;   
        height: 433px;
        background: white;
        box-shadow: 0px 3px 10px rgba(0, 0, 0, .3);
    }
}

#popup-elevation{
    svg{
        position: absolute;
        bottom: 0;
    }
}

.low-perf .popup{
    -webkit-transition: opacity 0.3s ease-out;
    opacity: 0;
    
    .popup-box{
        -webkit-transition: -webkit-transform 0.3s ease-out;
    }
    
    &.opening{
        display: block;
        opacity: 0;

        .popup-box {
            -webkit-transform: translateZ(-600px) rotateX(90deg);
        }
    }
    
    &.opened{
        opacity: 1;
        display: block;
        
        .popup-box {
            -webkit-transform: translateZ(0px) rotateX(0deg);
        }
    }
    
    &.closing{
        display: block;
        opacity: 0;
        -webkit-transition: opacity 0.2s ease-out;
    }
}

#popup-video{

    z-index: 101; // Push above overlayToggle

    .popup-box{
        position: absolute;
        background-color: #333;
        opacity: 0;
        overflow: hidden;

        video{
            position: absolute;
            top: 50%;
            left: 50%;
            opacity: 0;
            background: black;
        }
    }

    .video-controls{
        position: absolute;
        bottom: 0;
        height: 50px;
        background: rgba(0, 0, 0,0.8);
        left: 0;
        width: 100%;
        
        button{
            background: none;
            border: none;
            width: 100%;
            height: 100%;
        }
        
        .playpause{
            position: absolute;
            bottom: 0;
            left: 0;
            width: 50px;
            height: 50px;
            
            button{
                cursor: pointer;
                min-width: 30px;
                background-image: url(../assets/images/video-ui-play.svg);
                background-repeat: no-repeat;
                background-position: center;
                @include transition(background-color 1s);

                &.pause{
                    background-image: url(../assets/images/video-ui-pause.svg);
                }
                
                &:hover{
                    background-color: $blue;
                }
            }
        }
        
        
        input.time-bar{
            position: relative;
            display: block;
            width: 74%;
            margin: 24px 0 0 10%;
            -webkit-appearance: none;
            background: rgba(255, 255, 255, 0.5);
            // border-radius: 25px;
            // height: 15px;
            height: 6px;
            z-index: 1;
            
            &::-webkit-slider-thumb {
                -webkit-appearance: none;
                width: 25px;
                height: 6px;
                // background: #666;
                background: $blue;
                // background: transparent;
                // border-radius: 50%;
                position: relative;
                z-index: 2;
            }
        }
        
        .togglemute{
            position: absolute;
            right: 0;
            bottom: 0;
            width: 50px;
            height: 50px;
            
            button {
                cursor: pointer;
                // min-width: 30px;
                // padding: 0 8px 0 0;
                background-image: url(../assets/images/video-ui-sound-on.svg);
                background-repeat: no-repeat;
                background-position: center;
                @include transition(background-color 1s);
                
                &.mute{
                    background-image: url(../assets/images/video-ui-sound-off.svg);
                }

                &:hover{
                    background-color: $blue;
                }
            }
        }
        
        .video-time{
            position: absolute;
            right: 6%;
            bottom: 0;
            color: white;
            font-size: .9rem;
            line-height: 50px;
            width: 9%;
            text-align: center;
            text-shadow: 0px 0px 2px #000;
        }
    }
}

#cover{
    height: 50vh;
	background-image: $img_cover;
	background-size: auto 100vh;
	background-repeat: no-repeat;
	background-position: 30% center;
    // background-attachment: fixed;
	@include transition(opacity .2s ease-out);

    .high-perf &{
        height: 90vh;
        @include transition(height .2s ease-in-out);
    }

    .high-perf &.resolve{
        @include transition(height 2s ease-in-out);
        height: 50vh;
    }
}

time{
    display: block;
	margin-top: 5rem;
    color: $blue;
    font-weight: bold;
    font-size: .8rem;
}

h1{
	margin-top: .2em;
    margin-bottom: 1rem;
	font-size: 156px;
	font-size: 5rem;
	font-weight: bold;
	letter-spacing: -.03em;
}

i{
	font-style: italic;
}

a{
	color: $blue;
	text-decoration: none;
    @include transition(color .2s ease-out);
    
    &:hover{
        color: $lightblue;
    }
}

section{
	position: relative;
}

.clear{
    clear: both;
}

.subhead{
	display: block;
    font-size: 1.2rem;
	font-family: $seriffont;
	font-style: italic;
	line-height: 1.8;
	margin: 1em 0 2em 0;
}

.byline{
    font-size: .8rem;
    margin: 2rem 0;
	line-height: 2;
	text-transform: uppercase;

    a{
        font-weight: bold;
    }
}

.col{
	padding: 0 1em;
	max-width: 35em;
	margin: auto;
	margin-left: 15vw;
}

.drop-caps{
    float: left;
    //margin-top: .1em;
	margin-top: .05em;
	font-size: 9em;
	// color: $blue;
	// font-size: 9em;
	// font-weight: bold;
	// line-height: .8;
    // border-radius: 3em;
    width: 120px;
    height: 110px;
    background-image: url(../assets/images/drop-caps.svg);
    background-repeat: no-repeat;
    -webkit-shape-outside: ellipse(50% 43%);
    shape-outside: ellipse(50% 43%);
}

.img{
    opacity: 0;
    @include transition(opacity 1s ease-out);
}

p{
	// margin: 2ex 0;
	margin: 1.9em 0;
	line-height: 1.9;
	text-align: justify;
	text-indent: 1.5em;

	&.first{
		text-indent: 0;
	}
}

@mixin dropdown-arrow {
    &:after {
        content: '\00A0';
        width: 8px;
        margin-left: 2px;
        float: right;

        background: {
            image: url(../assets/images/arrow-down.svg);
            repeat: no-repeat;
            position: center;
        }
    }
}

#sort-btn{
    text-transform: uppercase;
    padding: 10px 15px;
    font-weight: bold;
    cursor: pointer;

    @include dropdown-arrow;
}

#search-wrap{
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    width: 60px;
    cursor: pointer;
    @include transition(width 0.5s ease-out);
}

#search-form{
    display: inline-block;
    
    input{
        padding: 2px;
        background-color: black;
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.5);
        font-size: 1rem;
        width: 100%;
        opacity: 0;
        box-sizing: border-box;
        @include transition(opacity 0.3s ease-out);
    
        &::-webkit-input-placeholder{
            color: #555;
        }
    }
}

#search-btn{
    width: 60px;
    vertical-align: middle;
    background-image: url(../assets/images/search-icon.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.7rem;
}

#search-wrap.expanded{
    width: 230px;
    
    #search-form{
        display: inline-block;
        width: 155px;
    }
    
    input{
        opacity: 1;
    }
}

#main {
    @include transition( transform 0.5s, -webkit-filter 0.5s );
    -webkit-filter: none;
}

body.withSidebar #main {
    -webkit-filter: opacity(75%) blur(2px);
    @include transform(translateZ(0));
}

#comments-btn{
    width: 106px;
    background-image: url(../assets/images/head-icon.svg);
    background-repeat: no-repeat;
    background-position: 45px;
    margin-right: 0px;
    padding-left: 30px;
    padding-right: 30px;
    cursor: pointer;
    
    @include dropdown-arrow;

    #comment-count{
        background-color: #FFDB4E;
        color: black;
        width: 15px;
        height: 15px;
        line-height: 15px;
        font-weight: bold;
        float: left;
        pointer-events: none;
    }
}

#overlayToggle{
    position: fixed;
    padding: 1em;
    bottom: 0;
    height: 2ex;
    width: 100%;
    color: white;
    font-family: indie-flower;
    background: rgba(0, 0, 0, .2);
    z-index: 50;
    cursor: pointer;
    @include transition(background .2s linear);

    &:hover{
        background: rgba(0, 0, 0, .5);
    }
}

#item-list{
    display: none;
    position: fixed;
    top: 60px;
    width: $sidebar_width;
    // bottom: 0;
    right: -$sidebar_width;
    max-height: -webkit-calc(100% - 60px);
    background-color: $lightgray;
    z-index: 15;
    border-top: 1px solid rgba(255,255,255,0.5);
    border-left: 1px solid black;
    border-bottom: 1px solid black;
    overflow-y: auto;
    overflow-x: hidden;
    
    @include transition(right 0.3s);
    
    &.opening{
        display: block;
    }
    
    &.opened{
        display: block;
        opacity: 1;
        right: 0;
    }
    
    &.closing{
        display: block;
        @include transition(right 0.2s);
    }
    
    h3{
        line-height: 2.5rem;
        margin: 0;
        font-size: 0.7rem;
        text-align: center;
        text-transform: uppercase;
        text-indent: 0;
        background: black;
        color: white;
    }
    
    #comment-list{
        max-height: 80%;
    }
    
    .comment_entry{
        margin: 15px;
        
        textarea{
            width: 100%;
            box-sizing: border-box;
            font-size: .8rem;
            height: 1.5rem;
            @include transition(height 0.4s);
        }
        
        textarea:focus{
            height: 4rem;
        }
        
        button{
            display: inline-block;
            text-transform: uppercase;
            border: 1px solid #bbb;
            color: #777;
            background-color: transparent;
            margin: 10px 10px 0 0;
            font-size: .8rem;
        }
        
        button:hover{
            background: white;
        }
    }
    
    article {
        margin: 15px;
        border-bottom: 1px solid #BBB;
        max-height: 260px;
        overflow-y: hidden;
        position: relative;
    
        header {
            clear: both;
            position: static; 
            background-color: $lightgray;
            @include perspective(300px);
        }
    
        .avatar{
            width: 50px;
            height: 50px;
            display: inline-block;
            background-image: url(../assets/images/head-icon.svg);
            background-repeat: no-repeat;
            background-position: 50% 50%;
            background-color: #555;
            background-size: 100%;
            float: left;
            margin-right: 15px;
            // @include transform( scale(0.9) rotateY(50deg) );
            @include transform-origin( 50% );
        }
        h4{
            display: block;
            height: 25px;
        }
        time{
            margin-top: 0;
            display: inline-block;
            height: 25px;
        }
        
        p{
            text-indent: 0;
            line-height: 1.5rem;
            margin: .5rem 0;
            font-size: .9rem;
        }

        p.overflow {
            position: absolute;
            bottom: 0px;
            background: white;
            width: 100%;
            background-color: $lightgray;
        }
    }
}

#content{
	-webkit-flow-into: content;
    // widows: 3; 
    // orphans: 3;
}

.region{
	-webkit-flow-from: content;
}

#region1{
	height: 40ex;
}

#region2{
	height: 39ex;
        max-width: 375px;
}

#region2-1{
        height: 21ex;
}

#region3{
    float: right;
    width: 30em;
    max-width: 40vw;
	height: 120ex;
    margin-top: 1.5em;
    margin-right: 3em;
}

#region5{
    position: absolute;
    // top: 88.5ex;
    left: 50%;
    margin-top: 1.5em;
    padding-top: 47em;
	width: 27em;
    height: 35ex;
	max-height: 80vh;
}

#region6{
    position: relative;
	height: 55ex;
    max-width: 35em;
    margin: 0 auto;
}

#section78{
   max-width: 35em;
   margin: auto;
   margin-right: 15vw;
}

#region7{
   height: 100ex;
   max-height: 60vh;
}

#section9{
    margin: auto;
    margin-right: 15vw;
	max-width: 35em;
}

#region9{
	// height: 190px;
	// height: 24ex;
    height: 21.4ex;
}

#region10{
    margin-left: 80px;
    // height: 340px;
    height: 363px;
}

#region11{
    margin-bottom: 2em;
    margin-left: 1em;
}

#layers{
    height: 600px;
    margin-bottom: calc(2ex + 2em);
}

#video-btn{
        position: absolute;
	right: -300px;
	color: #666;
	cursor: pointer;
	z-index: 10;
    opacity: .5;
    @include transform(translateZ(0));
    @include transition(opacity 1s);

    &.in{
        opacity: 1;

        .play-icon{
		    @include transform(scale(.9));
        }
    }

    &:hover{
		.img-video{
			-webkit-filter: none;
		}

		.play-icon{
			@include transform(scale(1));
		}
	}

	.img-video{
		@include transition(all .5s ease-out);
		-webkit-filter: sepia(.5) grayscale(.5);
	}

    .play-icon{
        vertical-align: middle;
        display: inline;
		@include transform(scale(0));
		@include transition(-webkit-transform .2s ease-out);
	}

	figcaption{
		box-sizing: border-box;
		position: absolute;
		width: 100%;
		bottom: 0px;
		padding: 1em;
		font-size: .8rem;
		line-height: 1.7;
		background-color: rgba(0, 0, 0, .7);

		.video-label{
            float: left;
			display: inline-block;
			color: $lightblue;
			line-height: 3em;
			padding-bottom: 1em;

			svg{
				display: inline;
				vertical-align: middle;
			}

			div{
				display: inline;
				margin-left: 1em;
				text-transform: uppercase;
			}
		}


		.video-label-text{
			float: right;
			width: 50%;
			color: #eee;
			text-align: right;

			h5{
				font-weight: bold;
			}

			.balance{
				display: inline-block;
				// height: 5ex;
			}
		}
	}
}

.img-mist{
    height: 80ex;
	width: 50%;
	margin: 2em 0;
	background-image: $img_mist;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
    cursor: pointer;
}

#img1{
	position: relative;
    float: right;
    right: 0px;
	opacity: .2;
    z-index: 2;
    -webkit-filter: grayscale(40rem);

    // @include transition(opacity .4s, -webkit-filter .4s linear .4s);
    @include transform(translateZ(0));
    @include transition(opacity .4s linear .4s, -webkit-filter .4s linear .4s);

    &.in{
        opacity: 1;
        -webkit-filter: grayscale(0%);
    }
}

#img2{
    position: relative;
	height: 40rem;
	max-height: 600px;
	margin: 10vh 0;
	// margin: 1em 0;
	background-image: $img_bottom;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center bottom;
    -webkit-filter: grayscale(100%);
    @include transform(translateZ(0));
    @include transition(-webkit-filter .4s linear .5s);

    &.in{
        -webkit-filter: none;

        .copy{
            opacity: 1;
        }
    }

    .copy{
        position: absolute;
        bottom: 0;
        right: 0;
        max-width: 30em;
        height: 22ex;
        margin-right: 5em;
        padding: 2em;
        color: rgba(0, 0, 0, .7);
        font-family: $seriffont;
        font-size: 1.1rem;
        font-style: italic;
        line-height: 1.8;
        text-align: justify;
        opacity: 0;
        @include transition(opacity 1s linear 1s);
    }
}

.shapes * #img2 .copy .shape{
        float: left;
        width: 100%;
        height: 100%;
        -webkit-shape-outside: polygon(0 50%, 50% 0, 0 0);
        shape-outside: polygon(0 50%, 50% 0, 0 0);
}

#img3{
	height: 90vh;
	max-height: 600px;
	// margin: 2em 0;
	margin: 10vh 0;
	background-image: $img_dark;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
    opacity: .1;
    @include transform(translateZ(0));
    @include transition(opacity .4s ease-out);

    &.in{
        opacity: 1;

        .copy{
            opacity: 1;
        }
    }

    .copy{
        position: absolute;
        bottom: 0;
        max-width: 30em;
        height: 25ex;
        padding: 2em;
        color: #fafafa;
        font-family: $seriffont;
        font-size: 1.1rem;
        font-style: italic;
        line-height: 1.8;
        opacity: 0;
        @include transition(opacity 1s ease-out 1s);
    }
}

.shapes * #img3 .copy .shape{
    float: right;
    width: 100%;
    height: 100%;
    -webkit-shape-outside: polygon(40% 0, 80% 100%, 100% 100%, 100% 0);
    shape-outside: polygon(40% 0, 80% 100%, 100% 100%, 100% 0);
}

#img4{
    float: left;
    margin-left: -350px;
}

#figureTree{
    position: absolute;
    // top: 850px;
    right: 100%;
    width: 20vw;
    max-width: 300px;
    margin-right: 4em;
    font-size: .7rem;
    font-family: $seriffont;
    font-style: italic;
    line-height: 1.2;

    img{
        float: left;
        padding: 0 1.5em .5em 0;
    }

    p{
        margin-top: 0;
        text-align: left;
	    text-indent: 0;
    }

    a{
        font-size: 1rem;
    }
}

#asideBook{
    float: left;
    margin-left: -300px;
    width: 300px;
    font-size: .8rem;
    
    i{
        font-family: $seriffont;
        line-height: 2em;
        color: gray;
        font-size: .7rem;
    }

    hr{
        // margin: 1em 0;
        // border: 0;
        // height: 1px;
        // background: black;
    }

    b{
        display: block;
        font-weight: bold;
        // margin-left: -1em;
        margin-bottom: 1em;

        span{
            color: $yellow;
            padding-right: .5em;
        }
    }

    p{
        margin-top: 0;
        margin-bottom: 1em;
        text-align: left;
	    text-indent: 0;
    }
}

#ad1{
	height: 90px;
	background: #ccc;
	margin: 2em 0;
    padding: 5px 0;

    img{
        display: block;
        margin: auto;
        background: black;
    }
}

#ad2{
	position: absolute;
	right: 0px;
	height: 300px;
	width: 320px;
	background: #ccc;
}

#ad3{
	display: none;
	position: absolute;
	left: 105%;
	bottom: 0px;
	height: 100vh;
	width: 320px;
	background: #ccc;	
}

#making{
    background: red;
}
