/* ==========================================================================
   Верхнее меню сайта
   ========================================================================== */

.nv {
    --nv-bg: rgba(252, 240, 234, 0.82);
    --nv-bg-solid: rgba(252, 240, 234, 0.96);
    --nv-line: rgba(226, 203, 188, 0.7);
    --nv-accent: #b28663;
    --nv-accent-dark: #96694a;
    --nv-ink: #1d1d1d;
    --nv-ink-mute: rgba(29, 29, 29, 0.6);

    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
    background: var(--nv-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid transparent;
    transition: background-color .4s ease, border-color .4s ease, box-shadow .4s ease;
}

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

/* отступ под фиксированную шапку (в style.css было 70px) */
body {
    padding-top: 72px;
}

/* при прокрутке шапка становится плотнее */
.nv.is-scrolled {
    background: var(--nv-bg-solid);
    border-bottom-color: var(--nv-line);
    box-shadow: 0 10px 30px rgba(122, 78, 45, 0.08);
}

.nv__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    width: min(1500px, 100%);
    height: 72px;
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 44px);
}

/* --- бренд ---------------------------------------------------------------- */

.nv__brand {
    display: inline-flex;
    flex-direction: column;
    justify-self: start;
    gap: 3px;
    text-decoration: none;
    line-height: 1;
}

.nv__brand-name {
    font-family: "Forum", serif;
    font-size: 1.3rem;
    letter-spacing: 0.04em;
    color: var(--nv-ink);
    transition: color .35s ease;
}

.nv__brand-sub {
    font-family: "Roboto", sans-serif;
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--nv-ink-mute);
}

.nv__brand:hover .nv__brand-name {
    color: var(--nv-accent);
}

/* --- меню на ПК ------------------------------------------------------------ */

.nv__menu {
    justify-self: center;
}

.nv__list {
    display: flex;
    align-items: center;
    gap: clamp(6px, 1vw, 18px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.nv__list li {
    margin: 0;
    padding: 0;
}

.nv__link {
    position: relative;
    isolation: isolate;
    display: inline-block;
    padding: 12px 10px;
    font-family: "Roboto", sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--nv-ink);
    text-decoration: none;
    transition: color .35s ease;
}

/* звёзды, проявляющиеся при наведении */
.nv__link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: 88px;
    height: 88px;
    background: url("/theme/images/stars.png") center / contain no-repeat;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(-22deg);
    filter: blur(3px);
    pointer-events: none;
    transition: opacity .45s ease, transform .6s cubic-bezier(.22, .61, .36, 1), filter .45s ease;
}

/* тонкая линия, растущая из центра */
.nv__link::after {
    content: "";
    position: absolute;
    right: 50%;
    bottom: 4px;
    left: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--nv-accent), transparent);
    transition: left .45s cubic-bezier(.22, .61, .36, 1), right .45s cubic-bezier(.22, .61, .36, 1);
}

.nv__link:hover,
.nv__link:focus-visible {
    color: var(--nv-accent-dark);
}

.nv__link:hover::before,
.nv__link:focus-visible::before {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1) rotate(10deg);
    filter: blur(0);
}

.nv__link:hover::after,
.nv__link:focus-visible::after {
    right: 6px;
    left: 6px;
}

/* активный раздел */
.nv__link.is-active {
    color: var(--nv-accent-dark);
}

.nv__link.is-active::after {
    right: 6px;
    left: 6px;
    opacity: 0.55;
}

/* --- правая часть и бургер -------------------------------------------------- */

.nv__side {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
}

.nv__burger {
    display: none;
    position: relative;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--nv-line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color .3s ease, border-color .3s ease, transform .3s ease;
}

.nv__burger:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--nv-accent);
    transform: scale(1.05);
}

.nv__burger span {
    position: absolute;
    left: 50%;
    display: block;
    width: 24px;
    height: 2px;
    margin-left: -12px;
    border-radius: 2px;
    background: var(--nv-ink);
    transition: transform .4s cubic-bezier(.22, .61, .36, 1), opacity .3s ease;
}

.nv__burger span:nth-child(1) { top: 17px; }
.nv__burger span:nth-child(2) { top: 25px; }
.nv__burger span:nth-child(3) { top: 33px; }

