:root {
    --bg-color: rgb(15, 15, 15);
    --text-main: #ffffff;
    --accent: #b3b3b3;
    --glass-bg: rgba(50, 50, 50, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

*::selection {
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar {
    width: 7px;
}

*::-webkit-scrollbar-thumb {
    background: rgb(255, 255, 255);
    border: 3px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    border: 0;
    background: rgba(255, 255, 255, 0.5);
}

*::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.2);
}

*::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0);
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica,
        Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    padding: 1rem 5%;
    display: flex;
    align-items: center;
    z-index: 100;
    gap: 1rem;
}

.glass-header p {
    color: var(--accent);
}

.glass-header a:not(h1 a) {
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
}

.glass-header h1 a {
    text-decoration: none;
    color: var(--text-main);
    filter: drop-shadow(0 0 0.2rem rgba(255, 255, 255, 0.5));
    font-weight: 300;
    transition: 250ms;
}

.glass-header h1 a:hover {
    font-weight: 600;
    filter: drop-shadow(0 0 0.4rem rgba(255, 255, 255, 0.5));
    animation: flyLink 5s ease-in-out infinite alternate;
}

.glass-header h1:has(a:hover) {
    animation: flyCont 5s ease-in-out infinite alternate;
}

@keyframes flyLink {
    0% {
        filter: drop-shadow(0 0 0.4rem rgba(255, 255, 255, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 0.6rem rgba(255, 255, 255, 0.5));
    }
}

@keyframes flyCont {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-3px);
    }
}


.hero {
    background: var(--glass-bg);
    backdrop-filter: blur(100px);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: calc(100% - 2rem);
    max-width: calc(800px - 2rem);
}

.hero h1 {
    font-size: 2.5rem;
    /* font-weight: 300; */
}

.hero p {
    font-size: 1.1rem;
    color: var(--accent);
}

.why {
    width: 100%;
    padding: 1rem 5%;
    min-height: 256px;
    display: grid;
    justify-items: center;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.why h1 {
    font-weight: 300;
    font-size: 2.5rem;
}

.why p {
    font-size: 1.1rem;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.post-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.post-card {
    background: var(--glass-bg);
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transition: 250ms;
}
.post-card:hover {
    transform: scale(1.01);
    background: rgba(50, 50, 50, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}
.post-card:active {
    background: rgba(50, 50, 50, 0.3);
}

.post-card img {
    width: 100%;
    height: 312px;
    object-fit: cover;
}
.post-card h2 {
    color: var(--text-main);
    text-decoration: none;
    margin: 4px 0;
}
.post-card p {
    color: var(--accent);
    margin: 4px 0 8px 0;
}
.post-card .date {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 0;
}
.post-card.viewed .date:after {
    content: " (Просмотрено)";
    color: var(--accent);
    font-style: italic;
    font-weight: 300;
}

.post-card.viewed h2 {
    font-weight: 400;
}

.markdown-body *::-webkit-scrollbar {
    height: 7px;
}

.markdown-body img {
    max-width: 100%;
    cursor: pointer;
    transition: 250ms;
}

.markdown-body img:hover {
    opacity: 0.9;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    text-decoration: none;
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    transition: 250ms;
}
.back-link:hover {
    transform: scale(1.01);
    background: rgba(50, 50, 50, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}
.back-link:active {
    background: rgba(50, 50, 50, 0.3);
}

footer {
    color: var(--accent);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 2rem;
    font-family: "consolas", monospace;
    border-top: 1px solid rgb(30, 30, 30);
    background: rgb(10, 10, 10);
}

footer div:last-child {
    text-align: right;
}

footer a {
    color: var(--text-main);
    filter: drop-shadow(0 0 0rem rgba(255, 255, 255, 0.5));
    transition: 250ms;
}

footer a:hover {
    font-weight: 600;
    filter: drop-shadow(0 0 0.4rem rgba(255, 255, 255, 0.5));
}

#imgView {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    justify-content: space-between; 
    align-items: center;
    padding: 20px;
    z-index: 10000;
    gap: 1rem;
    animation: fadeIn 250ms cubic-bezier(0,1,1,1);
}

@keyframes fadeIn {
    from {opacity: 0; scale: 0.9;}
    to {opacity: 1; scale: 1;}
}

#imgView img {
    max-width: 100%;
    max-height: calc(100% - 43.59px - 1rem);
    object-fit: contain;
    margin: auto;
}

#imgView > div {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-top: auto;
}

#imgView span {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    padding: 0.5rem 1rem;
    transition: 250ms;
    user-select: none;
    cursor: pointer;
}
#imgView span:hover {
    transform: scale(1.01);
    background: rgba(50, 50, 50, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}
#imgView span:active {
    background: rgba(50, 50, 50, 0.3);
}

@media screen and (max-width: 1000px) {
    .why {
        min-height: unset;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .why h1 {
        font-size: 1.5rem;
        font-weight: 400;
    }

    .why img {
        width: 100%;
        max-height: 512px;
        aspect-ratio: 1/1;
        object-fit: contain;
    }
}

@media screen and (max-width: 800px) {
    footer {
        padding: 1rem;
    }
}

@media screen and (max-width: 568px) {
    .glass-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .glass-header p {
        max-width: 100% !important;
    }

    .glass-header > div {
        display: none;
    }

    .bg-container {
        padding-top: calc(112.78px + 2rem) !important;
        margin-top: -112.78px !important;
    }

    footer div {
        display: flex;
        flex-direction: column;
    }

    body:has(.markdown-body) .why {
        top: 112.78px;
    }
}

/* TODO: 
- Поменять стиль хеадера (типо спутифай)
- Мобильная адатпация
- Главную страницу оформить с причиной зачем этот сайт
- Просмотр фотографий
*/