html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-offset, 100px);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

:root {
    --border: #17312e;
    --border-light: #234740;
    --background: #050c14;
    --background-section: #0a141e;
    --button: #0d1a20;
    --button-highlighted: #12262a;
    --tag: #152b2d;
    --text-secondary: #92a99f;
    --ligyb: #429e93;
    --section-width: min(1000px, 90%);
    --section-padding: 20px;
    --background-green: #052016;
}

@font-face {
    font-family: 'Martian Mono';
    src: url('src/MartianMono.ttf') format('truetype');
    font-display: swap;
}

body {
    margin: 0;
    font-family: 'Martian Mono', monospace;
    background:
        radial-gradient(circle at top, var(--background-section), transparent 40%),
        linear-gradient(180deg, var(--background) 0%, var(--background-section) 100%);
    color: white;
    min-height: 100vh;
}

.top-panel {
    z-index: 1000;
    position: fixed;
    top: 2vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(1000px, 90%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--background);
    color: white;
    border: 2px solid var(--border);
    border-radius: 15px;
    box-sizing: border-box;
}

.big {
    font-size: 1.5em;
}

.ligyb {
    /* font-size: 1.5em; */
    font-weight: bold;
    color: var(--ligyb);
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 15px;
    background-color: transparent;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: white;
    background-color: var(--button);
    border-color: var(--border);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    outline: none;
}

.about {
    align-items: flex-start;
    gap: 24px;
    margin: 100px auto 0;
    width: var(--section-width);
    padding: var(--section-padding);
    border: 2px solid var(--border);
    border-radius: 15px;
    display: flex;
    background-color: var(--background-section);
    box-sizing: border-box;
}

.description {
    color: var(--text-secondary);
}

.about img {
    flex: 0 0 130px;
    width: 130px;
    height: 130px;
    margin-right: 0;
    border-radius: 25%;
    margin-left: 3px;
    border: 2px solid var(--border);
    object-fit: cover;
    /* margin-right: 20px; */
}

.about-info {
    min-width: 0;
}

.name {
    margin-top: 0;
    margin: 0 0 12px;
}


.section-panel {
    margin: 15px auto 0;
    width: var(--section-width);
    padding: var(--section-padding);
    border: 2px solid var(--border);
    border-radius: 15px;
    background-color: var(--background-section);
    box-sizing: border-box;
}

.section-name {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    width: var(--section-width);
    margin: 40px auto 0;
    padding-inline: 0;
    transform: translateX(-5px);
    box-sizing: border-box;
}

.section-name h2 {
    margin: 0;
}

.section-name + .section-panel {
    margin-top: 10px;
}

.project-list {
    width: var(--section-width);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    box-sizing: border-box;
    margin: 15px auto 0;
}

.project-item {
    flex: 0 0 calc((100% - 40px) / 3);
    height: 490px;
    background-color: var(--button);
    border: 2px solid var(--border);
    border-radius: 15px;
    display: grid;
    grid-template-rows: 3fr 4fr;
    overflow: hidden;
    color: var(--text-secondary);
}

.project-top {
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--border);
}

.project-top-bg--image,
.project-top-bg--image img {
    width: 100%;
    height: 100%;
}

.project-top-bg--image img {
    display: block;
    object-fit: cover;
}

.project-top-bg--gradient {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--background-green), rgba(0, 0, 0, 1));
}

.project-top-line {
    position: absolute;
    top: 0px;
    width: 105%;
    z-index: 2;
    padding: 6px 10px;
    border-radius: 10px;
    background: linear-gradient(to bottom, var(--background-section), rgba(0, 0, 0, 0) 100%);
}

.project-path {
    margin: 0;
    font-size: 14px;
    color: white;
}

.project-bottom {
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}


.project-title {
    margin: 0px 0 6px;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

.project-description {
    margin: 2px;
    font-size: 14px;
    flex-grow: 1;
}

.project-aftertitle {
    font-size: 12px;
    color: gray;
    font-weight: normal;
}

.tag {
    display: inline-block;
    padding: 10px 12px;
    margin-top: 10px;
    background-color: var(--tag);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    font-size: 12px;
    margin-right: 6px;
    color: white;
}

.project-links a {
    display: inline-flex;
    align-items: center;
    margin-right: 10px;
    margin-top: 10px;
    color: var(--text-secondary);
    background-color: var(--button);
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 15px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.project-links a:hover,
.project-links a:focus-visible {
    color: white;
    background-color: var(--button-highlighted);
    border-color: var(--border);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    outline: none;
}

.project-top-content {
    position: absolute;
    inset: 32px 12px 12px 12px;
    z-index: 2;
}

.project-top-content--icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-top-content--icon img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    background: var(--button);
    padding: 6px;
}

.project-top-content--code {
    padding: 12px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.project-top-content--code pre {
    margin: 0;
    font-size: 15px;
    line-height: 0.7;;
    color: #5ecf97;
    white-space: pre-wrap;
}

.project-top-content--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 64px;
    padding: 12px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
}

.split-text {
    min-width: 0;
}

.split-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--ligyb);
    margin-bottom: 4px;
}

