:root {
    --bg: #f5f4ef;
    --paper: #fbfaf6;
    --ink: #151515;
    --muted: #686762;
    --line: #d9d7d0;
    --line-dark: #bcb9b0;
    --accent: #4f46e5;
    --white: #ffffff;
    --shadow: 0 20px 50px rgba(20, 20, 20, .10);
    --radius: 18px;
    --max: 1160px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background:
        linear-gradient(rgba(20,20,20,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20,20,20,.035) 1px, transparent 1px),
        var(--bg);
    background-size: 32px 32px;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(255,255,255,.28), transparent 22%, transparent 78%, rgba(255,255,255,.18));
    z-index: -1;
}

body.modal-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; }
button { cursor: pointer; }

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }

.container {
    width: min(100% - 40px, var(--max));
    margin: 0 auto;
}

.section {
    padding: 104px 0;
}

.section__title {
    margin-bottom: 72px;
    font-size: clamp(34px, 4vw, 50px);
    line-height: .95;
    letter-spacing: -.045em;
    font-weight: 800;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(245, 244, 239, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(188, 185, 176, .72);
}

.site-header__inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.brand__mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: 10px;
    font-size: 11px;
    letter-spacing: -.08em;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 18px;
}

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

.site-nav a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    transition: color .15s ease;
}

.site-nav a:hover { color: var(--ink); }

.language-switch {
    padding: 5px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.language-switch:hover,
.language-switch:focus-visible {
    color: var(--ink);
    background: rgba(0,0,0,.05);
    outline: none;
}

.hero {
    padding: 112px 0 124px;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 72px;
}

.hero__title {
    font-size: clamp(56px, 9vw, 112px);
    line-height: .84;
    letter-spacing: -.065em;
    font-weight: 850;
    max-width: 900px;
}

.hero__subtitle {
    margin-top: 26px;
    font-size: 18px;
    font-weight: 700;
    color: var(--muted);
}

.hero__text {
    max-width: 640px;
    margin-top: 22px;
    font-size: 17px;
    color: #3d3d39;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 17px;
    border: 1px solid var(--ink);
    border-radius: 10px;
    background: var(--ink);
    color: var(--white);
    font-size: 13px;
    font-weight: 800;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--ink);
}

.btn--ghost:hover { background: rgba(0,0,0,.04); }

.hero-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.hero-card__avatar {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 20px;
    background: #e8e6df;
}

.hero-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(0,0,0,.035), rgba(0,0,0,.075)),
        #e8e6df;
    color: #77756f;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.image-placeholder--avatar {
    font-size: clamp(38px, 8vw, 76px);
}

.image-placeholder--project {
    font-size: 11px;
    min-height: 100%;
}

.resume__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}

.tile {
    background: rgba(251, 250, 246, .78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
}

.tile__title {
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
    font-size: 20px;
    line-height: 1.1;
}

.edu + .edu,
.exp + .exp,
.skill-group + .skill-group {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--line);
}

.edu__date,
.exp__date {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.edu__place,
.exp__role {
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.3;
}

.edu__degree,
.exp__company {
    color: #5c5b55;
    font-size: 14px;
}

.exp__company { margin-bottom: 9px; }

.exp__duties li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 5px;
    color: #363632;
    font-size: 14px;
}

.exp__duties li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #9b9991;
}

.skill-group__title {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

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

.skill-tags li {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f2f0e9;
    color: #3f3e39;
    font-size: 12px;
}

.projects__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.project-card {
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(251, 250, 246, .78);
    color: var(--ink);
    text-align: left;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-dark);
    box-shadow: 0 16px 36px rgba(20,20,20,.08);
}

.project-card__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8e6df;
}

.project-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card__body {
    padding: 19px;
}

