/* ------------------------------------------------------------------
   ixi Pro screens, see docs/pro-screens.md. The base picture and where
   its display sits are set in BASES in pro.js; everything inside is laid out in the watch's own
   dp (240×240 px at 120dpi = 320×320 dp), so it scales with the picture.
   Positions checked against a uiautomator dump of a real watch.
------------------------------------------------------------------- */
.ixipro { position: relative; }
.ixipro > img { display: block; width: 100%; height: auto; }
/* a screen in perspective on a photo: 320px square, pro.js sets matrix3d */
.ixipro-screen.ixipro-quad { left: 0; top: 0; width: 320px; height: 320px; transform-origin: 0 0; }
.ixipro-screen {
  position: absolute;
  overflow: hidden;
  container-type: inline-size;
  background: #000;
}
.ixipro .ui {
  --dp: calc(100cqw / 320);
  --top: calc(4 * 4 / 3 * var(--dp)); /* 4 watch px; the app has 2dp (2px), two more for readability */
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  color: #fff;
  -webkit-font-smoothing: antialiased;
}
/* bg_*_gradient.xml, android:angle="225" = top right → bottom left */
.ixipro .ui.black { background: #000; }
.ixipro .ui.blue { background: linear-gradient(to bottom left, #2162ef, #4286f3); }
.ixipro .ui.orange { background: linear-gradient(to bottom left, #ff802e, #fea82d); }
/* bg_red_gradient.xml, the heart-rate alarm's; here for the made-up aggression screen */
.ixipro .ui.red { background: linear-gradient(to bottom left, #ff2e2e, #ff6354); }

/* top bar: fragment_top_bar.xml + subfragment_signals.xml. Sizes as the app;
   one change: the time and "4G" are centred on the bar by their capitals,
   like the battery figure. The app sits them on a low baseline, which reads
   low at small sizes. text-box trims the line to the capitals (Chrome,
   Safari); elsewhere line-height 1 lands within a dp of it. */
.ixipro .bar {
  flex: none;
  position: relative;
  height: calc(32 * var(--dp));
  margin-top: var(--top);
  display: flex; align-items: center; justify-content: space-between;
}
.ixipro .time,
.ixipro .bearer { line-height: 1; text-box: trim-both cap alphabetic; white-space: nowrap; }
.ixipro .time {
  padding-left: calc(4 * var(--dp));
  font-family: 'Open Sans', sans-serif; font-weight: 600; font-size: calc(28 * var(--dp));
}
.ixipro .signals { display: flex; align-items: center; height: 100%; padding: 0 calc(4 * var(--dp)) 0 calc(2 * var(--dp)); }
.ixipro .bearer {
  width: calc(44 * var(--dp));
  font-family: Roboto, sans-serif; font-weight: 600; font-size: calc(32 * var(--dp));
}
.ixipro .signals svg { display: block; height: calc(32 * var(--dp)); width: auto; fill: #fff; }
.ixipro .bars { padding-right: calc(8 * var(--dp)); }
.ixipro .ble { padding-right: calc(4 * var(--dp)); }
.ixipro .battery { position: relative; margin-right: calc(8 * var(--dp)); }
.ixipro .battery svg { width: calc(60 * var(--dp)); height: calc(32 * var(--dp)); }
.ixipro .battery span {
  position: absolute; left: 0; width: 95%; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  font: 700 calc(22 * var(--dp))/normal Roboto, sans-serif;
}

.ixipro .body { flex: 1; position: relative; display: flex; flex-direction: column; }

/* pulsator4droid: 4 rings, 4s, linear, #70FFFFFF, radius = half the shorter side */
.ixipro .pulsator { position: relative; height: calc(150 * var(--dp)); }
.ixipro .pulsator i {
  position: absolute; left: 50%; top: 50%;
  width: calc(150 * var(--dp)); height: calc(150 * var(--dp));
  margin: calc(-75 * var(--dp)) 0 0 calc(-75 * var(--dp));
  border-radius: 50%;
  background: rgba(255, 255, 255, .44);
  transform: scale(0); opacity: 0;
  animation: ixipro-pulse 4s linear infinite;
}
.ixipro .pulsator i:nth-child(2) { animation-delay: 1s; }
.ixipro .pulsator i:nth-child(3) { animation-delay: 2s; }
.ixipro .pulsator i:nth-child(4) { animation-delay: 3s; }
@keyframes ixipro-pulse {
  from { transform: scale(0); opacity: 1; }
  to   { transform: scale(1); opacity: 0; }
}
.ixipro .pulsator .icon svg {
  position: absolute; left: 50%; top: 50%;
  width: calc(48 * var(--dp)); height: calc(48 * var(--dp));
  margin: calc(-24 * var(--dp)) 0 0 calc(-24 * var(--dp));
}
.ixipro .text {
  margin: 0;
  padding: 0 calc(4 * var(--dp));
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
  font: 700 calc(40 * var(--dp))/1.362 'Open Sans', sans-serif;
  transition: opacity .2s;
}
.ixipro .text.small { font-size: calc(36 * var(--dp)); }
.ixipro .text.swap { opacity: 0; }

/* fragment_cancel_button.xml + ic_cancel_button.xml */
.ixipro .pulsator .button {
  position: absolute; left: 50%; top: 50%;
  width: calc(150 * var(--dp)); height: calc(150 * var(--dp));
  margin: calc(-75 * var(--dp)) 0 0 calc(-75 * var(--dp));
  box-sizing: border-box;
  border-radius: 50%;
  border: calc(5 * var(--dp)) solid #fff;
  background: radial-gradient(circle closest-side, #fff, rgba(255, 255, 255, .44) 20%);
}

/* fragment_notification.xml + bg_red_border.xml: fills the space under the bar */
.ixipro .body > .notification {
  flex: 1;
  border: calc(15 * var(--dp)) solid #ff2e2e;
  border-radius: calc(20 * var(--dp));
}

/* the logo screen: the stacked logo as on the old marketing render,
   about 80% of the screen wide, no top bar */
.ixipro .ui.splash .bar { display: none; }
.ixipro .logo { flex: 1; display: grid; place-items: center; }
.ixipro .ixipro-screen .logo img { display: block; width: 100%; height: auto; filter: none; transition: none; }

/* fragment_watch.xml: time 96sp with the 43f1f0 → 4286f3 shader, date 36sp */
.ixipro .watch { text-align: center; padding-top: calc(16 * var(--dp)); }
.ixipro .clock {
  font: 600 calc(96 * var(--dp))/1.333 'Open Sans', sans-serif;
  background: linear-gradient(120deg, #43f1f0, #4286f3);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.ixipro .date {
  white-space: pre-line;
  font: 400 calc(36 * var(--dp))/1.362 'Open Sans', sans-serif;
}

/* an alarm that is not yet accepted: the watch buzzes, a short shake
   every 1.5 s, like the real one vibrating. Fixed px, so the small watch
   in the devices row still shows it. */
.ixipro.ixipro-ringing { animation: ixipro-buzz 1.5s linear infinite; }
@keyframes ixipro-buzz {
  0%, 24%, 100% { transform: none; }
  3%, 9%, 15% { transform: translateX(-2px) rotate(-2.5deg); }
  6%, 12%, 18% { transform: translateX(2px) rotate(2.5deg); }
  21% { transform: translateX(-1px) rotate(-1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ixipro .pulsator i { animation: none; }
  .ixipro.ixipro-ringing { animation: none; }
  .ixipro .text { transition: none; }
}
