@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/bebas-nunito/font-2.ttf') format('truetype');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/bebas-nunito/font-3.ttf') format('truetype');
}

@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/bebas-nunito/font-4.ttf') format('truetype');
}

@font-face {
    font-family: 'Clash Display';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('./fonts/clash-display/clash-display-400.ttf') format('truetype');
}

@font-face {
    font-family: 'Clash Display';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('./fonts/clash-display/clash-display-500.ttf') format('truetype');
}

@font-face {
    font-family: 'Clash Display';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('./fonts/clash-display/clash-display-600.ttf') format('truetype');
}

@font-face {
    font-family: 'Clash Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('./fonts/clash-display/clash-display-700.ttf') format('truetype');
}

:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #5d5d5d;
    --line: #ececec;
    --font-body: 'Nunito', sans-serif;
    --font-display: 'Clash Display', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
}

.page {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
}

.portfolio {
    width: min(100%, 1480px);
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.portfolio__header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2px 0 6px;
}

.portfolio__name {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 2.4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    text-align: left;
    margin: 0;
}

.portfolio__gallery {
    position: relative;
}

.grid-sizer {
    width: calc((100% - 42px) / 4);
}

.grid-gutter {
    width: 14px;
}

.gallery-item {
    width: calc((100% - 42px) / 4);
    margin: 0;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 0;
    background: #f7f7f7;
}

.gallery-item--w2 {
    width: calc((100% - 42px) / 4);
}

.gallery-item img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 0;
    transition: none;
    cursor: zoom-in;
}

.gallery-item--portrait img {
    aspect-ratio: 4 / 5;
}

.gallery-item--landscape img {
    aspect-ratio: 16 / 10;
}

.gallery-item--square img {
    aspect-ratio: 1 / 1;
}

.portfolio__footer {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 8px 0 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px 24px;
}

.portfolio__links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-size: 0.82rem;
    color: rgba(17, 17, 17, 0.46);
}

.portfolio__socials {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.portfolio__social-label {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(17, 17, 17, 0.36);
}

.portfolio__icon-link {
    width: 1.12rem;
    height: 1.12rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.72;
}

.portfolio__icon-link img,
.portfolio__icon-link i {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    font-size: 1.12rem;
    line-height: 1;
}

.portfolio__email {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.7vw, 1.32rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(17, 17, 17, 0.88);
    line-height: 1.1;
}

.portfolio__email i {
    font-size: 0.95em;
}

.portfolio__links a,
.portfolio__email {
    transition: color 0.2s ease;
}

.portfolio__links a:hover,
.portfolio__email:hover {
    color: var(--text);
}

.portfolio__links a:hover {
    opacity: 0.9;
}

.portfolio__about {
    width: min(100%, 760px);
    margin: 8px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    display: grid;
    justify-items: center;
    gap: 12px;
}

.portfolio__about-text {
    margin: 0;
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.65;
    color: rgba(17, 17, 17, 0.72);
    max-width: 58ch;
}

.portfolio__contact-trigger {
    min-height: 46px;
    border: 1px solid #18181b;
    border-radius: 8px;
    background: #18181b;
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0 18px;
    cursor: pointer;
}

.portfolio__contact-trigger:hover {
    background: #27272a;
}

.portfolio__micro-contact {
    width: min(100%, 760px);
    margin: 6px auto 2px;
    display: grid;
    justify-items: center;
    gap: 7px;
}

.portfolio__micro-email {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(17, 17, 17, 0.44);
    text-transform: uppercase;
}

.portfolio__micro-phone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(17, 17, 17, 0.4);
    text-transform: uppercase;
}

.portfolio__micro-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: rgba(17, 17, 17, 0.36);
}

.portfolio__micro-icon-link {
    width: 0.78rem;
    height: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.78;
}

.portfolio__micro-icon-link i {
    font-size: 0.78rem;
    line-height: 1;
}

