/* ===== Блоки главной (sites/_portfolio/BLOCKS.md) и анимации ===== */

/* Анимация появления: прячем только когда JS подтвердил, что сам покажет (класс anim-on) */
.anim-on [data-reveal] { transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1), filter .7s, clip-path .9s cubic-bezier(.7,0,.2,1); transition-delay: calc(var(--i, 0) * 90ms); }
.anim-on [data-reveal]:not(.is-in) { opacity: 0; }
.anim-fade-up.anim-on [data-reveal]:not(.is-in) { transform: translateY(28px); }
.anim-zoom.anim-on [data-reveal]:not(.is-in) { transform: scale(.92); }
.anim-slide.anim-on [data-reveal]:not(.is-in) { transform: translateX(-40px); }
.anim-slide.anim-on [data-reveal].r-alt:not(.is-in) { transform: translateX(40px); }
.anim-blur.anim-on [data-reveal]:not(.is-in) { filter: blur(12px); transform: translateY(12px); }
.anim-flip.anim-on [data-reveal]:not(.is-in) { transform: perspective(900px) rotateX(-18deg) translateY(24px); transform-origin: 50% 0; }
.anim-mask.anim-on [data-reveal] { opacity: 1; }
.anim-mask.anim-on [data-reveal]:not(.is-in) { opacity: 1; clip-path: inset(0 0 100% 0); }
.anim-mask.anim-on [data-reveal].is-in { clip-path: inset(0 0 0 0); }

/* Первый экран тоже появляется по-своему */
@keyframes h-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes h-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
.js .h2o__text > * { animation: h-in .8s cubic-bezier(.2,.7,.2,1) both; }
.js .h2o__text > :nth-child(2) { animation-delay: .08s; } .js .h2o__text > :nth-child(3) { animation-delay: .16s; } .js .h2o__text > :nth-child(4) { animation-delay: .24s; }
.anim-zoom .h2o__media img, .anim-blur .h2o__media img { animation: h-zoom 1.6s cubic-bezier(.2,.7,.2,1) both; }

/* Парящие 3D-иконки */
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-3deg); } }
.ax-float .ico3d { animation: float 5s ease-in-out infinite; }
.ax-float .why__item:nth-child(2) .ico3d { animation-delay: -1.6s; } .ax-float .why__item:nth-child(3) .ico3d { animation-delay: -3.2s; }
.ax-tilt .card, .ax-tilt .why__item, .ax-tilt .b-tips__item, .ax-tilt .b-aud__item, .ax-tilt .b-bento__item { transition: transform .25s ease, box-shadow .25s; will-change: transform; }
.ax-parallax .h2o__media { overflow: hidden; }

/* Бегущая строка */
.b-marquee { overflow: hidden; background: var(--teal); color: var(--on-primary, #fff); padding: 18px 0; }
.b-marquee__track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.b-marquee__row { display: flex; align-items: center; gap: 28px; padding-right: 28px; white-space: nowrap; font-family: var(--font-head); font-size: clamp(18px, 2.4vw, 26px); font-weight: 700; }
.b-marquee__row i { font-style: normal; opacity: .6; font-size: .7em; }
.b-marquee:hover .b-marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Мозаика направлений */
.b-bento__grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.b-bento__item { position: relative; display: block; border-radius: var(--radius, 16px); overflow: hidden; min-height: 200px; color: #fff; text-decoration: none; }
.b-bento__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.b-bento__item:hover img { transform: scale(1.05); }
.b-bento__item::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.72)); }
.b-bento__cap { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: flex-end; }
.b-bento__cap b { font-family: var(--font-head); font-size: 20px; } .b-bento__cap small { font-size: 15px; opacity: .9; }
@media (min-width: 768px) {
  .b-bento__grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; }
  .b-bento__item:first-child { grid-column: span 2; grid-row: span 2; }
  .b-bento__item:first-child .b-bento__cap b { font-size: 28px; }
}

