/* Проект 05 — базовая тема публичной страницы.
   Дизайн-токены задаются здесь; бизнес-данные в CSS не хранятся. */

:root {
    --ink: #2d2e2b;
    --ink-soft: #5f605a;
    --paper: #f4f1eb;
    --surface: #fbf9f4;
    --surface-alt: #eae4da;
    --stone: #e1dacd;
    --brand: #3b3c38;
    --brand-deep: #262724;
    --accent: #9a6a4b;
    --accent-ink: #7d5238;
    --accent-deep: #83583d;
    --accent-soft: #d8c4b0;
    --line: #d8d0c3;
    --line-strong: #8a8275;
    --white: #ffffff;
    --success: #2f6b4f;
    --success-soft: #e6efe9;
    --danger: #a94438;
    --danger-soft: #f7e7e3;
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 28px;
    --shadow: 0 18px 50px rgba(45, 46, 43, 0.10);
    --container: 1180px;
    --font-body: "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Georgia", "Times New Roman", serif;
}

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

html {
    scroll-behavior: smooth;
}

[id] {
    scroll-margin-top: 92px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.25rem, 4.4vw, 4.1rem);
    max-width: 15ch;
}

h2 {
    font-size: clamp(1.85rem, 3vw, 2.85rem);
    max-width: 20ch;
}

h3 {
    font-size: 1.32rem;
    line-height: 1.25;
}

p {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

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

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 100;
    padding: 12px 18px;
    background: var(--brand-deep);
    color: var(--white);
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 16px;
}

/* --- Кнопки --- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.97rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

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

.button--primary {
    background: var(--accent);
    color: var(--white);
}

.button--primary:hover {
    background: var(--accent-deep);
    color: var(--white);
}

.button--ghost {
    border-color: rgba(28, 38, 32, 0.28);
    background: transparent;
    color: var(--ink);
}

.button--ghost:hover {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.section--dark .button--ghost,
.section--accent .button--ghost {
    border-color: rgba(255, 255, 255, 0.42);
    color: var(--white);
}

.section--dark .button--ghost:hover,
.section--accent .button--ghost:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--brand-deep);
}

.button--small {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.9rem;
    background: var(--brand);
    color: var(--white);
}

.button--small:hover {
    background: var(--accent);
    color: var(--white);
}

/* --- Шапка --- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(244, 241, 235, 0.94);
    border-bottom: 1px solid rgba(45, 46, 43, 0.10);
    backdrop-filter: blur(10px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 78px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 1.25rem;
}

.brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand__name {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.brand__descriptor {
    color: var(--ink-soft);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-nav {
    margin-left: auto;
}

.site-nav__list {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 0.92rem;
}

.site-nav__list a {
    text-decoration: none;
    color: var(--ink-soft);
}

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

.site-header__contacts {
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-header__phone {
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

/* --- Первый экран --- */

.hero {
    position: relative;
    overflow: hidden;
    background-color: #d9d1c5;
    background-image:
        radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.55), transparent 40%),
        radial-gradient(circle at 16% 84%, rgba(154, 106, 75, 0.16), transparent 42%),
        linear-gradient(135deg, #ece6dc 0%, #d7cec0 100%);
    background-position: center;
    background-size: cover;
}

.hero--image {
    background-image: none;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__bg img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(244, 241, 235, 0.98) 0%, rgba(244, 241, 235, 0.95) 34%, rgba(244, 241, 235, 0.68) 60%, rgba(244, 241, 235, 0.16) 84%, rgba(244, 241, 235, 0) 100%),
        linear-gradient(0deg, rgba(244, 241, 235, 0.94) 0%, rgba(244, 241, 235, 0) 28%),
        linear-gradient(180deg, rgba(244, 241, 235, 0.52) 0%, rgba(244, 241, 235, 0) 24%);
    pointer-events: none;
}

.hero__inner {
    position: relative;
    z-index: 2;
    padding-block: clamp(84px, 9vw, 132px) clamp(66px, 8vw, 104px);
}

.hero__content {
    max-width: 780px;
}

.hero h1 {
    max-width: 18ch;
}

.eyebrow {
    margin-bottom: 18px;
    color: var(--accent-ink);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero__text {
    max-width: 52ch;
    margin-top: 24px;
    color: #4f504b;
    font-size: clamp(1.08rem, 1.6vw, 1.28rem);
}

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

.hero__facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    max-width: 780px;
    margin: clamp(40px, 6vw, 64px) 0 0;
    padding-top: 26px;
    border-top: 1px solid rgba(45, 46, 43, 0.2);
}

