/* ГНМ по полочкам — палитра из осенних фото Игоря: твид-олива, овсяный свитер, рябина */
:root {
  --moss-950: #121510;
  --moss-900: #171B15;
  --moss-850: #1D2219;
  --moss-800: #262C21;
  --moss-700: #343C2D;
  --moss-600: #454E3B;
  --oat-50:  #F5F1E8;
  --oat-100: #EFEADF;
  --oat-200: #E3DBCB;
  --oat-300: #CFC5B1;
  --ink:     #1B1E18;
  --ink-2:   #4E5146;
  --brass:   #B5A47A;
  --rowan:   #A63F28;   /* кнопки, белый текст 6.0:1 */
  --rowan-d: #8E3420;
  --rowan-l: #E8957A;   /* рябина на тёмном, 7.2:1 к moss-900 */
  --line-d:  rgba(239, 234, 223, .14);
  --line-l:  rgba(27, 30, 24, .14);
  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --sans: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Alegreya", Georgia, serif;
  --pad: clamp(20px, 5vw, 72px);
  --max: 1240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html:not(.motion) { scroll-behavior: auto; } }
body {
  margin: 0;
  font: 400 19px/1.5 var(--sans);
  color: var(--ink);
  background: var(--oat-100);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: clamp(36px, 5.2vw, 64px); }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--rowan-l); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--oat-50); padding: 10px 14px; border-radius: var(--r-s); }
.skip:focus { left: 8px; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: 700 18px/1 var(--sans); letter-spacing: .005em;
  color: #fff; background: var(--rowan);
  border: 0; border-radius: 10px; text-decoration: none; cursor: pointer;
  transition: background-color .2s, transform .2s;
}
.btn:hover { background: var(--rowan-d); }
.btn:active { transform: translateY(1px); }
.btn--ghost { color: var(--oat-50); background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-d); }
.btn--ghost:hover { background: rgba(239, 234, 223, .08); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 16px; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: .7; cursor: progress; }

/* шапка */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 var(--pad);
  color: var(--oat-50);
  background: rgba(23, 27, 21, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-d);
}
.top__name { font-weight: 700; font-size: 18px; text-decoration: none; white-space: nowrap; }
.top__nav { display: flex; gap: 22px; margin-left: auto; }
.top__nav a { text-decoration: none; font-size: 16px; opacity: .82; transition: opacity .2s; }
.top__nav a:hover { opacity: 1; }
@media (max-width: 860px) { .top__nav { display: none; } .top .btn { margin-left: auto; } }

/* первый экран */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 64px);
  align-items: end;
  padding: calc(64px + clamp(40px, 7vh, 88px)) var(--pad) 0;
  color: var(--oat-50); background: var(--moss-900);
  overflow: hidden;
}
.hero__text { padding-bottom: clamp(32px, 6vh, 72px); max-width: 680px; }
.hero__kicker { font-size: 19px; color: var(--rowan-l); font-weight: 500; margin-bottom: 18px; }
.hero__title { font-size: clamp(52px, 7.6vw, 116px); line-height: .92; letter-spacing: -0.03em; margin-bottom: 30px; }
.shelf {
  position: relative; display: block; width: fit-content;
  padding: 0 0 .04em; margin-bottom: .16em; white-space: nowrap;
}
/* полка под каждой строкой заголовка */
.shelf::after {
  content: ""; position: absolute; left: -.06em; right: -.18em; bottom: -.03em; height: max(7px, .07em);
  background: var(--brass); border-radius: 2px;
  box-shadow: 0 .09em .14em -.04em rgba(0, 0, 0, .55);
  transform-origin: left center;
}
.shelf .w { display: inline-block; }
.hero__lead { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: rgba(245, 241, 232, .86); max-width: 34em; margin-bottom: 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero__note { font-size: 16px; color: rgba(245, 241, 232, .66); }
.hero__photo { margin: 0; align-self: end; }
.hero__photo img {
  width: 100%; max-height: min(78vh, 760px); object-fit: cover; object-position: 50% 18%;
  border-radius: var(--r-l) var(--r-l) 0 0;
}
.hero__bound {
  grid-column: 1 / -1; margin: 0 calc(var(--pad) * -1); padding: 16px var(--pad);
  font-size: 16px; color: rgba(245, 241, 232, .78);
  background: var(--moss-950); border-top: 1px solid var(--line-d);
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: calc(64px + 36px); }
  .hero__text { padding-bottom: 8px; }
  .hero__photo { margin: 0 auto; width: min(100%, 440px); }
  .hero__photo img { max-height: 520px; }
}

