/* Анимации лендинга «Счётчик дней и событий» (разметка — scripts/build-countly.mjs, поведение — countly-demo.js).
   Телефон — общий с демо клинера (swipe-demo.css: .sd, .sd-phone, .sd-screen, .sd-status); размеры — в em от --w.
   Экран — как в приложении: светло-серый фон, белые карточки групп, чёрные кружки-стрелки и чёрная капсула «+». */

/* ---------- 1) Демо в hero: главная приложения ---------- */
.cd .sd-phone { background: #111; box-shadow: 0 3.5em 8em rgba(0,0,0,.28), 0 0 0 .1em rgba(0,0,0,.12), inset 0 0 0 .12em rgba(255,255,255,.08); }
.cd-screen { background: #f4f4f4; color: #111; text-align: left; }
.cd-top { display: flex; justify-content: flex-end; padding: 0 1.1em; height: 3.4em; }
.cd-pill { display: inline-flex; align-items: center; gap: 1.2em; height: 3.2em; padding: 0 1.2em; border-radius: 1.6em; background: #fff; box-shadow: 0 .4em 1.2em rgba(0,0,0,.07); }
.cd-pill svg { width: 1.75em; height: 1.75em; fill: #111; display: block; }
.cd-title { display: block; padding: .5em 1.05em .45em; font-size: 2.55em; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.cd-group { margin: 0 .55em .55em; padding: .95em 1em; border-radius: 1.6em; background: #fff; opacity: 0; transform: translateY(.8em); animation: cd-in .5s ease forwards; animation-delay: calc(var(--i) * 80ms); }
@keyframes cd-in { to { opacity: 1; transform: none; } }
.cd-gh { display: flex; align-items: center; gap: .45em; }
.cd-gh b { font-size: 1.12em; font-weight: 500; }
.cd-gh i { font-style: normal; font-size: .78em; font-weight: 600; min-width: 1.5em; height: 1.5em; display: grid; place-items: center; border: .12em solid #111; border-radius: .45em; }
.cd-chev { margin-left: auto; width: 2em; height: 2em; border-radius: 50%; background: #111; display: grid; place-items: center; transform: rotate(180deg); }
.cd-chev svg { width: 1.2em; height: 1.2em; }
.cd-item { display: flex; align-items: center; gap: .6em; margin-top: .75em; padding-top: .75em; border-top: 1px solid #eee; }
.cd-emo { font-size: 1.7em; line-height: 1; }
.cd-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .15em; }
.cd-info b { font-size: .98em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-info small { font-size: .74em; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-time { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd-time small { font-size: .68em; color: #8e8e93; }
.cd-time b { font-size: 1.1em; font-weight: 700; white-space: nowrap; }
.cd-hms { font-size: .74em; color: #555; }
.cd-item[data-dir="since"] .cd-time b { color: #111; }
.cd-item.tap { animation: cd-tap .5s ease; }
@keyframes cd-tap { 40% { background: #f0f0f2; } }

/* ---------- 2) Виджеты: «Домой» и экран блокировки ---------- */
.cw { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); justify-content: center; gap: 24px; }
@media (max-width: 760px) { .cw { grid-template-columns: minmax(0, 380px); } }
.cw-home, .cw-lock {
  position: relative; padding: 22px 20px 24px; border-radius: 40px; overflow: hidden; isolation: isolate;
  font-size: clamp(11px, 3.4vw, 13px); color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 30px 70px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.07);
}
.cw-home { background: radial-gradient(70% 60% at 15% 0%, #5b6b8c, transparent 70%), radial-gradient(60% 60% at 100% 100%, #8c6a55, transparent 70%), linear-gradient(160deg, #2c3446, #16181f); }
.cw-lock { display: flex; flex-direction: column; align-items: center; min-height: 30em; background: radial-gradient(80% 50% at 50% 0%, #7a6a9c, transparent 70%), radial-gradient(70% 60% at 0% 100%, #3d5a7a, transparent 70%), linear-gradient(180deg, #2a2438, #12121a); }
.cw-w { position: relative; margin: 0 0 2em; border-radius: 1.6em; padding: 1.1em 1.25em; box-sizing: border-box; background: #fff; color: #111; }
.cw-w figcaption { position: absolute; left: 0; right: 0; bottom: -1.65em; text-align: center; color: rgba(255,255,255,.85); font-size: .85em; font-weight: 500; }
.cw-h { display: block; font-size: .85em; color: #8e8e93; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35em; }
.cw-row { display: flex; align-items: center; gap: .55em; padding: .32em 0; font-size: 1.05em; }
.cw-row + .cw-row { border-top: 1px solid #f0f0f0; }
.cw-row .cw-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-row b { font-variant-numeric: tabular-nums; }
.cw-small { aspect-ratio: 1; margin: 0; display: flex; flex-direction: column; justify-content: center; padding: .9em 1em; }
.cw-small .cw-emo { font-size: 1.4em; }
.cw-num { font-size: 2.9em; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: .1em; }
.cw-small small { color: #8e8e93; font-size: .85em; }
.cw-small .cw-t { font-size: .9em; font-weight: 600; margin-top: .25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4em; margin: 0 0 2em; }
.cw-apps i { aspect-ratio: 1; border-radius: 26%; background: rgba(255,255,255,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.cw-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4em; }
.cw-apps.two { grid-template-columns: repeat(2, 1fr); margin: 0; }
.cw-island { width: 8em; height: 2.3em; border-radius: 2em; background: #000; margin-bottom: 1.6em; }
.cw-date { margin: 0; font-size: 1.05em; font-weight: 600; opacity: .9; text-align: center; }
.cw-clock { margin: 0 0 auto; font-size: 6.2em; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.cw-live { align-self: stretch; display: flex; align-items: center; gap: .7em; margin-top: 2em; padding: 1em 1.1em; border-radius: 1.6em; background: rgba(20,20,24,.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.cw-live .cw-emo { font-size: 1.9em; }
.cw-live .cw-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cw-live .cw-t small { font-size: .78em; opacity: .6; }
.cw-live .cw-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-lt { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.cw-lt small { font-size: .78em; opacity: .6; }
.cw-lt b { white-space: nowrap; font-size: 1.05em; }

@media (prefers-reduced-motion: reduce) {
  .cd-group { animation: none; opacity: 1; transform: none; }
  .cd-item.tap { animation: none; }
}
