:root {
  --paper: #f6f1e6;
  --graphite: #2f2f33;
  --graphite-soft: rgba(47, 47, 51, .62);
  --staff: rgba(70, 90, 120, .16);
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--graphite);
  font-family: var(--hand);
  font-size: 22px;
  line-height: 1.3;
  background-color: var(--paper);
  /* нотный стан: группы по 5 линеек */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='96'%3E%3Cg stroke='%23465a78' stroke-opacity='.17' stroke-width='1'%3E%3Cpath d='M0 24.5h10M0 34.5h10M0 44.5h10M0 54.5h10M0 64.5h10'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed, local;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }
.pencil { filter: url(#pencil); }

/* ---------- переключатель языка ---------- */
.lang {
  position: fixed; top: 18px; right: 24px; z-index: 10;
  font-size: 24px; font-weight: 700; letter-spacing: .04em;
  background: rgba(246, 241, 230, .85); padding: 2px 10px; border-radius: 8px;
}
.lang button {
  font: inherit; color: var(--graphite-soft); background: none; border: 0;
  cursor: pointer; padding: 2px 4px;
}
.lang button[aria-current="true"] {
  color: var(--graphite);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.lang button:hover { color: var(--graphite); }
.lang .sep { color: var(--graphite-soft); }

/* ---------- главная ---------- */
.home {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 80px 6vw 56px;
}
.hero { max-width: 760px; }
.portrait { width: clamp(180px, 22vw, 280px); display: block; }
.portrait img, .portrait svg { width: 100%; height: auto; display: block; }

.name {
  margin: 18px 0 4px;
  font-size: clamp(42px, 6.4vw, 84px);
  font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: .02em;
}
.subtitle {
  margin: 0; font-size: clamp(22px, 2.3vw, 30px); color: var(--graphite-soft);
  max-width: 34ch;
}

/* Ряд иконок (6 разделов): 6 в ряд на широком экране, 3+3 на ноутбуке/планшете/телефоне,
   2+2+2 на самых узких — без «одиноких» иконок в последней строке. */
.sections {
  --cols: 6; --gap: clamp(14px, 2vw, 34px);
  display: flex; flex-wrap: wrap; gap: 28px var(--gap);
  max-width: 1250px;
  margin-top: 56px; padding: 12px 0 8px;
}
.sections .card { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); width: auto; min-width: 0; }
.sections .card .label { font-size: clamp(17px, 1.6vw, 24px); }
@media (max-width: 1099px) {
  .sections { --cols: 3; max-width: 640px; }
  .sections .card .label { font-size: clamp(16px, 3.4vw, 24px); }
}
@media (max-width: 340px) {
  .sections { --cols: 2; }
}

/* Контакты на главной — напротив портрета */
.hero-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 32px 6vw; max-width: 1250px;
}
.home-contacts { flex: 0 1 380px; }
.home-contacts h2 {
  margin: 0 0 6px; font-size: clamp(34px, 3.4vw, 48px); font-weight: 700;
  text-transform: uppercase; line-height: 1;
}
.home-contacts p { margin: 0 0 12px; font-size: 22px; color: var(--graphite-soft); }
.home-contacts ul { list-style: none; padding: 0; margin: 0; font-size: 28px; line-height: 1.35; }
.home-contacts li a { text-decoration: none; border-bottom: 1.5px solid var(--graphite-soft); }
.home-contacts li a:hover { border-bottom-color: var(--graphite); }
@media (max-width: 760px) {
  .home-contacts { flex-basis: 100%; }
  .home-contacts ul { font-size: 24px; }
}

/* ---------- карточка-иконка раздела ---------- */
.card {
  display: flex; flex-direction: column; align-items: center;
  width: clamp(104px, 11vw, 150px);
  text-decoration: none;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1.3);
}
.card .pic { width: 100%; aspect-ratio: 1; }
.card .pic img, .card .pic svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .label {
  margin-top: 6px; font-size: clamp(20px, 1.8vw, 26px); font-weight: 700;
  text-align: center; line-height: 1.05;
}
.card:hover, .card:focus-visible { transform: translateY(-12px) rotate(-1.5deg) scale(1.04); }
.card:focus-visible { outline: 2px dashed var(--graphite-soft); outline-offset: 6px; }

/* ---------- страница раздела ---------- */
.page { padding: 28px 6vw 80px; max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 22px; margin-bottom: 26px; }
.page-head .card { width: 130px; }
.page-head .card:hover { transform: translateY(-6px) rotate(-1deg); }
.back { font-size: 22px; color: var(--graphite-soft); text-decoration: none; padding-bottom: 10px; }
.back:hover { color: var(--graphite); text-decoration: underline; }

.year { margin: 18px 0 10px; }
.year > summary {
  list-style: none; cursor: pointer; user-select: none;
  font-size: 46px; font-weight: 700; display: inline-flex; align-items: center; gap: 12px;
}
.year > summary::-webkit-details-marker { display: none; }
.year > summary::before {
  content: "▾"; font-size: 30px; transition: transform .2s; display: inline-block;
}
.year:not([open]) > summary::before { transform: rotate(-90deg); }
.year > summary .hint { font-size: 18px; color: var(--graphite-soft); font-weight: 400; }

