/*
 * Teléfono dibujado en CSS (lo usan la guía web y el PDF). Todo se mide en cqw (ancho del teléfono): basta
 * con cambiar el ancho de .phone. Las capturas miden 390 px de ancho; la pantalla, 390 × 844 (47 de la barra
 * de estado + 797 de la app). Ver scripts/build.mjs.
 */
.phone {
  container-type: inline-size;
  width: var(--pw, 300px);
  flex: none;
}
.phone .frame {
  position: relative;
  padding: 3.4cqw;
  border-radius: 16.5cqw;
  background: linear-gradient(150deg, #48524d 0%, #1a201e 18%, #111614 60%, #2c3431 100%);
  box-shadow:
    inset 0 0 0 0.45cqw #5d6762,
    inset 0 0 0 1.1cqw #0b0f0d,
    0 1.5cqw 3cqw -1cqw rgb(6 42 30 / 0.28),
    0 14cqw 22cqw -10cqw rgb(6 42 30 / 0.5);
}
/* Botones laterales. */
.phone .frame::before,
.phone .frame::after {
  content: '';
  position: absolute;
  width: 1cqw;
  border-radius: 1cqw;
  background: linear-gradient(90deg, #262d2a, #4b5550);
}
.phone .frame::before {
  right: -0.7cqw;
  top: 27%;
  height: 15%;
}
.phone .frame::after {
  left: -0.7cqw;
  top: 21%;
  height: 8%;
  box-shadow: 0 13cqw 0 #3a4340;
}
.phone .screen {
  position: relative;
  aspect-ratio: 390 / 844;
  border-radius: 13cqw;
  overflow: hidden;
  background: #f3f6f4;
  isolation: isolate;
  transform: translateZ(0);
}
/* Reflejo sutil sobre el vidrio. */
.phone .screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(115deg, rgb(255 255 255 / 0.2) 0%, rgb(255 255 255 / 0.05) 24%, transparent 40%);
  box-shadow: inset 0 0 0 0.3cqw rgb(0 0 0 / 0.5);
}
.phone .island {
  position: absolute;
  z-index: 9;
  top: 2.7cqw;
  left: 50%;
  width: 30cqw;
  height: 8.6cqw;
  margin-left: -15cqw;
  border-radius: 99px;
  background: #000;
}

/* Cada pantalla ocupa todo el vidrio; solo una tiene .is-on. */
.phone .view {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform: scale(1.015);
}
.phone .view.is-on {
  opacity: 1;
  transform: none;
}
.phone .status {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  height: calc(47 / 844 * 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2cqw 8cqw 0 10cqw;
  background: #fff;
  color: #10231b;
  font: 700 4.2cqw/1 'Manrope', system-ui, sans-serif;
}
.phone .status svg {
  width: 19cqw;
  height: auto;
}
.phone .status-light {
  background: transparent;
  color: #fff;
}
.phone .app {
  position: absolute;
  inset: calc(47 / 844 * 100%) 0 0;
  overflow: hidden;
}
.phone .app img {
  position: absolute;
  left: 0;
  top: calc(var(--off) * -100% / 797);
  width: 100%;
  height: auto;
  max-width: none;
}
.phone .app .bar,
.phone .app .tabbar {
  position: absolute;
  left: 0;
  width: 100%;
  background-repeat: no-repeat;
  background-size: 100% auto;
}
.phone .app .bar {
  top: 0;
  height: calc(60 / 797 * 100%);
  background-position: top;
}
.phone .app .tabbar {
  bottom: 0;
  height: calc(66 / 797 * 100%);
  background-position: bottom;
}

/* Resaltado: anillo turquesa fino, el resto atenuado y un pulso suave. */
.phone .hl {
  position: absolute;
  z-index: 2;
  left: calc(var(--x) * 100% / 390);
  top: calc((var(--y) - var(--off)) * 100% / 797);
  width: calc(var(--w) * 100% / 390);
  height: calc(var(--h) * 100% / 797);
  border-radius: 99px;
  box-shadow: 0 0 0 0.75cqw #13a39b, 0 0 0 1.6cqw rgb(19 163 155 / 0.22);
}
.phone .hl-card {
  border-radius: 6cqw;
}
.phone .hl::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 300cqw rgb(5 32 23 / 0.26);
  opacity: 0;
  transition: opacity 0.8s ease 0.5s;
}
.phone .is-on .hl::before {
  opacity: 1;
}
.phone .hl::after {
  content: '';
  position: absolute;
  inset: -0.75cqw;
  border-radius: inherit;
  border: 0.7cqw solid #13a39b;
  opacity: 0;
}
.phone .is-on .hl::after {
  animation: guia-pulso 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) 1s infinite;
}
@keyframes guia-pulso {
  0% {
    opacity: 0.85;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.06, 1.3);
  }
}

