 body {
            margin: 0;
            font-family: sans-serif;
            background: #f6f5f2;
            perspective: 1200px;
            perspective-origin: top center;
        }
header {
            padding: 8px 12px;
            background: #3b362f;
            text-align: center;
            border-bottom: 3px solid #c2a26a;
            position: relative;
        }
.container {
            display: flex;
            min-height: 100vh;
            gap: 24px;
            padding: 24px;
            max-width: 1200px;
            margin: 0 auto;
        }
/* Само меню */
    #side-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        background: #111;
        padding-top: 60px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
 /* Кнопка меню */
   #menu-toggle {
       position: fixed;
       top: 15px;
       left: 15px;
       z-index: 1001;
       width: 32px;
       height: 26px;
       font-size: 26px;
       background: none;
       border: none;
       cursor: pointer;
       padding: 0;
    }

    #menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #c2a26a; /* твой цвет */
    margin: 6px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* hover — аккуратно */
#menu-toggle:hover span {
    background-color: #e0c48f;
}

/* превращение в крестик */
#menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

#menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

#menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Индикатор активного пункта */
    .menu-indicator {
        list-style: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 44px;
        background: linear-gradient(
           90deg,
           rgba(255,255,255,0.12),
           rgba(255,255,255,0.04)
        );
        border-left: 3px solid #fff;

        transform: translateY(0);
        transition: transform 0.35s cubic-bezier(.4,0,.2,1);
        pointer-events: none;
    }
 #side-menu ul {
       position: relative;
       padding-left: 0;
    }

    #side-menu li {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #side-menu li {
        margin: 20px 0;
    }

    #side-menu a {
        color: #fff;
        text-decoration: none;
        font-size: 18px;
        padding: 10px 20px;
        display: block;
        transition: background 0.2s ease;
    }

    #side-menu a:hover {
        background: rgba(255,255,255,0.08);
    }

    #side-menu a.active {
        background: rgba(255,255,255,0.15);
        border-left: 3px solid #fff;
    }
   
    /* Контейнер меню */
    #side-menu {
        position: fixed;
        overflow: hidden;
    }
/* Ссылки поверх индикатора */
    #side-menu a {
        position: relative;
        z-index: 1;
    }

    /* Убираю старую .active-заливку */
    #side-menu a.active {
        background: none;
        border: none;
    }
    
    /* Активное состояние */
    #side-menu.open {
        transform: translateX(0);
    }

    /* Overlay */
    #menu-overlay {
        position: fixed;
        inset: 0;
        top: 0;
        left: 0;
        width: 100vw;
        background: rgba(0,0,0,0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 999;
    }

    #menu-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .main-title {
        font-family: "Marck Script", cursive;
        font-size: 6em;
        font-weight: 600;
        letter-spacing: 0.03em;
        line-height: 1.15;

        margin: 0.3em 0 0.8em;
        text-align: center;
        font-style: italic;
        color: #c2a26a; /* тёмно-бежевый */
    }

    .subtitle {
        font-size: 1.6em;
        font-weight: 400;
        color: #d8c7a3;
    }
 .sidebar {
            width: 20%;
            padding: 20px;
            background: #ebe6da;
            border-radius: 10px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        }

        .content {
            width: 60%;
            padding: 26px;
            background: #ffffff;
            border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }

        h2 {
            margin-top: 0;
        }
    .library-entry {
        max-width: 1200px;
        margin: 40px auto 20px;
        padding: 0 24px;
    }

    .entry-modes {
        display: flex;
        gap: 16px;
        margin-bottom: 20px;
    }

    .entry-tab {
        background: none;
        border: 2px solid #c2a26a;
        color: #3b362f;
        padding: 10px 18px;
        font-size: 16px;
        cursor: pointer;
        border-radius: 8px;
    }

    .entry-tab.active {
        background: #c2a26a;
        color: #3b362f;
    }

    .entry-grid {
        max-width: 1200px;
        position: absolute;
        margin: 0 auto 12px;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
        gap: 6px;
        z-index: 10;

        padding: 10px 20px;
        background: none;
        border-bottom: 2px solid #c2a26a;
    }

    .entry-grid a {
        display: block;
        text-align: center;
        padding: 10px 0;
        background: #caa034;
        color: #c2a26a;
        font-weight: 600;
        border-radius: 6px;
        text-decoration: none;

    }

    .entry-grid a:hover {
        background: #d8c7a3;
        color: #3b362f;
    }

    /* ===== Scroll lock helpers ===== */
