/* =========================
   Base / Variables
========================= */
:root {
    --bg: #f8fafc;
    /* slate-50 */
    --text: #0f172a;
    /* slate-900 */
    --muted: #64748b;
    /* slate-500/600 */
    --muted2: #94a3b8;
    /* slate-400 */
    --line: #e2e8f0;
    /* slate-200 */
    --line2: #f1f5f9;
    /* slate-100 */
    --white: #ffffff;
    --accent: #4f46e5;
    /* indigo-600 */
    --accentSoft: #eef2ff;
    /* indigo-50 */
    --dark: #0b1220;
    --shadow: 0 18px 45px rgba(2, 6, 23, .12);
    --r12: 12px;
    --r16: 16px;
    --r24: 24px;
    --r32: 32px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

.container {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
}

/* =========================
   Utilities-ish
========================= */
.accent {
    color: var(--accent);
}

.muted {
    color: var(--muted);
}

.w-md {
    max-width: 520px;
}

.w-lg {
    max-width: auto;
}

.text-sm {
    font-size: 14px;
    line-height: 1.6;
}

.small {
    font-size: 13px;
    line-height: 1.6;
}

.small--light {
    color: rgba(255, 255, 255, .78);
}

.small--muted {
    color: rgba(148, 163, 184, .75);
}

.h2 {
    font-size: 34px;
    line-height: 1.15;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
    font-weight: 800;
}

.h2--white {
    color: #fff;
}

.h3 {
    font-size: 20px;
    margin: 10px 0 6px;
    font-weight: 800;
}

.h4 {
    font-size: 16px;
    margin: 0 0 6px;
    font-weight: 800;
}

.h4--white {
    color: #fff;
}

.lead {
    font-size: 18px;
    line-height: 1.7;
    margin: 0 0 22px;
}

.lead--light {
    color: rgba(255, 255, 255, .88);
}

/* =========================
   Glass + blobs
========================= */
.glass {
    background: rgba(255, 255, 255, .75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(79, 70, 229, .10);
    filter: blur(100px);
    border-radius: 999px;
    z-index: -1;
}

.blob--one {
    top: 0;
    left: 25%;
    transform: translateX(-25%);
}

.blob--two {
    bottom: 0;
    right: 25%;
    transform: translateX(25%);
    background: rgba(16, 185, 129, .14);
    /* emerald-ish */
}

/* =========================
   Nav
========================= */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.nav__inner {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
}

.brand {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 18px;
}

.nav__links {
    display: none;
    gap: 32px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.nav__links a {
    transition: color .2s ease;
}

.nav__links a:hover {
    color: var(--accent);
}

/* =========================
   Sections
========================= */
.section {
    padding: 80px 0;
}

.section--white {
    background: var(--white);
}

.section--soft {
    background: var(--bg);
}

.section--dark {
    background: #0f172a;
    color: #fff;
}

.section--accent {
    background: var(--accent);
    color: #fff;
}

.section__head {
    margin-bottom: 52px;
}

.section__head--center {
    text-align: center;
}

.section__head--center .muted {
    margin: 0 auto;
}

/* =========================
   Hero
========================= */
.hero {
    position: relative;
    overflow: hidden;
    padding: 128px 0 84px;
}

.hero__content {
    max-width: 780px;
}

.hero__title {
    font-size: 52px;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin: 0 0 18px;
    font-weight: 900;
}

.hero__text {
    font-size: 20px;
    line-height: 1.65;
    color: var(--muted);
    margin: 0 0 28px;
    max-width: 640px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

/* =========================
   Buttons
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: var(--r12);
    font-weight: 800;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
    border: 1px solid transparent;
    user-select: none;
}

.btn--primary {
    background: var(--text);
    color: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}

.btn--primary:hover {
    background: #111c31;
}

.btn--secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

.btn--secondary:hover {
    background: #f8fafc;
}

.btn--full {
    width: 100%;
}

.btn--with-icon:hover .icon--shift {
    transform: translateX(4px);
}

.icon--shift {
    transition: transform .2s ease;
}

/* =========================
   Grids
========================= */
.grid {
    display: grid;
    gap: 32px;
}

.grid--projects {
    grid-template-columns: 1fr;
}

.grid--projects>.card-link {
    display: block;
}

.grid--gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid--skills {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid--two {
    grid-template-columns: 1fr;
}

.grid--gap-lg {
    gap: 64px;
}

.grid--center {
    align-items: center;
}

/* =========================
   Cards / Media / Tags
========================= */
.card--project {
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.card--project:hover {
    transform: translateY(-4px);
}

.card--project:active {
    transform: scale(.98);
}

.card-link .card {
    height: 100%;
}

.media {
    border-radius: var(--r24);
    overflow: hidden;
    background: #f1f5f9;
    margin-bottom: 18px;
    position: relative;
}

.media--43 {
    aspect-ratio: 4 / 3;
}

.media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition: transform .5s ease;
}

.card--project:hover .media img {
    transform: scale(1.08);
}

.label {
    display: inline-block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--line2);
    padding: 6px 8px;
    border-radius: 10px;
}

/* =========================
   Gallery tiles
========================= */
.tile {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

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

.tile__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px;
    background: rgba(0, 0, 0, .60);
    opacity: 0;
    transition: opacity .2s ease;
    color: #fff;
}

.tile:hover .tile__overlay {
    opacity: 1;
}

.tile__meta {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

/* =========================
   Presentation section
========================= */
.feature {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-top: 18px;
}

.feature__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .10);
    display: flex;
    align-items: center;
    justify-content: center;
}

.showreel {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--r24);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .20);
    background: rgba(15, 23, 42, .28);
    box-shadow: 0 28px 70px rgba(2, 6, 23, .35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.showreel__bg {
    position: absolute;
    inset: 0;
    background-image: url("https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=800&q=80");
    background-size: cover;
    background-position: center;
    opacity: .20;
}

.showreel__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.play {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: #fff;
    color: var(--accent);
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease;
    margin-bottom: 14px;
}

.play:hover {
    transform: scale(1.08);
}

.play__icon {
    margin-left: 2px;
}

.showreel__label {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* =========================
   Skills
========================= */
.skill {
    padding: 22px;
    border-radius: var(--r24);
    border: 1px solid var(--line2);
    text-align: center;
    background: #fff;
    transition: border-color .2s ease;
}

.skill:hover {
    border-color: rgba(79, 70, 229, .25);
}

.skill__title {
    font-size: 13px;
    font-weight: 800;
    margin: 10px 0 0;
}

/* =========================
   About
========================= */
.about-media {
    position: relative;
}

.portrait {
    border-radius: 28px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    filter: grayscale(1);
    transition: filter .7s ease;
    box-shadow: var(--shadow);
}

.portrait:hover {
    filter: grayscale(0);
}

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

.badge {
    position: absolute;
    right: -24px;
    bottom: -24px;
    width: 128px;
    height: 128px;
    background: var(--accent);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-weight: 900;
    line-height: 1.1;
    box-shadow: 0 18px 35px rgba(2, 6, 23, .35);
}

.prose {
    margin-top: 18px;
    color: rgba(148, 163, 184, .75);
    line-height: 1.75;
}

.prose p {
    margin: 0 0 14px;
}

.facts {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
}

/* =========================
   Contact
========================= */
.contact {
    background: var(--bg);
    border-radius: 32px;
    border: 1px solid var(--line2);
    padding: 32px;
    text-align: center;
}

.contact__title {
    margin: 0 0 14px;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 900;
}

.contact__actions {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.social {
    display: flex;
    gap: 14px;
}

.social__btn {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.social__btn:hover {
    background: #fff;
    border-color: rgba(79, 70, 229, .25);
    color: var(--accent);
}

/* =========================
   Footer
========================= */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--line2);
    background: #fff;
}

.footer__inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}

.footer__copy {
    margin: 0;
    font-size: 13px;
    color: var(--muted2);
}

.footer__links {
    display: flex;
    gap: 28px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted2);
}

.footer__links a {
    transition: color .2s ease;
}

.footer__links a:hover {
    color: var(--text);
}

/* =========================
   Icons sizes
========================= */
.icon {
    width: 24px;
    height: 24px;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

.icon--lg {
    width: 32px;
    height: 32px;
}

.icon--xl {
    width: 32px;
    height: 32px;
}

/* =========================
   Responsive
========================= */
@media (min-width: 768px) {
    .nav__links {
        display: flex;
    }

    .hero {
        padding: 190px 0 128px;
    }

    .hero__title {
        font-size: 72px;
    }

    .grid--projects {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid--gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }

    .grid--two {
        grid-template-columns: 1fr 1fr;
    }

    .contact {
        padding: 64px;
    }

    .contact__actions {
        flex-direction: row;
    }

    .btn--full {
        width: auto;
    }

    .footer__inner {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .grid--projects {
        grid-template-columns: repeat(3, 1fr);
    }

    .grid--skills {
        grid-template-columns: repeat(6, 1fr);
    }
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

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

.gallery-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 1;
    pointer-events: auto;
}

.gallery-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    height: 100%;
    pointer-events: none;
}

/* контейнер ровно по размеру картинки */
.gallery-frame {
    position: relative;
    display: inline-block;
    max-width: none;
    max-height: none;
    pointer-events: auto;
}

/* крестик всегда в правом верхнем углу картинки */
.gallery-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;

    width: 40px;
    height: 40px;
    border-radius: 10px;

    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(6px);
}

/* стрелки по центру слева/справа на самой картинке */
.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    width: 48px;
    height: 48px;
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 26px;
    line-height: 1;

    backdrop-filter: blur(6px);
    transition: transform .15s ease, background .15s ease;
}

.gallery-prev {
    left: 12px;
}

.gallery-next {
    right: 12px;
}

.gallery-prev:hover,
.gallery-next:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.06);
}

