/* Q+luch — стили сайта. Палитра взята из брендбука в Figma. */

@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(../fonts/onest-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(../fonts/onest-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(../fonts/onest-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 500;
  src: url(../fonts/onest-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 700;
  src: url(../fonts/onest-cyrillic-700-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 700;
  src: url(../fonts/onest-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #F7F2EE;
  --paper: #FFFDFB;
  --ink: #2C2825;
  --ink-soft: #5E5752;
  --line: #E4DCD5;
  --orange: #FFA91E;
  --olive: #828F40;
  --blue: #7EBDD3;
  --purple: #8F4082;
  --black: #13171A;
  --pink: #FF86C9;
  --radius: 20px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 18px; line-height: 1.55;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Шапка */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 26px; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }
.logo .plus { color: var(--pink); }
.logo small { font-weight: 400; font-size: 14px; color: var(--ink-soft); margin-left: 8px; letter-spacing: 0; }
.nav { display: flex; gap: 6px 18px; flex-wrap: wrap; align-items: center; font-size: 16px; }
.nav a { text-decoration: none; padding: 6px 2px; }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--ink); }
.nav .lang { border: 1px solid var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 14px; }
.nav-toggle { display: none; }

/* Типографика */
h1, h2, h3 { font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(36px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 40px); margin-top: 1.6em; }
h3 { font-size: 22px; }
p { margin: 0 0 1em; }
.lead { font-size: clamp(19px, 2.2vw, 22px); color: var(--ink); max-width: 720px; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }

main { padding-bottom: 64px; }
section { padding: 8px 0; }

/* Обложка */
.hero { position: relative; overflow: hidden; padding: 56px 0 0; }
.hero .wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: end; }
.hero-text { padding-bottom: 56px; }
.hero-art { display: flex; align-items: flex-end; justify-content: center; min-height: 260px; }
.hero-art svg, .hero-art img { width: 100%; max-width: 460px; height: auto; }
.page-hero { padding: 48px 0 8px; }

/* Пилюли «ключ открывает» */
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.pills li { background: var(--black); color: #fff; border-radius: 999px; padding: 8px 18px; font-size: 16px; }
.pills li:nth-child(odd) { transform: rotate(-2deg); }
.pills li:nth-child(3n) { transform: rotate(3deg); }

/* Три входа */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 0; }
.door { display: block; text-decoration: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-height: 170px; position: relative; overflow: hidden; transition: transform .15s ease; }
.door:hover { transform: translateY(-3px); }
.door h3 { margin-bottom: 8px; }
.door p { color: var(--ink-soft); font-size: 16px; margin: 0; max-width: 85%; }
.door .arrow { position: absolute; right: 20px; top: 20px; font-size: 22px; }
.door.read { background: var(--blue); border-color: var(--blue); }
.door.come { background: var(--orange); border-color: var(--orange); }
.door.join { background: var(--pink); border-color: var(--pink); }
.door.read p, .door.come p, .door.join p { color: var(--ink); }

/* Карточки программ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card .art { height: 190px; overflow: hidden; }
.card .art svg { width: 100%; height: 100%; display: block; }
.card .body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { margin-bottom: 4px; }
.card p { font-size: 16px; margin: 0 0 6px; }
.card .meta { font-size: 15px; color: var(--ink-soft); }
.card .actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.card .art { background: var(--bg); border-bottom: 1px solid var(--line); }

/* Кнопки */
.btn { display: inline-block; text-decoration: none; background: var(--black); color: #fff; border-radius: 999px; padding: 10px 20px; font-size: 16px; font-weight: 500; border: 2px solid var(--black); }
.btn:hover { background: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper); }

/* Блоки помощи */
.box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 16px 0; }
.box.accent { border-left: 8px solid var(--purple); }
.note { font-size: 15px; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.phones { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.phone { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.phone a.num { font-size: 28px; font-weight: 700; text-decoration: none; display: block; }
ul.check { padding-left: 0; list-style: none; }
ul.check li { padding-left: 28px; position: relative; margin-bottom: 6px; }
ul.check li::before { content: ''; position: absolute; left: 4px; top: .55em; width: 12px; height: 12px; border-radius: 50%; background: var(--olive); }

/* Материалы */
.list { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.list li { border-bottom: 1px solid var(--line); padding: 16px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: baseline; }
.list li .t { font-weight: 500; }
.list li .d { color: var(--ink-soft); font-size: 15px; grid-column: 1; }
.list li .links { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 14px; flex-wrap: wrap; font-size: 16px; justify-content: flex-end; }
.tag { display: inline-block; font-size: 13px; border: 1px solid var(--ink); border-radius: 999px; padding: 1px 10px; margin-right: 6px; vertical-align: 2px; }

/* Таймлайн */
.timeline { list-style: none; padding: 0; margin: 16px 0 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 16px 20px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); }
.timeline b { font-weight: 500; }

/* Telegram */
.tg-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }

/* Партнёры */
.partners { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 12px 0 0; }
.partners li { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 16px; font-size: 16px; }

/* Быстрый выход */
.quick-exit { position: fixed; right: 16px; bottom: 16px; z-index: 20; background: var(--purple); color: #fff; border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

/* Подвал */
.site-footer { background: var(--black); color: #F7F2EE; padding: 48px 0 32px; margin-top: 48px; }
.site-footer a { color: #F7F2EE; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer h4 { font-weight: 500; font-size: 16px; margin: 0 0 10px; color: #BDB5AE; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .logo { font-size: 30px; }
.site-footer .fine { margin-top: 32px; font-size: 14px; color: #BDB5AE; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-text { padding-bottom: 8px; }
  .hero-art { min-height: 0; }
  .hero-art svg, .hero-art img { max-width: 340px; }
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 0; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .list li { grid-template-columns: 1fr; }
  .list li .links { grid-row: auto; grid-column: 1; justify-content: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav-toggle { display: inline-block; background: none; border: 1px solid var(--ink); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 15px; color: var(--ink); }
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-bottom: 16px; }
  .nav.open { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .door { transition: none; } }
.nav .lang + .lang { margin-left: -10px; }

/* живые глаза на обложке (assets/js/eyes.js) */
.lively .pupil { transition: transform .18s ease-out; }
.lively .eyes { transform-box: fill-box; transform-origin: center; transition: transform .07s ease-in, opacity .15s; }
.lively .eyes.blink { transform: scaleY(.1); }
@media (prefers-reduced-motion: reduce) { .lively .pupil, .lively .eyes { transition: none; } }
.lively .ch { transform-box: fill-box; transform-origin: 50% 100%; }
.lively .ch.brr { animation: brr .5s ease-in-out; }
.lively .ch.brr .pupil { transition: transform .06s linear; }
@keyframes brr {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-2.5deg); } 30% { transform: rotate(2.5deg); }
  45% { transform: rotate(-2deg); }  60% { transform: rotate(1.5deg); } 75% { transform: rotate(-.8deg); }
}
@media (prefers-reduced-motion: reduce) { .lively .ch.brr { animation: none; } }

/* слова-плашки на обложке чуть меняют наклон при наведении */
.hero .pills li { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); cursor: default; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .hero .pills li:hover { transform: rotate(-3deg); }
  .hero .pills li:nth-child(odd):hover { transform: rotate(2deg); }
  .hero .pills li:nth-child(3n):hover { transform: rotate(-1.5deg); }
}

/* выбор языка с глобусом — на телефоне рядом с кнопкой «Меню» */
.header-tools { display: flex; gap: 8px; align-items: center; }
.langs { position: relative; display: none; }
.langs summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border: 1px solid var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 15px; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary svg { width: 18px; height: 18px; }
.langs ul { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; margin: 0; list-style: none; box-shadow: 0 8px 24px rgba(0,0,0,.08); min-width: 150px; z-index: 10; }
.langs a { display: block; padding: 8px 12px; border-radius: 10px; text-decoration: none; }
.langs a:hover { background: var(--bg); }
.langs a[aria-current] { font-weight: 700; }
@media (max-width: 640px) {
  .langs { display: block; }
  .nav .lang { display: none; }
}

/* подсказка про версию на языке браузера (assets/js/lang-hint.js) */
.lang-hint { background: var(--blue); color: var(--ink); font-size: 15px; }
.lang-hint .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-top: 10px; padding-bottom: 10px; }
.lang-hint a { font-weight: 500; }
.lang-hint button { margin-left: auto; background: none; border: 0; font: inherit; font-size: 16px; color: var(--ink); cursor: pointer; padding: 2px 6px; }
