/* Главная страница «Мир в душе» по утверждённому стальному прототипу: светлая сталь и воздух,
   хромовый заголовок, стальные нити света, тёмно-стальные секции практикумов и консультации.
   Файл подключается только на главной (см. templates/home.html), остальные страницы его не получают.
   Все классы начинаются с home-, чтобы не пересекаться со стилями сайта в site.css. */

@font-face {
  font-family: "Cormorant";
  src: url("/static/fonts/Cormorant-Variable-subset.woff2") format("woff2");
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("/static/fonts/Cormorant-MediumItalic-subset.woff2") format("woff2");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url("/static/fonts/Montserrat-Variable-subset.woff2") format("woff2");
  font-weight: 100 600;
  font-style: normal;
  font-display: swap;
}

.page-home {
  --hm-bg: #EEF1F5;           /* светлый стальной фон */
  --hm-card: #E2E7ED;         /* карточки на свету */
  --hm-line: #CFD6DE;         /* границы, линии */
  --hm-ink: #262E39;          /* основной текст на свету */
  --hm-mut: #5C6774;          /* вторичный текст */
  --hm-deep: #11161F;         /* тёмно-стальные секции */
  --hm-deep-2: #171E2A;       /* карточки в темноте */
  --hm-deep-ink: #DDE3EA;     /* текст в темноте */
  --hm-brass: #B8956A;        /* тёплая латунь — цены и акценты */
  --hm-brass-deep: #8A6A3C;
  --hm-chrome-a: #FDFEFF;     /* хром заголовка */
  --hm-chrome-b: #AEB9C6;
  --hm-chrome-c: #79879A;
  --hm-display: "Montserrat", -apple-system, "Segoe UI", Arial, sans-serif;
  --hm-serif: "Cormorant", Georgia, "Times New Roman", serif;
  background: var(--hm-bg);
}

/* ── Основа: шрифты и отступы текста внутри главной ── */
.page-home main {
  font-family: var(--hm-display);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--hm-ink);
  -webkit-font-smoothing: antialiased;
}
:where(.page-home main) :is(h1, h2) {
  font-family: var(--hm-display);
  font-weight: 200;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
:where(.page-home main) h3 {
  font-family: var(--hm-display);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}
:where(.page-home main) p { margin: 0; }
:where(.page-home main) b { font-weight: 600; }
.page-home main img { max-width: 100%; }
.page-home main :focus-visible { outline: 3px solid var(--hm-brass); outline-offset: 3px; }

.home-wrap { max-width: 1180px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.home-nowrap { white-space: nowrap; }
.home-eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .4em; text-transform: uppercase; color: var(--hm-mut); }

/* Кнопки: крупные, капителью, перламутровый перелив и парение (как в прототипе) */
.home-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 20px 46px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--hm-display); font-weight: 500; font-size: 15.5px; line-height: 1; letter-spacing: .09em;
  text-transform: uppercase; text-align: center; text-decoration: none; cursor: pointer;
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), box-shadow .28s ease, background-color .26s ease, border-color .26s ease, color .26s ease;
  will-change: transform;
}
.home-btn:hover { text-decoration: none; }
.home-btn--gold, .home-btn--gold:hover {
  color: var(--hm-ink);
  background: linear-gradient(115deg, #ffffff 0%, #dfe7f0 18%, #f6efe6 36%, #ffffff 52%, #d6deea 70%, #efe9f2 86%, #ffffff 100%);
  background-size: 320% 100%;
  animation: home-sheen 7s linear infinite;
}
.home-btn--gold { box-shadow: 0 8px 22px -10px rgba(38, 46, 57, .45); }
.home-btn--gold:hover { transform: translateY(-4px); box-shadow: 0 26px 48px -14px rgba(38, 46, 57, .52); animation-duration: 2.6s; }
.home-btn--ghost { position: relative; overflow: hidden; border-color: var(--hm-line); color: var(--hm-ink); background: transparent; }
.home-btn--ghost::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .5; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .85) 50%, transparent 70%);
  background-size: 280% 100%;
  animation: home-sheen 6s linear infinite;
}
.home-btn--ghost:hover { transform: translateY(-4px); box-shadow: 0 18px 36px -16px rgba(38, 46, 57, .4); background: #fff; color: var(--hm-ink); }
.home-btn--forest { border-color: rgba(185, 196, 210, .3); color: var(--hm-deep-ink); background: transparent; font-size: 13.5px; min-height: 48px; padding: 14px 28px; letter-spacing: .1em; }
.home-btn--forest:hover { transform: translateY(-3px); background: #fff; color: var(--hm-deep); box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .6); }
@keyframes home-sheen { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }

/* ── Кнопка «Атмосфера»: стоит под шапкой, при прокрутке остаётся в правом верхнем углу ── */
.home-dock { position: sticky; top: 0; z-index: 10; height: 0; }
.home-sound {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 82px); right: clamp(14px, 4vw, 40px);
  display: none; align-items: center; gap: 9px; min-height: 42px; padding: 9px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--hm-line); color: var(--hm-mut);
  font-family: var(--hm-display); font-weight: 400; font-size: 12.5px; line-height: 1.7; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease, border-color .25s ease;
}
.home-js .home-sound { display: inline-flex; }  /* без скриптов звук не включить — кнопку не показываем */
.home-sound:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(38, 46, 57, .4); }
.home-sound.is-on { color: var(--hm-ink); border-color: var(--hm-brass); }
.home-sound__bars { display: inline-flex; gap: 3px; align-items: flex-end; height: 13px; }
.home-sound__bars i { width: 2px; height: 4px; border-radius: 2px; background: var(--hm-brass); }
.home-sound.is-on .home-sound__bars i { animation: home-eq 1.2s ease-in-out infinite; }
.home-sound.is-on .home-sound__bars i:nth-child(2) { animation-delay: .25s; }
.home-sound.is-on .home-sound__bars i:nth-child(3) { animation-delay: .5s; }
@keyframes home-eq { 0%, 100% { height: 4px; } 50% { height: 13px; } }

