* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    outline-offset: 0;
}

html {
    --loading: rgba(255,255,255,.8);
    --body-bg: #fff;
    --body-color: #000;
    --header-bg: #fff;
    --header-border: #eee; 
    --languages-color: #aaa;
    --languages-color-hover: #777;
    --languages-color-active: #000;
    --header-a-color: #000;
    --header-a-active: #eee;
    --menu-toggle-bg: #000;
    --header-mobile-nav-bg: #fff;
    --section-even-bg: #fafafa;
    --my-photo-bg: #ddd;
    --project-border: #eee;
    --project-link-bg: #eee;
    --project-link-hover: #e7e7e7;
    --post-box-shadow: #eee;
    --post-border: #eee;
    --category-bg: #fafafa;
    --category-color: #000;
    --link-bg: #222;
    --link-color: #fff;
    --input-color: #000;
    --input-border: #ddd;
    --input-outline: #ccc;
    --submit-bg: #222;
    --submit-color: #fff;
    --green: green;
    --red: red;
    --footer-border: #eee; 
}

html.dark {
    --loading: rgba(0,0,0,.8);
    --body-bg: #222;
    --body-color: #eee;
    --header-bg: #222;
    --header-border: #333; 
    --languages-color: #777;
    --languages-color-hover: #aaa;
    --languages-color-active: #eee;
    --header-a-color: #eee;
    --header-a-active: #333;
    --menu-toggle-bg: #eee;
    --header-mobile-nav-bg: #222;
    --section-even-bg: #1a1a1a;
    --my-photo-bg: #444;
    --project-border: #333;
    --project-link-bg: #333;
    --project-link-hover: #3d3d3d;
    --post-box-shadow: #2c2c2c;
    --post-border: #2c2c2c;
    --category-bg: #111;
    --category-color: #eee;
    --link-bg: #fff;
    --link-color: #000;
    --input-color: #fff;
    --input-border: #444;
    --input-outline: #aaa;
    --submit-bg: #fff;
    --submit-color: #000;
    --footer-border: #333; 
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    overflow-x: hidden;
    background-color: var(--body-bg);
    color: var(--body-color);
}

/* portfolio styles */

/* loading spinner */

.loading {
    position: fixed;
    z-index: 99999;
    background: var(--loading);
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    justify-content: center; 
}

/* form messages */

.form-message {
    display: none;
    position: fixed;
    z-index: 999;
    top: 70px;
    right: 50%;
    transform: translateX(50%);
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--body-color);
}

.form-message.success {
    background-color: var(--green);
}

.form-message.error {
    background-color: var(--red);
}

/* main */

main {
    width: 100%;
    min-height: calc(100dvh - 71px);
    display: flex;
    flex-direction: column;
    padding-top: 70px;
}

section {
    width: 100%;
    min-height: calc(50vh - 50px);
    display: flex;
    justify-content: center; 
    padding: 0 3%;
}

section:nth-child(even) {
    background-color: var(--section-even-bg);
}

section .content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 1280px;
    padding: 30px 0;
}

section h1 {
    font-weight: 600;
    font-size: 40px;
    margin-bottom: 30px;
    text-align: center;
}

section p {
    font-size: 18px;
    line-height: 150%;
}

/* home */

section:nth-child(1) {
    min-height: calc(100svh - 69px);
}

section:nth-child(1) .content {
    height: auto;
    align-items: center;
    padding-bottom: 120px;
}