.portfolio__micro-icon-link:hover,
.portfolio__micro-email:hover,
.portfolio__micro-phone:hover {
    color: rgba(17, 17, 17, 0.62);
}

.contact-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: block;
}

.contact-modal[hidden] {
    display: none;
}

.contact-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: #111111;
}

.contact-modal__panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: #111111;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 40px 24px;
    display: grid;
    align-content: center;
    gap: 18px;
}

.contact-modal__close {
    position: absolute;
    right: 20px;
    top: 20px;
    border: 1px solid rgba(244, 244, 245, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f4f4f5;
    width: 36px;
    height: 36px;
    padding: 0;
    cursor: pointer;
}

.contact-modal__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.2vw, 1.8rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    width: min(100%, 680px);
    margin-inline: auto;
}

.contact-modal__form {
    display: grid;
    gap: 12px;
    width: min(100%, 680px);
    margin-inline: auto;
}

.contact-modal__form label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(244, 244, 245, 0.75);
}

.contact-modal__form input,
.contact-modal__form textarea {
    border: 1px solid rgba(244, 244, 245, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.94rem;
    line-height: 1.5;
    padding: 12px 14px;
    width: 100%;
    outline: none;
}

.contact-modal__form textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-modal__form input:focus,
.contact-modal__form textarea:focus {
    border-color: rgba(255, 255, 255, 0.64);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.contact-modal__form button[type="submit"] {
    margin-top: 8px;
    min-height: 46px;
    width: fit-content;
    border: 1px solid #ffffff;
    border-radius: 8px;
    background: #ffffff;
    color: #111111;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0 18px;
    cursor: pointer;
}

.contact-modal__form button[type="submit"]:hover {
    background: rgba(255, 255, 255, 0.84);
}

.contact-modal__status {
    min-height: 1.2em;
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: rgba(244, 244, 245, 0.75);
}

.portfolio__made-with {
    width: 100%;
    padding: 0 24px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: rgba(17, 17, 17, 0.28);
    white-space: nowrap;
}

.portfolio__made-with-label {
    display: inline-flex;
    align-items: center;
}

.portfolio__made-with-brand {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--text);
}

.portfolio__made-with img {
    width: 0.62rem;
    height: 0.62rem;
    object-fit: contain;
    opacity: 0.55;
}

.portfolio__copyright {
    width: 100%;
    margin: 0;
    padding: 0 24px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(17, 17, 17, 0.34);
    text-transform: uppercase;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: #fff;
    cursor: default;
    opacity: 1;
    will-change: opacity;
}

.lightbox__panel {
    position: relative;
    width: min(100vw, 1400px);
    max-height: 100vh;
    padding: 16px;
    display: grid;
    gap: 10px;
    will-change: transform, opacity;
}

.lightbox__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.lightbox__button,
.lightbox__nav {
    border: 0;
    background: transparent;
    color: rgba(17, 17, 17, 0.62);
    min-width: 34px;
    height: 42px;
    padding: 0;
    font-size: 1.04rem;
    font-weight: 700;
    border-radius: 0;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lightbox__nav {
    min-width: 30px;
    font-size: 1.12rem;
}

.lightbox__button i,
.lightbox__nav i {
    opacity: 0.72;
}

.lightbox__stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.lightbox__figure {
    margin: 0;
    width: 100%;
    max-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.lightbox__image {
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transform: scale(1);
    transition: transform 0.2s ease, opacity 0.22s ease;
    cursor: zoom-in;
    opacity: 1;
    will-change: transform, opacity;
}

.lightbox__image.is-zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

@media (max-width: 1120px) {
    .grid-sizer,
    .gallery-item {
        width: calc((100% - 24px) / 3);
    }

    .grid-gutter {
        width: 12px;
    }

    .gallery-item--w2 {
        width: calc((100% - 24px) / 3);
    }
}

@media (max-width: 760px) {
    .page {
        padding: 16px;
    }

    .portfolio {
        gap: 18px;
    }

    .grid-sizer,
    .gallery-item {
        width: calc((100% - 10px) / 2);
    }

    .grid-gutter {
        width: 10px;
    }

    .gallery-item {
        margin-bottom: 10px;
    }

    .gallery-item--w2 {
        width: calc((100% - 10px) / 2);
    }

    .portfolio__footer {
        width: min(100%, 560px);
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 12px;
    }

    .portfolio__socials {
        justify-items: center;
    }

    .portfolio__links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 13px;
        max-width: 260px;
    }

    .portfolio__social-label {
        text-align: center;
    }

    .portfolio__email {
        justify-content: center;
        text-align: center;
    }

    .portfolio__about {
        width: min(100%, 560px);
    }

    .portfolio__micro-contact {
        width: min(100%, 560px);
    }

    .contact-modal__panel {
        width: 100%;
        min-height: 100vh;
        padding: 32px 16px;
    }
}

@media (max-width: 520px) {
    .grid-sizer,
    .gallery-item,
    .gallery-item--w2 {
        width: calc((100% - 8px) / 2);
    }

    .grid-gutter {
        width: 8px;
    }

    .gallery-item {
        margin-bottom: 8px;
    }

    .portfolio__made-with {
        padding: 0 16px 14px;
        font-size: 0.68rem;
    }

    .portfolio__email {
        font-size: 1rem;
    }

    .lightbox__panel {
        padding: 10px;
        gap: 8px;
    }

    .lightbox__button,
    .lightbox__nav {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
    }

    .lightbox__stage {
        grid-template-columns: minmax(0, 1fr);
    }

    .lightbox__nav {
        display: none;
    }
}

/* ---------- Dark theme ---------- */
body.theme-dark {
    --bg: #101012;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --line: #27272a;
}

body.theme-dark .gallery-item {
    background: #1c1c1f;
}

body.theme-dark .portfolio__links {
    color: rgba(244, 244, 245, 0.55);
}

body.theme-dark .portfolio__social-label {
    color: rgba(244, 244, 245, 0.42);
}

body.theme-dark .portfolio__email {
    color: rgba(244, 244, 245, 0.9);
}

body.theme-dark .portfolio__about-text {
    color: rgba(244, 244, 245, 0.78);
}

body.theme-dark .portfolio__contact-trigger {
    background: #f4f4f5;
    border-color: #f4f4f5;
    color: #111111;
}

body.theme-dark .portfolio__contact-trigger:hover {
    background: #e4e4e7;
}

body.theme-dark .portfolio__micro-email {
    color: rgba(244, 244, 245, 0.52);
}

body.theme-dark .portfolio__micro-phone {
    color: rgba(244, 244, 245, 0.48);
}

body.theme-dark .portfolio__micro-links {
    color: rgba(244, 244, 245, 0.42);
}

body.theme-dark .portfolio__micro-icon-link:hover,
body.theme-dark .portfolio__micro-email:hover,
body.theme-dark .portfolio__micro-phone:hover {
    color: rgba(244, 244, 245, 0.75);
}

body.theme-dark .portfolio__made-with {
    color: rgba(244, 244, 245, 0.34);
}

body.theme-dark .portfolio__copyright {
    color: rgba(244, 244, 245, 0.4);
}

body.theme-dark .lightbox__backdrop {
    background: #101012;
}

body.theme-dark .lightbox__button,
body.theme-dark .lightbox__nav {
    color: rgba(244, 244, 245, 0.68);
}

/* ---------- Gallery videos ---------- */
.gallery-item video {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 0;
    cursor: zoom-in;
}

.gallery-item--portrait video {
    aspect-ratio: 4 / 5;
}

.gallery-item--landscape video {
    aspect-ratio: 16 / 10;
}

.gallery-item--square video {
    aspect-ratio: 1 / 1;
}

/* ---------- Lightbox video player ---------- */
.lightbox__video {
    display: none;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    background: #000;
}

.lightbox__video.is-active {
    display: block;
}

.lightbox__image.is-hidden {
    display: none;
}