/* ── Обложка: светлая сталь, хромовый заголовок, нити света и прогрессивный расфокус ── */
.home-hero {
  position: relative; overflow: hidden; color: var(--hm-ink); text-align: center;
  background:
    radial-gradient(900px 500px at 70% 20%, rgba(184, 149, 106, .07), transparent 60%),
    linear-gradient(180deg, #F3F5F8 0%, var(--hm-bg) 60%, #E8ECF1 100%);
}
.home-sparkle { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.home-defocus {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: radial-gradient(ellipse 62% 55% at 50% 44%, transparent 38%, #000 86%);
  mask-image: radial-gradient(ellipse 62% 55% at 50% 44%, transparent 38%, #000 86%);
}
.home-hero__inner { position: relative; z-index: 2; padding-block: clamp(64px, 11vh, 120px) clamp(56px, 9vh, 100px); }
.home-hero .home-eyebrow { color: var(--hm-mut); margin-bottom: 26px; }
.home-hero h1 {
  font-weight: 100;
  font-size: clamp(44px, 9.2vw, 118px);
  line-height: 1.02;
  letter-spacing: .045em;
  margin: 0 auto;
  max-width: 12ch;
  background: linear-gradient(175deg, var(--hm-chrome-a) 8%, var(--hm-chrome-b) 46%, var(--hm-chrome-c) 72%, var(--hm-chrome-a) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .75)) drop-shadow(0 14px 28px rgba(38, 46, 57, .22));
}
.home-hero h1 em { font-style: normal; font-weight: 200; }
.home-hero__lead { max-width: 600px; margin: 30px auto 0; color: var(--hm-mut); font-size: 19.5px; line-height: 1.6; }
.home-hero__cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 40px; }
.home-hero__meta {
  display: flex; flex-wrap: wrap; gap: 20px 34px; justify-content: center; margin: 48px 0 0; padding: 0; list-style: none;
  font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--hm-mut);
}
.home-hero__meta b { display: block; font-family: var(--hm-display); font-weight: 200; font-size: 34px; line-height: 1.1; letter-spacing: .02em; color: var(--hm-ink); }

/* ── Секции ── */
.home-section { padding-block: clamp(64px, 9vh, 108px); }
.home-section--alt { background: var(--hm-card); }
/* «О Юлии» и «Статьи» стоят ближе друг к другу: между ними один отступ, а не два */
.home-section--close { padding-bottom: 36px; }
.home-section--tight { padding-top: 56px; }
.home-head { max-width: 64ch; display: flex; flex-direction: column; gap: 14px; margin-bottom: 42px; }
.home-head h2 { font-size: clamp(30px, 4.6vw, 52px); }
.home-head p { color: var(--hm-mut); font-size: 18.5px; }
.home-head .home-eyebrow { font-size: 11.5px; color: var(--hm-brass); }
.home-rule { width: 64px; height: 1px; background: linear-gradient(90deg, var(--hm-brass), transparent); }

/* Блоки плавно появляются при прокрутке. Класс home-js ставит скрипт: без него всё видно сразу. */
.home-js .home-rv { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .8, .3, 1); }
.home-js .home-rv.is-in { opacity: 1; transform: none; }

