@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Light_0.ttf') format('truetype');
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Regular_0.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Medium_0.ttf') format('truetype');
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Semibold_0.ttf') format('truetype');
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Gilroy';
    src: url('../fonts/Gilroy-Bold_0.ttf') format('truetype');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Kudryashev Headline Sans';
    src: url('../fonts/kudryashev-headline-sans.ttf') format('truetype');
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}

:root {
    --color-bg: #F8F8F6;
    --color-card: #F8F8F6;
    --color-primary: #540B16;
    --color-primary-soft: #69202B;
    --color-text: #7D6962;
    --color-white: #F8F8F6;
    --color-placeholder: #D8D1CC;
    --color-placeholder-dark: #B7ADA7;

    --shadow-folder: 0 6px 5.5px rgba(0, 0, 0, 0.25);

    --radius-xl: 50px;
    --radius-lg: 20px;
    --radius-md: 17px;

    --transition-base: 0.25s ease;

    --site-max-width: 1440px;
    --site-side-padding: clamp(20px, 13.9vw, 200px);
    --intro-media-width: 366px;
    --intro-content-width: 612px;
    --portfolio-column-width: 475px;
    --price-width: 717px;
    --sales-width: 498px;
    --contacts-width: 501px;
    --map-width: 1040px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    background: var(--color-bg);
    color: var(--color-primary);
    font-family: 'Gilroy', Arial, sans-serif;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    background: transparent;
}

[hidden] {
    display: none !important;
}

.site {
    width: 100%;
    min-height: 100vh;
}

.site__main {
    width: min(100%, var(--site-max-width));
    margin: 0 auto;
    background: var(--color-bg);
    overflow: visible;
}

/* =========================
   TYPOGRAPHY + UI
   ========================= */

.section-title {
    margin: 0;
    color: var(--color-primary);
    font-family: 'Kudryashev Headline Sans', serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
}

.section-title--light {
    color: var(--color-white);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 41px;
    padding: 15px 30px;
    border-radius: var(--radius-md);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    transition:
        transform var(--transition-base),
        opacity var(--transition-base),
        background-color var(--transition-base);
}

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

.button:hover,
.button:active {
    transform: translateY(-1px);
}

/* =========================
   INTRO
   ========================= */

.intro {
    width: 100%;
}

.hero__image {
    min-height: 482px;
    background-color: var(--color-placeholder-dark);
    background-image: url('../images/hero.webp');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
}

.about {
    position: relative;
    margin-top: -60px;
    z-index: 1;
}

.about__card {
    width: 100%;
    background: var(--color-card);
    border-radius: var(--radius-xl);
    padding: 50px 20px 54px;
}

.about__content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.about__text-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about__text {
    margin: 0;
    color: var(--color-text);
    font-size: 16px;
    line-height: 1.18;
}

/* =========================
   PORTFOLIO
   ========================= */

.portfolio-row {
    padding: 24px 20px 0;
}

.portfolio-row,
.sales-contacts-row {
    display: grid;
    gap: 24px;
}

.portfolio {
    padding-top: 0;
    overflow: visible;
}

.portfolio__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.portfolio-folder {
    position: relative;
    width: 100%;
    height: 249px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    isolation: isolate;
    overflow: visible;
}

.portfolio-folder__preview,
.portfolio-folder__front {
    position: absolute;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.portfolio-folder__preview {
    background-color: var(--color-placeholder);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.portfolio-folder__preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(84, 11, 22, 0.08);
}

.portfolio-folder__preview--left {
    left: 24px;
    top: 42px;
    width: 118px;
    height: 112px;
    transform: rotate(-40deg);
}

.portfolio-folder__preview--center {
    left: 124px;
    top: 0;
    width: 112px;
    height: 103px;
    transform: rotate(-22deg);
}

.portfolio-folder__preview--right {
    right: 44px;
    top: 38px;
    width: 127px;
    height: 117px;
    transform: rotate(8.5deg);
}

.portfolio-folder__front {
    left: 42px;
    top: 68px;
    width: calc(100% - 84px);
    height: 169px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft);
    box-shadow: var(--shadow-folder);
}

