:root {
    --bg: #f5f7f6;
    --surface: #ffffff;
    --surface-soft: #eef2ef;
    --surface-warm: #f2f0ea;
    --text: #17212b;
    --muted: #607080;
    --accent: #17324d;
    --accent-soft: #7c8a95;
    --line: rgba(23, 33, 43, 0.1);
    --shadow: 0 16px 40px rgba(12, 19, 26, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #fbfcfb 0%, var(--bg) 100%);
}

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

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

.page-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    padding: 18px 0 10px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: var(--accent);
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: var(--shadow);
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-text strong,
h1,
h2,
h3 {
    font-family: Georgia, "Times New Roman", serif;
}

.brand-text strong {
    font-size: 1rem;
    line-height: 1.1;
}

.brand-text small {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.topbar-links {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar-links a {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.topbar-links a:hover {
    transform: translateY(-1px);
    border-color: rgba(23, 50, 77, 0.22);
    color: var(--accent);
}

.hero-grid {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
    min-height: 560px;
    padding: 18px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(10, 16, 23, 0.72) 0%, rgba(10, 16, 23, 0.38) 32%, rgba(10, 16, 23, 0.10) 60%, rgba(10, 16, 23, 0.02) 100%),
        url("images/matrac.jpg") center center / cover no-repeat;
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--accent-soft);
}

h1 {
    margin: 0;
    font-size: clamp(2.8rem, 6vw, 5.1rem);
    line-height: 0.96;
    max-width: 12ch;
}

h2 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.7rem);
    line-height: 1.05;
}

h3 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.2;
}