.hero__fact dt {
    order: 2;
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.hero__fact dd {
    order: 1;
    margin: 0 0 6px;
    font-family: var(--font-heading);
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.2;
}

.hero__fact {
    display: flex;
    flex-direction: column;
}

/* --- Секции --- */

.section {
    padding-block: clamp(64px, 8vw, 110px);
}

.section--tinted {
    background: var(--surface-alt);
}

.section--stone {
    background:
        radial-gradient(circle at 92% 8%, rgba(255, 255, 255, 0.4), transparent 34%),
        var(--stone);
}

.section--dark {
    background:
        radial-gradient(circle at 90% 10%, rgba(154, 106, 75, 0.2), transparent 32%),
        var(--brand-deep);
    color: var(--white);
}

.section--accent {
    background:
        radial-gradient(circle at 88% 12%, rgba(154, 106, 75, 0.24), transparent 34%),
        linear-gradient(160deg, #353632 0%, #242522 100%);
    color: var(--white);
}

.section__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 88px);
    align-items: start;
}

.section__body p + p {
    margin-top: 18px;
}

.section__body {
    color: var(--ink-soft);
    font-size: 1.04rem;
}

.section__intro {
    max-width: 720px;
    margin-bottom: 46px;
}

.section__intro p {
    margin-top: 18px;
    color: var(--ink-soft);
    font-size: 1.04rem;
}

.section--dark .section__intro p,
.section--accent .section__intro p {
    color: rgba(255, 255, 255, 0.78);
}

.section--dark .eyebrow,
.section--accent .eyebrow {
    color: var(--accent-soft);
}

