/* ===================================================================
   PORTFOLIO v1.0.2
   =================================================================== */

*,
*::before,
*::after{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

:root{
    --bg:rgb(1,1,1);
    --text:#f4f4f4;
    --gray:#b5b5b5;
    --accent:#4AA3FF;
    --pdf:#d93e3e;
    --radius:10px;
    --speed:.18s;
}

html{
    min-height:100%;
}

body{
    min-height:100%;
    background:var(--bg);
    color:var(--text);
    font-family:"Segoe UI", Tahoma, Arial, sans-serif;
    overflow-x:hidden;
}

body::before{
    content:"";
    position:fixed;
    inset:0;
    background:url("../images/texture.png") repeat;
    opacity:.04;
    pointer-events:none;
    z-index:-1;
}

.app{
    width:calc(100% - 50px);
    max-width:1850px;
    margin:auto;
}

/* HEADER */

.header{
    height:140px;
    background:url("../images/header.jpg") center center no-repeat;
    background-size:cover;
    border-radius:0 0 10px 10px;
    margin-bottom:38px;
    position:relative;
}

.nav{
    position:absolute;
    left: 148px;
    top:135px;
    display:flex;
    gap:34px;
    z-index:10;
}

.nav a{
    position:relative;
    display:inline-block;
    padding-bottom:6px;
    color:#ffffff;
    text-decoration:none;
    font-size:20px;
    font-weight:500;
    letter-spacing:.02em;
    transition:.18s;
    opacity:.92;
}

.nav a::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:2px;
    background:#ffffff;
    opacity:.9;
    transition:.18s;
}

.nav a:hover,
.nav a.active{
    color:var(--accent);
}

.nav a:hover::after,
.nav a.active::after{
    background:var(--accent);
    opacity:1;
}

/* MAIN */

.main{
    display:grid;
    grid-template-columns:minmax(0,76%) minmax(260px,24%);
    gap:30px;
}

.gallery-container{
    display:flex;
    flex-direction:column;
}

.gallery{
    height:620px;
    background:transparent;
    border:none;
    outline:none;
    border-radius:10px;
    overflow:hidden;
    display:flex;
    justify-content:center;
    align-items:center;
    position:relative;
    box-shadow:none;
}

.gallery img{
    width:100%;
    height:100%;
    object-fit:contain;
    user-select:none;
    cursor:pointer;
    opacity:1;
    transition:opacity .18s ease;
    -webkit-user-drag:none;
    -webkit-touch-callout:none;
}
.gallery img:not([src]),
.gallery img[src=""]{
    display:none;
}

.gallery img.fade{
    opacity:0;
}

.gallery-empty{
    position:absolute;
    background:transparent;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#999;
    font-size:18px;
    letter-spacing:.03em;
}

/* CONTROLS */

.gallery-controls{
    display:flex;
    justify-content:center;
    gap:12px;
    margin-top:18px;
}

.gallery-controls button{
    width:42px;
    height:36px;
    border:none;
    border-radius:8px;
    background:#202020;
    color:#ffffff;
    font-size:16px;
    cursor:pointer;
    transition:var(--speed);
}

.gallery-controls button:hover{
    background:var(--accent);
}

.gallery-controls button:active{
    transform:scale(.97);
}

.gallery-controls button:disabled{
    opacity:.35;
    cursor:default;
    background:#202020;
}

/* RIGHT COLUMN */

.sidebar{
    padding:4px 0;
}

.section-title{
    display:none;
}

.sections{
    display:flex;
    flex-direction:column;
}

.section{
    display:flex;
    align-items:center;
    justify-content:space-between;
    height:40px;
    padding-left:12px;
    border-left:3px solid transparent;
    cursor:pointer;
    transition:var(--speed);
}

.section:hover,
.section.active{
    color:var(--accent);
    border-left-color:var(--accent);
}

.section-name{
    flex:1;
    font-size:15px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.section-pdf{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    width:16px;
    height:16px;
    margin-left:10px;
    opacity:.9;
    cursor:pointer;
    transition:var(--speed);
}

.section-pdf img{
    width:16px;
    height:16px;
    display:block;
}

.section-pdf:hover{
    transform:scale(1.1);
    opacity:1;
}

.section-pdf::after{
    content:"Скачати PDF";
    position:absolute;
    right:24px;
    top:50%;
    transform:translateY(-50%);
    padding:5px 10px;
    background:#222;
    color:#ddd;
    font-size:12px;
    border-radius:6px;
    white-space:nowrap;
    opacity:0;
    pointer-events:none;
    transition:var(--speed);
}

.section-pdf:hover::after{
    opacity:1;
}

/* MESSAGE BAR */

.message-bar{
    margin-top:22px;
    height:48px;
    display:flex;
    justify-content:center;
    align-items:center;
    border-top:1px solid rgba(255,255,255,.08);
}

#messageText{
    font-size:17px;
    color:#cfcfcf;
    letter-spacing:.02em;
    opacity:1;
    transition:opacity .3s;
}

#messageText.fade{
    opacity:0;
}

/* VIEWER */

.viewer{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.88);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
    backdrop-filter:blur(2px);
}

.viewer.hidden{
    display:none;
}

.viewer img{
    max-width:95vw;
    max-height:94vh;
    object-fit:contain;
    border-radius:10px;
    box-shadow:0 0 40px rgba(0,0,0,.5);
}

#viewerClose{
    position:absolute;
    top:20px;
    right:28px;
    color:white;
    font-size:42px;
    cursor:pointer;
    transition:var(--speed);
    user-select:none;
}

#viewerClose:hover{
    color:var(--accent);
}

/* STATIC PAGES */

.page{
    max-width:900px;
    padding:60px 0;
}

.page h1{
    font-size:36px;
    margin-bottom:20px;
}

.page p{
    color:#cfcfcf;
    font-size:18px;
}

/* HELPERS */

.hidden{
    display:none !important;
}

::selection{
    background:var(--accent);
    color:white;
}

button:focus,
a:focus{
    outline:none;
}

a{
    color:inherit;
}

a:hover{
    text-decoration:none;
}

/* SCROLLBAR */

::-webkit-scrollbar{
    width:10px;
}

::-webkit-scrollbar-track{
    background:#111;
}

::-webkit-scrollbar-thumb{
    background:#3a3a3a;
    border-radius:20px;
}

::-webkit-scrollbar-thumb:hover{
    background:#565656;
}

/* RESPONSIVE */

@media (max-width:1200px){
    .main{
        grid-template-columns:1fr;
    }

    .sidebar{
        margin-top:25px;
    }
}

@media (max-width:900px){
    .app{
        width:calc(100% - 20px);
    }

    .header{
        height:110px;
    }

    .nav{
        left:20px;
        top:70px;
        gap:18px;
    }

    .gallery{
        height:420px;
    }

    .gallery-controls button{
        width:38px;
        height:34px;
        font-size:14px;
    }

    .message-bar{
        height:44px;
    }
}

.page{
    max-width:1400px;
    margin:0 auto;
    padding:10px 0 40px;
}

.page-content h1{

    font-size:28px;
    font-weight:600;
    color:#ffffff;

    margin-bottom:18px;

}

.page-content h2{

    font-size:20px;
    font-weight:600;

    color:var(--accent);

    margin-top:26px;
    margin-bottom:10px;

}

.page-content p{

    font-size:18px;

    line-height:1.42;

    color:#d0d0d0;

    margin-bottom:5px;

}

.page-list-item{
    position:relative;
    padding-left:22px;
}

.page-list-item::before{
    content:"•";
    position:absolute;
    left:0;
    color:var(--accent);
}

.page-space{

    height:12px;

}
}
