/* run-trener — variant-watch_1 + motion / glow polish */
:root {
  --bg: #070b10;
  --text: #f5fafc;
  --dim: #b4c4d0;
  --steel-hi: #8a97a2;
  --steel-mid: #4a5660;
  --steel-lo: #242c34;
  --mip: #222c29;
  --mip-txt: #f7fdf9;
  --mip-dim: #c2d4c9;
  --mip-blue: #6eb8ef;
  --mip-amber: #f0a84a;
  --strava: #fc4c02;
  --max-glow: rgba(110, 184, 239, 0.55);
  --font-display: "Saira Condensed", system-ui, sans-serif;
  --font-body: "Onest", system-ui, sans-serif;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    linear-gradient(165deg, #0e1620 0%, var(--bg) 42%, #0a1014 100%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Атмосфера: блики + «дорожка» + зерно */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}

.bg__glow--a {
  width: min(130vw, 780px);
  height: min(75vh, 560px);
  left: 50%;
  top: -10%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 40%, rgba(110, 184, 239, 0.42) 0%, rgba(110, 184, 239, 0.12) 40%, transparent 72%);
}

.bg__glow--b {
  width: min(95vw, 520px);
  height: min(55vh, 400px);
  right: -18%;
  bottom: 6%;
  background:
    radial-gradient(ellipse at 40% 50%, rgba(240, 168, 74, 0.26) 0%, transparent 68%);
}

.bg__glow--c {
  width: min(75vw, 400px);
  height: min(45vh, 300px);
  left: -16%;
  bottom: 20%;
  background:
    radial-gradient(ellipse at 60% 40%, rgba(63, 224, 143, 0.16) 0%, transparent 70%);
}

.bg__track {
  position: absolute;
  left: 50%;
  top: 42%;
  width: min(140vw, 820px);
  height: min(140vw, 820px);
  transform: translate(-50%, -50%);
  opacity: 0.34;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      transparent 0 36px,
      rgba(110, 184, 239, 0.11) 36px 37px
    );
  -webkit-mask: radial-gradient(closest-side, transparent 18%, #000 32%, #000 58%, transparent 72%);
  mask: radial-gradient(closest-side, transparent 18%, #000 32%, #000 58%, transparent 72%);
}

.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.14;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: clamp(10px, 2vh, 18px);
  max-width: 440px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + clamp(16px, 3.4vh, 26px))
    18px
    calc(env(safe-area-inset-bottom) + clamp(14px, 2.6vh, 24px));
}

.who {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.who picture {
  flex: none;
  line-height: 0;
}

.who img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  background: #1a222a;
  border: 1px solid #2e3a45;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.who h1 {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.who p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 13px;
  color: var(--dim);
}

.who p::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fe08f;
  box-shadow: 0 0 8px rgba(63, 224, 143, 0.55);
  flex: none;
}

.hero {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 2vh, 16px);
  min-height: 0;
}

.watch {
  --size: clamp(196px, min(64vw, 33vh), 272px);
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: clamp(6px, 2vh, 16px) auto;
  isolation: isolate;
  overflow: visible;
  flex: none;
  contain: layout style;
  filter: saturate(1.08) brightness(1.08);
}

.watch__glow {
  position: absolute;
  inset: -28%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(110, 184, 239, 0.42) 0%, rgba(240, 168, 74, 0.14) 40%, transparent 72%);
  filter: blur(3px);
}