.section__note {
    max-width: 880px;
    margin-top: 34px;
    padding: 18px 22px;
    border-left: 3px solid var(--accent);
    background: rgba(255, 255, 255, 0.62);
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.check-list {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.check-list li {
    position: relative;
    padding-left: 32px;
    color: var(--ink);
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 16px;
    height: 9px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
}

/* --- Услуги --- */

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

/* Пять услуг — намеренная композиция «3 + 2»:
   три равные карточки в первом ряду и две широкие во втором. */
.service-grid--five {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.service-grid--five .service-card {
    grid-column: span 2;
}

.service-grid--five .service-card:nth-child(4),
.service-grid--five .service-card:nth-child(5) {
    grid-column: span 3;
}

.service-card {
    display: flex;
    flex-direction: column;
    padding: 26px 26px 28px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.service-card__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 18px;
    border-radius: 12px;
    background: rgba(154, 106, 75, 0.1);
    color: var(--accent-ink);
}

.service-card__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.service-card__head h3 {
    font-size: 1.24rem;
}

.service-card__price {
    color: var(--accent-ink);
    font-size: 1rem;
    font-weight: 700;
}

.service-card__description {
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 0.97rem;
    line-height: 1.55;
}

.service-card__details {
    display: grid;
    gap: 7px;
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

.service-card__details li {
    position: relative;
    padding-left: 16px;
}

.service-card__details li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* --- Галерея --- */

.section--gallery {
    background: var(--paper);
}

.gallery-categories {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 36px;
}

.gallery-category {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.gallery-category:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.gallery-category[aria-pressed="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.gallery-category__art {
    display: block;
    aspect-ratio: 2.1 / 1;
    overflow: hidden;
    background: #d8cfc1;
}

.gallery-category__art--kitchens {
    background: linear-gradient(135deg, #ded5c7 0%, #c3b4a1 100%);
}

.gallery-category__art--living {
    background: linear-gradient(135deg, #e5ded2 0%, #c8bcae 100%);
}

.gallery-category__art--bathrooms {
    background: linear-gradient(135deg, #d9d4cb 0%, #bbb4a9 100%);
}

.gallery-category__art--offices {
    background: linear-gradient(135deg, #cec8bc 0%, #b7ac9d 100%);
}

.gallery-category__art--other {
    background: linear-gradient(135deg, #e0d8cb 0%, #c4b6a4 100%);
}

.gallery-category__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
}

.gallery-category__index {
    color: var(--accent-ink);
    font-family: var(--font-heading);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
}

.gallery-category__title {
    font-family: var(--font-heading);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.2;
}

.gallery-category__text {
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.45;
}

.gallery-category__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    color: var(--accent-ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.gallery-category__action svg {
    transition: transform 160ms ease;
}

.gallery-category:hover .gallery-category__action svg {
    transform: translateX(3px);
}

.gallery-panels {
    padding-top: 28px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 104px;
}

.gallery-panel {
    scroll-margin-top: 104px;
}

.gallery-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
    margin-bottom: 24px;
}

.gallery-panel__kicker {
    margin-bottom: 4px;
    color: var(--accent-ink);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gallery-panel h3 {
    font-size: clamp(1.4rem, 2.2vw, 1.75rem);
}

.gallery-panel__reset {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.gallery-panel__reset:hover {
    color: var(--accent-deep);
}

.gallery-panel__reset[hidden] {
    display: none;
}

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

.gallery-item {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.gallery-item picture {
    display: block;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-item figcaption {
    padding: 14px 18px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.gallery-empty {
    display: grid;
    justify-items: center;
    padding: clamp(38px, 6vw, 64px) 24px;
    border: 1px dashed #cbc1b2;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(234, 228, 218, 0.46));
    text-align: center;
}

.gallery-empty__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: rgba(154, 106, 75, 0.1);
    color: var(--accent-ink);
}

.gallery-empty__title {
    margin-bottom: 8px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.2;
}

.gallery-empty__text {
    max-width: 48ch;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* --- Преимущества --- */

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

.benefit-card {
    padding: 26px;
    border: 1px solid rgba(45, 46, 43, 0.11);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.56);
}

.benefit-card__number {
    display: block;
    margin-bottom: 18px;
    color: var(--accent-ink);
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.benefit-card h3 {
    margin-bottom: 10px;
    font-size: 1.16rem;
}

.benefit-card p {
    color: var(--ink-soft);
    font-size: 0.94rem;
}

/* --- Этапы --- */

.step-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    counter-reset: step;
}

.step {
    position: relative;
    padding-top: 24px;
    border-top: 2px solid var(--line);
}

.step__number {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent-ink);
    font-family: var(--font-heading);
    font-size: 1rem;
}

.step h3 {
    margin-bottom: 10px;
    font-size: 1.12rem;
}

.step p {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

/* --- Контакты --- */

.section--contacts {
    background: var(--surface-alt);
}

.contacts {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: center;
}

.contacts__intro p {
    max-width: 52ch;
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

/* Заголовок «Контакты» начинает левую колонку без верхнего зазора —
   так его верх выравнивается с верхом карточки справа. */
.contacts__intro .eyebrow {
    margin-top: 0;
}

.contacts__points {
    display: grid;
    gap: 12px;
    max-width: 46ch;
    margin-top: 26px;
    color: var(--ink);
    font-size: 0.98rem;
}

.contacts__points li {
    position: relative;
    padding-left: 30px;
}

.contacts__points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.46em;
    width: 15px;
    height: 8px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
}

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

.contact-card {
    /* Карточка центрируется по вертикали относительно текстового столбца. */
    margin-top: 0;
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.contact-card__title {
    margin-bottom: 20px;
    color: var(--ink);
    font-family: var(--font-heading);
    font-size: 1.32rem;
    font-weight: 600;
    line-height: 1.2;
}

.contact-list {
    display: grid;
    margin: 0;
}

.contact-list__item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.contact-list__item:first-child {
    padding-top: 0;
}

.contact-list__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.contact-list dt {
    margin-bottom: 5px;
    color: var(--accent-ink);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.contact-list dd {
    margin: 0;
    font-size: 1.02rem;
}

.contact-list dd a {
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}

.contact-list dd a:hover {
    color: var(--accent-ink);
    border-color: var(--accent);
}

.contact-list__note {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 0.82rem;
}

/* --- Форма заявки --- */

.section--form {
    background: var(--surface);
}

.lead-form {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.lead-form__intro p {
    max-width: 46ch;
    margin-top: 16px;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.lead-form__points {
    display: grid;
    gap: 12px;
    max-width: 44ch;
    margin-top: 24px;
    color: var(--ink);
    font-size: 0.98rem;
}

.lead-form__points li {
    position: relative;
    padding-left: 30px;
}

.lead-form__points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.46em;
    width: 15px;
    height: 8px;
    border-left: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
}

.lead-form__card {
    padding: clamp(24px, 3vw, 34px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
    box-shadow: var(--shadow);
}

.form {
    display: grid;
    gap: 18px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
}

.field__note {
    margin-left: 6px;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 400;
}

.field__req {
    color: var(--accent-ink);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.field--check .check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 400;
    cursor: pointer;
}

.field--check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--accent);
}

.form__submit {
    justify-self: start;
}

/* --- Состояния формы (этап 6) --- */

.form-status {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.45;
}

/* Пустое состояние не занимает места, но остаётся в дереве доступности
   для корректного объявления сообщений вспомогательными технологиями. */
.form-status:empty {
    padding: 0;
    border: 0;
    height: 0;
    overflow: hidden;
}

.form-status:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.form-status--success {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

.form-status--error,
.form-status--invalid,
.form-status--limited {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

.form-status--loading {
    border-color: var(--accent);
    background: var(--surface-alt);
    color: var(--ink-soft);
}

.field__error {
    margin: 0;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
}

.field__error[hidden] {
    display: none;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: var(--danger);
}

.field input[aria-invalid="true"]:focus,
.field select[aria-invalid="true"]:focus,
.field textarea[aria-invalid="true"]:focus {
    border-color: var(--danger);
    outline-color: var(--danger);
}

.button.is-loading,
.button:disabled {
    cursor: default;
    opacity: 0.72;
}

.button:disabled {
    transform: none;
}

/* Honeypot: поле вне видимой области; скрыто и от вспомогательных технологий. */
.lead-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- Подвал --- */

.site-footer {
    /* Компактный подвал: уменьшенные вертикальные отступы вместо больших пустых зон. */
    padding-block: clamp(22px, 2.5vw, 30px) clamp(18px, 2.3vw, 26px);
    border-top: 3px solid var(--accent);
    background: var(--brand-deep);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

.site-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: clamp(22px, 2.6vw, 40px);
    align-items: start;
    padding-bottom: 14px;
}

.site-footer__brand .brand__name {
    display: block;
    color: var(--white);
    font-size: 1.35rem;
}

.site-footer__descriptor {
    display: block;
    margin-top: 3px;
    color: var(--accent-soft);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-footer__tagline {
    display: block;
    max-width: 34ch;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.86rem;
    line-height: 1.5;
}

.site-footer__heading {
    margin-bottom: 7px;
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-footer__nav ul {
    display: grid;
    gap: 5px;
}

.site-footer__nav a {
    color: rgba(255, 255, 255, 0.74);
    text-decoration: none;
}

.site-footer__nav a:hover {
    color: var(--accent-soft);
}

.footer-contacts {
    display: grid;
    gap: 4px;
}

.footer-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    line-height: 1.35;
}

.footer-contact__label {
    color: var(--accent-soft);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-contact__value {
    color: rgba(255, 255, 255, 0.82);
}

.footer-contact__pending {
    color: rgba(255, 255, 255, 0.55);
}

.footer-contact a {
    color: var(--white);
    text-decoration: none;
}

.footer-contact a:hover {
    color: var(--accent-soft);
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 24px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer__copyright,
.site-footer__demo {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.site-footer__demo {
    max-width: none;
}

/* Нижняя строка на desktop — в одну строку без переноса. */
@media (min-width: 1100px) {
    .site-footer__demo {
        white-space: nowrap;
    }
}

.error-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding-block: 60px;
}

/* --- Кнопка «Наверх» --- */

.to-top {
    position: fixed;
    right: clamp(16px, 3vw, 30px);
    bottom: clamp(16px, 3vw, 30px);
    z-index: 60;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(45, 46, 43, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.to-top:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.to-top:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* --- Адаптивность --- */

@media (max-width: 1080px) {
    .hero__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-grid,
    .service-grid--five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-grid--five .service-card,
    .service-grid--five .service-card:nth-child(4),
    .service-grid--five .service-card:nth-child(5) {
        grid-column: auto;
    }

    .service-grid--five .service-card:last-child {
        grid-column: 1 / -1;
    }

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

    .gallery-categories {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .step-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px 40px;
    }

    .site-footer__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .site-nav {
        display: none;
    }

    .site-header__contacts {
        margin-left: auto;
    }

    .section__grid,
    .lead-form,
    .contacts {
        grid-template-columns: 1fr;
    }

    .gallery-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    body {
        font-size: 16px;
    }

    .site-header__inner {
        min-height: 68px;
        gap: 12px;
    }

    .site-header__phone {
        display: none;
    }

    .brand__mark {
        width: 36px;
        height: 36px;
    }

    .brand__name {
        font-size: 1.18rem;
    }

    .hero__inner {
        padding-block: 56px 64px;
    }

    .hero__actions .button {
        width: 100%;
    }

    .hero::before {
        background: linear-gradient(180deg, rgba(244, 241, 235, 0.93) 0%, rgba(244, 241, 235, 0.84) 62%, rgba(244, 241, 235, 0.9) 100%);
    }

    .hero__facts {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 38px;
    }

    .benefit-grid,
    .gallery-grid,
    .step-list,
    .service-grid,
    .service-grid--five {
        grid-template-columns: 1fr;
    }

    .service-grid--five .service-card:last-child {
        grid-column: auto;
    }

    .section {
        padding-block: 56px;
    }

    .contacts__actions .button {
        width: 100%;
    }

    .form__submit {
        width: 100%;
        justify-self: stretch;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .site-footer__brand {
        grid-column: auto;
    }

    /* Зазор под плавающую кнопку «Наверх», чтобы она не перекрывала нижнюю строку. */
    .site-footer {
        padding-bottom: 76px;
    }
}

@media (max-width: 560px) {
    .gallery-categories {
        grid-template-columns: 1fr;
    }

    .gallery-category {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .gallery-category__art {
        height: 100%;
        min-height: 124px;
        aspect-ratio: auto;
    }

    .gallery-category__body {
        padding: 16px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