body.no-scroll {
    overflow: hidden;
}

/* ENTRY GRID — glass bar anchored below search, toned #c2a26a, stronger 3D glass */
.entry-grid {
  position: relative;                /* keep in normal flow (won't overlap) */
  margin: 14px auto 0;               /* sits just below preceding element (search field) */
  width: min(1200px, calc(100% - 48px));
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.06),
    rgba(255,255,255,0.02)
  );
  border: 1px solid rgba(194,162,106,0.14);
  backdrop-filter: blur(14px) saturate(140%) contrast(1.02);
  -webkit-backdrop-filter: blur(14px) saturate(140%) contrast(1.02);
  box-shadow:
    0 8px 30px rgba(0,0,0,0.14),
    inset 0 1px 0 rgba(255,255,255,0.03);
  z-index: 30;
  overflow-x: auto;
  white-space: nowrap;
}

/* Toned gold buttons with subtle 3D bevel */
.entry-grid a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 56px;
  padding: 0 10px;
  color: #3b362f;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  background: linear-gradient(180deg, #ead5a1 0%, #c2a26a 70%);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    0 6px 12px rgba(0,0,0,0.12),
    0 2px 0 rgba(255,255,255,0.06) inset;
  transform: translateZ(0);
  transition: transform 180ms cubic-bezier(.2,.9,.3,1), box-shadow 180ms ease, filter 180ms ease;
  flex: 0 0 auto;
}

/* pressed / hover states for stronger 3D feel */
.entry-grid a:hover {
  transform: translateY(-6px);
  box-shadow:
    0 18px 34px rgba(0,0,0,0.18),
    0 2px 0 rgba(255,255,255,0.04) inset;
  filter: saturate(1.05);
}

.entry-grid a:active {
  transform: translateY(-2px) scale(0.995);
  box-shadow:
    0 8px 14px rgba(0,0,0,0.12),
    0 2px 0 rgba(255,255,255,0.02) inset;
}

/* keep layout tidy on smaller screens */
@media (max-width: 920px) {
  .entry-grid {
    gap: 8px;
    padding: 10px 12px;
  }
  .entry-grid a {
    min-width: 48px;
    height: 48px;
    border-radius: 9px;
    font-size: 0.95em;
  }
}

/* optional: make scrollbars unobtrusive when overflowed */
.entry-grid::-webkit-scrollbar { height: 8px; }
.entry-grid::-webkit-scrollbar-thumb {
  background: rgba(194,162,106,0.22);
  border-radius: 6px;
}

.content-switch {
    position:absolute;
     bottom: 20px;           /* отступ от нижнего края header */
    left: 50px;          /* выровнять под правой кромкой иконки (230px + небольшой зазор) */
    display: flex;
    gap: 12px;
    /*margin-bottom: 20px; */
}

