/* Every phone on the site: double click / double tap turns the screen off and on (assets/js/phone-power.js). */
.nl-power-phone {
  pointer-events: auto;          /* some phones sit in a layer that lets clicks through (home hero) */
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
/* an <img> phone gets its glass laid over it */
.nl-power-float { position: absolute; z-index: 2; pointer-events: none; }

/* ---- the dark screen ---- */
.nl-power-glass {
  position: absolute;
  inset: var(--nl-glass-inset, 0);
  z-index: 30;
  display: grid;
  place-items: center;
  border-radius: var(--nl-glass-r, inherit);
  background:
    linear-gradient(128deg, rgb(255 255 255 / .09) 0 15%, rgb(255 255 255 / .025) 27%, transparent 40%),
    radial-gradient(ellipse at 50% 38%, #0b0e14, #020305 72%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}
[data-power="off"] > .nl-power-glass { opacity: 1; }
.nl-power-hint {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: rgb(255 255 255 / .34);
  font: 600 8px/1.2 var(--font, Inter, Arial, sans-serif);
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transition: opacity .4s ease .5s;
}
[data-power="off"] > .nl-power-glass .nl-power-hint { opacity: 1; }
.nl-power-hint svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nl-guide-tap 2.6s ease-in-out infinite;
  transform-origin: 45% 20%;
}
/* a short glow as the screen wakes */
.nl-power-phone.is-waking, .nl-power-live.is-waking { animation: nl-phone-wake .7s ease-out; }
@keyframes nl-phone-wake {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.45) saturate(.7); }
  100% { filter: none; }
}

/* ---- the gesture guide: a hand tapping twice, with ripples ---- */
.nl-phone-guide {
  position: absolute;
  z-index: 31;
  left: 50%;
  bottom: 14%;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: .94;
  animation: nl-guide-in .4s ease-out both;
  transition: opacity .35s ease, scale .35s ease;
}
.nl-phone-guide.is-done { opacity: 0; scale: .8; }
@keyframes nl-guide-in { from { opacity: 0; scale: .85; } }
.nl-phone-guide-touch {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgb(6 9 16 / .62);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .18), 0 6px 18px rgb(0 0 0 / .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.nl-phone-guide svg {
  position: relative;
  width: 22px;
  height: 22px;
  margin: 6px 0 0 3px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nl-guide-tap 2.6s ease-in-out infinite;
  transform-origin: 45% 20%;
}
.nl-phone-guide-touch i {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid rgb(255 255 255 / .85);
  opacity: 0;
  animation: nl-guide-ripple 2.6s ease-out infinite;
}
.nl-phone-guide-touch i + i { animation-delay: .32s; }
.nl-phone-guide-label {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgb(6 9 16 / .7);
  color: #fff;
  font: 600 9px/1.2 var(--font, Inter, Arial, sans-serif);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .14);
}
@keyframes nl-guide-tap {
  0%, 6%, 18%, 30%, 100% { transform: translateY(0) scale(1); }
  12%, 24% { transform: translateY(3px) scale(.92); }
}
@keyframes nl-guide-ripple {
  0%, 11% { opacity: 0; transform: scale(.4); }
  13% { opacity: .95; transform: scale(.6); }
  34% { opacity: 0; transform: scale(2.6); }
  100% { opacity: 0; transform: scale(2.6); }
}

/* ---- where the finger tapped: a fingertip and two rings, one per tap ---- */
.nl-tap-ripple { position: absolute; z-index: 32; width: 0; height: 0; pointer-events: none; --rip: 60px; }
.nl-tap-ripple i, .nl-tap-ripple b {
  position: absolute;
  left: calc(var(--rip) / -2);
  top: calc(var(--rip) / -2);
  width: var(--rip);
  height: var(--rip);
  border-radius: 50%;
}
.nl-tap-ripple i {
  border: max(2px, calc(var(--rip) * .05)) solid rgb(255 255 255 / .9);
  opacity: 0;
  animation: nl-tap-ring .75s ease-out forwards;
}
.nl-tap-ripple i + i { animation-delay: .16s; }
.nl-tap-ripple.is-single i { border-color: rgb(255 255 255 / .5); }
.nl-tap-ripple b {
  background: radial-gradient(circle, rgb(255 255 255 / .55), rgb(255 255 255 / .12) 60%, transparent 72%);
  animation: nl-tap-dot .7s ease-out forwards;
}
@keyframes nl-tap-ring {
  0% { opacity: .95; transform: scale(.35); }
  100% { opacity: 0; transform: scale(2.1); }
}
@keyframes nl-tap-dot {
  0%, 35% { opacity: 1; transform: scale(.7); }
  100% { opacity: 0; transform: scale(1.1); }
}

/* ---- the live phone in the project viewer: sizes are in its screen's own 390 x 844 px box ---- */
.nl-power-live > .nl-power-glass { inset: 0; border-radius: inherit; cursor: pointer; touch-action: manipulation; }
.nl-power-live[data-power="off"] > .nl-power-glass { pointer-events: auto; }
.nl-power-live .nl-power-hint { gap: 14px; font-size: 19px; letter-spacing: .06em; }
.nl-power-live .nl-power-hint svg { width: 58px; height: 58px; stroke-width: 1.4; }
.nl-power-live > .nl-phone-guide { bottom: 17%; gap: 14px; }
.nl-power-live .nl-phone-guide-touch {
  width: 100px;
  height: 100px;
  background: rgb(6 9 16 / .55);
  box-shadow: 0 0 0 2px rgb(255 255 255 / .22), 0 14px 40px rgb(0 0 0 / .45);
}
.nl-power-live .nl-phone-guide svg { width: 56px; height: 56px; margin: 16px 0 0 8px; stroke-width: 1.5; }
.nl-power-live .nl-phone-guide-touch i { width: 36px; height: 36px; margin: -18px 0 0 -18px; border-width: 3px; }
.nl-power-live .nl-phone-guide-label { font-size: 21px; padding: 8px 20px; box-shadow: 0 0 0 2px rgb(255 255 255 / .16); }

@media (max-width: 700px) {
  .nl-power-host:not(.nl-power-live) > .nl-phone-guide { gap: 4px; bottom: 10%; }
  .nl-power-host:not(.nl-power-live) .nl-phone-guide-touch { width: 30px; height: 30px; }
  .nl-power-host:not(.nl-power-live) .nl-phone-guide svg { width: 18px; height: 18px; }
  .nl-power-host:not(.nl-power-live) .nl-phone-guide-label { font-size: 7.5px; padding: 2px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .nl-phone-guide svg, .nl-phone-guide-touch i, .nl-power-hint svg, .nl-phone-guide { animation: none; }
  .nl-power-phone.is-waking, .nl-power-live.is-waking { animation: none; }
  .nl-tap-ripple i, .nl-tap-ripple b { animation-duration: .01s; }
}
