/* ============================= */
/* VARIABLES / THEME             */
/* ============================= */

:root {
    --bg: #ffffff;
    --bg-muted: #f4f7f8;
    --bg-paper: #fbfbfa;
    --bg-dark: #0f2f3a;

    --text: #0f1f24;
    --text-soft: #5f6f75;
    --text-invert: #ffffff;

    --accent: #00796B;
    --accent-light: #4fc3f7;

    --border: #e2e8ea;
    --radius: 18px;

    --container: 1200px;
}

/* ============================= */
/* BASE                          */
/* ============================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg-paper);
    line-height: 1.65;
}

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

/* ============================= */
/* LAYOUT                        */
/* ============================= */

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

.container.narrow {
    max-width: 1040px;
}

.site-content {
    min-height: 60vh;
}

/* ============================= */
/* HEADER                        */
/* ============================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-height: 72px;
    gap: 32px;
}

/* LOGO */

.logo-link {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 64px;
    transition: transform 0.25s ease;
}

.logo-link:hover .site-logo {
    transform: scale(1.03);
}

/* ============================= */
/* HEADER CENTER (NAV + SEARCH)  */
/* ============================= */

.header-center {
    display: flex;
    align-items: center;
    gap: 28px;
}

.form-search {
    flex: 1;
    min-width: 0;
}

.header-search {
    display: flex;
    width: 100%;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
    display: none;
    z-index: 200;
}

.search-suggestions.open {
    display: block;
}

.search-suggestions a {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
}

.search-suggestions a:hover {
    background: var(--bg-muted);
}

/* NAV */

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav a {
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.main-nav a:hover::after {
    width: 100%;
}

/* ============================= */
/* HEADER SEARCH                 */
/* ============================= */



/* search icon */

.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;

    font-size: 18px;
    color: var(--text);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.search-toggle:hover {
    opacity: 1;
}

/* search input */

.header-search input {
    position: relative;
    right: 0;

    width: 0;
    opacity: 0;
    pointer-events: none;

    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #ffffff;

    font-size: 14px;
    color: var(--text);

    transform: translateX(8px);
    transition:
        width 0.35s ease,
        opacity 0.2s ease,
        transform 0.25s ease,
        box-shadow 0.2s ease;

    outline: none;
    max-width: calc(100% - 60px);
}

/* open state */

.header-search:focus-within input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;


    box-shadow: 0 0 0 2px rgba(0,121,107,0.12);
    border-color: var(--accent);
}

.header-search input::placeholder {
    color: var(--text-soft);
}

.header-search.open input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;


    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0,121,107,.12);
}

/* 👇 ВАЖНО: разрешаем фокус сразу */
.header-search input:focus {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
}

/* ============================= */
/* HEADER CONTACTS               */
/* ============================= */

.header-contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}

.header-contacts a {
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
}

.header-contacts .phone {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.header-contacts .email {
    font-size: 13px;
    opacity: 0.75;
}

.header-contacts a:hover {
    opacity: 1;
}

/* ============================= */
/* BREADCRUMBS                   */
/* ============================= */

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-soft);
    margin: 32px 0;
}

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

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

.breadcrumbs .sep {
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

/* ============================= */
/* SECTIONS                      */
/* ============================= */

.section {
    padding: 20px 0;
    background: var(--bg-paper);
    margin:10px 0 10px 0;
}

.section.paper {
    background: url("/static/img/paper-bg.png") center / cover no-repeat;
}

.section.muted {
    background:
        linear-gradient(rgba(255,255,255,0.92), rgba(255,255,255,0.92)),
        url("/static/img/stone-texture.png") center / cover no-repeat;
}

.section h2 {
    font-size: 42px;
    margin-bottom: 52px;
    text-align: center;
}

/* ============================= */
/* VALUE GRID                    */
/* ============================= */

.value-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 56px;
}

.value {
    padding: 40px;
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--border);
}

.value strong {
    display: block;
    font-size: 22px;
    margin-bottom: 18px;
}

.value p {
    font-size: 17px;
    line-height: 1.65;
    margin-bottom: 18px;
}

/* ============================= */
/* FOOTER                        */
/* ============================= */

.site-footer {
    background: var(--bg-paper);
    border-top: 1px solid var(--border);
    padding: 64px 24px 48px;
    font-size: 13px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.footer-brand strong {
    font-size: 18px;
    letter-spacing: 0.12em;
}

.footer-tagline {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-soft);
}

.footer-copy {
    margin-top: 18px;
    font-size: 12px;
    color: var(--text-soft);
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-contact a {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-soft);
}


/* ============================= */
/* HERO — ПЕРЕОСМЫСЛЕН           */
/* ============================= */

.hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;

       background:
        radial-gradient(900px 420px at 50% -120px, rgba(255,255,255,0.12), transparent 65%),
        url("/static/img/stone-texture.png") center / cover no-repeat;
    border-bottom: 1px solid var(--border);
}

.hero .container {
    text-align: center;
    max-width: 820px;
}

/* бренд */
.hero h1 {
    font-size: 96px;
    letter-spacing: .18em;
    margin-bottom: 16px;
}

/* мастерская */
.hero h2 {
    font-size: 18px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 56px;
}

/* манифест */
.hero-subtitle {
    font-size: 22px;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto 72px;
}

/* действия */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.button {
    padding: 14px 30px;
    border-radius: 999px;
    font-size: 14px;
    letter-spacing: .14em;
    text-transform: uppercase;
    text-decoration: none;
}

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

.button.primary:hover {
    background: #00695c;
}

.button.ghost {
    border: 1px solid var(--border);
    color: var(--text);
}

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