/* Прайс-лист с точками */
.b-price__wrap { display: grid; gap: 28px; }
.b-price__wrap > *, .b-check__wrap > *, .b-about__wrap > *, .b-blog__grid > * { min-width: 0; }
.b-price__head h2, .b-quote p { overflow-wrap: break-word; hyphens: auto; }
.b-price__head p { color: var(--muted); max-width: 42ch; }
.b-price__list { list-style: none; margin: 0; padding: 0; }
.b-price__list a { display: flex; align-items: baseline; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 44px; }
.b-price__list a span { font-family: var(--font-head); font-size: 18px; min-width: 0; }
.b-price__list a i { flex: 1; border-bottom: 2px dotted var(--line); min-width: 16px; transform: translateY(-4px); }
.b-price__list a b { white-space: nowrap; color: var(--teal-d, var(--teal)); }
.b-price__list a:hover span { color: var(--teal); }
@media (min-width: 1024px) { .b-price__wrap { grid-template-columns: 1fr 1.6fr; align-items: start; } .b-price__head { position: sticky; top: 100px; } }

/* Крупная статья + список */
.b-blog__grid { display: grid; gap: 24px; }
.b-blog__main { display: block; color: inherit; text-decoration: none; }
.b-blog__main img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius, 16px); margin-bottom: 14px; }
.b-blog__main h3 { font-size: clamp(22px, 2.6vw, 30px); margin: 8px 0; }
.b-blog__list { list-style: none; counter-reset: bl; margin: 0; padding: 0; }
.b-blog__list li { counter-increment: bl; border-bottom: 1px solid var(--line); }
.b-blog__list a { display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; padding: 18px 0; color: inherit; text-decoration: none; }
.b-blog__list a::before { content: counter(bl, decimal-leading-zero); grid-row: span 2; font-family: var(--font-head); font-size: 24px; color: var(--teal); }
.b-blog__list b { font-size: 18px; line-height: 1.35; } .b-blog__list a:hover b { color: var(--teal); }
@media (min-width: 900px) { .b-blog__grid { grid-template-columns: 1.3fr 1fr; align-items: start; } }

/* Как работаем: таймлайн */
.b-steps__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; position: relative; }
.b-steps__list li { position: relative; padding-left: 64px; min-width: 0; }
.b-steps__n { position: absolute; left: 0; top: 0; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: var(--on-primary, #fff); font-family: var(--font-head); font-weight: 700; z-index: 1; }
.b-steps__list::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 2px; background: var(--line); }
.b-steps__list h3 { margin: 10px 0 6px; } .b-steps__list p { margin: 0; color: var(--muted); }
@media (min-width: 900px) {
  .b-steps__list { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }
  .b-steps__list li { padding: 70px 0 0; }
  .b-steps__list::before { left: 24px; right: 24px; top: 23px; bottom: auto; width: auto; height: 2px; }
  .ax-draw.anim-on .b-steps__list::before { transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.4s cubic-bezier(.7,0,.2,1) .2s; }
  .ax-draw.anim-on .b-steps__list.is-in::before { transform: scaleX(1); }
}

/* Кому подходит */
.b-aud__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.b-aud__item { padding: 26px 22px; border-radius: var(--radius, 16px); background: var(--bg-soft); min-width: 0; }
.b-aud__item .i { width: 40px; height: 40px; color: var(--teal); }
.b-aud__item h3 { margin: 14px 0 6px; } .b-aud__item p { margin: 0; color: var(--muted); }

/* Чек-лист */
.b-check__wrap { display: grid; gap: 28px; }
.b-check__lead { color: var(--muted); max-width: 46ch; margin-bottom: 20px; }
.b-check__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.b-check__list li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--bg-soft); }
.b-check__list .i { flex: none; width: 22px; height: 22px; color: var(--teal); margin-top: 2px; } .b-check__list span { min-width: 0; }
@media (min-width: 900px) { .b-check__wrap { grid-template-columns: 1fr 1.4fr; align-items: start; } .b-check__list { grid-template-columns: 1fr 1fr; } }

