/* --- Global Styles --- */
* {
    font-family: "Inter", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style-type: none;
}

body {
    background: #f2f2f2;
    overflow-x: hidden;
	display: flex;
	flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

body.home {
	overflow-y: hidden;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

.wrap {
    width: 100%;
    max-width: 1248px;
    margin: 0 auto;
    padding: 0 1em;
    position: relative;
}

section {
    display: flex;
    align-items: center;
    justify-content: center;
}

body.home section {
    min-height: 100vh;
}

/* --- Buttons --- */
.buttons {
    display: flex;
    text-decoration: none;
    gap: 1em;
    padding: 1em 0;
    font-size: .8em;
    transition: opacity, .25s;
}

.buttons a {
    display: inline-block;
    text-decoration: none;
    padding: .75em;
    font-weight: 500;
    background: #fff0;
    color: #202020;
    border: 1px solid #707070;
    transition: background, hover, .25s;
}

.buttons a:hover {
    background: #fff;
    color: #000;
}

.buttons a.active {
    background: #fff;
    color: #000;
    border: 1px solid red;
}

/* --- Header & Navigation --- */
header {
    width: 100%;
    position: sticky;
    top: 0;
    left: 0;
    background: rgb(255 255 255 / .9);
    padding: 1em;
    z-index: 8888;
    font-size: 1.1em;
    transition: font-size .3s;
}

body.home header {
	position: fixed;
}

body.home, header.scroll {
    font-size: .9em;
}

header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header img {
    height: 2em;
}

header .burger {
    display: none;
    font-size: 1.5em;
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
}

header nav a {
    font-size: .85em;
    text-decoration: none;
    margin-left: 1em;
    color: #333;
	position: relative;
    display: inline-flex;
    align-items: center;
	
}

header nav a:last-child {
    background: #000;
    color: #fff;
    padding: .5em;
}

header nav a.active {
    color: #000;
}

header nav a.active:last-child {
    color: #fff;
}

header nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0;
    height: 2px;
    background: #000;
    transform: translateX(-50%);
	opacity: .2;
    transition: width, opacity, 0.35s ease;
    border-radius: 10px;
}

header nav a:hover::after { opacity: .6; width: 100%; }
header nav a.active::after { opacity: 1; width: 100%; }

/* --- Main --- */

main {
    margin: 5em auto 5em auto;
    display: flex;
    flex-direction: column;
    gap: 5em;
    width: 100%;
    max-width: 1248px;
    transition: opacity 0.3s ease;
}

body.home main {
    margin: 0 auto;
    overflow: hidden;
    max-width: none;
}

main.is-loading {
    opacity: 0.3;
    pointer-events: none; /* Prevent double clicking while loading */
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Cover Section --- */
#cover {
    width: 100%;
    height: 100vh;
    background-color: #838383;
    background-position: center;
    background-position: top;
    background-size: cover;
    background-repeat: no-repeat;
    flex-direction: column;
    color: #fff;
    gap: 2em;
    position: fixed;
    transform: scale(1);
    transition: transform, .25s;
	top: 0;
	left: 0;
    padding: 0 1em;
    text-align: center;
}

#cover:hover {
    transform: scale(1.02);
}

/*

body.day #cover { background-image: url(/assets/backgrounds/standing_day.webp); }
body.night #cover { background-image: url(/assets/backgrounds/standing_night.webp); }
body.meeting.day #cover { background-image: url(/assets/backgrounds/blog_day.webp); }
body.meeting.night #cover { background-image: url(/assets/backgrounds/blog_night.webp); }
body.hover.day #cover{ background-image: url(/assets/backgrounds/home_day.webp); }
body.hover.night #cover { background-image: url(/assets/backgrounds/home_night.webp); }


body.day #cover { background-image: url(/assets/backgrounds/home_day.webp); }
body.night #cover { background-image: url(/assets/backgrounds/home_night.webp); }
body.hover.day #cover { background-image: url(/assets/backgrounds/blog_day.webp); }
body.hover.night #cover { background-image: url(/assets/backgrounds/blog_night.webp); }

*/