section:nth-child(1) .info {
    width: 80%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

section:nth-child(1) .info .hello {
    font-size: 24px;
}

section:nth-child(1) .info .name {
    font-size: 64px;
    font-weight: 600;
    margin: 20px 0 30px 0;
    line-height: 50px;
}

section:nth-child(1) .info .subtitle {
    font-size: 28px;
}

section:nth-child(1) .info .buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

section:nth-child(1) .info .buttons > button {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--link-bg);
    color: var(--link-color);
    padding: 0 20px;
    padding-bottom: 3px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    margin: 0 5px;
    cursor: pointer;
    border: none;
    outline: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

section:nth-child(1) .info .buttons > button:focus {
    outline: 3px solid var(--input-outline);
}

section:nth-child(1) .scroll {
    position: absolute;
    bottom: 70px;
}

section:nth-child(1) .scroll img {
    position: relative;
    height: 32px;
    animation: scrollDownAnim 2s linear 1s infinite;
}

/* about */

section:nth-child(2) .about-content {
    width: 100%;
    height: calc(100% - 30px - 30px);
    display: flex;
    padding-bottom: 20px;
}

section:nth-child(2) .info {
    width: calc(100% - 400px);
    padding-right: 50px;
}

section:nth-child(2) .info p:not(:last-child) {
    margin-bottom: 20px;
}

section:nth-child(2) .image {
    width: 400px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

section:nth-child(2) .image .image-container {
    width: 100%;
    height: 400px;
    background: var(--my-photo-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
}

section:nth-child(2) .image img {
    width: 80%;
}

/* projects */

section:nth-child(3) .projects {
    display: flex;
    flex-direction: column;
}

section:nth-child(3) .projects .project {
    position: relative;
    display: flex;
    width: 100%;
    height: 350px;
    border: 1px solid var(--project-border);
		cursor: pointer;
}

section:nth-child(3) .projects .project:hover {
    box-shadow: 0px 7px 29px 0px var(--post-box-shadow);
}

section:nth-child(3) .projects .project:not(:last-child) {
    margin-bottom: 30px;
}

section:nth-child(3) .projects .project > div {
    height: 100%;
}

section:nth-child(3) .projects .project .info {
    width: 50%; 
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
}

section:nth-child(3) .projects .project .info > div:not(:last-child) {
    margin-bottom: 20px;
}

section:nth-child(3) .projects .project .info .top {
    display: flex;
    align-items: center;
}

section:nth-child(3) .projects .project .info .title {
    font-size: 32px;
    font-weight: 600;
}

section:nth-child(3) .projects .project .info .top img {
    position: relative;
    cursor: pointer;
    margin-left: 10px;
    height: 24px;
}

section:nth-child(3) .projects .project .info .top:hover img {
    animation: infoAnim 1.5s linear infinite;
}

section:nth-child(3) .projects .project .info .bottom {
    position: absolute;
    bottom: 30px;
}

section:nth-child(3) .projects .project .info .bottom > div:not(:last-child) {
    margin-bottom: 20px;
}

section:nth-child(3) .projects .project .info .bottom .technologies {
    display: flex;
    align-items: center;
}

section:nth-child(3) .projects .project .info .bottom .technologies img {
    height: 32px;
    margin-right: 5px;
    /* filter: grayscale(100%); */
    /* opacity: .5; */
}

section:nth-child(3) .projects .project .info .bottom .technologies img.php {
    height: 48px;
}

section:nth-child(3) .projects .project .info .bottom .technologies img.fancyapps {
    height: 28px;
}

section:nth-child(3) .projects .project .info .bottom .technologies img.vite {
    height: 28px;
}

section:nth-child(3) .projects .project .info .bottom .technologies img.tailwind {
    height: 24px;
}

section:nth-child(3) .projects .project .info .bottom .links {
    display: flex;
}

section:nth-child(3) .projects .project .info .bottom .links a {
    width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--project-link-bg);
    color: var(--body-color);
    text-decoration: none;
    padding-bottom: 3px;
    margin-right: 10px;
    border-radius: 5px;
    transition: .2s;
}

section:nth-child(3) .projects .project .info .bottom .links a:hover {
    background-color: var(--project-link-hover);
    transition: .2s;
}

section:nth-child(3) .projects .project .info .bottom .links a img {
    height: 20px;
    margin-right: 5px;
}

section:nth-child(3) .projects .project .image {
    width: 50%;
    display: flex;
    align-items: center;
    padding: 0 20px;
    overflow: hidden;
}

section:nth-child(3) .projects .project .image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.projects-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.projects-link a {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--link-bg);
    color: var(--link-color);
    text-decoration: none;
    padding: 0 20px;
    padding-bottom: 3px;
    border-radius: 5px;
    transition: .2s;
    font-weight: 600;
}

.projects-link a:focus {
    outline: 3px solid var(--input-outline);
}

/* blog */

.posts {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
}

.posts .no-post {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30vh;
}

.posts .post {
    position: relative;
    width: 350px;
    height: 400px;
    background-color: var(--body-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border: 1px solid var(--post-border);
}

.posts .post:hover {
    /* scale: 1.05; */
    box-shadow: 0px 7px 29px 0px var(--post-box-shadow);
}

.posts .post .image {
    width: 100%;
    height: 50%;
}

.posts .post .image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.posts .post .content {
    width: 100%;
    height: 50%;
    padding: 20px;
}

.posts .post .creation-date {
    /* margin-top: 10px;  */
}

.posts .post .title {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 24px;
}

.posts .post .subtitle {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    white-space: pre-wrap;
}

.posts .post .read-more {
    display: none;
}

.posts .post .category {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: var(--category-bg);
    color: var(--category-color);
    border-radius: 5px;
    padding: 5px 10px;
}

.blog-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.blog-link a {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--link-bg);
    color: var(--link-color);
    text-decoration: none;
    padding: 0 20px;
    padding-bottom: 3px;
    border-radius: 5px;
    transition: .2s;
    font-weight: 600;
}

.blog-link a:focus {
    outline: 3px solid var(--input-outline);
}

/* contact */

section:nth-child(5) form {
    display: flex;
    flex-direction: column;
    align-items: center;
}

section:nth-child(5) form input:not([type="submit"]),
section:nth-child(5) form textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    width: 95%;
    max-width: 400px;
    background: transparent;
    margin-bottom: 20px;
    padding: 0 10px;
    padding-bottom: 3px;
    font-size: 16px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    outline: none;
    color: var(--input-color);
}