.strap {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 44%;
  height: clamp(34px, 7vh, 58px);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, #171d22, #2a333a 45%, #151b20);
  z-index: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.strap.top {
  bottom: 88%;
  border-radius: 8px 8px 0 0;
  -webkit-mask: linear-gradient(180deg, transparent, #000 75%);
  mask: linear-gradient(180deg, transparent, #000 75%);
}

.strap.bottom {
  top: 88%;
  border-radius: 0 0 8px 8px;
  -webkit-mask: linear-gradient(0deg, transparent, #000 75%);
  mask: linear-gradient(0deg, transparent, #000 75%);
}

.case {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 1;
  overflow: hidden;
  background:
    conic-gradient(
      from 210deg,
      var(--steel-lo),
      var(--steel-hi) 14%,
      var(--steel-lo) 28%,
      var(--steel-mid) 42%,
      #4a5560 55%,
      var(--steel-lo) 68%,
      var(--steel-hi) 84%,
      var(--steel-lo)
    );
  padding: clamp(11px, 3.4vw, 15px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14),
    0 26px 48px rgba(0, 0, 0, 0.55),
    0 0 56px rgba(110, 184, 239, 0.28),
    0 0 20px rgba(240, 168, 74, 0.1),
    inset 0 2px 3px rgba(255, 255, 255, 0.42),
    inset 0 -3px 6px rgba(0, 0, 0, 0.4);
}

.bezel-ring {
  position: absolute;
  inset: clamp(8px, 2.6vw, 11px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.65),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.ticks {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.72) 0deg 0.55deg,
    transparent 0.55deg 6deg
  );
  -webkit-mask: radial-gradient(closest-side, transparent 87.5%, #000 88.5%, #000 92%, transparent 93%);
  mask: radial-gradient(closest-side, transparent 87.5%, #000 88.5%, #000 92%, transparent 93%);
  opacity: 0.8;
}

.ticks--hours {
  background: repeating-conic-gradient(
    from -0.8deg,
    rgba(255, 255, 255, 0.98) 0deg 1.4deg,
    transparent 1.4deg 30deg
  );
  opacity: 0.95;
}

/*
  Пушеры под .case: центр → rotate(a) → translateX(R).
  Без обратного rotate — длинная сторона по касательной, flush к дуге.
*/
.pusher {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 24px;
  margin: -12px 0 0 -5px;
  border-radius: 2px;
  z-index: 0;
  pointer-events: none;
  transform: rotate(var(--a)) translateX(calc(var(--size) * 0.5 - 0.5px));
  background: linear-gradient(90deg, #222830 0%, #4a5560 42%, #8a97a2 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(120% 80% at 50% 18%, #2a3532 0%, var(--mip) 52%, #141a18 100%);
  box-shadow:
    inset 0 0 0 1px #0e1210,
    inset 0 8px 18px rgba(0, 0, 0, 0.45),
    inset 0 -10px 22px rgba(110, 184, 239, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  font-family: var(--font-display);
  z-index: 1;
}

.face-screens {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.face__glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(110, 184, 239, 0.28), rgba(240, 168, 74, 0.08) 55%, transparent 72%);
  z-index: 0;
}

.face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 2px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0 1px, transparent 1px 2px),
    radial-gradient(closest-side, transparent 55%, rgba(0, 0, 0, 0.28) 100%);
}

.face-in {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 20% 20%;
  opacity: 0;
  visibility: hidden;
  /* без scale — иначе визуально «прыгают» часы при кроссфейде */
  transform: none;
  pointer-events: none;
}

.face-in.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.face-in.is-exit {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  z-index: 1;
}

.f-title {
  max-width: 8.5ch;
  font-weight: 700;
  font-size: clamp(19px, 5.8vw, 25px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--mip-txt);
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  text-shadow: 0 0 16px rgba(244, 251, 246, 0.22);
}

.f-sub {
  max-width: 92%;
  margin-top: 2px;
  font-size: clamp(10px, 2.6vw, 11px);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--mip-dim);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.f-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  max-width: 90%;
}

.f-pills span {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(159, 178, 168, 0.35);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mip-txt);
  text-transform: uppercase;
}

.f-wave {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 22px;
  margin-top: 12px;
}

.f-wave i {
  display: block;
  width: 3px;
  height: 40%;
  border-radius: 2px;
  background: var(--mip-blue);
  box-shadow: 0 0 8px rgba(95, 168, 220, 0.45);
}

.f-chat {
  margin-top: 12px;
}

.f-bubble {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(110, 184, 239, 0.18);
  border: 1px solid rgba(110, 184, 239, 0.4);
  color: var(--mip-txt);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.f-sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(252, 76, 2, 0.16);
  border: 1px solid rgba(252, 76, 2, 0.55);
  color: #ffd4c2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.f-sync__mark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--strava);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 0 10px rgba(252, 76, 2, 0.55);
}

.f-macros {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  max-width: 92%;
}

.f-macros span {
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(63, 224, 143, 0.4);
  background: rgba(63, 224, 143, 0.1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #d8ffe8;
  text-transform: uppercase;
}

.f-top {
  font-size: clamp(9.5px, 2.8vw, 11.5px);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--mip-amber);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(227, 154, 69, 0.35);
}

.f-big {
  font-weight: 700;
  font-size: clamp(46px, 15.5vw, 64px);
  line-height: 0.9;
  color: var(--mip-txt);
  letter-spacing: -0.01em;
  text-shadow: 0 0 18px rgba(233, 241, 236, 0.18);
  font-variant-numeric: tabular-nums;
}

.f-unit {
  font-size: clamp(10px, 3vw, 12px);
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--mip-dim);
  text-transform: uppercase;
  margin-top: -2px;
}

.f-row {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 9px;
  align-items: center;
  width: min(100%, 11.5rem);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(159, 178, 168, 0.28);
}

.f-row .k {
  font-size: clamp(9px, 2.6vw, 10.5px);
  letter-spacing: 0.14em;
  color: var(--mip-dim);
  text-transform: uppercase;
}

.f-row .v {
  font-size: clamp(16px, 5vw, 21px);
  font-weight: 700;
  color: var(--mip-txt);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.f-row .div {
  background: rgba(159, 178, 168, 0.28);
  height: 26px;
}

.f-zone {
  display: flex;
  gap: 2px;
  width: min(100%, 11.5rem);
  margin-top: 9px;
}

.f-zone i {
  height: 5px;
  flex: 1;
  background: rgba(159, 178, 168, 0.28);
  transform-origin: left center;
}

.f-zone i.on {
  background: var(--mip-blue);
  box-shadow: 0 0 8px rgba(95, 168, 220, 0.45);
}

.caption {
  text-align: center;
  font-size: 14.5px;
  color: var(--dim);
  line-height: 1.4;
  max-width: 30ch;
  /* Фикс высоты — иначе space-between дёргает часы при смене текста */
  min-height: calc(1.4em * 3);
  margin: 0 auto;
  text-wrap: pretty;
}

.caption b {
  color: var(--text);
  font-weight: 600;
}

.cta {
  display: grid;
  gap: 10px;
  flex: none;
  margin-top: auto;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 18px 0 16px;
  border-radius: 14px;
  font-size: 16.5px;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.15s var(--ease-out-expo),
    box-shadow 0.2s var(--ease-out-expo),
    filter 0.15s var(--ease-out-expo),
    background-color 0.15s var(--ease-out-expo);
  -webkit-tap-highlight-color: transparent;
}

.btn__lead {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  line-height: 1.2;
}

.btn svg.btn__icon {
  display: block;
  width: 22px;
  height: 22px;
  min-width: 22px;
  max-width: 22px;
  flex: 0 0 22px;
}

.btn:active {
  transform: scale(0.985);
}

.btn:focus-visible {
  outline: 3px solid var(--mip-blue);
  outline-offset: 3px;
}

.btn-primary {
  min-height: 60px;
  background: linear-gradient(180deg, #ffffff 0%, #e8eef3 100%);
  color: #0b0f12;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    0 0 28px var(--max-glow),
    0 12px 28px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.04);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45),
    0 0 36px rgba(95, 168, 220, 0.55),
    0 14px 32px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid #45535f;
}

.btn-secondary:hover {
  border-color: #5a6a78;
  background: rgba(255, 255, 255, 0.03);
}

.btn i {
  font-style: normal;
  opacity: 0.6;
}

.btn-primary i {
  opacity: 0.75;
}

.note {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--dim);
}

/* Entrance — already-visible defaults */
@media (prefers-reduced-motion: no-preference) {
  .who {
    animation: rise 0.65s var(--ease-out-expo) both;
  }

  .watch {
    animation: watch-in 0.9s var(--ease-out-expo) 0.06s both;
  }

  .watch__glow {
    animation: glow-breathe 4.2s var(--ease-out-expo) 0.5s infinite alternate;
  }

  .face__glow {
    animation: mip-breathe 3.6s var(--ease-out-expo) 0.7s infinite alternate;
  }

  .caption {
    animation: rise 0.7s var(--ease-out-expo) 0.2s both;
  }

  .btn-primary {
    animation: cta-in 0.7s var(--ease-out-expo) 0.28s both;
  }

  .btn-secondary {
    animation: cta-in 0.7s var(--ease-out-expo) 0.36s both;
  }

  .note {
    animation: rise 0.6s var(--ease-out-expo) 0.42s both;
  }

  .face-in.is-active,
  .face-in.is-exit {
    transition: opacity 0.35s var(--ease-out-expo);
  }

  .js-zones.is-armed i {
    transition:
      transform 0.45s var(--ease-out-expo),
      opacity 0.35s var(--ease-out-expo),
      box-shadow 0.35s var(--ease-out-expo),
      background-color 0.35s var(--ease-out-expo);
  }

  .js-zones.is-armed i.on:not(.is-on) {
    background: rgba(159, 178, 168, 0.28);
    box-shadow: none;
    opacity: 0.35;
    transform: scaleX(0.15);
  }

  .js-zones.is-armed i.on.is-on {
    background: var(--mip-blue);
    box-shadow: 0 0 8px rgba(95, 168, 220, 0.55);
    opacity: 1;
    transform: scaleX(1);
  }

  .face-in.is-active .f-wave i {
    animation: wave 0.9s var(--ease-out-expo) infinite alternate;
  }

  .face-in.is-active .f-wave i:nth-child(2) { animation-delay: 0.05s; }
  .face-in.is-active .f-wave i:nth-child(3) { animation-delay: 0.1s; }
  .face-in.is-active .f-wave i:nth-child(4) { animation-delay: 0.15s; }
  .face-in.is-active .f-wave i:nth-child(5) { animation-delay: 0.2s; }
  .face-in.is-active .f-wave i:nth-child(6) { animation-delay: 0.25s; }
  .face-in.is-active .f-wave i:nth-child(7) { animation-delay: 0.3s; }

  .bg__glow--a {
    animation: aurora-a 7s var(--ease-out-expo) infinite alternate;
  }

  .bg__glow--b {
    animation: aurora-b 9s var(--ease-out-expo) infinite alternate;
  }

  .bg__track {
    animation: track-spin 48s linear infinite;
  }

  .face-in.is-active .f-sync__mark {
    animation: sync-spin 1.8s var(--ease-out-expo) infinite;
  }
}

@keyframes aurora-a {
  from { opacity: 0.75; transform: translateX(-50%) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

@keyframes aurora-b {
  from { opacity: 0.55; transform: translate(-4%, 4%) scale(0.94); }
  to { opacity: 1; transform: translate(3%, -2%) scale(1.06); }
}

@keyframes track-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes sync-spin {
  0%, 70% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rise {
  from {
    opacity: 0.55;
    transform: translate3d(0, 0.55rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes watch-in {
  from {
    opacity: 0.45;
    transform: scale(0.94) translate3d(0, 0.6rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes cta-in {
  from {
    opacity: 0.6;
    transform: translate3d(0, 0.45rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes glow-breathe {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

@keyframes mip-breathe {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

@keyframes wave {
  from {
    height: 28%;
    opacity: 0.55;
  }
  to {
    height: 100%;
    opacity: 1;
  }
}

/* Пауза бесконечных анимаций, когда вкладка в фоне (ставит main.js) */
body.is-bg-paused .watch__glow,
body.is-bg-paused .face__glow,
body.is-bg-paused .bg__glow--a,
body.is-bg-paused .bg__glow--b,
body.is-bg-paused .bg__track,
body.is-bg-paused .f-sync__mark,
body.is-bg-paused .face-in.is-active .f-wave i {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .watch__glow,
  .face__glow,
  .bg__glow--a,
  .bg__glow--b,
  .bg__track,
  .f-sync__mark {
    animation: none;
  }
}