/* Pantalla de inicio del teléfono (instalar). */
.phone .home {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 70% at 85% 0%, #1fb3a9 0%, transparent 55%),
    radial-gradient(90% 60% at 0% 100%, #0e6a4c 0%, transparent 60%),
    linear-gradient(170deg, #0c5a42 0%, #073826 100%);
  font-family: 'Manrope', system-ui, sans-serif;
}
.phone .apps {
  position: absolute;
  inset: 30cqw 7cqw auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9cqw 6.5cqw;
}
.phone .apps .g,
.phone .dock .g {
  display: block;
  aspect-ratio: 1;
  border-radius: 23%;
  background: rgb(255 255 255 / 0.16);
  box-shadow: inset 0 0 0 0.3cqw rgb(255 255 255 / 0.08);
}
.phone .app-mine {
  position: relative;
  display: block;
}
.phone .app-ico {
  position: relative;
  display: block;
  border-radius: 23%;
  overflow: hidden;
  box-shadow: 0 2cqw 4cqw -1cqw rgb(0 0 0 / 0.45);
  transform: scale(0.86);
  transition: transform 0.9s cubic-bezier(0.3, 1.5, 0.5, 1) 0.9s;
}
.phone .app-ico svg {
  display: block;
  width: 100%;
  height: auto;
}
.phone .app-load {
  position: absolute;
  inset: 0;
  background: rgb(4 20 14 / 0.55);
  transition: opacity 0.7s ease 0.6s;
}
.phone .app-name {
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 1.6cqw;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #fff;
  font-size: 3.2cqw;
  font-weight: 700;
}
.phone .is-on .app-ico {
  transform: none;
}
.phone .is-on .app-load {
  opacity: 0;
}
.phone .app-mine::after {
  content: '';
  position: absolute;
  inset: -2.2cqw;
  bottom: auto;
  aspect-ratio: 1;
  border-radius: 28%;
  border: 0.7cqw solid #f4c430;
  opacity: 0;
}
.phone .is-on .app-mine::after {
  animation: guia-pulso 2.4s cubic-bezier(0.2, 0.6, 0.3, 1) 1.8s infinite;
}
.phone .dock {
  position: absolute;
  inset: auto 4.5cqw 5cqw;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6.5cqw;
  padding: 4cqw 5cqw;
  border-radius: 9cqw;
  background: rgb(255 255 255 / 0.14);
}
.phone .toast {
  position: absolute;
  z-index: 4;
  inset: 13cqw 4cqw auto;
  display: flex;
  gap: 3cqw;
  align-items: center;
  padding: 3.2cqw 4cqw;
  border-radius: 6.5cqw;
  background: rgb(250 252 251 / 0.94);
  color: #10231b;
  font-size: 3.3cqw;
  line-height: 1.25;
  box-shadow: 0 3cqw 8cqw -2cqw rgb(0 0 0 / 0.35);
  opacity: 0;
  transform: translateY(-6cqw) scale(0.96);
  transition: opacity 0.6s ease 1.8s, transform 0.8s cubic-bezier(0.2, 1.2, 0.4, 1) 1.8s;
}
.phone .toast b {
  display: block;
  font-size: 3.5cqw;
}
.phone .toast-ico {
  width: 9cqw;
  flex: none;
}
.phone .toast-ico svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 23%;
}
.phone .is-on .toast {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .phone .view,
  .phone .hl::before,
  .phone .app-ico,
  .phone .app-load,
  .phone .toast {
    transition: none;
  }
  .phone .view {
    transform: none;
  }
  .phone .is-on .hl::after,
  .phone .is-on .app-mine::after {
    animation: none;
  }
}