section:nth-child(5) form input:focus,
section:nth-child(5) form textarea:focus {
    outline: 3px solid var(--input-outline);
}


section:nth-child(5) form input:not([type="submit"]) {
    height: 50px;
}

section:nth-child(5) form textarea {
    height: 200px;
    padding: 10px;
    resize: none;
}

section:nth-child(5) form input::placeholder,
section:nth-child(5) form textarea::placeholder {
    font-size: 16px;
}

section:nth-child(5) form input[type="submit"] {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    width: 150px;
    height: 40px;
    background-color: var(--submit-bg);
    color: var(--submit-color);
    font-weight: 600;
    font-size: 16px;
    padding-bottom: 3px;
    border: none;
    border-radius: 5px;
    transition: .2s;
    cursor: pointer;
}

/* projects and project page */

main.projects,
main.project {
    width: 100%;
    min-height: calc(100dvh - 70px);
    display: flex;
    align-items: center;
    padding: 0 3%;
    padding-top: 70px;
}

main.projects .content,
main.project .content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 20px 0;
}

main.projects .content {
    max-width: 1280px;
}

main.project .content {
	display: flex;
	flex-direction: column;
	align-items: center;
    max-width: 900px;
	font-size: 18px;
	line-height: 32px;
}

main.projects h1,
main.project h1 {
    font-weight: 600;
    font-size: 40px;
    margin-bottom: 40px;
    text-align: center;
}

/* projects page */

main.projects .all-projects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

main.projects .all-projects .project {
    width: 400px;
    min-height: 320px;
}

main.projects .all-projects .project .image {
    width: 100%;
    height: 230px;
}

main.projects .all-projects .project .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

main.projects .all-projects .project .title {
    font-size: 24px;
    font-weight: 600;
    margin: 15px 0;
    text-align: center;
}

main.projects .all-projects .project .title a {
    color: var(--body-color);
    text-decoration: none;
}

