:root {
    --bg: #f3eee4;
    --bg-muted: #e8e0d2;
    --ink: #1b1712;
    --ink-soft: #5b5348;
    --paper: #fffaf2;
    --line: #d6cdb8;
    --accent: #c45c26;
    --accent-dark: #9a4218;
    --ok: #2f6b3a;
    --error: #a33b2b;
    --header: #16130f;
    --radius: 14px;
    --shadow: 0 18px 40px rgba(27, 23, 18, 0.08);
    --font: "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
}

a {
    color: var(--accent-dark);
}

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

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

.shell {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 72px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 88px;
}

.sidebar__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: var(--header);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.sidebar__cta:hover {
    color: #fff;
    background: #2a241c;
}

.sidebar__cta--ghost {
    margin-top: 20px;
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.sidebar__cta--ghost:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    border-top: 1px solid var(--line);
}

.sidebar__link {
    display: block;
    padding: 11px 0;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--line);
    line-height: 1.35;
}

.sidebar__link:hover,
.sidebar__link.is-active {
    color: var(--accent-dark);
}

.sidebar__link.is-active {
    font-weight: 700;
}

.crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 4px;
    padding: 0;
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--ink-soft);
    counter-reset: crumb;
}

.crumbs li {
    counter-increment: crumb;
}

.crumbs li::before {
    content: counter(crumb) ". ";
}

.crumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 8px;
    color: #b7ad9a;
}

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

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

.crumbs span {
    color: var(--ink);
}

.content .article {
    padding: 0;
}

.content .article h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
    max-width: 18ch;
}

.content .lead {
    font-size: 1.15rem;
    margin: 0;
}

.content .prose {
    max-width: none;
}

.content .prose h2 {
    margin-top: 2.2em;
    font-size: 1.55rem;
}

.content .prose h3 {
    margin-top: 1.6em;
    font-size: 1.15rem;
}

.content .prose ol {
    padding-left: 1.2em;
}

.content .prose .note {
    background: var(--paper);
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 10px;
    padding: 16px 18px;
    color: var(--ink);
}

.content .prose .content-cta {
    margin-top: 36px;
}

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

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

.page {
    flex: 1;
}

.header {
    background: var(--header);
    color: #f7f1e6;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.logo:hover {
    color: inherit;
}

.logo__img {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    flex-shrink: 0;
}

.logo__text {
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav__link {
    color: #d8d0c2;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
}

.nav__link:hover,
.nav__link.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    border-radius: 10px;
    padding: 10px 9px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    margin: 5px 0;
}

.hero,
.section,
.article {
    padding: 72px 0;
}

.hero h1,
.article h1,
.section h2 {
    font-family: var(--serif);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 16px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    max-width: 16ch;
}

.hero__container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 40px 48px;
    align-items: center;
}

.hero__photo {
    display: block;
    width: 100%;
    height: 360px;
    object-fit: cover;
    object-position: 22% 12%;
    border-radius: 18px;
    box-shadow: var(--shadow);
}

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

.lead {
    font-size: 1.2rem;
    color: var(--ink-soft);
    max-width: 62ch;
}

.hero__actions,
.section__head {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 28px;
}

.section__head {
    justify-content: space-between;
    margin: 0 0 28px;
}

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

.cards,
.post-grid,
.contacts {
    display: grid;
    gap: 20px;
}

.cards,
.post-grid {
    grid-template-columns: repeat(3, 1fr);
}

.card,
.post-card,
.form,
.contacts__info {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 0 14px;
    border-radius: 12px;
    background: rgba(196, 92, 38, 0.1);
    color: var(--accent-dark);
}

.card__icon svg {
    display: block;
}

.copy-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.copy-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink-soft);
    cursor: pointer;
}

.copy-btn:hover {
    color: var(--accent-dark);
    border-color: var(--accent);
}

.copy-btn__check {
    display: none;
}

.copy-btn.is-copied {
    color: var(--ok);
    border-color: var(--ok);
}

.copy-btn.is-copied .copy-btn__icon {
    display: none;
}

.copy-btn.is-copied .copy-btn__check {
    display: block;
}

.card h3,
.post-card h3 {
    font-family: var(--serif);
    margin: 0 0 10px;
}

.post-card time,
.footer__note {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.post-card a {
    color: inherit;
    text-decoration: none;
}

.post-card a:hover {
    color: var(--accent-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
}

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

.btn--primary:hover {
    background: var(--accent-dark);
    color: #fff;
}

.btn--ghost {
    border-color: var(--line);
    color: var(--ink);
    background: transparent;
}

.link {
    color: var(--accent-dark);
}

.article__head {
    margin-bottom: 32px;
}

.prose {
    max-width: 72ch;
}

.prose p,
.prose li {
    color: var(--ink-soft);
}

.prose h2,
.prose h3 {
    font-family: var(--serif);
    color: var(--ink);
}

.contacts {
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
}

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

.form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.form input,
.form textarea {
    font: inherit;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.form input:focus,
.form textarea:focus {
    outline: 2px solid rgba(196, 92, 38, 0.35);
    border-color: var(--accent);
}

.optional {
    font-weight: 400;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.field-error,
.alert--error {
    color: var(--error);
    font-weight: 500;
}

.alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: 10px;
}

.alert--ok {
    background: #e7f3ea;
    color: var(--ok);
}

.alert--error {
    background: #fbecea;
}

.pager {
    display: flex;
    gap: 8px;
    margin-top: 32px;
}

.pager a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    text-decoration: none;
    border: 1px solid var(--line);
    color: var(--ink);
}

.pager a.is-active {
    background: var(--header);
    color: #fff;
    border-color: var(--header);
}

.footer {
    background: var(--header);
    color: #d8d0c2;
    padding: 48px 0 24px;
    margin-top: auto;
}

.footer a {
    color: #f7f1e6;
    text-decoration: none;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--serif);
    font-size: 1.4rem;
    color: #fff;
    margin: 0 0 8px;
}

.footer__logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.footer__nav,
.footer__contacts {
    display: grid;
    gap: 8px;
    align-content: start;
}

.footer__copy {
    padding-top: 20px;
    font-size: 0.9rem;
}

@media (max-width: 860px) {
    .cards,
    .post-grid,
    .contacts,
    .footer__grid,
    .shell,
    .post-grid--inner {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: -1;
    }

    .nav-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--header);
        padding: 12px 20px 20px;
        flex-direction: column;
    }

    .nav.is-open {
        display: flex;
    }

    .hero,
    .section,
    .article {
        padding: 48px 0;
    }

    .hero__container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero__photo {
        width: min(240px, 70%);
        height: 280px;
    }
}