.split-sub {
    font-size: 12px;
    color: white;
}

.split-icon {
    flex: 0 0 64px;
    width: 64px;
    height: 48px;

    border: 2px solid var(--border-light);
    border-radius: 10px;
    background: var(--button);

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.split-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.language-switcher {
    display: inline-flex;
    padding: 3px;
    background: var(--button);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.lang {
    min-width: 30px;
    padding: 7px 8px;
    border-radius: 9px;
    color: var(--text-secondary);
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    transition:
        color 0.15s ease,
        background-color 0.15s ease;
}

.lang:hover,
.lang:focus-visible {
    color: white;
    background: var(--button-highlighted);
    outline: none;
}

.lang.selected {
    color: var(--background);
    background: var(--ligyb);
}

.experience-list {
    width: var(--section-width);
    margin: 15px auto 0;
    display: grid;
    gap: 14px;
}

.experience-item {
    padding: 20px;
    background: var(--background-section);
    border: 2px solid var(--border);
    border-left: 4px solid var(--ligyb);
    border-radius: 15px;
    box-sizing: border-box;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
}

.experience-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.experience-period {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
}

.experience-company {
    margin: 6px 0 0;
    color: var(--ligyb);
    font-size: 14px;
}

.experience-item ul {
    margin: 16px 0 4px;
    padding-left: 20px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.experience-item li + li {
    margin-top: 6px;
}

@media (max-width: 600px) {
    .experience-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

.skill-group + .skill-group {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.group-name {
    margin: 0 0 2px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: bold;
}

.skill-group .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-group .tag {
    margin: 8px 0 0;
}

.contacts {
    background-color: #00000000;
    border-color: #00000000;
    margin-top: 0px;
}

.ss14-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.ss14-project {
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: var(--button);
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.ss14-project-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ss14-project h4 {
    margin: 0;
    color: white;
}

.work-type {
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--tag);
    color: var(--ligyb);
    font-size: 11px;
}

.ss14-project p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.ss14-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.ss14-links a {
    color: var(--ligyb);
    font-size: 12px;
    text-decoration: none;
}

.ss14-links a:hover {
    text-decoration: underline;
}

@media (min-width: 850px) {
    .project-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .project-item--featured {
        grid-column: span 2;
    }
}

/* some interactive hover things */
.project-item,
.ss14-project {
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.project-item:hover,
.project-item:focus-within,
.ss14-project:hover,
.ss14-project:focus-within {
    transform: translateY(-4px);
    border-color: var(--ligyb);
    box-shadow: 0 16px 32px rgb(0 0 0 / 25%);
}

.project-top-bg--image img {
    transition: transform .35s ease;
}

.project-item:hover .project-top-bg--image img {
    transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
    .project-item,
    .ss14-project,
    .project-top-bg--image img {
        transition: none;
    }
}

span.tag {
    transition: background-color .2s ease, border-color .2s ease;
}

span.tag:hover {
    background-color: #1c3636;
    border-color: #32645d;
}
/* end */

@media (max-width: 700px) {
    .top-panel {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        top: 12px;
        width: calc(100% - 24px);
        padding: 10px;
    }

    .top-panel > .ligyb {
        grid-column: 1;
        grid-row: 1;
    }

    .header-actions {
        display: contents;
    }

    .language-switcher {
        grid-column: 2;
        grid-row: 1;
    }

    .nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
    }

    .nav-link {
        justify-content: center;
        padding: 8px 2px;
        font-size: clamp(10px, 3vw, 12px);
        white-space: nowrap;
    }

    .about {
        margin-top: calc(var(--header-offset, 130px) + 5px);
    }

    .project-list,
    .ss14-projects {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-item {
        height: auto;
        min-height: 450px;
        grid-template-rows: 180px auto;
    }
    
    .about {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }

    .about img {
        margin-left: 0;
        flex-basis: 112px;
        width: 112px;
        height: 112px;
    }
}
