:root {
    --bg: #050505;
    --bg-soft: #0a0a0a;
    --text: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Big Shoulders Display', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 82% 74%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 40%),
        linear-gradient(140deg, #030303 0%, #0b0b0b 56%, #040404 100%);
    background-attachment: fixed;
    background-color: #050505;
}

.page {
    width: min(1440px, 100%);
    margin: 0 auto;
}

.section {
    min-height: 100vh;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#bio {
    min-height: 90vh;
}

.section-contacts {
    min-height: auto;
}

.hero-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(1200px, calc(100% - 64px));
    text-align: center;
}

.language-switch {
    position: absolute;
    top: 26px;
    left: 26px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.lang-btn {
    width: 54px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-family: 'Big Shoulders Display', sans-serif;
    font-size: 20px;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.25s ease;
}

.lang-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
}

.hero-headline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: fit-content;
    max-width: 100%;
}

.hero-top-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    gap: 24px;
    margin-bottom: 14px;
}

.hero-python,
.hero-backend {
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.hero-backend {
    text-align: right;
}

.hero-title {
    font-size: clamp(72px, 24vw, 335px);
    font-weight: 700;
    line-height: 0.86;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    display: block;
}

.hero-name {
    margin-top: 18px;
    font-size: 72px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-label {
    position: absolute;
    top: 36px;
    left: 36px;
    font-size: 28px;
    opacity: 0.55;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.works-container {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 60px;
    align-items: start;
    padding: 40px;
    width: min(1380px, calc(100% - 80px));
    margin: 0 auto;
    min-height: 100vh;
}

.works-title-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 60px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 240px);
    gap: 32px;
}

.project-card {
    position: relative;
    --photo-blur-percent: 35;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    overflow: hidden;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: -4px;
    background-image: var(--project-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(calc(var(--photo-blur-percent) * 0.06px));
    transform: scale(1.04);
    z-index: 0;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.52));
    transition: opacity 0.3s ease;
    z-index: 1;
}

.works-grid .project-card:nth-child(1) {
    --project-image: url('../images/project1_preview.png');
}

.works-grid .project-card:nth-child(2) {
    --project-image: url('../images/project2_preview.png');
}

.works-grid .project-card:nth-child(3) {
    --project-image: url('../images/project3_preview.png');
}

.works-grid .project-card:nth-child(4) {
    --project-image: url('../images/project4_preview.png');
}

.works-grid .project-card:nth-child(5) {
    --project-image: url('../images/project5_preview.png');
}

.works-grid .project-card:nth-child(6) {
    --project-image: url('../images/project6_preview.png');
}

.project-card-label {
    font-size: clamp(24px, 3.4vw, 40px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    -webkit-text-stroke: 1px #000000;
    text-shadow: 1px 1px 0 #000000, -1px 1px 0 #000000, 1px -1px 0 #000000, -1px -1px 0 #000000;
    opacity: 0.95;
    position: relative;
    z-index: 2;
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

.project-card:hover::before {
    opacity: 0.35;
}

.bio-layout {
    min-height: 70vh;
    width: min(1240px, calc(100% - 80px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(320px, 1fr);
    align-items: center;
    gap: 72px;
}

.bio-photo {
    width: min(100%, 300px);
    justify-self: start;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.bio-photo img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.bio-text {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.bio-title {
    font-size: clamp(34px, 6vw, 64px);
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
}

.bio-copy {
    font-family: 'Yanone Kaffeesatz', sans-serif;
    font-size: 20px;
    line-height: 1.5;
    letter-spacing: 0.03em;
    max-width: 620px;
}

.contacts-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    min-height: auto;
    padding: 28px 20px;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.contact-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-4px);
}

.contact-link img {
    width: 50px;
    height: 50px;
    display: block;
}

@media (max-width: 900px) {
    .contacts-container {
        gap: 32px;
        min-height: auto;
        padding: 60px 20px;
    }

    .contact-link {
        width: 70px;
        height: 70px;
    }

    .contact-link img {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 600px) {
    .language-switch {
        top: 14px;
        left: 14px;
        gap: 6px;
    }

    .lang-btn {
        width: 46px;
        height: 30px;
        font-size: 17px;
    }

    .hero-title {
        font-size: clamp(130px, 24vw, 260px);
    }

    .hero-name {
        font-size: clamp(36px, 6vw, 72px);
    }

    .hero-python,
    .hero-backend {
        font-size: clamp(14px, 2.3vw, 32px);
    }
}

@media (max-width: 760px) {
    .hero-content {
        width: calc(100% - 28px);
    }

    .hero-top-row {
        padding: 0;
        gap: 14px;
    }

    .hero-title {
        font-size: clamp(72px, 20vw, 132px);
        letter-spacing: 0.01em;
    }

    .hero-name {
        font-size: clamp(28px, 8vw, 48px);
    }

    .hero-python,
    .hero-backend {
        font-size: clamp(10px, 3.6vw, 16px);
    }

    .bio-layout {
        width: calc(100% - 28px);
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 40px 0;
    }

    .bio-photo {
        width: min(88vw, 300px);
        justify-self: center;
    }

    .bio-title {
        font-size: clamp(28px, 10vw, 42px);
        letter-spacing: 0.03em;
    }

    .contacts-container {
        gap: 24px;
        padding: 20px 14px;
    }

    .contact-link {
        width: 60px;
        height: 60px;
    }

    .contact-link img {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 1000px) {
    .works-container {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 28px;
        width: calc(100% - 56px);
    }

    .works-title-vertical {
        writing-mode: horizontal-tb;
        font-size: 42px;
        margin-bottom: 12px;
    }

    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 180px);
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .works-container {
        padding: 14px;
        width: calc(100% - 28px);
    }

    .works-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 16px;
    }

    .project-card {
        aspect-ratio: 16 / 10;
    }
}