.project-card__title {
    margin-bottom: 8px;
    font-size: 19px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.project-card__desc {
    color: #55544f;
    font-size: 14px;
}

.project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.project-card__tags li {
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #66645d;
    font-size: 11px;
}

.project-card__more {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 800;
}

.contacts__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.contact-tile {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(251,250,246,.78);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.contact-tile:hover {
    transform: translateY(-2px);
    border-color: var(--line-dark);
    box-shadow: 0 14px 30px rgba(20,20,20,.07);
}

.contact-tile__link {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 24px;
    text-align: center;
}

.contact-tile__icon {
    width: 34px;
    height: 34px;
    color: var(--ink);
}

.contact-tile__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.contact-tile__label {
    color: var(--muted);
    font-size: 12px;
}

.contact-tile__value {
    max-width: 100%;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    word-break: break-word;
}

.contact-tile__copy {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #88867f;
}

.contact-tile__copy:hover { background: rgba(0,0,0,.055); color: var(--ink); }

.contact-tile__copy svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    pointer-events: none;
}

.contact-tile__copy .icon-check { display: none; }
.contact-tile__copy.is-copied { color: #15803d; }
.contact-tile__copy.is-copied .icon-copy { display: none; }
.contact-tile__copy.is-copied .icon-check { display: block; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

.modal.is-open { display: block; }

.modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,13,13,.58);
    animation: fadeIn .18s ease;
}

.modal__dialog {
    position: relative;
    width: calc(100% - 32px);
    max-width: 920px;
    max-height: calc(100dvh - 64px);
    margin: 32px auto;
    overflow-y: auto;
    border-radius: 18px;
    background: var(--paper);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: popIn .18s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
}

.carousel {
    position: relative;
    background: #e8e6df;
    touch-action: pan-y;
}

.carousel__viewport {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.carousel__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .28s ease;
}

.carousel__slide {
    flex: 0 0 100%;
    height: 100%;
}

.carousel__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

.carousel__btn {
    position: absolute;
    top: 50%;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0 0 2px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.94);
    color: var(--ink);
    box-shadow: 0 3px 10px rgba(0,0,0,.12);
    font-size: 25px;
    line-height: 1;
}

.carousel__btn--prev { left: 12px; }
.carousel__btn--next { right: 12px; }

.carousel__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 9px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.carousel__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
}

.carousel__dot.is-active { background: #fff; }

.modal__body {
    padding: 30px;
}

.modal__title {
    margin-bottom: 26px;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1;
    letter-spacing: -.035em;
}

.modal__section + .modal__section {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.modal__subtitle {
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.modal__short {
    color: #2f2f2c;
    font-size: 17px;
}

.modal__full p {
    margin-bottom: 14px;
    color: #46453f;
}

.modal__full p:last-child { margin-bottom: 0; }

.modal__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 200;
    max-width: min(520px, calc(100% - 32px));
    padding: 10px 14px;
    transform: translateX(-50%);
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    background: rgba(251,250,246,.96);
    box-shadow: 0 10px 30px rgba(0,0,0,.10);
    color: var(--ink);
    font-size: 13px;
}

@media (max-width: 960px) {
    .hero__grid,
    .resume__grid,
    .projects__grid,
    .contacts__grid {
        grid-template-columns: 1fr;
    }

    .hero__grid {
        gap: 42px;
    }

    .hero-card {
        width: min(100%, 420px);
    }

    .site-nav { gap: 14px; }
}

@media (max-width: 720px) {
    .container { width: min(100% - 32px, var(--max)); }

    .site-header__inner {
        min-height: 60px;
    }

    .brand > span:last-child { display: none; }

    .header-controls { gap: 8px; }
    .site-nav { gap: 12px; }
    .site-nav a { font-size: 11px; }

    .hero {
        padding: 76px 0 88px;
    }

    .hero__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-card {
        width: min(100%, 320px);
    }

    .section {
        padding: 84px 0;
    }

    .section__title {
        margin-bottom: 52px;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn { width: 100%; }

    .modal__dialog {
        width: 100%;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .modal__body { padding: 22px; }
}

@media (max-width: 420px) {
    .site-nav a:nth-child(1) { display: none; }
    .hero__title { font-size: 54px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}