.content-tab {
    background: none; 
    border: 1px solid #ccc;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    }
    
.content-tab.active {
    background: #111;
    color: #fff;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}


.site-logo {
    position: absolute;
    bottom: 16px;           /* отступ от нижнего края header */
    left: 16px;            /* отступ от левого края (вместо center) */
    top: 50%;              /* вертикальное центрирование */
    transform: translateY(-50%); /* центрирование по вертикали */
    z-index: 10;
    width: 220px;           /* увеличенный размер */
    height: 220px;
    border-radius: 50%;     /* круглый контур, если нужно */
    border: 2px solid rgba(255, 255, 255, 0.2); /* лёгкая рамка */
    background-color: rgba(0, 0, 0, 0.1); /* лёгкий фон под иконкой */
    transition: all 0.3s ease;
}

/* Эффект при наведении (опционально) */
.site-logo:hover {
    width: 240px;
    height: 240px;
    border-color: rgba(255, 255, 255, 0.4);
}


/* ===== НОТНАЯ БИБЛИОТЕКА ===== */

.work {
  margin-bottom: 1em;
}

.work-header {
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.work-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 18px 0 6px;
    cursor: pointer;
}

.work-title:hover {
    text-decoration: underline;
}

.work-editions {
    display: none;
    margin-left: 0; /* карточки остаются ровно как сейчас */
}

.work-editions.open {
    display: block;
}

.work-header:hover {
  text-decoration: underline;
}

.editions {
  padding-left: 20px;
}

.editions li {
  margin: 4px 0;
}

/* ===== Карточка издания ===== */

.edition-card {
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    margin: 20px 0;
    background: #fff;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Заголовок карточки */
.edition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f4f4f4;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
}

.edition-title {
    line-height: 1.3;
}

.edition-subtitle {
    font-size: 0.9em;
    color: #555;
}

.edition-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    white-space: nowrap;
}

/* Кнопка быстрого просмотра - контейнер превью */
.quick-view {
    display: none;             /* Скрыто по умолчанию */
    width: 100%;               /* Занимает всю ширину карточки */
    border-top: 1px solid #ddd;
    background: #fafafa;
}

/* когда открыт превью */
.quick-view.open {
    display: block;
}

.quick-view iframe {
    width: 100%;
    height: 420px;             /* Высота превью, как я хотел */
    border: none;
    display: block;
}

.quick-view-btn {
    margin-left: 10px;
    padding: 6px 10px;
    border: 1px solid #888;
    background: #fff;
    cursor: pointer;
    font-size: 0.85em;
}

.quick-view-btn::before {
  content: "👁";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.98em;
  vertical-align: middle;
  opacity: 0.95;
  pointer-events: none;
}

/* Тело карточки */

.edition-body {
    display: flex;
    gap: 20px;
    padding: 16px;
}

/* Информация о издании */

.edition-info {
    flex: 1;
}

.info-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.info-row .label {
    color: #666;
}

.info-row .value {
    color: #000;
}

/* Обложка издания */

.edition-cover {
    width: 160px;
    flex-shrink: 0;
}

.edition-cover img {
    width: 100%;
    display: block;
    border: 1px solid #ccc;
}


/* =====================================================
   ДОПОЛНЕНИЯ ДЛЯ КАРТОЧЕК IMSLP-STYLE
   ===================================================== */

/* Отступ заголовка произведения */
.score-work > h3 {
    margin: 24px 12px 16px;
}

/* Обложка справа */
.edition-cover {
    width: 160px;
    flex-shrink: 0;
    position: relative;
}

.edition-cover img {
    width: 100%;
    display: block;
    border: 1px solid #ccc;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: zoom-in;
}

/* Эффект увеличительного стекла */
.edition-cover img:hover {
    transform: scale(1.8);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 20;
}

/* Гарантируем вертикальное отображение метаданных */
.edition-info {
    display: block;
}

.info-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: start;
    margin-bottom: 8px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 24px auto 32px;
}

#searchInput {
    width: 100%;
    padding: 16px 56px;
    font-size: 18px;
    border: 2px solid #ccc;
    border-radius: 999px;
    outline: none;
}

#searchInput:focus {
    border-color: #111;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.5;
    font-size: 18px;
}

.clear-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    cursor: pointer;
    opacity: 0.4;
    display: none;
}

.clear-icon:hover {
    opacity: 1;
}

#composer-list {
    margin: 24px auto 12px;
    padding: 16px 24px;
    z-index: 300px;

    max-width: 720px;
    background: #f6f5f2;
    border-radius: 14px;

    list-style: none;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;

    /* цвет как у заголовка */
    color: #c2a26a;
    font-size: 1.3em;
    font-family: "Cormorant Garamond", serif;

     /* ===== 3D-скрытие ===== */
    opacity: 0;
    transform-origin: top center;
    transform:
        rotateX(-35deg)
        scale(0.92)
        translateY(-24px);

    backface-visibility: hidden;
    will-change: transform, opacity;    

    pointer-events: none;

    transition:
        opacity 0.35s ease,
        transform 0.55s cubic-bezier(.16,.84,.24,1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition-delay: 0.03s;
} 

#composer-list.visible {
    opacity: 1;
    transform:
        rotateX(0deg)
        scale(1)
        translateY(0);
    pointer-events: auto;
}

#composer-list li {
    opacity: 0;
    transform-origin: top center;
    transform:
        rotateX(-35deg)
        scale(0.92)
        translateY(-18px);

    filter: blur(6px);
    cursor: pointer;
    padding: 8px 6px;
    transition: 
        opacity 1.2s ease,
        transform 1.6s cubic-bezier(.16,.84,.24,1),
        filter 1.4s ease;
}