body.nv-open .nv__burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nv-open .nv__burger span:nth-child(2) { opacity: 0; transform: scaleX(0.3); }
body.nv-open .nv__burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ==========================================================================
   ПОЛНОЭКРАННОЕ МЕНЮ
   ========================================================================== */

.nv-screen {
    position: fixed;
    inset: 0;
    z-index: 1029;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 96px 24px 48px;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.95), transparent 38%),
        radial-gradient(circle at 88% 92%, rgba(178, 134, 99, 0.18), transparent 42%),
        #fcf0ea;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.04);
    transition: opacity .45s ease, transform .55s cubic-bezier(.22, .61, .36, 1), visibility .45s;
}

body.nv-open .nv-screen {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

body.nv-open {
    overflow: hidden;
}

/* орнаменты */
.nv-screen__stars,
.nv-screen__taro {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.nv-screen__stars {
    top: 8%;
    right: -40px;
    width: clamp(170px, 46vw, 300px);
    opacity: 0.2;
    transform: rotate(22deg);
}

.nv-screen__taro {
    left: -70px;
    bottom: -40px;
    width: clamp(190px, 52vw, 330px);
    opacity: 0.09;
    transform: rotate(-12deg);
}

.nv-screen__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(78vw, 460px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(178, 134, 99, 0.22);
    border-radius: 50%;
    pointer-events: none;
    animation: nv-spin 90s linear infinite;
}

@keyframes nv-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.nv-screen__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: 100%;
    overflow-y: auto;
    text-align: center;
}

.nv-screen__brand {
    display: block;
    margin-bottom: 26px;
    font-family: "Roboto", sans-serif;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--nv-accent);
    text-decoration: none;
}

.nv-screen__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nv-screen__list li {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .5s ease, transform .6s cubic-bezier(.22, .61, .36, 1);
}

body.nv-open .nv-screen__list li {
    opacity: 1;
    transform: none;
}

body.nv-open .nv-screen__list li:nth-child(1) { transition-delay: .10s; }
body.nv-open .nv-screen__list li:nth-child(2) { transition-delay: .16s; }
body.nv-open .nv-screen__list li:nth-child(3) { transition-delay: .22s; }
body.nv-open .nv-screen__list li:nth-child(4) { transition-delay: .28s; }
body.nv-open .nv-screen__list li:nth-child(5) { transition-delay: .34s; }
body.nv-open .nv-screen__list li:nth-child(6) { transition-delay: .40s; }
body.nv-open .nv-screen__list li:nth-child(7) { transition-delay: .46s; }
body.nv-open .nv-screen__list li:nth-child(8) { transition-delay: .52s; }

.nv-screen__link {
    position: relative;
    display: inline-block;
    padding: 11px 8px;
    font-family: "Forum", serif;
    font-size: clamp(1.5rem, 6.4vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: var(--nv-ink);
    text-decoration: none;
    transition: color .35s ease;
}

.nv-screen__link::after {
    content: "";
    position: absolute;
    right: 50%;
    bottom: 6px;
    left: 50%;
    height: 1px;
    background: var(--nv-accent);
    opacity: 0.7;
    transition: left .4s ease, right .4s ease;
}

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

.nv-screen__link:hover::after,
.nv-screen__link.is-active::after {
    right: 8px;
    left: 8px;
}

.nv-screen__ornament {
    display: block;
    position: relative;
    width: 120px;
    height: 10px;
    margin: 26px auto 0;
}

.nv-screen__ornament::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--nv-accent), transparent);
    opacity: 0.6;
}

.nv-screen__ornament::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    background: #fcf0ea;
    border: 1px solid var(--nv-accent);
    transform: rotate(45deg);
}

/* ==========================================================================
   АДАПТИВ
   ========================================================================== */

@media (max-width: 1399.98px) {
    .nv__menu {
        display: none;
    }

    .nv__burger {
        display: block;
    }

    .nv__inner {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (max-width: 575.98px) {
    body {
        padding-top: 66px;
    }

    .nv__inner {
        height: 66px;
        padding: 0 16px;
    }

    .nv__brand-name {
        font-size: 1.18rem;
    }

    .nv__brand-sub {
        font-size: 9.5px;
        letter-spacing: 0.18em;
    }

    .nv-screen {
        padding: 88px 20px 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nv-screen,
    .nv-screen__list li,
    .nv-screen__ring,
    .nv__link::before {
        transition: none !important;
        animation: none !important;
    }
}