body.day #cover { background-image: url(/assets/backgrounds/standing_day.webp); }
body.night #cover { background-image: url(/assets/backgrounds/standing_night.webp); }

#cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 1;
    animation: fadeOut 0.8s ease 0s forwards;
    z-index: 0;
}

@keyframes fadeOut {
    to { opacity: 0; }
}

#cover h2 {
    font-size: 3em;
}

#cover h2, #cover p {
    transition: filter 0.5s ease;
    filter: drop-shadow(2px 4px 4px black);
}

#cover .meeting {
    color: #fff;
    text-decoration: none;
    border: 1px solid;
    padding: .5em;
    background: rgba(0,0,0,.5);
    cursor: pointer;
}

#cover .buttons {
    opacity: 0;
    z-index: 1;
}

#cover:hover .buttons {
    opacity: 1;
}

#cover .buttons a {
    color: #fff;
    border: 1px solid #fff;
}

#cover .buttons a:hover {
    color: #000;
    border: 1px solid #000;
}

/* --- Calendar Drawer --- */
#cal-drawer {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 9999;
    overflow: hidden;
    max-width: 100%;
}

body.meeting #cal-drawer {
    right: 0;
}

body>*:not(#cal-drawer) {
    opacity: .85;
    transition: opacity, .25s;
}

body.meeting>*:not(#cal-drawer){
    opacity: .3 !important;
}

#cal-drawer iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#cal-drawer .close {
    cursor: pointer;
    padding: 10px;
    text-align: right;
    font-size: 24px;
    transition: transform .2s ease;
    position: absolute;
    right: .4em;
}

/* --- Profile Section --- */
#profile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1em;
    padding: 5em 1em;
    text-align: center;
}

#profile p {
    max-width: 600px;
}

#profile .companies img {
    height: 2.3em;
    margin: .5em 1em;
    filter: grayscale(100%);
    transition: filter, .25s;
}

#profile .companies img:hover {
    filter: grayscale(0);
}

/* --- Journey Section --- */
#journey {
    display: flex;
    flex-direction: column;
    gap: 1em;
    align-items: baseline;
    overflow: hidden;
}

#journey .list {
    display: flex;
    height: 215px;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 5em 0 3em 0;
    scroll-behavior: smooth;
}

#journey .list li {
    flex: 0 0 auto;
    width: 280px;
    height: 90px;
    padding: .5em 1.5em .5em 0;
    position: relative;
}

#journey .list li:after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #000;
    border: 3px solid #fff;
    position: absolute;
    left: 0;
}

#journey .list li:nth-child(odd) {
    border-bottom: 2px solid #000;
    display: flex;
    flex-direction: column;
    justify-content: end;
}

#journey .list li:nth-child(odd):after {
    bottom: -.5em;
}

#journey .list li:nth-child(even) {
    transform: translateY(calc(100% - 2px));
    border-top: 2px solid #000;
}

#journey .list li:nth-child(even):after {
    top: -.5em;
}

/* --- Counters --- */
#counters .numbers {
    clear: both;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding-top: 3em;
}

#counters .numbers div {
    border-left: 1px solid #c7c7c7;
    padding: 0 2em 0 1em;
    display: flex;
    flex-direction: column;
    margin-bottom: 1em;
}

#counters .numbers span {
    font-size: 4em;
}

/* --- Projects Section --- */
#projects {
    flex-direction: column;
    width: 800px;
    margin: 0 auto;
    position: relative;
}

#projects > .title {
	margin-bottom: 3em;
}

#projects .project {
    width: calc(100% - 2em);
    margin-left: 1em;
}

#projects .details {
    width: 800px;
    display: flex;
    flex-direction: row;
    background: #fff;
    margin-top: -2.75em;
    position: relative;
    opacity: 0;
    transform: translateX(1em);
    pointer-events: none;
    height: 3em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#projects .project:hover .details {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    height: auto;
}