#composer-list.visible li {
    opacity: 1;
    transform:
        rotateX(0deg)
        scale(1)
        translateY(0);
    filter: blur(0);
}

#composer-list li:hover {
    color: #a8843a;
    text-decoration: underline;
}

/* MOBILE: avoid overlap with left-side buttons (menu + logo) — REPLACEMENT */
@media (max-width: 720px) {
  :root { --left-avoid: 96px; }

  /* composers list: shift right, constrain width, lower z-index */
  #composer-list {
    margin: 12px 12px 12px calc(var(--left-avoid) + 12px);
    padding-left: 0;
    padding-right: 12px;
    max-width: calc(100% - var(--left-avoid) - 36px);
    box-sizing: border-box;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    z-index: 5; /* lower than .entry-grid (which stays higher) */
  }

  /* keep the buttons-bar visible on the left and inside viewport */
  .entry-grid {
    margin-left: 12px;
    width: calc(100% - 24px);
    justify-content: flex-start;
    z-index: 30;
  }

  /* smaller floating logo and menu position */
  .site-logo {
    width: 56px;
    height: 56px;
    left: 12px;
    bottom: 12px;
    top: auto;
    transform: none;
  }

  #menu-toggle {
    left: 12px;
    top: 12px;
  }
}

/* Layout: single right sidebar (left sidebar hidden), sticky + hover-scrollable */
.container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.content {
  flex: 1 1 auto;
  width: auto;
  box-sizing: border-box;
}

/* force sidebars to fixed width */
.sidebar {
  flex: 0 0 260px;
  width: 260px;
  box-sizing: border-box;
}

/* hide the left sidebar (keeps DOM intact) */
.container > .sidebar:first-of-type {
  display: none;
}

/* make the right sidebar sticky and not scroll with page.
   It becomes scrollable only when hovered or focused-within. */
.container > .sidebar:last-of-type {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: hidden; /* no scroll during page scroll */
  -webkit-overflow-scrolling: touch;
  transition: box-shadow 160ms ease;
}

/* enable scrolling when hovering / interacting */
.container > .sidebar:last-of-type:hover,
.container > .sidebar:last-of-type:focus-within {
  overflow: auto;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* subtle scrollbar that appears on hover */
.container > .sidebar:last-of-type::-webkit-scrollbar {
  width: 10px;
  height: 8px;
}
.container > .sidebar:last-of-type::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 8px;
  transition: opacity .15s;
  opacity: 0;
}
.container > .sidebar:last-of-type:hover::-webkit-scrollbar-thumb {
  opacity: 1;
}

/* Mobile: restore normal flow so sidebar doesn't cover content */
@media (max-width: 920px) {
  .container {
    flex-direction: column;
  }
  .container > .sidebar:first-of-type {
    display: none;
  }
  .container > .sidebar:last-of-type {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}

/* --- Smooth header collapse but keep search + letters sticky --- */

/* default header variable (will be set from JS) */
:root { --header-height: 120px; }

/* header slide-out animation */
header {
  position: relative; /* keep layout unchanged */
  transition: transform 260ms ease, opacity 200ms ease;
  will-change: transform, opacity;
}
header.header-collapsed {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* make search and letters sticky under header height */
.search-wrapper,
.entry-grid {
  position: sticky;
  top: calc(var(--header-height, 120px));
  z-index: 60;
  transition: top 260ms ease; /* smooth movement as header collapses */
}

/* make sure sticky layers sit above content but below menu overlay */
.search-wrapper { z-index: 60; }
.entry-grid     { z-index: 59; }

/* ensure sticky elements keep their layout/gaps unchanged */
.search-wrapper { margin: 24px auto 32px; } /* your original values preserved */
.entry-grid { margin: 14px auto 0; }         /* original values preserved */

/* Mobile tweak: slightly faster transition and keep spacing consistent */
@media (max-width: 720px) {
  .search-wrapper,
  .entry-grid { transition-duration: 200ms; }
}

/* Optional: improve visual separation when stuck */
.search-wrapper.is-sticky,
.entry-grid.is-sticky {
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  background: rgba(255,255,255,0.02);
}