.portfolio-folder__label {
    color: var(--color-white);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    text-decoration: underline;
    text-transform: lowercase;
}

.portfolio-gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.works-card {
    aspect-ratio: 154 / 142;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-placeholder);
    cursor: pointer;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.works-card.is-revealing {
    opacity: 0;
    transform: translateY(20px);
}

.portfolio-gallery.is-opening .works-card {
    opacity: 0;
    transform: translateY(20px);
}

.works-grid .works-card:nth-child(1) { transition-delay: 0s; }
.works-grid .works-card:nth-child(2) { transition-delay: 0.1s; }
.works-grid .works-card:nth-child(3) { transition-delay: 0.2s; }
.works-grid .works-card:nth-child(4) { transition-delay: 0.3s; }

.works-card.works-card--extra {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

.works-card.works-card--extra.is-revealing {
    opacity: 0;
    transform: translateY(20px);
}

.works-grid .works-card--extra:nth-child(5) { transition-delay: 0s; }
.works-grid .works-card--extra:nth-child(6) { transition-delay: 0.1s; }
.works-grid .works-card--extra:nth-child(7) { transition-delay: 0.2s; }
.works-grid .works-card--extra:nth-child(8) { transition-delay: 0.3s; }

.works-card__image {
    width: 100%;
    height: 100%;
    background-color: var(--color-placeholder);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* =========================
   PRICE
   ========================= */

.price {
    padding: 24px 20px 0;
}

.price-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 30px 20px;
    border-radius: var(--radius-lg);
    background: var(--color-primary);
    color: var(--color-white);
    
}


.price-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-group__title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: fit-content;
    color: var(--color-white);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    text-transform: uppercase;
}

.price-group__title img {
    width: 18px;
    height: 15px;
    flex: 0 0 auto;
}

.price-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-list--compact {
    gap: 4px;
}

.price-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
}

.price-item--compact {
    align-items: center;
}

.price-item__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.price-item__text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.18;
}

.price-item__text p {
    margin: 0;
    max-width: 217px;
    font-size: 11px;
    font-style: italic;
    font-weight: 300;
    line-height: 1.18;
    text-transform: lowercase;
    opacity: 0.92;
}

.price-item__price,
.price-item__subprice {
    text-align: right;
}

.price-item__price {
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
}

.price-item__price-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.price-item__subprice {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.price-item__subprice-value {
    font-size: 20px;
    font-weight: 400;
}

.price-item__subprice-label {
    font-size: 11px;
    font-style: italic;
    font-weight: 300;
    line-height: 1.2;
    text-transform: lowercase;
    opacity: 0.92;
}


   /* SALES + CONTACTS */
.sales {
    padding: 34px 20px 0;
}

.contacts {
    padding: 10px 20px 0;
}

.sales__inner,
.contacts__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sales__banner {
    width: calc(100% + 40px);
    margin-left: -20px;

    min-height: 286px;
    border-radius: var(--radius-lg);

    background-color: var(--color-placeholder);
    background-image: url('../images/sales.webp');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.contacts__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.contacts__note {
    margin: 0;
    color: #000000;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.23;
    text-align: center;

}

/* =========================
   MAP
   ========================= */

.map-section {
    padding: 30px 0 0;
}

.map-section__card {
    width: 100%;
    background: var(--color-primary);
    border-radius: 20px 20px 0 0;
    padding: 30px 20px;
}

.map-section__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-section__title {
    margin: 0;
    color: var(--color-white);
    font-family: 'Kudryashev Headline Sans', serif;
    font-style: normal;
    font-weight: 500;
    font-size: 24px;
    line-height: 1.2;
    text-transform: uppercase;
}

.map-section__frame {
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-white);
}

.map-section__frame iframe {
    display: block;
    width: 100%;
    height: 245px;
    border: 0;
}

.map-section__address {
    color: var(--color-white);
    font-size: 14px;
    font-style: normal;
    line-height: 1.35;
}

.map-note {
    margin: 0;
    font-size: 13px;
    font-style: italic;
    line-height: 1.4;
    opacity: 0.85;
    color: var(--color-white);
}

/* =========================
   LIGHTBOX
   ========================= */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    padding: 20px;
    touch-action: none;
    overscroll-behavior: contain;
    opacity: 1;
    transform: translateY(0);
    transition: transform 0.7s ease, opacity 0.7s ease;
}