/* Тесты: светлые стальные карточки */
/* min(…, 100%): на самых узких экранах карточка не шире колонки */
.home-tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 18px; }
.home-test, .home-test:hover { color: var(--hm-ink); text-decoration: none; }
.home-test {
  display: flex; flex-direction: column; gap: 9px; padding: 26px 24px 22px; border-radius: 18px; min-height: 180px;
  background: linear-gradient(165deg, #fff, var(--hm-card));
  border: 1px solid rgba(207, 214, 222, .7);
  transition: transform .32s cubic-bezier(.2, .8, .3, 1), box-shadow .32s ease;
}
.home-test:hover { transform: translateY(-6px); box-shadow: 0 30px 48px -22px rgba(38, 46, 57, .42); }
.home-test h3 { font-size: 17.5px; }
.home-test__meta { font-size: 15px; color: var(--hm-mut); line-height: 1.55; letter-spacing: normal; }
.home-test__price { margin-top: auto; padding-top: 12px; font-family: var(--hm-display); font-weight: 500; font-size: 14px; letter-spacing: .06em; color: var(--hm-brass); font-variant-numeric: tabular-nums; }
.home-test__price small { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 400; letter-spacing: .02em; color: var(--hm-mut); }
.home-test--free, .home-test--free:hover { color: var(--hm-ink); }
.home-test--free { background: linear-gradient(160deg, #fff 20%, #F3EDE4); }
.home-test--free .home-test__meta { color: var(--hm-mut); }
.home-test--free .home-test__price { color: var(--hm-brass-deep); }

/* Практикумы: тёмно-стальная секция */
.page-home #praktikumy {
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(135, 160, 190, .14), transparent 60%),
    radial-gradient(700px 420px at 90% 100%, rgba(184, 149, 106, .12), transparent 60%),
    var(--hm-deep);
  color: var(--hm-deep-ink);
}
.page-home #praktikumy h2 { color: #F2F5F9; }
.page-home #praktikumy .home-head p { color: #97A2B0; }
.home-products { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.home-product {
  position: relative;
  display: flex; flex-direction: column; gap: 12px; padding: 30px 28px; border-radius: 20px; min-height: 250px;
  background: linear-gradient(165deg, var(--hm-deep-2), #121926);
  border: 1px solid rgba(185, 196, 210, .14);
  transition: transform .32s cubic-bezier(.2, .8, .3, 1), box-shadow .32s ease, border-color .32s ease;
}
.home-product:hover { transform: translateY(-6px); box-shadow: 0 34px 60px -24px rgba(0, 0, 0, .65); border-color: rgba(184, 149, 106, .45); }
.home-product h3 { font-weight: 300; font-size: 24px; letter-spacing: .02em; color: #F2F5F9; }
.home-tag {
  align-self: flex-start; padding: 6px 13px; border-radius: 999px; border: 1px solid rgba(185, 196, 210, .3);
  font-size: 10.5px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: #97A2B0;
}
.home-product--flag .home-tag { position: absolute; top: -12px; left: 24px; background: var(--hm-brass); border-color: var(--hm-brass); color: var(--hm-deep); font-weight: 600; }
.home-product--flag { border-color: rgba(184, 149, 106, .4); }
.home-product__text { font-size: 15.5px; color: #9AA5B3; line-height: 1.62; }
.home-product__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; }
.home-price { font-family: var(--hm-display); font-weight: 300; font-size: 26px; line-height: 1.2; color: var(--hm-brass); font-variant-numeric: tabular-nums; }
.home-price small { display: block; font-size: 12.5px; font-weight: 400; color: #7D8795; letter-spacing: .02em; }

/* О Юлии: цитата и факты */
.home-about { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.home-about__quote { font-family: var(--hm-serif); font-style: italic; font-weight: 500; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.4; color: var(--hm-ink); }
.home-about h2 { font-size: clamp(24px, 3vw, 34px); margin-top: 10px; }
.home-about__bio { margin-top: 14px; font-size: 15.5px; color: var(--hm-mut); }
.home-about__bio + .home-about__bio { margin-top: 10px; }
.home-creds { display: grid; gap: 10px; margin: 22px 0 0; padding-left: 18px; list-style: none; border-left: 2px solid var(--hm-brass); }
.home-creds b { display: block; font-size: 13.5px; font-weight: 500; }
.home-creds span { display: block; font-size: 13px; color: var(--hm-mut); }
/* Ссылка на анкету на B17.ru — под списком образования, с тем же отступом, что и пункты списка */
.home-about__b17 { margin-top: 16px; padding-left: 20px; font-size: 13px; line-height: 1.6; color: var(--hm-mut); }
.home-about__b17 a, .home-about__b17 a:hover { color: var(--hm-brass-deep); }
.home-about__b17 a { text-decoration: none; border-bottom: 1px solid rgba(138, 106, 60, .4); }
.home-about__b17 a:hover { border-bottom-color: var(--hm-brass-deep); }

/* Статьи: светлые карточки со стальными обложками-градиентами */
.home-articles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.home-article, .home-article:hover { color: var(--hm-ink); text-decoration: none; }
.home-article {
  display: flex; flex-direction: column; gap: 8px; padding: 0 0 20px; border-radius: 18px; overflow: hidden;
  background: #fff; border: 1px solid rgba(207, 214, 222, .7);
  transition: transform .3s cubic-bezier(.2, .8, .3, 1), box-shadow .3s ease;
}
.home-article::before { content: ""; display: block; height: 110px; margin-bottom: 10px; }
.home-article:nth-child(6n+1)::before { background: radial-gradient(130% 160% at 20% 10%, #F4F6F9 0%, #AEBBCA 45%, #5C6B7E 100%); }
.home-article:nth-child(6n+2)::before { background: radial-gradient(130% 160% at 80% 20%, #F6F3EE 0%, #C4B49D 45%, #6E5F49 100%); }
.home-article:nth-child(6n+3)::before { background: radial-gradient(130% 160% at 30% 80%, #EEF2F6 0%, #9FB4C9 40%, #3C4F66 100%); }
.home-article:nth-child(6n+4)::before { background: radial-gradient(130% 160% at 70% 70%, #F5F1F2 0%, #C3A9B2 45%, #6B4E5C 100%); }
.home-article:nth-child(6n+5)::before { background: radial-gradient(130% 160% at 50% 0%, #F1F4F3 0%, #A5C0B8 45%, #44625A 100%); }
.home-article:nth-child(6n)::before { background: radial-gradient(130% 160% at 20% 50%, #F3F3F6 0%, #B1AECB 45%, #514D73 100%); }
.home-article:hover { transform: translateY(-6px); box-shadow: 0 28px 48px -22px rgba(38, 46, 57, .4); }
.home-article__rubric { padding-inline: 22px; font-size: 10.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--hm-brass-deep); }
.home-article h3 { padding-inline: 22px; font-size: 16.5px; line-height: 1.35; }
.home-article__meta { padding-inline: 22px; margin-top: auto; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--hm-mut); }
.home-more { margin-top: 28px; font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.home-more a, .home-more a:hover { color: var(--hm-brass-deep); }
.home-more a { text-decoration: none; border-bottom: 1px solid rgba(138, 106, 60, .4); padding-bottom: 3px; }
.home-more a:hover { border-bottom-color: var(--hm-brass-deep); }

/* ── Консультация: снова глубокая сталь ── */
.home-consult {
  position: relative; overflow: hidden; padding-block: clamp(64px, 9vh, 108px); color: var(--hm-deep-ink);
  background:
    radial-gradient(800px 420px at 85% 10%, rgba(135, 160, 190, .12), transparent 60%),
    var(--hm-deep);
}
.home-consult__inner { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 30px; align-items: center; justify-content: space-between; }
.home-consult .home-eyebrow { color: var(--hm-brass); font-size: 11.5px; }
.home-consult h2 { font-size: clamp(30px, 4.6vw, 52px); margin-top: 14px; color: #F2F5F9; }
.home-consult h2 em { font-style: italic; font-family: var(--hm-serif); text-transform: none; letter-spacing: .01em; color: var(--hm-brass); }
.home-consult__lead { margin-top: 14px; max-width: 52ch; color: #97A2B0; font-size: 17px; }
.home-consult__prices { display: grid; gap: 0; margin: 26px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(185, 196, 210, .16); }
.home-consult__prices li { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; padding: 14px 4px; border-bottom: 1px solid rgba(185, 196, 210, .16); font-size: 16px; color: #C7CFD9; }
.home-consult__prices b { font-family: var(--hm-display); font-weight: 300; font-size: 20px; color: var(--hm-brass); white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-consult__actions { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.home-consult__actions .home-btn--ghost { border-color: rgba(185, 196, 210, .3); color: var(--hm-deep-ink); }
.home-consult__actions .home-btn--ghost:hover { background: #fff; color: var(--hm-deep); }
.home-contacts {
  display: flex; flex-wrap: wrap; gap: 12px 40px; width: 100%; margin: 48px 0 0; padding: 22px 0 0; list-style: none;
  border-top: 1px solid rgba(185, 196, 210, .16); font-size: 13px; color: #7D8795;
}
.home-contacts a, .home-contacts a:hover { color: var(--hm-brass); }
.home-contacts a { text-decoration: none; }
.home-contacts a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .home-hero__inner { padding-block: 64px 72px; }
  .home-about { grid-template-columns: 1fr; }
  .home-section, .home-consult { padding-block: 64px; }
  .home-section--close { padding-bottom: 24px; }
  .home-section--tight { padding-top: 44px; }
}

/* Узкие телефоны: главная кнопка обложки остаётся в одну строку, название сайта в шапке — тоже */
/* Телефоны: кнопка «Атмосфера» по центру между шапкой и заголовком, чтобы не наезжать на текст */
@media (max-width: 700px) {
  .home-dock { top: 70px; }
  .home-sound { top: 6px; left: 50%; right: auto; translate: -50% 0; }
  .home-hero__inner { padding-top: 92px; }
}

@media (max-width: 370px) {
  .home-hero__cta .home-btn { padding-inline: 24px; }
}
@media (max-width: 340px) {
  .page-home .nav__toggle, .page-home .nav__account { padding-inline: .65em; }
  .home-hero__cta .home-btn { padding-inline: 16px; font-size: 13px; letter-spacing: .04em; }
}

/* Печать и «Сохранить как PDF»: все блоки видны, кнопки звука и мерцания нет */
@media print {
  .home-js .home-rv { opacity: 1; transform: none; transition: none; }
  .home-dock, .home-sparkle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero h1 em { animation: none; }
  .home-btn--gold, .home-btn--ghost::after { animation: none; }
  .home-btn, .home-test, .home-product, .home-article { transition: none; }
  .home-js .home-rv { opacity: 1; transform: none; transition: none; }
  .home-sound.is-on .home-sound__bars i { animation: none; height: 9px; }
}
