@import url('https://fonts.googleapis.com/css2?family=Geist:ital,wght@0,100..900;1,100..900&display=swap');

html {
    scroll-behavior: smooth;
}

:root {

    color-scheme: light dark;

    --color-main: light-dark(#fff, #0A0A0A);
    --color-card: light-dark(#FFFFFF, #171717);
    --color-border: light-dark(#e7e7e7, #242424);
    --color-links-bg: light-dark(#e7e7e7, black);
    --color-primary: light-dark(#000, #262626);
    --color-secondary: #b60d0d;

    --color-gradient: light-dark(rgba(255, 255, 255, 0.2), rgba(34, 34, 34, 0.2));

    --color-shadow: light-dark(#ebebeb, rgba(0, 0, 0, 0));
    --color-shadow-projects: light-dark(grey, rgba(0, 0, 0, 0));

    --font-main: "Geist", sans-serif;
    --rounded-size: 12px;

    --shadow-card: 0 10px 20px var(--color-shadow);
    --transition-time: 0.2s;
}

.hidden {
    display: none;
}

body {
    font-family: var(--font-main);
    background: var(--color-main);
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.container {
    margin-inline: auto;
    padding-inline: 12px;
    width: 100%;

    @media(width >=576px) {
        max-width: 540px;
    }

    @media(width >=768px) {
        max-width: 720px;
    }

    @media(width >=1024px) {
        max-width: 960px;
    }

    @media(width >=1280px) {
        max-width: 1140px;
    }

    @media(width >=1536px) {
        max-width: 1440px;
    }
}

.mobile-menu-btn {

    @media(width > 768px) {
        display: none;
    }
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    text-align: center;
    width: 100%;
    background: var(--color-main);
    border-bottom: 1px solid var(--color-border);
    z-index: 201;

    &.open-menu {
        display: block;
    }

    @media (width > 768px) {
        display: none;
    }
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: .3s;

    &.show-overlay {
        opacity: 1;
        visibility: visible;
    }
}

.btn {
    background: var(--color-primary);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    column-gap: 10px;
    border-radius: var(--rounded-size);
    display: inline-flex;
    color: white;
    transition: var(--transition-time);

    &:hover {
        background: #464646;
        transform: translateY(-2px);
    }
}

.btn-default {
    background: var(--color-primary);
    color: white;
    display: block;
    padding: 12px;
    border-radius: var(--rounded-size);
}

.btn-full {
    width: 100%;
    border-radius: 8px;
}

.btn-dashed {
    padding: 12px 16px;
    border: 1px dashed var(--color-border);
    display: inline-flex;
    align-items: center;
    column-gap: 10px;
    border-radius: 50px;
}

.section-title {
    font-size: clamp(30px, 3vw, 50px);
    letter-spacing: 12px;
}

.header {
    position: fixed;
    border-block: 1px solid var(--color-border);
    width: 100%;
    top: 0;
    left: 0;
    background: var(--color-main);
    z-index: 9999;
}

.border-section {
    border-inline: 1px dashed var(--color-border);
}

.wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: 8px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
}

.menu {
    column-gap: 30px;
    display: none;

    @media(width > 768px) {
        display: flex;
    }
}

.header-box {
    display: flex;
    align-items: center;
    column-gap: 10px;
}

.header-lang {
    display: flex;
    border-radius: 50px;
}

.btn-lang {
    display: block;
    padding: 3px 10px;
    border-radius: 50px;
}

.lang-active {
    background: black;
    color: white;
}

.link {

    display: block;
    padding: 8px 12px;
    border-radius: 50px;
    font-size: 15px;
    transition: var(--transition-time);

    &:hover {
        background: var(--color-links-bg);
    }
}

.mobile-link {
    display: block;
    padding: 20px;
    border-radius: 50px;
    font-size: 20px;
    transition: var(--transition-time);
}

.btn-theme {

    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: .3s;

    &:hover {
        transform: rotate(45deg);
    }
}

/* Bg-pattern */

.bg-pattern {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    background:
        linear-gradient(to right, var(--color-border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
    ;
    background-size: 50px 50px;
}

.home-overlay {
    position: absolute;
    background: linear-gradient(to bottom, var(--color-gradient) 20%, var(--color-main));
    inset: 0;
    top: 0;
    left: 0;
    z-index: 40;
}

/* Home */

.home {
    min-height: 100vh;
    display: grid;
    place-content: center;
}

.home-box {
    position: relative;
    min-height: 100vh;
    border-inline: 1px dashed var(--color-border);
    margin: 0 auto;
    max-width: 1440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(to right, var(--color-border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
    ;
    background-size: 70px 70px;
}

.home-wrapper {
    position: relative;
    z-index: 50;
    max-width: 1000px;
    text-align: center;
}

.home-title {
    font-size: clamp(32px, 5vw, 80px);
    font-weight: 700;
}

.home-desc {
    font-size: clamp(14px, 2vw, 20px);
    margin-block: 30px;
}

.home-icon {
    display: inline-block;
    color: var(--color-secondary);
    animation: toUpDown 4s ease-in-out infinite;
}

.home-links-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 50px;
}

.home-links {
    display: inline-flex;
    column-gap: 10px;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--rounded-size);
    transition: var(--transition-time);
    background: var(--color-card);
    box-shadow: var(--shadow-card);
    transition: var(--transition-time);

    &:hover {
        transform: translateY(-3px);
        background: var(--color-primary);
        color: white;
    }
}

/* About */

.about {
    position: relative;
    padding-block: 100px;
}

.about-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
}

.card-wrapper-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-card {
    border-radius: var(--rounded-size);
    padding: 20px;
    transition: var(--transition-time);
    cursor: pointer;
    background: var(--color-card);
    box-shadow: var(--shadow-card);

    &:hover {
        background: var(--color-primary);
        color: white;
    }
}

.about-text {
    margin-block: 40px;
    line-height: 30px;
    color: grey;
}

.card-title-right {
    font-size: 20px;
    margin-bottom: 20px;
}

.about-card-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.about-card-desc {
    color: grey;
}

.about-card:hover .about-card-desc {
    color: white;
}

/* Skills */

.skills {
    position: relative;
    padding-block: 150px;
}

.wrapper-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.skills-wrapper {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;

    @media(width > 768px) {
        grid-template-columns: repeat(2, 1fr);
    }

    @media(width > 1024px) {
        grid-template-columns: repeat(3, 1fr);
    }

    @media(width > 1280px) {
        grid-template-columns: repeat(4, 1fr);
    }

    @media(width > 1536px) {
        grid-template-columns: repeat(8, 1fr);
    }
}

.skills-heading {
    text-align: center;
    margin: 50px;
}

.skills-card {
    position: relative;
    border-radius: var(--rounded-size);
    padding: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: .2s;
    background: var(--color-card);
    box-shadow: var(--shadow-card);

    &:hover {
        border-color: #000;
    }
}

.skills-toolbar {
    position: absolute;
    top: 110%;
    left: calc(50% - 100px);
    border-radius: var(--rounded-size);
    padding: 20px;
    width: 200px;
    background: var(--color-card);
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    color: grey;
    box-shadow: var(--shadow-card);
    z-index: 8888;

    &::after {
        content: '';
        position: absolute;
        top: -19px;
        left: 50%;
        transform: translateX(-50%);
        border-style: solid;
        border-width: 10px;
        border-color: transparent transparent var(--color-card) transparent;
    }
}

.skills-title {
    font-size: 18px;
    font-weight: 700;
    margin-block: 15px;
}

.skills-desc {
    color: grey;
    max-width: 1000px;
    line-height: 30px;
    text-align: center;
}

.skills-icon {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: white;
    border-radius: 50px;
    display: grid;
    place-content: center;
    transition: var(--transition-time);
}

.skills-card:hover .skills-toolbar {
    opacity: 1;
    visibility: visible;
}

.skills-card:hover .skills-icon {
    background: var(--color-secondary);
    transform: translateY(-3px) rotateZ(15deg);
}

/* Login */

.section-login {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-login-title {
    font-size: 25px;
    font-weight: 600;
}

.form-box-input {
    margin-top: 20px;
}

.form-login {
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--rounded-size);
    max-width: 500px;
    width: 90%;
    background: var(--color-card);
}

.form-label {
    font-weight: 600;
}

.form-login-input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    height: 40px;
    padding-left: 12px;
    margin-block: 6px;
    transition: var(--transition-time);

    &:focus {
        border-color: black;
    }
}

.btn-login {
    background: var(--color-primary);
    color: white;
    width: 100%;
    border-radius: 8px;
    padding: 10px 0;
    margin-top: 20px;
}

.errors-wrapper {
    background: #FDF4EF;
    border-radius: var(--rounded-size);
    padding: 10px;
    margin: 20px 0;
    color: crimson;
}

.errors-list {
    display: flex;
    column-gap: 10px;
}

.ri-error-warning-fill {
    margin-top: 3px;
}

/* Projects */

.projects {
    position: relative;
    padding-block: 100px;
}

.projects-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.projects-card {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: var(--rounded-size);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--color-shadow-projects);
}

.projects-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.2) 60%, #000);
    z-index: 777;
}

.projects-img {
    width: 100%;
    height: 300px;
    transform: scale(1);
    transition: var(--transition-time);
    filter: grayscale(100%);
    object-fit: cover;
}

.projects-content {
    position: absolute;
    inset: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    z-index: 999;
}

.projects-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.projects-stacks {
    display: flex;
    column-gap: 5px;
    font-size: 14px;
    margin-top: 5px;
}

.stack {
    background: var(--color-border);
    padding: 3px 6px;
    border-radius: 50px;
}

.projects-card:hover .projects-img {
    transform: scale(1.1);
    filter: grayscale(0);
}

/* Contacts */

.contacts {
    position: relative;
    padding-block: 100px;
}

.footer {
    position: relative;
    font-size: 14px;
    padding: 15px 0;
    text-align: center;
    color: grey;
}

.btn-up {
    position: fixed;
    right: 30px;
    bottom: 30px;
    opacity: 0;
    visibility: hidden;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border-radius: 50%;
    color: white;
    display: block;
    display: grid;
    place-content: center;

    &.show-btn {
        opacity: 1;
        visibility: visible;
    }
}

/* Dashboard */

.dashboard-title {
    font-size: 30px;
}

.dashboard-admin {
    padding-block: 150px;
}

.dashboard-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    margin-top: 20px;
}

.dashboard-link {
    display: block;
    padding: 13px 20px;
    background: var(--color-border);
    margin-top: 10px;
    border-radius: var(--rounded-size);
}

.dashboard-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-table {
    width: 100%;
    border-spacing: 10px;
    border-collapse: separate;
}

th {
    background: var(--color-border);
    border-radius: 8px;
}

tr,
td,
th {
    padding: 10px;
}

.btn-edit,
.btn-delete {
    padding: 8px 16px;
    display: block;
    border-radius: var(--rounded-size);
    color: white;
}

.dashboard-section-title {
    font-size: 30px;
}

.btn-edit {
    background: lightgreen;
}

.btn-delete {
    background: lightcoral;
    margin-left: 5px;
}

.btn-group {
    display: flex;
}

@keyframes toUpDown {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}