.lightbox.is-dragging-up {
    transition: none;
}

.lightbox.is-closing-up {
    opacity: 0;
    transform: translateY(-80px);
}

.lightbox__content {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    touch-action: none;
}

.lightbox__image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 20px;
    opacity: 1;
    transform: none;
    transition: opacity 0.45s ease;
}

.lightbox__image.is-fading-out {
    opacity: 0;
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: rgba(248, 248, 246, 0.14);
    color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.lightbox__close span,
.lightbox__nav span {
    display: block;
    line-height: 1;
    transform: translateY(2px);
}

.lightbox__close {
    top: 16px;
    right: 16px;
    font-size: 26px;
}

.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
}

.lightbox__nav--prev {
    left: 16px;
}

.lightbox__nav--next {
    right: 16px;
}

   /* SMALL MOBILE */
@media (max-width: 359px) {
    .portfolio-folder__front {
        left: 30px;
        width: calc(100% - 60px);
    }

    .portfolio-folder__preview--left {
        left: 14px;
    }

    .portfolio-folder__preview--right {
        right: 24px;
    }
}


   /* TABLET */
@media (min-width: 768px) and (max-width: 1199px) {
    body {
        padding: 24px 0;
    }

    .site__main {
        max-width: 480px;
        border-radius: 24px;
        box-shadow: 0 12px 40px rgba(84, 11, 22, 0.08);
        overflow: hidden;
    }
}


   /* DESKTOP */
