/* ==========================================================
           ТОКЕНЫ
        ========================================================== */
        :root {
            --ink: #0a0f0d;
            --ink-soft: #121a17;
            --ink-2: #1a2520;
            --cream: #f5efe3;
            --cream-soft: #ece4d2;
            --paper: #fbf7ee;
            --gold: #c9963f;
            --gold-light: #e8c983;
            --gold-deep: #8f6820;
            --amber: #e8a84a;
            --burgundy: #6e1f2e;
            --copper: #a4602f;
            --teal: #2d8171;
            --text: #2b2723;
            --muted: #7b705f;
            --line: rgba(184, 137, 59, .2);
            --line-strong: rgba(184, 137, 59, .45);

            --display: "Instrument Serif", "Fraunces", Georgia, serif;
            --sans: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
            --body: "Onest", "Bricolage Grotesque", system-ui, sans-serif;

            --ease: cubic-bezier(.2, .8, .2, 1);
            --ease-out: cubic-bezier(.16, 1, .3, 1);
            --radius: 24px;
            --radius-sm: 14px;
            --shadow-soft: 0 1px 0 rgba(255,255,255,.7) inset, 0 28px 56px -34px rgba(52, 36, 10, .4), 0 2px 8px rgba(52, 36, 10, .05);
            --shadow-deep: 0 44px 88px -44px rgba(30, 18, 3, .55), 0 6px 16px rgba(30, 18, 3, .08);
        }

        /* ==========================================================
           БАЗА
        ========================================================== */
        *, *::before, *::after { box-sizing: border-box; }
        html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--gold) var(--cream); overflow-x: hidden; }
        body {
            margin: 0;
            font-family: var(--body);
            font-size: 16px;
            line-height: 1.7;
            color: var(--text);
            background-color: #f5efe3;
            -webkit-font-smoothing: antialiased;
            text-rendering: optimizeLegibility;
            overflow-x: clip;
            position: relative;
            min-height: 100vh;
        }

        /* ==========================================================
           ФОН: живая аурора по углам + бумажное зерно
        ========================================================== */
        .bg-decor {
            position: fixed; inset: 0;
            z-index: -2;
            pointer-events: none;
            overflow: hidden;
            background-color: #f5efe3;
        }
        .bg-decor .blob {
            position: absolute;
            border-radius: 50%;
            filter: blur(90px);
            will-change: transform;
        }
        .blob-1 {
            width: 55vw; height: 55vw; max-width: 900px; max-height: 900px;
            top: -22%; left: -18%;
            background: radial-gradient(circle, rgba(232, 168, 74, .55), transparent 70%);
            animation: float1 22s ease-in-out infinite;
        }
        .blob-2 {
            width: 50vw; height: 50vw; max-width: 800px; max-height: 800px;
            top: -18%; right: -20%;
            background: radial-gradient(circle, rgba(180, 60, 90, .42), transparent 70%);
            animation: float2 26s ease-in-out infinite;
        }
        .blob-3 {
            width: 55vw; height: 55vw; max-width: 900px; max-height: 900px;
            bottom: -25%; right: -15%;
            background: radial-gradient(circle, rgba(45, 129, 113, .32), transparent 70%);
            animation: float3 24s ease-in-out infinite;
        }
        .blob-4 {
            width: 45vw; height: 45vw; max-width: 750px; max-height: 750px;
            bottom: -20%; left: -15%;
            background: radial-gradient(circle, rgba(220, 160, 80, .5), transparent 70%);
            animation: float4 20s ease-in-out infinite;
        }
        @keyframes float1 {
            0%, 100% { transform: translate(0,0) scale(1); }
            50% { transform: translate(6%, 4%) scale(1.08); }
        }
        @keyframes float2 {
            0%, 100% { transform: translate(0,0) scale(1); }
            50% { transform: translate(-5%, 6%) scale(.94); }
        }
        @keyframes float3 {
            0%, 100% { transform: translate(0,0) scale(1); }
            50% { transform: translate(-6%, -4%) scale(1.06); }
        }
        @keyframes float4 {
            0%, 100% { transform: translate(0,0) scale(1); }
            50% { transform: translate(5%, -5%) scale(.95); }
        }

        /* бумажное зерно */
        body::before {
            content: "";
            position: fixed; inset: 0;
            z-index: 9990;
            pointer-events: none;
            opacity: .05;
            mix-blend-mode: multiply;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
        }

        /* тонкая сетка */
        body::after {
            content: "";
            position: fixed; inset: 0;
            z-index: -1;
            pointer-events: none;
            opacity: .5;
            background-image:
                linear-gradient(rgba(143, 104, 32, .045) 1px, transparent 1px),
                linear-gradient(90deg, rgba(143, 104, 32, .045) 1px, transparent 1px);
            background-size: 88px 88px;
            -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse at center, #000 0%, transparent 75%);
        }

        ::selection { background: var(--gold); color: #fff; }
        img { max-width: 100%; display: block; }
        a { color: inherit; text-decoration: none; transition: color .3s var(--ease); }
        :focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

        .container { width: min(1320px, 100% - 2rem); margin-inline: auto; position: relative; }

        h1, h2, h3, h4 { font-family: var(--display); margin: 0; line-height: 1.08; font-weight: 400; letter-spacing: -.01em; }

        ::-webkit-scrollbar { width: 10px; height: 8px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: linear-gradient(var(--gold), var(--copper)); border-radius: 8px; }

        /* прогресс чтения */
        #progress {
            position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 10000;
            background: linear-gradient(90deg, var(--burgundy), var(--copper), var(--gold-light));
            transform: scaleX(0); transform-origin: left;
        }

        /* ==========================================================
           ПОЯВЛЕНИЕ ПРИ СКРОЛЛЕ
        ========================================================== */
        .js .reveal {
            opacity: 0;
            transform: translateY(32px);
            filter: blur(5px);
            transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
        }
        .js .reveal.in { opacity: 1; transform: none; filter: none; }
        .js .duo .reveal:nth-child(2) { transition-delay: .14s; }

        /* ==========================================================
           ШАПКА
        ========================================================== */
        .site-header {
            position: sticky; top: 0; z-index: 900;
            transition: background .4s var(--ease), box-shadow .4s var(--ease), backdrop-filter .4s, padding .4s var(--ease);
            border-bottom: 1px solid transparent;
        }
        .site-header.scrolled {
            background: rgba(245, 239, 227, .72);
            -webkit-backdrop-filter: blur(22px) saturate(160%);
            backdrop-filter: blur(22px) saturate(160%);
            border-bottom-color: var(--line);
            box-shadow: 0 12px 34px -22px rgba(40, 28, 8, .4);
        }
        .header-inner {
            display: flex; align-items: center; justify-content: space-between;
            gap: 1.5rem;
            padding-block: 1.1rem;
            transition: padding .4s var(--ease);
        }
        .site-header.scrolled .header-inner { padding-block: .7rem; }

        .logo {
            display: inline-flex; align-items: center; gap: .8rem;
            color: var(--ink);
            flex-shrink: 0;
        }
        .logo-mark {
            display: grid; place-items: center;
            width: 44px; height: 44px; border-radius: 50%;
            font-family: var(--display); font-size: 1.15rem;
            background: linear-gradient(135deg, var(--gold-light), var(--gold));
            color: var(--ink);
            box-shadow: 0 6px 16px -6px rgba(143, 104, 32, .65), inset 0 1px 0 rgba(255,255,255,.5);
            transition: transform .5s var(--ease), box-shadow .5s var(--ease);
        }
        .logo:hover .logo-mark { transform: rotate(-12deg) scale(1.05); box-shadow: 0 10px 22px -8px rgba(143, 104, 32, .75); }
        .logo-name {
            font-family: var(--display); font-size: 1.35rem;
            line-height: 1; letter-spacing: -.02em;
        }
        .logo-name em { font-style: italic; color: var(--copper); }
        @media (max-width: 560px) { .logo-name { display: none; } }

        /* Текстовая навигация в шапке */
        .site-nav {
            display: none;
            align-items: center;
            gap: .15rem;
            margin-left: auto;
        }
        .nav-link {
            position: relative;
            padding: .55rem .8rem;
            font-family: var(--sans);
            font-size: .78rem;
            font-weight: 500;
            letter-spacing: .02em;
            color: var(--ink);
            border-radius: 8px;
            transition: color .3s, background .3s;
        }
        .nav-link::after {
            content: "";
            position: absolute;
            left: 50%; bottom: .25rem;
            width: 0; height: 1.5px;
            background: linear-gradient(90deg, var(--burgundy), var(--gold));
            transform: translateX(-50%);
            transition: width .4s var(--ease-out);
            border-radius: 2px;
        }
        .nav-link:hover { color: var(--burgundy); }
        .nav-link:hover::after { width: calc(100% - 1.6rem); }
        .nav-link.active { color: var(--burgundy); }
        .nav-link.active::after { width: calc(100% - 1.6rem); background: linear-gradient(90deg, var(--copper), var(--gold-light)); }

        @media (min-width: 960px) {
            .site-nav { display: flex; }
        }

        /* Кнопка «Меню» — не бургер */
        .menu-toggle {
            display: inline-flex; align-items: center; gap: .75rem;
            padding: .45rem .5rem .45rem 1.15rem;
            border-radius: 999px;
            border: 1px solid var(--line-strong);
            background: rgba(255,255,255,.55);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            color: var(--ink);
            font-family: var(--sans);
            font-weight: 500; font-size: .82rem;
            letter-spacing: .02em;
            cursor: pointer;
            flex-shrink: 0;
            transition: background .4s, color .4s, transform .4s var(--ease), box-shadow .4s, border-color .4s;
        }
        .menu-toggle:hover {
            background: var(--ink); color: var(--cream); border-color: var(--ink);
            box-shadow: 0 16px 34px -16px rgba(10,15,13,.65), 0 0 0 4px rgba(232,201,131,.15);
            transform: translateY(-1px);
        }
        .menu-toggle-icon {
            display: grid; place-items: center;
            width: 34px; height: 34px;
            border-radius: 50%;
            background: var(--ink);
            transition: background .4s, transform .6s var(--ease-out);
        }
        .menu-toggle:hover .menu-toggle-icon { background: var(--gold); transform: rotate(45deg); }
        .menu-toggle-icon svg {
            width: 15px; height: 15px;
            fill: none; stroke: var(--cream);
            stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
            transition: stroke .4s;
        }
        .menu-toggle:hover .menu-toggle-icon svg { stroke: var(--ink); }

        /* ==========================================================
           ПОЛНОЭКРАННОЕ МЕНЮ
        ========================================================== */
        .menu-overlay {
            position: fixed; inset: 0; z-index: 9500;
            background: var(--ink);
            color: var(--cream);
            display: flex; flex-direction: column;
            padding: clamp(1.5rem, 3vw, 2.6rem);
            overflow: hidden;
            clip-path: circle(0% at calc(100% - 3.5rem) 3.5rem);
            visibility: hidden;
            transition: clip-path 1s var(--ease-out), visibility 0s linear 1s;
            pointer-events: none;
        }
        .menu-overlay.is-open {
            clip-path: circle(170% at calc(100% - 3.5rem) 3.5rem);
            visibility: visible;
            transition: clip-path 1s var(--ease-out), visibility 0s linear 0s;
            pointer-events: auto;
        }
        .menu-overlay::before {
            content: "";
            position: absolute; inset: -20%;
            background:
                radial-gradient(circle at 22% 30%, rgba(232,201,131,.20), transparent 42%),
                radial-gradient(circle at 78% 72%, rgba(110,31,46,.28), transparent 45%),
                radial-gradient(circle at 60% 5%, rgba(45,129,113,.14), transparent 40%);
            animation: aurora 14s ease-in-out infinite;
            pointer-events: none;
        }
        @keyframes aurora {
            0%, 100% { transform: translate(0,0) rotate(0deg); }
            50% { transform: translate(4%, -3%) rotate(8deg); }
        }
        .menu-overlay::after {
            content: "";
            position: absolute; inset: 0;
            opacity: .05; mix-blend-mode: screen; pointer-events: none;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
        }

        .menu-topbar {
            display: flex; align-items: center; justify-content: space-between;
            position: relative; z-index: 2;
            gap: 1rem;
        }
        .menu-eyebrow {
            display: inline-flex; align-items: center; gap: .8rem;
            font-family: var(--sans);
            font-size: .72rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
            color: var(--gold-light);
        }
        .menu-eyebrow::before {
            content: ""; width: 44px; height: 1px; background: var(--gold);
        }

        /* Кнопка закрытия — со спецэффектами */
        .menu-close {
            position: relative;
            width: 68px; height: 68px;
            border-radius: 50%;
            border: 1px solid rgba(232,201,131,.35);
            background: rgba(10,15,13,.55);
            -webkit-backdrop-filter: blur(8px);
            backdrop-filter: blur(8px);
            cursor: pointer;
            display: grid; place-items: center;
            transition: transform .7s var(--ease-out), background .45s, border-color .45s, box-shadow .45s;
        }
        .menu-close::before {
            content: "";
            position: absolute; inset: -6px;
            border-radius: 50%;
            border: 1px solid rgba(232,201,131,.35);
            animation: pulseRing 2.8s ease-out infinite;
            pointer-events: none;
        }
        @keyframes pulseRing {
            0% { transform: scale(1); opacity: .75; }
            100% { transform: scale(1.55); opacity: 0; }
        }
        .menu-close-line {
            position: absolute; width: 24px; height: 1.5px;
            background: var(--cream); border-radius: 2px;
            transition: background .4s;
        }
        .menu-close-line:nth-child(2) { transform: rotate(45deg); }
        .menu-close-line:nth-child(3) { transform: rotate(-45deg); }
        .menu-close:hover {
            transform: rotate(180deg) scale(1.06);
            background: var(--gold);
            border-color: var(--gold-light);
            box-shadow: 0 0 0 10px rgba(232,201,131,.12), 0 0 44px rgba(232,201,131,.55);
        }
        .menu-close:hover .menu-close-line { background: var(--ink); }

        .menu-inner {
            position: relative; z-index: 2;
            flex: 1;
            display: flex; flex-direction: column;
            justify-content: center;
            gap: clamp(1.5rem, 4vh, 3rem);
            padding-block: 2rem;
        }
        .menu-nav {
            display: flex; flex-direction: column;
            border-top: 1px solid rgba(232,201,131,.14);
        }
        .menu-link {
            position: relative;
            display: flex; align-items: baseline; gap: clamp(1rem, 2.5vw, 2rem);
            padding: clamp(.6rem, 1.6vh, 1rem) 0;
            border-bottom: 1px solid rgba(232,201,131,.14);
            font-family: var(--display);
            font-size: clamp(1.7rem, 5.5vw, 4rem);
            line-height: 1;
            color: var(--cream);
            opacity: 0;
            transform: translateY(48px);
            transition: opacity .6s var(--ease), transform .8s var(--ease-out), color .35s;
            transition-delay: calc(var(--i, 0) * 70ms + .25s);
        }
        .menu-overlay.is-open .menu-link { opacity: 1; transform: none; }
        .menu-overlay:not(.is-open) .menu-link { transition-delay: 0s; transition-duration: .3s; }
        .menu-num {
            font-family: var(--sans); font-weight: 500;
            font-size: .72rem; letter-spacing: .2em;
            color: rgba(232,201,131,.55);
            transition: color .35s, transform .5s var(--ease);
            align-self: flex-start;
            padding-top: .5rem;
        }
        .menu-label {
            display: inline-block;
            transition: transform .5s var(--ease-out), color .35s;
        }
        .menu-arrow {
            width: clamp(20px, 2.6vw, 30px); height: auto;
            margin-left: auto; align-self: center;
            stroke: var(--gold-light); fill: none;
            stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
            opacity: 0;
            transform: translate(-14px, 14px);
            transition: opacity .4s, transform .5s var(--ease-out);
        }
        .menu-link:hover { color: var(--gold-light); }
        .menu-link:hover .menu-num { color: var(--gold); transform: translateX(-6px); }
        .menu-link:hover .menu-label { transform: translateX(10px); }
        .menu-link:hover .menu-arrow { opacity: 1; transform: translate(0, 0); }

        .menu-footer {
            display: grid; grid-template-columns: 1fr; gap: 1rem;
            padding-top: 1rem;
            opacity: 0;
            transform: translateY(20px);
            transition: opacity .7s, transform .7s var(--ease-out);
            transition-delay: .8s;
        }
        .menu-overlay.is-open .menu-footer { opacity: 1; transform: none; }
        .menu-overlay:not(.is-open) .menu-footer { transition-delay: 0s; }
        .menu-footer-col p { margin: .2rem 0 0; color: var(--cream-soft); font-size: .95rem; font-family: var(--body); }
        .menu-footer-label {
            font-family: var(--sans);
            font-size: .68rem; letter-spacing: .28em; text-transform: uppercase;
            color: var(--gold-light); font-weight: 600;
        }
        @media (min-width: 640px) {
            .menu-footer { grid-template-columns: 1fr 1fr; gap: 2rem; }
        }

        /* ==========================================================
           ГАЛЕРЕЯ КНИГ
        ========================================================== */
        #gk-header {
            position: relative; overflow: hidden;
            background:
                radial-gradient(900px 380px at 50% -20%, rgba(232,201,131,.22), transparent 65%),
                radial-gradient(600px 280px at 15% 110%, rgba(180,60,90,.18), transparent 65%),
                linear-gradient(180deg, #060a08, #0f1a16 130%);
            padding: 1rem 0 1.2rem;
            margin-top: -1px;
            border-top: 1px solid rgba(232,201,131,.22);
            border-bottom: 1px solid rgba(232,201,131,.22);
        }
        #gk-header::before {
            content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
            background: linear-gradient(90deg, transparent, rgba(232,201,131,.55), transparent);
        }
        #gk-header::after {
            content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
            background: linear-gradient(90deg, transparent, rgba(45,129,113,.55), transparent);
        }
        .strip-section-label {
            display: flex; align-items: center; justify-content: space-between;
            padding: 1.1rem 1.5rem 0;
            font-family: var(--sans);
            color: rgba(245,239,227,.55);
            font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; font-weight: 500;
        }
        .strip-section-label span:last-child { color: var(--gold-light); }

        .cover-strip {
            display: flex; gap: clamp(1rem, 2.6vw, 2rem);
            overflow-x: auto; overscroll-behavior-x: contain;
            scroll-snap-type: x mandatory;
            padding: 2rem 1.5rem 2.4rem;
            scrollbar-width: none;
            perspective: 1400px;
            -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
        }
        .cover-strip::-webkit-scrollbar { display: none; }
        .cover-strip.dragging { scroll-snap-type: none; cursor: grabbing; }
        .book-item {
            flex: 0 0 clamp(128px, 22vw, 178px);
            scroll-snap-align: start;
            text-align: center;
        }
        .js .book-item {
            animation: bookRise .9s var(--ease-out) both;
            animation-delay: calc(var(--i, 0) * 55ms + .1s);
        }
        @keyframes bookRise { from { opacity: 0; transform: translateY(46px) scale(.94); } to { opacity: 1; transform: none; } }

        .book-link { display: block; }
        .book-cover {
            position: relative; line-height: 0;
            border-radius: 3px 8px 8px 3px;
            box-shadow: 0 18px 30px -14px rgba(0,0,0,.75), 0 3px 8px rgba(0,0,0,.4);
            transition: transform .7s var(--ease-out), box-shadow .7s var(--ease-out);
            transform-style: preserve-3d;
        }
        .book-cover::after {
            content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
            background:
                linear-gradient(90deg, rgba(0,0,0,.42) 0, rgba(255,255,255,.22) 3.5%, rgba(0,0,0,.08) 6%, transparent 12%, transparent 92%, rgba(0,0,0,.22) 100%),
                linear-gradient(180deg, transparent 70%, rgba(0,0,0,.25) 100%);
        }
        .book-cover img {
            display: block; width: 100%; height: auto; border-radius: inherit;
            -webkit-user-drag: none; user-select: none;
            transition: filter .5s var(--ease);
        }
        .book-title {
            display: block;
            margin-top: .9rem;
            font-family: var(--display); font-style: italic;
            font-size: .98rem; line-height: 1.25;
            color: rgba(245,239,227,.78);
            opacity: 0; transform: translateY(6px);
            transition: opacity .45s, transform .45s var(--ease-out), color .35s;
        }
        .book-item:hover .book-cover {
            transform: translateY(-14px) rotateY(-10deg) rotateX(4deg) scale(1.05);
            box-shadow: 0 44px 60px -18px rgba(0,0,0,.85), 0 0 70px rgba(232,201,131,.28);
        }
        .book-item:hover .book-title { opacity: 1; transform: none; color: var(--gold-light); }
        @media (hover: hover) {
            .cover-strip:hover .book-item:not(:hover) img { filter: brightness(.6) saturate(.75); }
        }

        .strip-controls {
            display: flex; align-items: center; gap: 1.5rem;
            padding: 0 1.5rem; margin-top: -.4rem;
        }
        .strip-progress {
            position: relative; flex: 1; height: 1px;
            background: rgba(232,201,131,.2);
        }
        .strip-progress span {
            position: absolute; top: -1px; left: 0; height: 3px; width: 20%;
            border-radius: 3px;
            background: linear-gradient(90deg, var(--copper), var(--gold-light));
            box-shadow: 0 0 14px rgba(232,201,131,.6);
            transition: left .3s ease-out, width .3s ease-out;
        }
        .strip-btns { display: flex; gap: .55rem; }
        .strip-btn {
            width: 46px; height: 46px; padding: 0; cursor: pointer;
            display: grid; place-items: center;
            color: var(--gold-light);
            background: transparent;
            border: 1px solid rgba(232,201,131,.4);
            border-radius: 50%;
            transition: background .35s var(--ease), color .35s var(--ease),
                        border-color .35s var(--ease), opacity .3s, transform .35s var(--ease);
        }
        .strip-btn svg {
            width: 20px; height: 20px; fill: none; stroke: currentColor;
            stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
            transition: transform .35s var(--ease);
        }
        .strip-btn:hover:not(:disabled) {
            background: var(--gold); border-color: var(--gold); color: var(--ink);
            transform: translateY(-2px);
            box-shadow: 0 0 24px rgba(232,201,131,.55);
        }
        .strip-btn.prev:hover:not(:disabled) svg { transform: translateX(-3px); }
        .strip-btn.next:hover:not(:disabled) svg { transform: translateX(3px); }
        .strip-btn:disabled { opacity: .25; cursor: default; }
        @media (hover: none) { .strip-btns { display: none; } }

        /* ==========================================================
           ОСНОВНАЯ СЕТКА
        ========================================================== */
        #gk-main { padding-block: 3rem 4rem; }
        .layout { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
        .duo { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); margin-top: 1.5rem; }
        @media (min-width: 768px) { .duo { grid-template-columns: 1fr 1fr; } }
        @media (min-width: 1024px) {
            #gk-main { padding-block: 4rem 5rem; }
            .layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 2.2rem; }
            .sidebar { position: sticky; top: 100px; align-self: start; }
        }

        /* ---- Карточки с подсвеченными L-уголками ---- */
        .card, .item-page, .box {
            position: relative;
            background: rgba(255, 255, 255, .58);
            -webkit-backdrop-filter: blur(18px) saturate(150%);
            backdrop-filter: blur(18px) saturate(150%);
            border: 1px solid var(--line);
            border-radius: var(--radius);
            box-shadow: var(--shadow-soft);
        }
        .item-page {
            padding: clamp(1.8rem, 4.2vw, 3.6rem);
        }
        .item-page::before {
            content: ""; position: absolute;
            top: 16px; left: 16px;
            width: 52px; height: 52px;
            border-top: 1.5px solid var(--gold);
            border-left: 1.5px solid var(--gold);
            border-radius: 6px 0 0 0;
            pointer-events: none;
            opacity: .55;
            filter: drop-shadow(0 0 6px rgba(232,201,131,.5));
        }
        .item-page::after {
            content: ""; position: absolute;
            bottom: 16px; right: 16px;
            width: 52px; height: 52px;
            border-bottom: 1.5px solid var(--gold);
            border-right: 1.5px solid var(--gold);
            border-radius: 0 0 6px 0;
            pointer-events: none;
            opacity: .55;
            filter: drop-shadow(0 0 6px rgba(232,201,131,.5));
        }
        .box { padding: 1.7rem; transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s; }
        .box:hover {
            transform: translateY(-4px);
            border-color: rgba(184,137,59,.55);
            box-shadow: var(--shadow-deep), 0 0 0 1px rgba(232,201,131,.2), 0 0 60px -20px rgba(232,201,131,.4);
        }
        .sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

        /* заголовок страницы */
        .article-header {
            font-family: var(--display);
            font-size: clamp(2.4rem, 6.5vw, 4.4rem);
            font-weight: 400;
            letter-spacing: -.02em;
            margin-bottom: 2rem;
            line-height: 1.02;
        }
        .article-header a {
            display: inline-block;
            background: linear-gradient(100deg, #4a0f1d 0%, var(--copper) 28%, var(--gold-deep) 52%, var(--copper) 72%, #4a0f1d 100%);
            background-size: 220% auto;
            -webkit-background-clip: text; background-clip: text;
            -webkit-text-fill-color: transparent; color: transparent;
            animation: sheen 12s linear infinite;
        }
        @keyframes sheen { to { background-position: 220% center; } }
        .article-header::after {
            content: ""; display: block; width: 140px; height: 2px; margin-top: 1.5rem;
            background: linear-gradient(90deg, var(--gold), transparent);
            box-shadow: 0 0 14px rgba(232,201,131,.6);
        }

        .article-body::after { content: ""; display: table; clear: both; }
        .article-body > h4 {
            font-family: var(--display);
            font-style: italic;
            font-size: clamp(1.7rem, 3.6vw, 2.3rem);
            color: var(--copper);
            margin-bottom: .6rem;
        }
        .article-body > p { margin: 0 0 1rem; }

        /* фото автора */
        .author-photo {
            float: none; display: block;
            width: min(260px, 70%); height: auto;
            margin: 0 auto 1.7rem;
            padding: 9px;
            background: var(--paper);
            border: 1px solid var(--gold);
            border-radius: 8px;
            box-shadow: 0 28px 44px -20px rgba(40,26,6,.5), 11px 11px 0 -1px rgba(184,137,59,.22), 0 0 40px -10px rgba(232,201,131,.4);
            filter: grayscale(1) sepia(.28) contrast(1.05);
            transition: filter .9s var(--ease), transform .9s var(--ease), box-shadow .9s var(--ease);
        }
        .author-photo:hover {
            filter: none; transform: rotate(-1.4deg) translateY(-4px);
            box-shadow: 0 40px 54px -20px rgba(40,26,6,.55), 15px 15px 0 -1px rgba(184,137,59,.34), 0 0 60px -10px rgba(232,201,131,.6);
        }
        @media (min-width: 640px) {
            .author-photo { float: left; margin: .3rem 2.2rem 1.1rem 0; width: 250px; }
        }

        /* ==========================================================
           ВКЛАДКИ
        ========================================================== */
        .tabs { margin-top: 2.6rem; clear: both; }
        .nav-tabs {
            position: relative; list-style: none; margin: 0;
            display: inline-flex; gap: .25rem;
            padding: .4rem;
            background: rgba(10,15,13,.05);
            border-radius: 999px;
            border: 1px solid var(--line);
        }
        .nav-tabs::after {
            content: ""; position: absolute;
            top: .4rem; bottom: .4rem;
            left: var(--x, 0); width: var(--w, 0);
            border-radius: 999px;
            background: linear-gradient(135deg, var(--gold-light), var(--gold));
            box-shadow: 0 4px 16px -6px rgba(143,104,32,.75), inset 0 1px 0 rgba(255,255,255,.5), 0 0 24px rgba(232,201,131,.35);
            transition: left .55s var(--ease-out), width .55s var(--ease-out);
            z-index: 0;
        }
        .nav-tabs > li { margin: 0; position: relative; z-index: 1; }
        .nav-tabs > li > a {
            display: block; padding: .8rem 1.4rem;
            font-family: var(--sans);
            font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
            color: var(--muted); border-radius: 999px;
            transition: color .3s;
        }
        .nav-tabs > li > a:hover { color: var(--ink); }
        .nav-tabs > li.active > a { color: var(--ink); }
        @media (max-width: 560px) {
            .nav-tabs { display: flex; width: 100%; }
            .nav-tabs > li { flex: 1; text-align: center; }
            .nav-tabs > li > a { padding: .7rem .4rem; font-size: .68rem; letter-spacing: .08em; }
        }

        .tab-content { margin-top: 2.2rem; }
        .tab-pane { display: none; }
        .tab-pane.active { display: block; }
        .js .tab-pane {
            opacity: 0; transform: translateY(18px);
            transition: opacity .4s ease, transform .6s var(--ease-out);
        }
        .js .tab-pane.show { opacity: 1; transform: none; }

        .tab-pane h2 {
            font-family: var(--display);
            font-size: clamp(2rem, 4.4vw, 2.9rem);
            margin-bottom: 1.1rem;
            background: linear-gradient(100deg, var(--burgundy), var(--copper) 55%, var(--gold-deep));
            -webkit-background-clip: text; background-clip: text;
            -webkit-text-fill-color: transparent; color: transparent;
        }
        .tab-pane p {
            margin: 0 0 1.1rem; font-size: 1rem; line-height: 1.85;
            hyphens: auto; -webkit-hyphens: auto;
        }
        .tab-pane p a {
            color: var(--burgundy); font-weight: 600;
            background: linear-gradient(rgba(184,137,59,.4), rgba(184,137,59,.4)) 0 100% / 100% 1px no-repeat;
            transition: background-size .4s var(--ease-out), color .3s;
            padding: 0 .1em;
        }
        .tab-pane p a:hover { background-size: 100% 100%; color: #3a0c16; }

        /* ==========================================================
           САЙДБАР
        ========================================================== */
        .box h3 {
            display: flex; align-items: center; gap: .8rem;
            font-family: var(--sans);
            font-size: .72rem; font-weight: 700;
            letter-spacing: .26em; text-transform: uppercase; color: var(--copper);
            margin-bottom: 1.2rem;
        }
        .box h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }

        .input-group {
            display: flex; align-items: center;
            background: rgba(255,255,255,.75);
            border: 1px solid var(--line); border-radius: 999px;
            padding: .25rem .25rem .25rem 1.15rem;
            transition: box-shadow .3s, border-color .3s;
        }
        .input-group:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184,137,59,.16), 0 0 24px -8px rgba(232,201,131,.5); }
        .form-control {
            flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
            font-family: var(--body); font-size: .95rem; color: var(--text); padding: .5rem 0;
        }
        .form-control::placeholder { color: var(--muted); }
        .btn {
            width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
            color: #fff; background: linear-gradient(135deg, var(--burgundy), var(--copper));
            display: grid; place-items: center;
            transition: transform .35s var(--ease), box-shadow .35s;
        }
        .btn:hover { transform: scale(1.1) rotate(-6deg); box-shadow: 0 10px 24px -6px rgba(110,31,46,.6), 0 0 24px rgba(232,201,131,.4); }

        .sidebar-news-item {
            display: grid; grid-template-columns: 66px 1fr; column-gap: 1rem; align-items: start;
            padding: .85rem; margin: 0 -.85rem; border-radius: 16px;
            transition: background .35s var(--ease);
        }
        .sidebar-news-item + .sidebar-news-item { position: relative; }
        .sidebar-news-item + .sidebar-news-item::before {
            content: ""; position: absolute; top: 0; left: .85rem; right: .85rem; height: 1px;
            background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px);
        }
        .sidebar-news-item:hover { background: rgba(184,137,59,.09); }
        .sidebar-news-item img {
            grid-row: 1 / span 2; grid-column: 1;
            width: 66px; height: 66px; object-fit: cover; border-radius: 12px;
            box-shadow: 0 8px 16px -8px rgba(40,26,6,.5);
            transition: transform .55s var(--ease-out), box-shadow .55s var(--ease-out);
            position: relative; z-index: 1;
        }
        .sidebar-news-item:hover img { transform: scale(1.14) rotate(-3deg); box-shadow: 0 16px 26px -8px rgba(40,26,6,.55); }
        .sidebar-news-item h4 {
            grid-column: 2;
            font-family: var(--display);
            font-size: 1.2rem; line-height: 1.25;
        }
        .sidebar-news-item h4 a:hover { color: var(--burgundy); }
        .sidebar-news-item .date {
            grid-column: 2; margin-top: .3rem;
            font-family: var(--sans);
            font-size: .7rem; font-weight: 600; letter-spacing: .14em; color: var(--copper);
            font-variant-numeric: tabular-nums;
        }
        .sidebar-news-item .intro { grid-column: 1 / -1; margin-top: .7rem; font-size: .86rem; line-height: 1.6; color: var(--muted); }

        /* ==========================================================
           НИЖНИЕ БЛОКИ
        ========================================================== */
        .duo .box { padding: clamp(1.6rem, 3vw, 2.5rem); overflow: hidden; }
        .duo .box::before {
            content: "“"; position: absolute; right: 1rem; top: -.6rem;
            font-family: var(--display); font-size: 10rem; line-height: 1; font-weight: 400;
            color: rgba(184,137,59,.14); pointer-events: none;
            transition: transform .9s var(--ease-out), color .5s;
        }
        .duo .box:hover::before { transform: translateY(10px) scale(1.08); color: rgba(184,137,59,.26); }
        .duo .box h4 {
            font-family: var(--display);
            font-size: clamp(1.55rem, 2.8vw, 2rem);
            line-height: 1.2; position: relative;
        }
        .duo .box h4 a {
            background: linear-gradient(90deg, var(--burgundy), var(--copper));
            -webkit-background-clip: text; background-clip: text;
            -webkit-text-fill-color: transparent; color: transparent;
        }
        .meta { margin: .6rem 0 1.2rem; font-family: var(--sans); font-size: .78rem; color: var(--muted); letter-spacing: .03em; position: relative; }
        .meta a { color: var(--copper); font-weight: 500; border-bottom: 1px solid transparent; transition: border-color .3s; }
        .meta a:hover { border-bottom-color: var(--copper); }
        .poem {
            margin: 0; padding-left: 1.4rem; position: relative;
            border-left: 2px solid var(--gold);
            font-family: var(--display); font-style: italic;
            font-size: clamp(1.3rem, 2.5vw, 1.55rem); line-height: 1.55;
            white-space: pre-line; color: #3a332b;
            box-shadow: -8px 0 20px -12px rgba(232,201,131,.6);
        }
        .letter-text { margin: 0; font-size: .95rem; line-height: 1.8; position: relative; color: #3b352d; }

        /* ==========================================================
           ФУТЕР
        ========================================================== */
        .site-footer {
            position: relative; text-align: center; color: var(--cream);
            padding: 4rem 0 4.5rem; margin-top: 1rem;
            background:
                radial-gradient(800px 320px at 50% 0%, rgba(232,201,131,.16), transparent 70%),
                radial-gradient(600px 300px at 85% 100%, rgba(45,129,113,.15), transparent 70%),
                linear-gradient(180deg, var(--ink-soft), var(--ink));
        }
        .site-footer::before {
            content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
            background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
            box-shadow: 0 0 20px rgba(232,201,131,.5);
        }
        .footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; max-width: 1000px; margin-inline: auto; }
        .footer-links p {
            grid-column: 1 / -1; margin: 0 0 .8rem;
            font-family: var(--sans);
            font-size: .72rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold-light);
        }
        .footer-links a {
            display: flex; align-items: center; justify-content: center;
            height: 108px; padding: 14px;
            background: rgba(245,239,227,.94);
            border: 1px solid rgba(232,201,131,.32);
            border-radius: 20px;
            transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .4s;
        }
        .footer-links a img {
            max-width: 100%; max-height: 70px; object-fit: contain;
            filter: grayscale(1); opacity: .6;
            transition: filter .5s var(--ease), opacity .5s var(--ease), transform .5s var(--ease);
        }
        .footer-links a:hover {
            transform: translateY(-6px);
            border-color: var(--gold-light);
            box-shadow: 0 24px 44px -16px rgba(0,0,0,.7), 0 0 34px rgba(232,201,131,.32);
        }
        .footer-links a:hover img { filter: none; opacity: 1; transform: scale(1.05); }
        @media (min-width: 768px) { .footer-links { grid-template-columns: repeat(4, 1fr); } }

        /* ==========================================================
           КНОПКА «НАВЕРХ»
        ========================================================== */
        #toTop {
            position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 9000;
            width: 56px; height: 56px; border-radius: 50%;
            display: grid; place-items: center; font-size: 1.05rem;
            color: var(--ink);
            background: linear-gradient(135deg, var(--gold-light), var(--gold));
            box-shadow: 0 0 0 0 rgba(232,201,131,.6), 0 14px 28px -10px rgba(0,0,0,.5);
            opacity: 0; visibility: hidden; transform: translateY(24px) scale(.8);
            transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s, background .4s, color .4s;
        }
        #toTop.visible { opacity: 1; visibility: visible; transform: none; animation: glow 2.8s ease-in-out infinite; }
        #toTop:hover { transform: translateY(-4px) scale(1.08); color: #fff; background: linear-gradient(135deg, var(--copper), var(--burgundy)); }
        @keyframes glow {
            0%, 100% { box-shadow: 0 0 0 0 rgba(232,201,131,.55), 0 14px 28px -10px rgba(0,0,0,.5); }
            50% { box-shadow: 0 0 0 16px rgba(232,201,131,0), 0 0 30px 6px rgba(232,201,131,.5), 0 14px 28px -10px rgba(0,0,0,.5); }
        }

        /* ==========================================================
           ДОСТУПНОСТЬ
        ========================================================== */
        @media (prefers-reduced-motion: reduce) {
            html { scroll-behavior: auto; }
            *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
            .js .reveal, .js .tab-pane, .js .book-item { opacity: 1; transform: none; filter: none; }
            .bg-decor .blob { animation: none !important; }
        }