.gallery-track {
    display: flex;
    height: 100%;
    transform: translateX(0);
    transition: transform 420ms cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

.gallery-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
}

.gallery-viewport {
    width: min(92vw, 1200px);
    height: min(85vh, 800px);
    overflow: hidden;
    border-radius: 10px;
}

.gallery-slick,
.gallery-slick .slick-list,
.gallery-slick .slick-track {
    height: 100%;
}

.gallery-slick .slick-slide {
    height: 100%;
}

.gallery-slick .slick-slide>div {
    height: 100%;
}

.gallery-slick img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== Design section blocks ===== */
.design-block {
    margin-top: 28px;
}

.design-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.design-head .icon {
    flex: 0 0 auto;
    margin-top: 2px;
}

.design-head .h3 {
    margin: 0;
}

.design-head .muted {
    margin: 6px 0 0;
}

/* Illustrator grid */
.design-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.design-tile {
    border: 0;
    padding: 0;
    background: transparent;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    position: relative;
}

.design-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    display: block;
}

.design-tile:hover img {
    transform: scale(1.06);
}

.design-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .92);
    background: rgba(0, 0, 0, .45);
    padding: 6px 10px;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

/* Photoshop before/after grid */
/* ===== Before/After (Photoshop) ===== */

.ps-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
}