/* ============================= */
/* RESPONSIVE                    */
/* ============================= */

@media (max-width: 900px) {
    .value-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 80px 0;
    }

    .section h2 {
        font-size: 32px;
    }
}


/* ============================= */
/* MAIN NAV — MULTI LEVEL        */
/* ============================= */

.main-nav {
    position: relative;
}

/* верхний уровень */
.main-nav .menu {
    list-style: none;
    display: flex;
    gap: 28px;
    margin: 0;
    padding: 0;
}

.main-nav .menu > li {
    position: relative;
}

/* ссылки верхнего уровня */
.main-nav .menu > li > a {
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 8px 2px;
    display: inline-block;
    white-space: nowrap;
}

/* подчёркивание */
.main-nav .menu > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.main-nav .menu > li > a:hover::after {
    width: 100%;
}

/* ============================= */
/* SUBMENU                       */
/* ============================= */

.main-nav .submenu {
    position: absolute;
    top: 100%;
    left: -16px;

    min-width: 240px;
    padding: 10px 0;

    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;

    box-shadow: 0 18px 40px rgba(0,0,0,0.12);

    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);

    transition:
        opacity 0.2s ease,
        transform 0.25s ease,
        visibility 0.2s ease;

    z-index: 300;
}

/* пункты */
.main-nav .submenu li {
    list-style: none;
}

/* ссылки */
.main-nav .submenu a {
    display: block;
    padding: 10px 22px;

    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;

    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

/* hover */
.main-nav .submenu a:hover {
    background: var(--bg-muted);
}

/* разделитель */
.main-nav .submenu .divider {
    height: 1px;
    margin: 8px 0;
    background: var(--border);
}

/* показать подменю */
.main-nav .menu > li:hover > .submenu,
.main-nav .menu > li:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================= */
/* EXTERNAL LINK (TELEGRAM)      */
/* ============================= */

.main-nav .menu > li.external > a {
    color: var(--accent);
}

.main-nav .menu > li.external > a::after {
    display: none;
}

/* ============================= */
/* MOBILE MENU / HAMBURGER      */
/* ============================= */

.main-nav .submenu-toggle {
    display: none;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    z-index: 101;
    position: relative;
    background: none;
    border: none;
    padding: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
    left: 0;
    transform-origin: center;
}

.mobile-menu-btn span:nth-child(1) {
    top: 0;
}

.mobile-menu-btn span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-btn span:nth-child(3) {
    bottom: 0;
}

.mobile-menu-btn.active span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: translateY(-50%) scale(0);
}

.mobile-menu-btn.active span:nth-child(3) {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

.mobile-nav-overlay {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================= */
/* MOBILE SAFE                  */
/* ============================= */

@media (max-width: 1280px) {
    .main-nav .menu {
        gap: 10px;
    }
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: flex;
    }

    .header-inner {
        grid-template-columns: auto 1fr auto;
        gap: 20px;
        position: relative;
    }

    .logo-link {
        order: 1;
    }

    .header-contacts {
        order: 2;
        justify-self: center;
        align-items: center;
    }

    .mobile-menu-btn {
        order: 3;
    }

    .header-center {
        display: none !important;
    }

    .header-center.mobile-open {
        display: flex !important;
        position: absolute;
        top: 100%;
        left: -24px;
        right: -24px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        max-height: 100vh;
        opacity: 1;
        visibility: visible;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 99;
        padding: 20px 48px;
    }

    .main-nav {
        width: 100%;
        order: 1;
    }

    .main-nav .menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .main-nav .menu > li {
        width: 100%;
        border-bottom: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav .menu > li:last-child {
        border-bottom: none;
    }

    .main-nav .menu > li:has(.submenu),
    .main-nav .menu > li.has-submenu {
        position: relative;
    }

    .main-nav .submenu-toggle {
        display: none;
        background: none;
        border: none;
        padding: 0;
        width: 20px;
        height: 20px;
        cursor: pointer;
        font-size: 10px;
        color: var(--text);
        flex-shrink: 0;
        transition: transform 0.3s ease;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 0;
        top: 17px;
        z-index: 100;
    }

    .main-nav .menu > li:has(.submenu) .submenu-toggle,
    .main-nav .menu > li.has-submenu .submenu-toggle {
        display: flex;
    }

    .main-nav .menu > li.active .submenu-toggle {
        transform: rotate(90deg);
        color: var(--accent);
    }

    .main-nav .menu > li > a {
        display: block;
        padding: 16px 0;
        cursor: pointer;
        width: 100%;
        position: relative;
        z-index: 1;
    }

    .main-nav .menu > li:has(.submenu) > a,
    .main-nav .menu > li.has-submenu > a {
        padding-left: 28px;
    }

    .main-nav .submenu {
        position: static;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0;
        background: transparent;
        min-width: auto;
        margin-top: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    .main-nav .menu > li.active > .submenu {
        max-height: 500px !important;
        opacity: 1 !important;
        visibility: visible !important;
        padding: 8px 0 8px 0 !important;
        margin-top: 0;
        width: 100%;
        overflow: visible !important;
    }

    .main-nav .submenu li {
        list-style: none;
    }

    .main-nav .submenu a {
        padding: 12px;
        font-size: 14px;
        text-transform: none;
        letter-spacing: normal;
    }

    .form-search {
        order: 2;
        width: 100%;
        margin-top: 20px;
        flex: none;
    }

    .header-search {
        width: 100%;
    }

    .header-search input {
        width: 100% !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .header-inner {
        gap: 16px;
    }

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

    .footer-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .header-contacts {
        align-items: flex-start;
    }
}