/* Сравнение */
.b-cmp__scroll { overflow-x: auto; border-radius: var(--radius, 16px); border: 1px solid var(--line); }
.b-cmp__table { width: 100%; min-width: 520px; border-collapse: collapse; }
.b-cmp__table th, .b-cmp__table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.b-cmp__table thead th { background: var(--teal); color: var(--on-primary, #fff); font-family: var(--font-head); }
.b-cmp__table tbody th { font-weight: 600; width: 30%; }
.b-cmp__table tbody tr:nth-child(even) { background: var(--bg-soft); }
.b-cmp__table tr:last-child > * { border-bottom: 0; }

/* Советы */
.b-tips__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.b-tips__item { position: relative; overflow: hidden; padding: 28px 22px 24px; border-radius: var(--radius, 16px); border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.b-tips__n { position: absolute; right: 10px; top: -14px; font-family: var(--font-head); font-size: 96px; font-weight: 800; line-height: 1; color: var(--teal); opacity: .14; }
.b-tips__item h3 { position: relative; margin: 0 0 8px; } .b-tips__item p { position: relative; margin: 0; color: var(--muted); }

/* Цифры */
.b-facts__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin: 0; }
.b-facts__item { padding: 24px 20px; border-top: 3px solid var(--teal); background: var(--bg-soft); border-radius: 0 0 var(--radius, 16px) var(--radius, 16px); min-width: 0; }
.b-facts__item dt { font-family: var(--font-head); font-size: clamp(34px, 4.4vw, 52px); font-weight: 800; line-height: 1.05; color: var(--teal-d, var(--teal)); overflow-wrap: anywhere; }
.b-facts__item dd { margin: 8px 0 0; color: var(--muted); }

/* Фото + текст */
.b-about__wrap { display: grid; gap: 28px; align-items: center; }
.b-about__media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius, 16px); }
.b-about__text p { color: var(--muted); }
.b-about__text ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.b-about__text li { display: flex; gap: 10px; } .b-about__text li .i { flex: none; width: 22px; height: 22px; color: var(--teal); }
@media (min-width: 900px) { .b-about__wrap { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* Манифест */
.b-quote { padding: clamp(56px, 9vw, 120px) 0; background: var(--navy, #102030); color: #fff; }
.b-quote blockquote { margin: 0 auto; max-width: 900px; text-align: center; }
.b-quote p { font-family: var(--font-head); font-size: clamp(24px, 3.6vw, 44px); line-height: 1.25; margin: 0; text-wrap: balance; }
.b-quote p::before { content: "«"; color: var(--teal-l, var(--teal)); } .b-quote p::after { content: "»"; color: var(--teal-l, var(--teal)); }
.b-quote footer { margin-top: 18px; opacity: .75; }

/* Сезоны */
.b-seasons__grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.b-seasons__item { padding: 24px 20px; border-radius: var(--radius, 16px); background: linear-gradient(160deg, var(--teal-l, var(--bg-soft)), var(--bg-soft)); min-width: 0; }
.b-seasons__item h3 { margin: 0 0 8px; } .b-seasons__item p { margin: 0; color: var(--muted); }

/* Тёмная тема: подложки блоков */
.theme-dark .b-aud__item, .theme-dark .b-check__list li, .theme-dark .b-facts__item, .theme-dark .b-tips__item { background: rgba(255,255,255,.04); }
.theme-dark .b-seasons__item { background: rgba(255,255,255,.05); }

@media (prefers-reduced-motion: reduce) {
  .b-marquee__track { animation: none; flex-wrap: wrap; width: auto; } .b-marquee__row[aria-hidden] { display: none; }
  .js .h2o__text > *, .h2o__media img, .ax-float .ico3d { animation: none !important; }
}