/* рамка строки — "от руки" */
.vrow {
  position: relative;
  margin: 0 0 30px;
  border: 2px solid var(--graphite-soft);
  border-radius: 14px 220px 12px 180px / 180px 12px 220px 14px;
  background: rgba(246, 241, 230, .72);
}
.vrow-body {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px; padding: 24px 26px 18px;
}
.video {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border: 1.5px solid var(--graphite-soft); border-radius: 6px 10px 5px 12px;
  overflow: hidden; background: #e9e3d6;
}
.video iframe, .video button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video button { padding: 0; cursor: pointer; background: none; font: inherit; color: inherit; }
.video img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15) sepia(.15); transition: filter .3s; }
.video button:hover img { filter: none; }
.video .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 76px; height: 76px;
}
.video .soon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--graphite-soft); font-size: 26px;
}
.vtitle {
  margin: 0 0 10px; font-size: clamp(30px, 3vw, 44px); font-weight: 700;
  text-transform: uppercase; line-height: 1.02;
}
.vdesc { margin: 0; font-size: 24px; color: var(--graphite); white-space: pre-line; }
.vdate { font-size: 20px; color: var(--graphite-soft); margin-top: 10px; }

.vtags {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  padding: 8px 26px 10px; border-top: 1.5px dashed var(--graphite-soft);
}
.vtags a { font-size: 22px; font-weight: 600; text-decoration: none; color: var(--graphite-soft); }
.vtags a:hover { color: var(--graphite); text-decoration: underline; }
.vtags a.current { color: var(--graphite); text-decoration: underline; text-decoration-thickness: 2px; }

.empty { font-size: 28px; color: var(--graphite-soft); }

/* ---------- контакты ---------- */
.contacts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; }
.contacts h2 { margin: 0 0 12px; font-size: 40px; text-transform: uppercase; }
.contacts p { margin: 0 0 16px; font-size: 26px; }
.contacts ul { list-style: none; padding: 0; margin: 0; font-size: 30px; }
.contacts li { margin: 4px 0; }
.contacts li a { text-decoration: none; border-bottom: 1.5px solid var(--graphite-soft); }
.contacts li a:hover { border-bottom-color: var(--graphite); }

form label { display: block; font-size: 24px; font-weight: 600; margin: 14px 0 2px; }
form input, form textarea {
  width: 100%; font: inherit; font-size: 24px; color: var(--graphite);
  background: transparent; border: 0; border-bottom: 2px solid var(--graphite-soft);
  padding: 4px 2px; outline: none;
}
form textarea { min-height: 150px; resize: vertical; border: 2px solid var(--graphite-soft); border-radius: 10px 14px 8px 16px; padding: 8px 10px; }
form input:focus, form textarea:focus { border-color: var(--graphite); }
form button {
  margin-top: 18px; font: inherit; font-size: 28px; font-weight: 700; cursor: pointer;
  color: var(--graphite); background: transparent; padding: 4px 26px;
  border: 2px solid var(--graphite); border-radius: 18px 6px 16px 8px;
  transition: transform .2s;
}
form button:hover { transform: translateY(-3px) rotate(-1deg); }
.form-status { font-size: 22px; margin-top: 10px; min-height: 1.3em; }

/* ---------- мобильные ---------- */
@media (max-width: 760px) {
  body { font-size: 20px; }
  .lang { top: 10px; right: 12px; font-size: 21px; }
  .home { padding: 64px 16px 40px; }
  .sections { gap: 22px 10px; margin-top: 40px; }
  .sections .card .label { font-size: clamp(14px, 4.1vw, 22px); }
  .page { padding: 56px 16px 60px; }
  .page-head .card { width: 100px; }
  .vrow-body { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .vtags { padding: 8px 16px 10px; }
  .year > summary { font-size: 38px; }
  .contacts { grid-template-columns: 1fr; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- все видео на главной ---------- */
.to-all {
  align-self: flex-start; margin-top: 36px; padding: 0;
  font: inherit; font-size: 26px; font-weight: 700; color: var(--graphite-soft);
  background: none; border: 0; cursor: pointer;
}
.to-all:hover { color: var(--graphite); text-decoration: underline; }
.all-videos { padding-top: 24px; }
.all-title {
  margin: 0 0 6px; font-size: clamp(40px, 5vw, 64px); font-weight: 700;
  text-transform: uppercase; line-height: 1;
}
.contacts.no-form { grid-template-columns: minmax(0, 1fr); }

/* ---------- статические страницы (SEO) ---------- */
.lang a { color: var(--graphite-soft); text-decoration: none; padding: 2px 4px; }
.lang a[aria-current="true"] { color: var(--graphite); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lang a:hover { color: var(--graphite); }
.year > summary h2 { margin: 0; font: inherit; }
.section-title {
  margin: 0 0 8px; font-size: clamp(40px, 5vw, 64px); font-weight: 700;
  text-transform: uppercase; line-height: 1;
}
.intro { margin: 0 0 18px; max-width: 70ch; font-size: 24px; color: var(--graphite); }
.card .pic img { mix-blend-mode: normal; }