@media (min-width: 1200px) {
    .site__main {
        padding: 70px var(--site-side-padding) 0;
    }

    /* =========================
       INTRO
       ========================= */

    .intro {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(320px, var(--intro-media-width)) minmax(520px, var(--intro-content-width));
        align-items: center;
        justify-content: space-between;
        column-gap: clamp(32px, 4.3vw, 62px);
    }

    .hero__image {
        min-height: 330px;
        border-radius: 30px;
        background-position: center center;
    }

    .about {
        margin-top: 0;
    }

    .about__card {
        min-height: 330px;
        padding: 0;
        background: transparent;
        border-radius: 0;
    }

    .about__content {
        min-height: 330px;
        justify-content: space-between;
        gap: 14px;
    }

    .about__text-block {
        gap: 22px;
    }

    .about .section-title {
        font-size: 36px;
    }

    .about__text {
        max-width: 612px;
        font-size: 24px;
        line-height: 1.21;
    }

    .about .button {
        min-height: 59px;
        padding: 20px 42px;
        border-radius: 24px;
        font-size: 24px;
    }

    /* =========================
       PORTFOLIO
       ========================= */

    .portfolio-row {
        width: 100%;
        max-width: var(--map-width);
        margin: 70px auto 0;
        padding: 0;
        display: grid;
        grid-template-columns: minmax(420px, var(--portfolio-column-width)) minmax(420px, var(--portfolio-column-width));
        justify-content: space-between;
        align-items: start;
        column-gap: clamp(48px, 6.25vw, 90px);
    }

    .portfolio__inner {
        gap: 26px;
    }

    #polina-works,
    #nastya-works {
        width: 100%;
        max-width: var(--portfolio-column-width);
    }

    #nastya-works {
        justify-self: end;
    }

    .portfolio .section-title {
        font-size: 36px;
        text-align: center;
    }

    .portfolio-folder {
        height: 372px;
    }

    .portfolio-folder__preview--left {
        left: 1px;
        top: 55px;
        width: 175px;
        height: 167px;
        border-radius: 30px;
    }

    .portfolio-folder__preview--center {
        left: 185px;
        top: 0;
        width: 167px;
        height: 154px;
        border-radius: 30px;
    }

    .portfolio-folder__preview--right {
        right: 54px;
        top: 55px;
        width: 190px;
        height: 175px;
        border-radius: 30px;
    }

    .portfolio-folder__front {
        left: 63px;
        top: 102px;
        width: 334px;
        height: 252px;
        border-radius: 30px;
        box-shadow: 0 9px 8px rgba(0, 0, 0, 0.25);
    }

    .portfolio-folder__label {
        font-size: 36px;
    }

    .works-grid {
        gap: 12px;
    }

    .works-card {
        aspect-ratio: 231 / 213;
        border-radius: 24px;
    }

    .portfolio .button {
        min-height: 57px;
        padding: 20px 30px;
        border-radius: 17px;
        font-size: 24px;
    }

    /* =========================
       PRICE
       ========================= */

    .price {
        max-width: var(--price-width);
        margin: 70px auto 0;
        padding: 0;
    }

    .price-card {
        gap: 24px;
        padding: 30px 20px;
        border-radius: 20px;
    }

    .price .section-title {
        font-size: 32px;
    }

    .price-group__title {
        font-size: 24px;
    }

    .price-item {
        gap: 40px;
    }

    .price-item__text h4 {
        font-size: 24px;
        line-height: 1.2;
    }

    .price-item__text p {
        max-width: 506px;
        font-size: 15px;
        line-height: 1.2;
    }

    .price-item__price {
        font-size: 32px;
        font-weight: 600;
    }

    .price-item__subprice-value {
        font-size: 24px;
        font-weight: 600;
    }

    .price-item__subprice-label {
        font-size: 15px;
    }

    /* =========================
       SALES + CONTACTS
       ========================= */

    .sales-contacts-row {
        width: 100%;
        max-width: var(--map-width);
        margin: 70px auto 0;
        padding: 0;
        display: grid;
        grid-template-columns: minmax(420px, var(--sales-width)) minmax(420px, var(--contacts-width));
        justify-content: space-between;
        align-items: start;
        column-gap: clamp(24px, 2.85vw, 41px);
    }

    .sales,
    .contacts {
        width: 100%;
        padding: 0;
    }

    .sales .section-title,
    .contacts .section-title {
        font-size: 32px;
        text-align: center;
    }

    .sales__banner {
        width: 100%;
        margin-left: 0;
        min-height: 396px;
        border-radius: 20px;
    }

    .contacts .button {
        min-height: 57px;
        padding: 20px 30px;
        font-size: 24px;
    }

    .contacts__note {
        font-size: 20px;
        line-height: 1.2;
    }

    /* =========================
       MAP
       ========================= */

    .map-section {
        max-width: var(--map-width);
        margin: 70px auto 0;
        padding: 0;
    }

    .map-section__card {
        width: 100%;
        padding: 20px 36px 30px;
    }
    
    .map-section__title {
        width: 223px;
        margin: 0 auto;
        color: var(--color-white);
        font-family: 'Kudryashev Headline Sans', serif;
        font-weight: 500;
        font-size: 32px;
        line-height: 49px;
        text-align: center;
        text-transform: uppercase;
    }

    .map-section__frame iframe {
        height: 325px;
    }

    .map-section__address {
        font-size: 18px;
    }

    .map-note {
        font-size: 15px;
    }

    /* =========================
       LIGHTBOX
       ========================= */

    .lightbox__content {
        max-width: 900px;
    }

    .lightbox__close,
    .lightbox__nav {
        width: 52px;
        height: 52px;
    }

    .lightbox__close {
        top: 24px;
        right: 24px;
    }

    .lightbox__nav--prev {
        left: 24px;
    }

    .lightbox__nav--next {
        right: 24px;
    }
}