/* появление заголовка: слова опускаются на полки */
.motion .hero__title .w { animation: drop .9s cubic-bezier(.2, .9, .25, 1.15) both; }
.motion .hero__title .shelf:nth-child(1) .w { animation-delay: .15s; }
.motion .hero__title .shelf:nth-child(2) .w:nth-child(1) { animation-delay: .38s; }
.motion .hero__title .shelf:nth-child(2) .w:nth-child(2) { animation-delay: .5s; }
.motion .shelf::after { animation: plank .7s cubic-bezier(.3, .7, .2, 1) both; }
.motion .shelf:nth-child(2)::after { animation-delay: .12s; }
@keyframes drop { from { opacity: 0; transform: translateY(-.6em) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes plank { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* программа: картотека */
.program { position: relative; color: var(--oat-50); background: var(--moss-850); }
.program__stage { padding: clamp(64px, 10vh, 120px) var(--pad); max-width: calc(var(--max) + var(--pad) * 2); margin: 0 auto; }
.program__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: clamp(32px, 5vh, 56px); }
.program__head p { color: rgba(245, 241, 232, .74); max-width: 30em; }
.cabinet-wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 4vw, 64px); align-items: center; }

.cabinet {
  display: grid; grid-template-columns: auto 1fr 1fr; gap: 10px 10px;
  padding: 14px; border-radius: var(--r-m);
  background: var(--moss-950);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05), 0 40px 80px -40px rgba(0, 0, 0, .8);
  perspective: 1100px; perspective-origin: 50% -30%;
}
.cabinet__week {
  align-self: center; justify-self: end;
  font: 500 15px/1.15 var(--sans); color: rgba(245, 241, 232, .55);
  padding-right: 6px; text-align: right; white-space: nowrap;
}
.drawer {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 14px;
  font: inherit; color: var(--ink); text-align: left;
  background: var(--moss-700);
  border: 0; border-radius: var(--r-s); cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -2px 0 rgba(0, 0, 0, .25);
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), background-color .3s, box-shadow .55s;
}
.drawer:hover { background: var(--moss-600); }
/* верх ящика, виден, когда он выдвинут */
.drawer::before {
  content: none; position: absolute; left: 3px; right: 3px; top: 0; height: 36px;
  background: #2A2117; border-radius: 3px 3px 0 0;
  transform-origin: top center; transform: rotateX(90deg);
  pointer-events: none;
}
.drawer[aria-selected="true"]::before { content: ""; }
.drawer__label {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 34px; border-radius: 4px;
  font: 500 17px/1 var(--serif); color: var(--ink);
  background: var(--oat-100);
  box-shadow: 0 0 0 2px var(--brass), 0 0 0 4px rgba(0, 0, 0, .2);
}
.drawer__title { flex: 1; min-width: 0; font-size: 16px; line-height: 1.2; color: rgba(245, 241, 232, .9); }
.drawer__pull {
  flex: none; width: 26px; height: 10px; border: 2px solid var(--brass); border-top: 0;
  border-radius: 0 0 14px 14px; opacity: .9;
}
.drawer[aria-selected="true"] {
  background: var(--moss-600);
  transform: translateZ(36px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 18px 30px -10px rgba(0, 0, 0, .7);
  z-index: 2;
}
.drawer[aria-selected="true"] .drawer__label { background: var(--oat-50); }

/* карточка выдвинутого ящика */
.card {
  position: relative;
  padding: 22px 32px 22px;
  color: var(--ink);
  background-color: var(--oat-50);
  /* разлиновка библиотечной карточки */
  background-image: linear-gradient(to bottom, transparent 56px, rgba(166, 63, 40, .6) 56px, rgba(166, 63, 40, .6) 58px, transparent 58px),
    repeating-linear-gradient(to bottom, transparent 0 33px, rgba(60, 80, 120, .08) 33px 34px);
  background-position: 0 0, 0 58px; background-repeat: no-repeat, repeat-y;
  border-radius: var(--r-s);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .75);
  min-height: 420px;
  display: flex; flex-direction: column;
}
.card__meta { display: flex; justify-content: space-between; gap: 12px; font: 400 17px/1 var(--serif); font-style: italic; color: var(--ink-2); margin-bottom: 36px; }
.card__title { font-size: clamp(28px, 2.8vw, 38px); line-height: 1.08; min-height: 1.1em; margin-bottom: 30px; }
.card__text { font: 400 19px/34px var(--serif); margin-bottom: 18px; }
.card__practice { display: grid; gap: 2px; font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.card__practice span:first-child { font-weight: 700; color: var(--rowan); }
.card__nav { margin-top: auto; padding-top: 22px; display: flex; align-items: center; justify-content: space-between; }
.card__count { font: 400 16px/1 var(--serif); font-style: italic; color: var(--ink-2); }
.iconbtn {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 10px; background: var(--oat-200); color: var(--ink); cursor: pointer;
  transition: background-color .2s;
}
.iconbtn:hover { background: var(--oat-300); }
.iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card.swap .card__title, .card.swap .card__text, .card.swap .card__practice { animation: swap .45s ease both; }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* на большом экране сцена липнет, а ящики выдвигаются прокруткой */
@media (min-width: 961px) {
  .scrub .program { height: calc(100vh + 12 * 38vh); }
  .scrub .program__stage { position: sticky; top: 64px; min-height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: center; padding-top: 32px; padding-bottom: 32px; }
  .scrub .program__head { margin-bottom: 28px; }
}
@media (max-width: 960px) {
  .program__head, .cabinet-wrap { grid-template-columns: 1fr; }
  .drawer[aria-selected="true"] { transform: none; outline: 2px solid var(--brass); outline-offset: 1px; }
  .drawer[aria-selected="true"]::before { content: none; }
  .card { min-height: 0; }
}
@media (max-width: 520px) {
  .cabinet { grid-template-columns: 1fr 1fr; padding: 10px; gap: 8px; }
  .cabinet__week { grid-column: 1 / -1; justify-self: start; padding: 8px 2px 0; }
  .drawer { min-height: 58px; padding: 8px 10px; gap: 8px; }
  .drawer__label { width: 38px; height: 30px; font-size: 15px; }
  .drawer__title { font-size: 15px; }
  .drawer__pull { display: none; }
  .card { padding: 24px 20px 18px; }
}

/* как проходит */
.format, .who, .host, .faq { padding: clamp(72px, 11vh, 130px) var(--pad); max-width: calc(var(--max) + var(--pad) * 2); margin: 0 auto; }
.format h2, .who > h2, .faq h2 { margin-bottom: clamp(32px, 5vh, 52px); }
.format__list { list-style: none; margin: 0 0 48px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.format__list li { display: grid; gap: 8px; padding: 26px 0; border-top: 1.5px solid var(--ink); }
.format__list b { font-size: 26px; line-height: 1.15; }
.format__list span { color: var(--ink-2); max-width: 30em; }
.bound {
  display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px;
  padding: clamp(28px, 4vw, 48px); border-radius: var(--r-l);
  color: var(--oat-50); background: var(--moss-900);
}
.bound h3 { font-size: 30px; color: var(--rowan-l); }
.bound p { color: rgba(245, 241, 232, .86); }
@media (max-width: 900px) {
  .format__list { grid-template-columns: 1fr; }
  .bound { grid-template-columns: 1fr; gap: 16px; }
}

/* кому подойдёт */
.who__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.who__col { padding: clamp(26px, 3.5vw, 44px); border-radius: var(--r-l); }
.who__col h3 { font-size: 28px; margin-bottom: 20px; }
.who__col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.who__col li { position: relative; padding-left: 30px; }
.who__col li::before { content: ""; position: absolute; left: 0; top: .62em; width: 16px; height: 2px; background: currentColor; }
.who__col--yes { background: var(--oat-50); box-shadow: inset 0 0 0 1px var(--line-l); }
.who__col--yes li::before { background: var(--moss-600); }
.who__col--no { box-shadow: inset 0 0 0 2px var(--rowan); }
.who__col--no li::before { background: var(--rowan); transform: rotate(45deg); box-shadow: 0 0 0 0 var(--rowan); }
.who__col--no li::after { content: ""; position: absolute; left: 0; top: .62em; width: 16px; height: 2px; background: var(--rowan); transform: rotate(-45deg); }
.who__doctor { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-l); font-weight: 700; color: var(--rowan-d); }
@media (max-width: 800px) { .who__cols { grid-template-columns: 1fr; } }

/* ведущий */
.host { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.host__photo { margin: 0; }
.host__photo img { width: 100%; border-radius: var(--r-l); aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.host__kicker { color: var(--rowan); font-weight: 700; margin-bottom: 10px; }
.host h2 { margin-bottom: 26px; }
.host__text > p:not(.host__kicker) { margin-bottom: 16px; max-width: 34em; color: var(--ink-2); }
.host__text > p.host__honest { color: var(--ink); font: 500 22px/1.4 var(--serif); font-style: italic; margin: 26px 0; }
.host__link { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; text-underline-offset: 4px; }
@media (max-width: 800px) { .host { grid-template-columns: 1fr; } .host__photo { max-width: 420px; } }

/* вопросы */
.faq__list { border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-l); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  min-height: 72px; padding: 18px 0; cursor: pointer; list-style: none;
  font-size: clamp(20px, 1.9vw, 24px); font-weight: 700; line-height: 1.25;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px; margin-right: 6px;
  border-right: 2.5px solid var(--rowan); border-bottom: 2.5px solid var(--rowan);
  transform: rotate(45deg) translate(-3px, -3px); transition: transform .25s;
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-3px, -3px); }
.faq details p { padding: 0 0 24px; max-width: 42em; color: var(--ink-2); }

/* лист ожидания */
.wait {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start;
  padding: clamp(72px, 11vh, 130px) var(--pad);
  color: var(--oat-50); background: var(--moss-900);
}
.wait__intro { position: sticky; top: 96px; }
.wait__intro h2 { margin-bottom: 20px; }
.wait__intro p { color: rgba(245, 241, 232, .8); max-width: 26em; font-size: 21px; }
.form { color: var(--ink); background: var(--oat-50); border-radius: var(--r-l); padding: clamp(24px, 3vw, 40px); max-width: 600px; width: 100%; }
.form__body { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { font-weight: 700; font-size: 17px; }
.field__label i { font-weight: 400; font-style: normal; color: var(--ink-2); }
.field input:not([type="radio"]) {
  width: 100%; min-height: 54px; padding: 0 16px;
  font: 400 18px/1 var(--sans); color: var(--ink);
  background: #fff; border: 1.5px solid var(--oat-300); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #8A8C80; }
.field input:focus { outline: none; border-color: var(--moss-600); box-shadow: 0 0 0 3px rgba(69, 78, 59, .22); }
.field input[aria-invalid="true"] { border-color: var(--rowan); }
.field__err { min-height: 0; font-size: 15px; color: var(--rowan-d); font-weight: 500; }
.field__err:empty { display: none; }
.choice { display: flex; gap: 10px; }
.choice label { flex: 1; position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: grid; place-items: center; min-height: 50px; border-radius: 10px;
  background: #fff; border: 1.5px solid var(--oat-300); font: 500 18px/1 var(--sans); transition: background-color .2s, border-color .2s, color .2s;
}
.choice input:checked + span { background: var(--moss-800); border-color: var(--moss-800); color: var(--oat-50); }
.choice input:focus-visible + span { outline: 3px solid var(--rowan); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.4; color: var(--ink-2); cursor: pointer; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--moss-700); }
.check a { color: var(--ink); text-underline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__error { font-size: 16px; color: var(--rowan-d); font-weight: 500; }
.linkbtn { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0 0 0 6px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.form__done { padding: 12px 0; }
.form__done:focus { outline: none; }
.form__done h3 { font-size: 34px; margin-bottom: 12px; }
.form__done p { color: var(--ink-2); }
@media (max-width: 900px) { .wait { grid-template-columns: 1fr; } .wait__intro { position: static; } }

/* подвал */
.foot { padding: 36px var(--pad) 44px; color: rgba(245, 241, 232, .66); background: var(--moss-950); font-size: 15px; }
.foot p { max-width: 62em; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 18px; }
.foot a { color: rgba(245, 241, 232, .86); text-underline-offset: 3px; }

/* страница политики */
.doc { max-width: 760px; margin: 0 auto; padding: calc(64px + 56px) var(--pad) 96px; }
.doc h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 28px; }
.doc h2 { font-size: 24px; margin: 32px 0 10px; }
.doc p, .doc li { color: var(--ink-2); margin-bottom: 10px; }