.hero-lead,
.section-lead,
.advantage-card p,
.workflow-step p,
.hero-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.hero-copy {
    display: grid;
    gap: 18px;
    max-width: 560px;
    padding: 22px 22px 20px;
    border-radius: 22px;
    background: rgba(12, 18, 25, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: none;
}

.hero-copy .eyebrow {
    color: rgba(255, 255, 255, 0.74);
}

.hero-copy h1 {
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.hero-copy .hero-sublead {
    max-width: 54ch;
}

.hero-copy .hero-metrics {
    max-width: 560px;
}

.hero-lead {
    max-width: 54ch;
    font-size: 1.03rem;
    color: #fff;
}

.hero-sublead {
    margin: 0;
    max-width: 54ch;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 560px;
}

.metric-pill {
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    backdrop-filter: none;
    display: flex;
    align-items: center;
    min-height: 68px;
}

.metric-pill strong {
    font-size: 0.96rem;
    line-height: 1.35;
    color: #fff;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 2px;
}

.button {
    min-height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

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

.button-primary {
    background: #fff;
    color: var(--accent);
    box-shadow: none;
}

.button-secondary {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.section {
    padding: 22px 0 0;
}

.section-header {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.section-header.compact {
    max-width: 760px;
}

.section-lead {
    max-width: 78ch;
}

.about-section {
    padding-top: 16px;
}

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

.product-card {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    padding: 0;
    appearance: none;
    aspect-ratio: 1 / 0.92;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-card:focus-visible {
    outline: 3px solid rgba(23, 50, 77, 0.34);
    outline-offset: 3px;
}

.product-card img {
    height: 100%;
    object-fit: cover;
}

.product-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 33, 0.04) 0%, rgba(15, 23, 33, 0.28) 100%);
    pointer-events: none;
}

.product-label {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 1;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-align: center;
    backdrop-filter: blur(10px);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

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

.advantage-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 28px rgba(12, 19, 26, 0.04);
}

.advantage-card h3 {
    margin-bottom: 10px;
}

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

.workflow-step {
    padding: 14px 14px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(241, 244, 242, 0.98) 100%);
    box-shadow: 0 10px 28px rgba(12, 19, 26, 0.04);
}

.workflow-step p {
    color: var(--text);
    font-size: 0.98rem;
}

.contacts-card {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 14px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
}

.contacts-copy {
    display: grid;
    gap: 10px;
}

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

.contact-link {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(247, 249, 248, 0.9);
    color: var(--muted);
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.contact-link:hover {
    transform: translateY(-1px);
    border-color: rgba(23, 50, 77, 0.18);
    color: var(--accent);
    background: rgba(255, 255, 255, 0.96);
}

.contact-link-featured {
    grid-column: 1 / -1;
    color: var(--accent);
    background: rgba(23, 50, 77, 0.04);
}

.contact-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: currentColor;
}

.contact-link span {
    line-height: 1.35;
}

.site-footer {
    margin-top: 24px;
    padding: 14px 0;
    border-top: 1px solid rgba(23, 33, 43, 0.08);
    background: linear-gradient(180deg, rgba(15, 21, 30, 0.96) 0%, rgba(12, 18, 25, 0.98) 100%);
    color: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
}

.site-footer-inner {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    text-align: center;
}

.site-footer-name {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.success-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.success-shell {
    width: min(700px, 100%);
}

.success-card {
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.success-card p {
    color: var(--muted);
    line-height: 1.65;
}

body.modal-open {
    overflow: hidden;
}

.order-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(12, 18, 25, 0.58);
}

.order-modal[hidden] {
    display: none;
}

.order-modal-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: var(--surface);
    box-shadow: 0 28px 80px rgba(12, 18, 25, 0.26);
}

.order-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(247, 249, 248, 0.96);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.order-modal-close:hover {
    transform: translateY(-1px);
    border-color: rgba(23, 50, 77, 0.24);
}

.order-modal-close:focus-visible,
.order-submit:focus-visible,
.form-field input:focus-visible,
.form-field textarea:focus-visible {
    outline: 3px solid rgba(23, 50, 77, 0.26);
    outline-offset: 2px;
}

.order-form {
    display: grid;
    gap: 16px;
    padding: 34px;
}

.order-form-header {
    display: grid;
    gap: 8px;
    padding-right: 42px;
}

.order-form-header .eyebrow {
    margin-bottom: 0;
}

.order-form-header h2 {
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    line-height: 1.1;
}

.form-field {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(247, 249, 248, 0.92);
    color: var(--text);
    font: inherit;
    font-weight: 400;
    line-height: 1.45;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.form-field input {
    min-height: 50px;
    padding: 0 14px;
}

.form-field textarea {
    min-height: 116px;
    resize: vertical;
    padding: 12px 14px;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: rgba(23, 50, 77, 0.28);
    background: #fff;
}

.order-submit {
    width: 100%;
    border: 0;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.order-submit:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.order-form-note {
    margin: -4px 0 0;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.form-status {
    display: none;
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.45;
}

.form-status.is-visible {
    display: block;
}

.form-status.is-success {
    border: 1px solid rgba(38, 132, 84, 0.2);
    background: rgba(38, 132, 84, 0.1);
    color: #236442;
}

.form-status.is-error {
    border: 1px solid rgba(174, 49, 49, 0.2);
    background: rgba(174, 49, 49, 0.1);
    color: #8a2d2d;
}

@media (max-width: 1080px) {
    .hero-grid {
        min-height: 500px;
        padding: 16px;
    }

    .hero-copy {
        max-width: 600px;
    }

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

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

    .contacts-card {
        grid-template-columns: 1fr;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 740px) {
    .page-shell {
        width: min(100% - 20px, 1240px);
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 18px;
    }

    .topbar-links {
        width: 100%;
    }

    .topbar-links a {
        flex: 1 1 0;
    }

    .hero-grid {
        min-height: 430px;
        padding: 12px;
    }

    .hero-metrics,
    .products-grid,
    .advantages-grid,
    .workflow-grid {
        grid-template-columns: 1fr;
    }

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

    .hero-copy {
        padding: 16px;
        max-width: none;
        border-radius: 20px;
    }

    .hero-lead,
    .hero-sublead {
        max-width: none;
    }

    .product-card {
        aspect-ratio: 1 / 0.9;
    }

    .contacts-card {
        padding: 16px;
    }

    .site-footer {
        margin-top: 18px;
        padding: 14px 0;
    }

    .site-footer-inner {
        width: min(100% - 20px, 1240px);
    }

    .success-card {
        padding: 26px;
    }

    .order-modal {
        padding: 10px;
    }

    .order-modal-dialog {
        max-height: calc(100vh - 20px);
        border-radius: 20px;
    }

    .order-form {
        padding: 24px 16px 18px;
    }

    .order-form-header {
        padding-right: 44px;
    }
}

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

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