#projects .details .info {
    width: 50%;
    padding: 1em;
    display: flex;
    flex-direction: column;
    gap: 1em;
    justify-content: center;
}

#projects .details .cover {
    width: 50%;
    background-position: 95% 45%;
    background-size: 30%;
    background-color: #fff;
    background-repeat: no-repeat;
}

#projects h3 {
	text-align: center;
	padding: .25em 0;
}

/* --- Blog Section --- */

#blog {
    display: flex;
    flex-direction: column;
    gap: 1em;
    align-items: baseline;
    overflow: hidden;
}

#blog .viewport {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5em;
    margin-top: 3em;
    padding-bottom: 2em;
}

#blog .viewport > div {
    color: #fff; /* Base color for text inside grid items */
    align-items: baseline;
}

#blog .viewport .cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

#blog .viewport .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

#blog .viewport .cover:hover img {
    filter: grayscale(0%);
}

#blog .viewport .info {
    display: flex;
    align-items: center;
    gap: 1em;
    margin: 1em 0;
}

#blog .viewport .category {
    background: #e6e6e6;
    color: #000;
    padding: 0.5em;
    font-size: 0.8em;
    border: 1px solid #c4c4c4;
}

#blog .viewport .time {
    color: #000;
    font-size: 0.8em;
}

#blog h2, 
#blog .viewport h3 {
    color: #000;
    margin: 0.5em 0;
}

#blog p, 
#blog .viewport p,
#post p,
#post .viewport p {
    color: #000;
    margin: 0.5em 0 2em 0;
    border-bottom: 1px solid #c4c4c4;
    padding-bottom: 1em;
}

#blog .viewport a {
    text-decoration: none;
    padding-bottom: 0.25em;
    display: inline-block;
    color: #000;
    width: fit-content;
    transition: transform 0.3s ease;
}

#post .cover {
    width: 100%;
    max-width: 500px;
    margin: 0 0 1em 1em;
    float: right;
}

/* --- Footer --- */

body.home footer {
    display: none;
}

footer .top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5em 0;
}
	
	footer .top .contacts a { margin-right: .5em; }
	footer .top .socials a { margin-left: .5em; }

footer .bottom {
    width: 100%;
    border-top: 1px solid #333;
    padding: 2em 0 1em 0;
    text-align: center;
    font-size: .85em;
}

footer .languages {
    font-size: .8em;
    width: 100%;
    padding: 1em 0 7em 0;
    text-align: center;
    color: #4496ff;
}

footer .languages a {
    text-decoration: none;
    color: #4496ff;
}

footer .top .contacts svg, footer .top .socials svg {
    width: 1.5em;
    height: 1.5em;
}

/* --- Media Queries --- */
@media (max-width: 1024px) {
    
	#counters .numbers { grid-template-columns: 1fr 1fr 1fr; }
    #projects { width: 100%; }
    #projects .project .details { width: 100%; }

}

@media (max-width: 978px) {
	
	#post .cover {
		margin: 0 0 1em 0;
		max-width: 100%;
		float: none;
	}
	
}

@media (max-width: 768px) {
    
    header .burger { display: block; }

    nav {
        position: absolute;
        top: calc(100% + 1em);
        left: 0;
        width: 100%;
        background: rgb(243 243 243 / 95%);
        display: none;
        flex-direction: column;
        padding: .5em 0;
    }
    nav.active { display: flex; }
    #counters .numbers { grid-template-columns: 1fr 1fr; }
    #projects .details { flex-direction: column; }
    #projects .details .cover { display: none; }

}

@media (max-width: 560px) {

    main {
        margin: 2em auto 2em auto;
    }

    .wrap { text-align: center; }
    #counters .numbers { grid-template-columns: 1fr; }
    #counters .numbers div { text-align: center; }
    #cal-drawer { right: -100%; width: 100%; }

}