.ps-item {
    position: relative;
}

.ps-compare {
    display: block;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(2, 6, 23, .12);
}

.ps-labels {
    pointer-events: none;
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.ps-labels span {
    font-size: 12px;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    backdrop-filter: blur(8px);
}

/* Responsive */
@media (max-width: 900px) {
    .design-grid {
        grid-template-columns: 1fr;
    }

    .ps-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Photoshop Compare (beauty pass) ===== */
image-compare.ps-compare {
    /* размеры */
    --handle-size: 26px;
    /* круг */
    --thumb-size: 26px;
    --icon-size: 14px;
    /* стрелки внутри круга */

    /* линия */
    --divider-width: 2px;

    /* цвета */
    --divider-color: rgba(255, 255, 255, .85);
    --handle-color: rgba(15, 23, 42, .55);
    /* slate-900 с прозрачностью */
    --handle-border-color: rgba(255, 255, 255, .65);

    /* обводка/тень */
    --handle-border-width: 1px;
    --handle-border: 1px;
    --handle-shadow: 0 10px 25px rgba(0, 0, 0, .25);

    /* если библиотека использует разные имена */
    --line-width: 2px;
    --line-color: rgba(255, 255, 255, .85);
    --handle-bg: rgba(15, 23, 42, .55);
    --handle-border-width: 1px;
    --handle-border-color: rgba(255, 255, 255, .65);
}

/* сам блок (карточка) */
.ps-compare {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, .9);
    /* slate-200 */
    background: rgba(255, 255, 255, .02);
}

/* картинки: чтобы было “реально наложено” */
.ps-compare img {
    width: 100%;
    height: 340px;
    /* можешь 320-420 под вкус */
    object-fit: cover;
    /* 1:1 одинаковый кроп */
    display: block;
}

/* ховер — чуть “живее”, но без кринжа */
.ps-item:hover .ps-compare {
    transform: translateY(-2px);
    transition: transform .18s ease, box-shadow .18s ease;
}

/* мобилка — меньше высота */
@media (max-width: 520px) {
    .ps-compare img {
        height: 280px;
    }

    image-compare.ps-compare {
        --handle-size: 24px;
        --thumb-size: 24px;
        --icon-size: 13px;
    }
}

/* фокус с клавиатуры (accessibility) */
image-compare.ps-compare:focus-within {
    outline: 3px solid rgba(79, 70, 229, .35);
    /* accent */
    outline-offset: 4px;
    border-radius: 18px;
}

/* ===== Presentation video player ===== */
.showreel--video {
    position: relative;
    overflow: hidden;
}

.showreel__video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* легкое затемнение, пока видео не играет */
.showreel--video::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .18);
    transition: opacity .25s ease;
    pointer-events: none;
}

.showreel--video.is-playing::after {
    opacity: 0;
}

/* кнопка в центре, аккуратная */
.showreel__toggle {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;

    width: 64px;
    height: 64px;
    border-radius: 999px;

    border: 0;
    cursor: pointer;

    background: rgba(255, 255, 255, .92);
    color: var(--accent);

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 18px 45px rgba(0, 0, 0, .25);
    transition: transform .15s ease, opacity .2s ease, background .2s ease;
}

.showreel__toggle:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

/* когда играет — кнопку скрываем, но возвращаем при hover (как у YouTube) */
.showreel--video.is-playing .showreel__toggle {
    opacity: 0;
    pointer-events: none;
}

.showreel--video.is-playing:hover .showreel__toggle {
    opacity: 1;
    pointer-events: auto;
}

/* на мобиле hover нет — поэтому можно всегда показывать кнопку при паузе, а при play она исчезнет */