main.projects .all-projects .project .description {
	min-height: 24px;
	text-align: center;
  padding: 0 20px;
}


/* project page */

main.project .image img {
    width: 100%;
}

main.project video {
	max-width: 100%;
	height: auto;
}

main.project .description {
	width: 100%;
	max-width: 700px;
    margin: 30px 0;
}

main.project .description p {
    margin-bottom: 24px;
}

main.project .description p:last-child {
    margin: 0;
}

main.project .technologies {
	width: 100%;
	max-width: 700px;
    display: flex;
    flex-direction: column;
}

main.project .technologies p {
    margin-bottom: 20px;
}

main.project .technologies .images {
    display: flex;
    align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

main.project .technologies .images img {
    max-width: 64px;
    margin-right: 5px;
    /* filter: grayscale(100%); */
    /* opacity: .5; */
}

main.project .links {
    display: flex;
    margin-top: 30px;
	font-size: 16px;
}

main.project .links a {
    width: 100px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--project-link-bg);
    color: var(--body-color);
    text-decoration: none;
    padding-bottom: 3px;
    margin-right: 10px;
    border-radius: 5px;
    transition: .2s;
}

main.project .links a:hover {
    background-color: var(--project-link-hover);
    transition: .2s;
}

main.project .links a img {
    height: 20px;
    margin-right: 5px;
}


/* animations */

@keyframes scrollDownAnim {
    0% {bottom: 0;}
    10% {bottom: 15px;}
    20% {bottom: 0;}
    30% {bottom: 5px;}
    40% {bottom: 0;}
    50% {bottom: 0;}
    100% {bottom: 0;}
}

@keyframes infoAnim {
    0% {bottom: 0;}
    10% {bottom: 7px;}
    20% {bottom: 0;}
    30% {bottom: 3px;}
    40% {bottom: 0;}
    50% {bottom: 0;}
    100% {bottom: 0;}
}

/* responsiveness */

@media only screen and (max-width: 950px) {
    section:nth-child(2) .info {
        width: calc(100% - 300px);
    }

    section:nth-child(2) .image {
        width: 300px;
    }

    section:nth-child(2) .image .image-container {
        height: 300px;
    }
}

@media only screen and (max-width: 800px) {
    section:nth-child(3) .projects {
        align-items: center;
    }

    section:nth-child(3) .projects .project {
        width: 90%;
        max-width: 600px;
        height: auto;
            flex-direction: column-reverse;
    }

    section:nth-child(3) .projects .project > div {
        width: 100% !important;
    }

    section:nth-child(3) .projects .project .info {
        padding-top: 20px;
        min-height: 40%;
    }

    section:nth-child(3) .projects .project .info .bottom {
        position: static;
    }
    
    section:nth-child(3) .projects .project .image {
        padding: 5px;
        height: auto;
    }

    section:nth-child(3) .projects .project .image img {
        width: 100%;
        object-fit: cover;
    }
}

@media only screen and (max-width: 700px) {
    section:nth-child(2) .about-content {
        flex-direction: column-reverse;
    }

    section:nth-child(2) .about-content > div {
        width: 100%;
    }

    section:nth-child(2) .info {
        padding: 0;
    }

    section:nth-child(2) .image {
        padding-top: 20px;
        padding-bottom: 70px;
    }

    section:nth-child(2) .image .image-container {
        width: 300px;
    }
}

@media only screen and (max-width: 600px) {
    section h1 {
        font-size: 32px;
    }

    section:nth-child(1) .info .hello {
        font-size: 18px;
    }

    section:nth-child(1) .info .name {
        font-size: 48px;
        margin: 10px 0 20px 0;
    }

    section:nth-child(1) .info .subtitle {
        font-size: 24px;
    }

    section:nth-child(3) .projects .project .info .title {
        font-size: 24px;
    }
}

@media only screen and (max-width: 375px) {
    section:nth-child(1) .info .subtitle {
        font-size: 20px;
    }

    section:nth-child(1) .info .buttons {
        margin-top: 20px;
    }
}