/* ==========================================================
   ВНУТРЕННИЕ СТРАНИЦЫ (категории, статьи, поиск)
   ========================================================== */
.inner-wrap {
    background: var(--paper);
    border-radius: 22px;
    border: 1px solid var(--line);
    padding: clamp(28px, 4vw, 56px);
    margin: 0 0 clamp(40px, 6vw, 80px);
    box-shadow: 0 24px 60px rgba(43, 39, 35, .07);
}
.inner-wrap .page-header,
.inner-wrap h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(32px, 4.4vw, 56px);
    line-height: 1.06;
    letter-spacing: -.01em;
    color: var(--gold-deep);
    margin: 0 0 28px;
}
.inner-wrap h2 { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: clamp(24px, 2.6vw, 34px); color: var(--ink-2); margin: 36px 0 14px; }
.inner-wrap h3, .inner-wrap h4 { font-family: 'Onest', sans-serif; font-weight: 600; color: var(--ink-2); }
.inner-wrap p, .inner-wrap li { font-family: 'Onest', sans-serif; font-size: 17px; line-height: 1.75; color: var(--text); }
.inner-wrap a { color: var(--gold-deep); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.inner-wrap a:hover { color: var(--copper); }
.inner-wrap img { max-width: 100%; height: auto; }
.inner-wrap ul, .inner-wrap ol { padding-left: 22px; margin: 0 0 20px; }
.inner-wrap blockquote { border-left: 3px solid var(--gold); padding-left: 20px; color: var(--muted); font-style: italic; margin: 24px 0; }
.inner-wrap table { width: 100%; border-collapse: collapse; }
.inner-wrap td, .inner-wrap th { padding: 8px 10px; border-bottom: 1px solid var(--line); }

/* Список статей категории */
.inner-wrap .com-content-category__items,
.inner-wrap .blog-items { display: grid; gap: 18px; }
.inner-wrap .blog-item,
.inner-wrap article { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; transition: border-color .2s, transform .2s; }
.inner-wrap .blog-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.inner-wrap .page-title, .inner-wrap .item-title { margin: 0 0 10px; font-family: 'Instrument Serif', Georgia, serif; font-size: 26px; font-weight: 400; }
.inner-wrap .item-title a { border: 0; color: var(--ink-2); }
.inner-wrap .item-title a:hover { color: var(--gold-deep); }
.inner-wrap .article-info { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.inner-wrap .pagination { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.inner-wrap .pagination a, .inner-wrap .pagination span { padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.inner-wrap .btn, .inner-wrap button { font-family: 'Onest', sans-serif; }
.inner-wrap .readmore a { display: inline-block; padding: 10px 18px; background: var(--gold); color: #fff; border-radius: 999px; border: 0; font-size: 14px; }
.inner-wrap .readmore a:hover { background: var(--gold-deep); color: #fff; }

/* Хлебные крошки и поиск */
.inner-wrap .breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.inner-wrap .breadcrumb a { border: 0; }
.inner-wrap input[type="search"], .inner-wrap input[type="text"] { padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; font-family: 'Onest', sans-serif; }
.inner-wrap .search input[type="submit"] { padding: 10px 18px; background: var(--gold); color: #fff; border: 0; border-radius: 10px; cursor: pointer; }

/* Подкатегории карточками */
.subcat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 32px;
}
.subcat-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--line) !important;
    border-radius: 14px;
    text-decoration: none !important;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.subcat-card:hover {
    border-color: var(--line-strong) !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(43,39,35,.08);
}
.subcat-title { font-family: 'Onest', sans-serif; font-size: 16px; font-weight: 600; color: var(--ink-2); line-height: 1.35; }
.subcat-count { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-deep); }

/* Страховка: если JS не отработал, контент всё равно виден */
.no-js .reveal, html:not(.js) .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }

/* Служебные блоки Joomla — убираем */
.com-content-article__info,
.com-content-article__info-title,
.inner-wrap dl.com-content-article__info,
.inner-wrap .com-content-article__author,
.inner-wrap .content-links,
.inner-wrap .icons { display: none !important; }

/* Статья: заголовок и текст */
.inner-wrap .com-content-article__body { font-size: 17px; }
.inner-wrap .com-content-article__body p { margin: 0 0 1.1em; }
.inner-wrap .com-content-article__body img { border-radius: 12px; margin: 8px 0; }

/* Сетка статей категории */
.inner-wrap .blog-items { grid-template-columns: 1fr; }
.inner-wrap .blog-items.masonry-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inner-wrap .blog-items.masonry-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
    .inner-wrap .blog-items.masonry-2,
    .inner-wrap .blog-items.masonry-3 { grid-template-columns: 1fr; }
}
.inner-wrap .blog-item .page-header h2 { font-size: 20px; margin: 0 0 8px; }
.inner-wrap .blog-item .page-header h2 a { border: 0; color: var(--ink-2); font-family: 'Onest', sans-serif; font-weight: 600; }
.inner-wrap .blog-item .page-header h2 a:hover { color: var(--gold-deep); }

/* Служебная «Информация о материале» в списках */
.inner-wrap .blog-item dl.article-info,
.inner-wrap .article-info.text-muted { display: none !important; }
.inner-wrap .blog-item .item-content > h2:first-child,
.inner-wrap .blog-item .page-header { margin-bottom: 10px; }
.inner-wrap .blog-item p { font-size: 16px; }

/* Страница материала: служебная информация и навигация */
.inner-wrap .com-content-article__info,
.inner-wrap dl.com-content-article__info { display: none !important; }
.inner-wrap .pagenavigation,
.inner-wrap .com-content-article__navigation,
.inner-wrap ul.pager,
.inner-wrap .pagination-wrapper { display: none !important; }

/* Статья: без двойной рамки внутри inner-wrap */
.inner-wrap .com-content-article { background: none; border: 0; border-radius: 0; padding: 0; }
.inner-wrap .com-content-article:hover { transform: none; }
